/* ==========================================================================
   styles.css — Shared design system
   Giyoung Park portfolio
   Components: nav, header, meta-table, sections, typography,
               stat-row, insight-cards, bar-charts, impact-list,
               reflection-list, fig-row, subsection-with-img,
               outcome-row, next-list, footer
   ========================================================================== */

/* ── RESET ── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --black: #0a0a0a;
      --white: #fafaf8;
      --gray-1: #f0efed;
      --gray-2: #b0adaa;
      --gray-3: #5c5a57;
      --gray-4: #2c2a28;
      --accent: #1a56a0;
      --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
      --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    html { scroll-behavior: smooth; color-scheme: light; }

    /* ── SKIP LINK (accessibility) ── */
    .skip-link {
      position: absolute; top: -40px; left: 0;
      background: var(--accent); color: #fff;
      padding: 8px 16px; font-size: 15px; font-weight: 500;
      text-decoration: none; border-radius: 0 0 6px 0;
      z-index: 999; transition: top 0.2s;
    }
    .skip-link:focus { top: 0; }

    /* ── FOCUS (accessibility) ── */
    :focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px; border-radius: 3px;
    }

    /* ── REDUCED MOTION (accessibility) ── */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
      .fade-in { opacity: 1 !important; transform: none !important; }
      html { scroll-behavior: auto; }
    }

    /* ── BASE TYPOGRAPHY ── */
    body {
      background: var(--white); color: var(--black);
      font-family: var(--sans); font-weight: 400;
      font-size: 18px; line-height: 1.6;
      -webkit-font-smoothing: antialiased;
    }

    /* ── NAV (fixed header) ── */
    nav:not(.sidebar):not(.project-nav) {
      position: fixed; top: 0; left: 0; right: 0; z-index: 200;
      padding: 0 120px; height: 56px;
      display: flex; align-items: center; justify-content: space-between;
      background: rgba(250,250,248,0.92);
      backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .nav-name {
      font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
      color: var(--black); text-decoration: none; white-space: nowrap;
      display: flex; align-items: center; gap: 10px;
    }
    .nav-name .creds { font-weight: 400; }
    .nav-links { display: flex; gap: 32px; list-style: none; }
    .nav-links a {
      font-size: 15px; font-weight: 400; letter-spacing: 0.02em;
      color: var(--gray-3); text-decoration: none;
      transition: color 0.2s var(--ease);
    }
    .nav-links a:hover { color: var(--black); }
    .nav-links a.active { color: var(--black); font-weight: 500; }

    .hamburger {
      display: none; flex-direction: column; justify-content: center;
      gap: 5px; width: 44px; height: 44px; cursor: pointer;
      background: none; border: none; padding: 8px; border-radius: 6px;
      transition: background 0.2s;
    }
    .hamburger:hover { background: var(--gray-1); }
    .hamburger span {
      display: block; height: 1.5px; background: var(--black);
      border-radius: 2px;
      transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
      transform-origin: center;
    }
    .hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

    .mobile-menu {
      display: none; position: fixed; top: 56px; left: 0; right: 0; z-index: 190;
      background: rgba(250,250,248,0.98);
      backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
      border-bottom: 1px solid rgba(0,0,0,0.06);
      padding: 20px 24px 28px; flex-direction: column;
      opacity: 0; pointer-events: none; transform: translateY(-6px);
      transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    }
    .mobile-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .mobile-menu a {
      font-size: 22px; font-weight: 400; letter-spacing: -0.02em;
      color: var(--black); text-decoration: none;
      padding: 14px 0; border-bottom: 1px solid var(--gray-1);
      transition: color 0.2s;
    }
    .mobile-menu a:last-child { border-bottom: none; }

    /* ── INDEX HERO ── */
    .hero-tag {
      font-size: 15px; font-weight: 500; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gray-3);
      margin-bottom: 28px;
    }
    .hero-title {
      font-size: clamp(30px, 4vw, 48px); font-weight: 700;
      line-height: 1.08; letter-spacing: -0.03em;
      color: var(--black); margin-bottom: 28px;
    }
    .hero-title em { font-style: italic; color: var(--accent); }
    .hero-body {
      font-size: 18px; font-weight: 400; line-height: 1.72;
      color: var(--gray-4);
    }

    /* ── PAGE HEADER (hero area with meta-table + pills) ── */
    .page-header { padding: 136px 120px 64px; background: var(--gray-1); }

    .back-link {
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 15px; font-weight: 500; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--gray-4);
      text-decoration: none; margin-bottom: 40px; transition: color 0.2s;
    }
    .back-link:hover { color: var(--black); }
    .back-link svg { width: 14px; height: 14px; }

    .page-header h1 {
      font-size: clamp(30px, 4vw, 48px); font-weight: 700;
      letter-spacing: -0.03em; line-height: 1.05;
      color: #13223e; margin-bottom: 8px;
    }

    .page-header h2 {
      font-size: clamp(18px, 2vw, 24px); font-weight: 500;
      letter-spacing: -0.02em; line-height: 1.3;
      color: var(--gray-4); margin-bottom: 28px;
    }

    .challenge-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
    .challenge-columns p { margin-top: 0; }


    .header-tables {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 40px; align-items: start;
    }

    .meta-table { width: auto; border-collapse: collapse; }
    .meta-table td,
    .meta-table th { padding: 10px 0; font-size: 17px; line-height: 1.55; vertical-align: top; }
    .meta-table td:first-child,
    .meta-table th[scope="row"] {
      font-weight: 500; color: var(--gray-3);
      width: 140px; min-width: 140px; white-space: normal; padding-right: 32px;
      text-transform: uppercase; font-size: 14px; letter-spacing: 0.1em;
      vertical-align: top; text-align: left;
    }
    .meta-cell-inner { display: inline-flex; align-items: center; }
    .meta-table td:last-child { color: var(--gray-4); font-weight: 400; }

    /* ── TABLE BODY ROWS (data tables) ── */
    table:not(.meta-table) tbody tr { background: var(--white); }
    table:not(.meta-table) tbody td { background: var(--white); }

    .meta-icon {
      display: inline-flex; align-items: center; margin-right: 12px;
      color: var(--gray-3); vertical-align: middle;
      position: relative; top: -1px; flex-shrink: 0;
    }

    /* ── SECTIONS & LAYOUT ── */
    .page-body { display: block; }
    .content-sections { border-left: none; }
    .content-section { padding: 72px 120px; --card-bg: var(--gray-1); }
    .content-section:nth-of-type(even) { background: var(--gray-1); --card-bg: var(--white); }
    .content-body { min-width: 0; }

    /* ── SECTION EYEBROW (label above h2) ── */
    .section-eyebrow {
      display: block;
      font-size: 14px; font-weight: 700;
      letter-spacing: 0.1em; text-transform: uppercase;
      color: var(--accent); margin-bottom: 8px;
    }

    /* Overview split: paragraphs left, context table right */
    .overview-split {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 40px;
      margin-top: 24px;
      align-items: start;
    }

    /* Lit review layout: text left, image right */
    .litreview-layout {
      display: grid;
      grid-template-columns: 1fr 340px;
      gap: 40px;
      align-items: start;
      margin-top: 12px;
    }
    .litreview-text { min-width: 0; }
    .litreview-img-right { overflow: hidden; }
    .litreview-img-right img { width: 100%; height: auto; display: block; }
    .content-body p.fig-caption {
      font-size: 16px; color: var(--gray-3);
      margin-top: 8px; margin-bottom: 32px; line-height: 1.5;
    }
    .text-reference {
      font-size: 14px; color: var(--gray-3);
      margin-top: 32px; line-height: 1.5;
    }

    /* ── FIGURES ── */
    .fig { margin-top: 28px; }
    .fig-wrap {
      background: var(--gray-1); border-radius: 0; overflow: hidden;
      min-height: 120px; display: flex; align-items: center; justify-content: center;
    }
    .fig-img { width: 100%; height: auto; display: block; }

    /* H2 */
    .content-body h2 {
      font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
      line-height: 1.2; color: #13223e; margin-bottom: 20px;
    }
    /* H3 — contrast ≥ 4.5:1 on white */
    .content-body h3 {
      font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
      line-height: 1.3; color: var(--gray-4); margin-top: 36px; margin-bottom: 10px;
    }
    .content-body h3:first-child { margin-top: 0; }
    /* H4 */
    .content-body h4 {
      font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
      line-height: 1.3; color: var(--black); margin-top: 28px; margin-bottom: 8px;
    }

    .content-body p {
      font-size: 18px; font-weight: 400; line-height: 1.72;
      color: var(--gray-4); margin-bottom: 16px;
    }
    .content-body p:last-child { margin-bottom: 0; }
    .content-body strong { font-weight: 500; color: var(--black); }
    .content-body a { color: var(--accent); text-underline-offset: 3px; }

    /* statistical symbols (n, p) — italic small caps */
    .stat-note em, .method-table em, .stat-sym {
      font-style: italic; font-variant: small-caps;
    }

    .body-list, .reflection-list { list-style: none; margin: 12px 0 16px 0; }
    .body-list li, .reflection-list li {
      font-size: 18px; font-weight: 400; color: var(--gray-4);
      line-height: 1.72; padding: 4px 0 4px 14px; position: relative;
    }
    .body-list li::before, .reflection-list li::before { content: '•'; position: absolute; left: 0; color: var(--gray-3); }
    /* sub-bullets keep em dash */
    .body-list li li::before,
    .insight-points li li::before,
    .reflection-list li li::before { content: '–'; }
    .body-list li strong, .reflection-list li strong { font-weight: 500; color: var(--black); }

    /* ── RESEARCH QUESTIONS (numbered rows in meta tables) ── */
    .rq-block { display: flex; flex-direction: column; gap: 10px; }
    .rq-row { display: grid; grid-template-columns: 32px 1fr; font-size: 17px; color: var(--gray-4); }
    .rq-num { color: var(--gray-3); font-weight: 500; }

    /* ── DELIVERABLE LIST (check-circle rows in meta tables) ── */
    .deliverable-list { list-style: none; margin: 0; padding: 0; }
    .deliverable-list li { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; }
    .deliverable-check {
      display: inline-flex; align-items: center; justify-content: center;
      width: 18px; height: 18px; background: var(--white);
      border: 1.5px solid var(--gray-3); border-radius: 50%;
      flex-shrink: 0; margin-top: 1px;
    }

    /* Stats row */
    .stat-row {
      display: grid; grid-template-columns: repeat(3, 1fr);
      gap: 1px; background: var(--gray-1);
      border-radius: 8px; overflow: hidden; margin-top: 28px;
    }
    .stat-cell { background: var(--white); padding: 24px 20px; }
    .stat-number {
      font-size: clamp(28px, 4vw, 40px); font-weight: 300;
      letter-spacing: -0.03em; color: var(--black);
      line-height: 1; margin-bottom: 6px;
    }
    .stat-label { font-size: 15px; font-weight: 400; color: var(--gray-3); line-height: 1.4; }

    /* ── INSIGHT CARDS (2-col grid, reusable) ── */
    .insight-cards {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 16px; margin-top: 28px;
    }
    .insight-card { background: var(--card-bg, var(--gray-1)); border-radius: 4px; padding: 24px; }
    .insight-title {
      font-size: 14px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--black);
      margin-bottom: 12px; line-height: 1.4;
    }
    .insight-points { list-style: none; margin: 0; }
    .insight-points li {
      font-size: 18px; font-weight: 400; color: var(--gray-4);
      line-height: 1.72; padding: 4px 0 4px 14px; position: relative;
    }
    .insight-points li::before { content: '•'; position: absolute; left: 0; color: var(--gray-3); }
    .insight-points li strong { font-weight: 500; color: var(--black); }

    /* inline stat annotation: 14px, italic n/p */
    .insight-points .stat-note {
      font-size: 14px; color: var(--gray-3);
    }

    /* ── BAR CHARTS (horizontal, label-left, pct inside bar) ── */
    .bar-chart { margin-top: 20px; }
    .bar-chart-title {
      font-size: 14px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gray-3); margin-bottom: 10px;
    }
    .bar-row {
      display: grid;
      grid-template-columns: 150px 1fr;
      align-items: center;
      gap: 10px;
      margin-bottom: 5px;
    }
    .bar-label {
      font-size: 14px; color: var(--gray-4);
      text-align: right; white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
    }
    .bar-track {
      height: 22px;
      border-radius: 0;
      overflow: hidden;
      background: transparent;
    }
    .bar-fill {
      height: 100%; background: var(--accent);
      border-radius: 0;
      transition: width 0.8s var(--ease);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 8px;
      min-width: 44px;
    }
    .bar-pct {
      font-size: 14px; font-weight: 700; color: #fff;
      white-space: nowrap; line-height: 1;
    }

    /* ── STACKED BAR CHART (single row, 3 segments) ── */
    .stacked-bar-wrap { margin-top: 20px; }
    .stacked-bar {
      display: flex; width: 100%; height: 36px;
      border-radius: 0; overflow: hidden;
    }
    .stacked-seg {
      display: flex; align-items: center; justify-content: center;
      transition: width 0.8s var(--ease);
    }
    .stacked-pct {
      font-size: 14px; font-weight: 700; color: #fff;
      white-space: nowrap;
    }
    .stacked-yes    { background: var(--accent); }
    .stacked-unsure { background: #7e7b78; }
    .stacked-no     { background: var(--gray-4); }
    .stacked-legend {
      display: flex; gap: 20px; margin-top: 10px; flex-wrap: wrap;
    }
    .stacked-legend-item {
      display: flex; align-items: center; gap: 6px;
      font-size: 14px; color: var(--gray-4);
    }
    .stacked-swatch {
      display: inline-block; width: 12px; height: 12px;
      border-radius: 2px; flex-shrink: 0;
    }

    /* ── IMPACT LIST (arrow + text rows) ── */
    .impact-list, .next-list { list-style: none; margin-top: 24px; }
    .next-list { margin-top: 20px; }
    .impact-list li, .next-list li {
      display: grid; grid-template-columns: 24px 1fr;
      padding: 10px 0; font-size: 18px; font-weight: 400;
      color: var(--gray-4); line-height: 1.72;
    }
    .impact-arrow, .next-arrow { color: var(--gray-3); flex-shrink: 0; }
    .impact-list li strong, .next-list li strong { font-weight: 500; color: var(--black); }

    /* ── SECTION DIVIDER ── */
    .section-divider { border: none; margin: 0; }

    /* ── FADE IN (scroll-triggered) ── */
    .fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
    .fade-in.visible { opacity: 1; transform: none; }

    /* ── PAGE REFERENCES / ACKNOWLEDGEMENTS ── */
    .page-references {
      padding: 24px 120px 32px;
      border-top: 1px solid var(--gray-2);
    }
    .page-references-label {
      display: block;
      font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--gray-3);
      margin-bottom: 8px;
    }
    .page-references-label + .page-references-item ~ .page-references-label {
      margin-top: 20px;
    }
    .page-references-item {
      font-size: 13px; color: var(--gray-3);
      line-height: 1.5;
    }
    .page-references-item a {
      color: var(--gray-3); text-decoration: underline;
    }
    .page-references-item a:hover { opacity: 0.6; }

    /* ── FOOTER ── */
    footer {
      border-top: 1px solid var(--gray-1);
      display: flex; flex-direction: column;
    }
    .footer-copy {
      padding: 32px 120px;
      display: flex; justify-content: space-between; align-items: center;
      border-top: 1px solid rgba(0,0,0,0.06);
    }
    footer p { font-size: 15px; color: var(--gray-3); }
    .footer-links { display: flex; gap: 24px; }
    .footer-links a {
      font-size: 15px; color: var(--gray-3); text-decoration: none;
      transition: opacity 0.2s;
    }
    .footer-links a:hover { opacity: 0.4; }

    /* ── RESPONSIVE (≤ 900px) ── */
    @media (max-width: 900px) {
      nav { padding: 0 20px; }
      .nav-links { display: none; }
      .hamburger { display: flex; }
      .mobile-menu { display: flex; }
      .page-header { padding: 100px 24px 48px; }
      .content-section { padding: 40px 24px; }
      .meta-table td:first-child { width: auto; white-space: normal; }
      .overview-split { grid-template-columns: 1fr; }
      .challenge-columns { grid-template-columns: 1fr; }
      .litreview-layout { grid-template-columns: 1fr; }
      .subsection-with-img { grid-template-columns: 1fr !important; }
      .subsection-with-img.img-left .sub-img { order: -1; }
      .insight-cards { grid-template-columns: 1fr; }
      .stat-row { grid-template-columns: 1fr; }
      .fig-row { grid-template-columns: 1fr; }
      .bar-row { grid-template-columns: 90px 1fr; }
      .bar-label { font-size: 14px; }
      .page-references { padding: 20px 20px 28px; }
      .project-nav { padding: 32px 24px; gap: 24px; }
      .project-nav-title { font-size: 17px; }
      .footer-copy { padding: 24px 20px; flex-direction: column; gap: 16px; align-items: flex-start; }
    }

    /* ── MEMBER / ASSOCIATE QUOTE ── */
    .member-quote {
      border-left: 2px solid var(--accent);
      margin: 14px 0 8px;
      padding: 10px 16px;
      font-style: italic;
      font-size: 18px;
      color: var(--accent);
      line-height: 1.72;
    }
    .member-quote cite {
      display: block;
      font-style: normal;
      font-size: 14px;
      line-height: 1.5;
      color: var(--gray-3);
      margin-top: 6px;
    }

    /* ── TWO-COLUMN FIGURE ROW ── */
    .fig-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-top: 28px;
    }
    .fig-row .fig { margin-top: 0; }

    /* ── THREE-COLUMN FIGURE ROW ── */
    .fig-row-3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 16px;
      margin-top: 32px;
    }
    .fig-row-3 .fig { margin-top: 0; }

    /* ── SUBSECTION WITH IMAGE (text + image side-by-side, matches litreview-layout) ── */
    .subsection-with-img { display: grid; gap: 40px; align-items: start; margin-top: 0; }
    .subsection-with-img.img-right { grid-template-columns: 1fr 340px; }
    .subsection-with-img.img-left  { grid-template-columns: 340px 1fr; }
    .subsection-with-img .sub-img { overflow: hidden; }
    .subsection-with-img .sub-img img { width: 100%; height: auto; object-fit: cover; display: block; }

    /* ── OUTCOME ROW (dark navy checkmark + text) ── */
    .outcome-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
    .outcome-row:last-child { margin-bottom: 0; }
    .outcome-check {
      display: inline-flex; align-items: center; justify-content: center;
      width: 20px; height: 20px; background: #13223e;
      border-radius: 50%; flex-shrink: 0; margin-top: 2px;
    }
    .outcome-row span { font-size: 17px; color: var(--gray-4); line-height: 1.72; }


/* ── FIGURE PLACEHOLDER ── */
    .fig-placeholder {
      padding: 32px 24px; text-align: center;
      font-size: 15px; color: var(--gray-3); font-style: italic; line-height: 1.5;
    }

    /* ── METHOD TABLE (3-col data-collected table, shared across project pages) ── */
    .method-table { width: 100%; border-collapse: collapse; margin: 28px 0 36px; font-size: 15px; }
    .method-table th {
      text-align: left; padding: 10px 14px;
      background: var(--gray-3); color: #fafaf8;
      font-weight: 500; text-transform: uppercase; font-size: 15px;
      letter-spacing: 0.04em; border-bottom: none;
    }
    .method-table th:first-child { width: 22%; }
    .method-table th:last-child  { width: 28%; }
    .method-table td {
      padding: 10px 14px; border-bottom: 1px solid var(--gray-1); vertical-align: top;
    }
    .method-table td:first-child {
      font-weight: 500; color: var(--gray-3);
      text-transform: uppercase; font-size: 15px; letter-spacing: 0.04em;
    }
    .method-table td:nth-child(2) { color: var(--gray-4); font-size: 17px; }
    .method-table td:last-child   { color: var(--gray-4); font-size: 17px; }
    .method-table ul { margin: 0; padding-left: 16px; }
    .method-table li { margin-bottom: 4px; }

/* ── PROJECT NAV BANNER ── */
    .project-nav {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 40px 120px;
      border-top: 1px solid var(--gray-1);
    }
    .project-nav-link {
      display: flex;
      flex-direction: column;
      gap: 6px;
      text-decoration: none;
      color: inherit;
      max-width: 45%;
    }
    .project-nav-link--next { text-align: right; }
    .project-nav-label {
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--gray-4);
    }
    .project-nav-title {
      font-size: 20px;
      font-weight: 600;
      color: var(--gray-3);
      letter-spacing: -0.02em;
      line-height: 1.2;
      transition: color 0.2s var(--ease);
    }
    .project-nav-link:hover .project-nav-title { color: var(--gray-4); }

/* ── IP PROTECTION (project pages only) ── */
    body.protected {
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
    }
    body.protected img {
      pointer-events: none;
      -webkit-user-drag: none;
      user-drag: none;
      -webkit-touch-callout: none;
    }
