    /* ------------------------------------------------------------------
       Graded palette — every color is drawn from a tonal ramp so both
       themes keep consistent contrast steps between surfaces, lines,
       text, and accent usage.
       ------------------------------------------------------------------ */
    :root {
      /* accent ramp (shared) */
      --green-100: #e4ffd6;
      --green-200: #b8ff9f;
      --green-300: #9dff7a;
      --green-400: #83ff57;
      --green-500: #57d92e;
      --green-600: #2f9e44;
      --green-700: #1f7a33;
      --green-800: #14532d;

      /* layout + rhythm */
      --max: 1200px;
      --gutter: clamp(16px, 4vw, 40px);
      --space-1: clamp(10px, 1.4vw, 16px);
      --space-2: clamp(16px, 2.2vw, 26px);
      --space-3: clamp(26px, 3.6vw, 44px);
      --space-4: clamp(44px, 6.5vw, 88px);
      --radius-sm: 10px;
      --radius-md: 16px;
      --radius-lg: clamp(18px, 2.4vw, 26px);

      /* fluid type scale */
      --fs-xs: clamp(10.5px, .78vw + 8px, 12px);
      --fs-sm: clamp(12.5px, .55vw + 11px, 14px);
      --fs-md: clamp(14.5px, .5vw + 13px, 16px);
      --fs-lg: clamp(17px, 1vw + 13px, 21px);
      --fs-h2: clamp(30px, 3.4vw + 14px, 50px);
      --fs-h1: clamp(44px, 6.2vw + 16px, 92px);
    }

    /* ---------- dark theme (default) ---------- */
    :root[data-theme="dark"] {
      --bg-0: #07090b;
      --bg-1: #0b0f12;
      --surface-1: #10161a;
      --surface-2: #151c21;
      --surface-3: #1b242b;
      --line-1: #222c31;
      --line-2: rgba(255,255,255,.08);
      --text-1: #f2f5f3;
      --text-2: #c3cdc7;
      --text-3: #8d9a93;
      --accent: var(--green-400);
      --accent-soft: var(--green-200);
      --accent-ink: var(--green-300);      /* accent used as text — passes on dark surfaces */
      --on-accent: #0b120d;                /* text on solid accent fills */
      --accent-line: rgba(131,255,87,.42);
      --accent-glow: rgba(131,255,87,.14);
      --chip-bg: #f4f7f4;                  /* neutral chip so brand SVGs stay legible */
      --chip-line: rgba(255,255,255,.14);
      --nav-bg: rgba(8,11,13,.74);
      --input-bg: #0a0f12;
      --shadow-lg: 0 22px 70px rgba(0,0,0,.42);
      --shadow-md: 0 16px 44px rgba(0,0,0,.24);
      --page-gradient:
        radial-gradient(circle at 75% 9%, rgba(131,255,87,.10), transparent 26%),
        radial-gradient(circle at 12% 34%, rgba(79,121,255,.055), transparent 26%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
    }

    /* ---------- light theme ---------- */
    :root[data-theme="light"] {
      --bg-0: #f5f8f5;
      --bg-1: #eef3ee;
      --surface-1: #ffffff;
      --surface-2: #f6f9f6;
      --surface-3: #ebf1ea;
      --line-1: #d7dfd8;
      --line-2: rgba(12,24,16,.10);
      --text-1: #101613;
      --text-2: #39443d;
      --text-3: #5d6b63;
      --accent: var(--green-600);
      --accent-soft: var(--green-700);
      --accent-ink: var(--green-700);      /* darker green for AA contrast on light */
      --on-accent: #f4fff0;
      --accent-line: rgba(47,158,68,.45);
      --accent-glow: rgba(47,158,68,.12);
      --chip-bg: #ffffff;
      --chip-line: rgba(12,24,16,.12);
      --nav-bg: rgba(245,248,245,.78);
      --input-bg: #ffffff;
      --shadow-lg: 0 20px 55px rgba(24,40,28,.14);
      --shadow-md: 0 12px 34px rgba(24,40,28,.10);
      --page-gradient:
        radial-gradient(circle at 75% 9%, rgba(47,158,68,.08), transparent 26%),
        radial-gradient(circle at 12% 34%, rgba(79,121,255,.05), transparent 26%),
        linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }

    body {
      margin: 0;
      min-width: 320px;
      color: var(--text-1);
      background: var(--page-gradient);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      -webkit-font-smoothing: antialiased;
      transition: background .25s ease, color .25s ease;
    }

    a { color: inherit; text-decoration: none; }
    button, input, textarea { font: inherit; }
    img, svg { max-width: 100%; display: block; }
    svg { fill: none; }

    .shell {
      width: min(var(--max), calc(100% - var(--gutter) * 2));
      margin-inline: auto;
    }

    /* ---------------- nav ---------------- */
    .nav {
      position: sticky;
      top: 0;
      z-index: 30;
      background: var(--nav-bg);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom: 1px solid var(--line-2);
    }

    .nav-inner {
      min-height: 68px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-2);
      padding-block: 8px;
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      font-weight: 800;
      letter-spacing: .02em;
    }

    .brand-mark {
      width: 34px;
      height: 34px;
      display: grid;
      place-items: center;
      border: 1px solid var(--accent-line);
      border-radius: 10px;
      color: var(--accent-ink);
      background: linear-gradient(180deg, var(--accent-glow), transparent);
      font-weight: 900;
      font-size: 13px;
    }

    .brand-word {
      letter-spacing: .30em;
      font-size: var(--fs-xs);
      color: var(--accent-ink);
    }

    .nav-right {
      display: flex;
      align-items: center;
      gap: clamp(14px, 2vw, 26px);
    }

    .nav-links {
      display: flex;
      align-items: center;
      gap: clamp(14px, 2vw, 26px);
      color: var(--text-2);
      font-size: var(--fs-sm);
    }

    .nav-links a { transition: color .18s ease; }
    .nav-links a:hover { color: var(--accent-ink); }

    /* theme toggle */
    .theme-toggle {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 1px solid var(--line-1);
      border-radius: 10px;
      background: var(--surface-2);
      color: var(--text-2);
      cursor: pointer;
      transition: border-color .18s ease, color .18s ease, transform .18s ease;
    }

    .theme-toggle:hover {
      border-color: var(--accent-line);
      color: var(--accent-ink);
      transform: translateY(-1px);
    }

    .theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    :root[data-theme="dark"] .icon-moon { display: none; }
    :root[data-theme="light"] .icon-sun { display: none; }

    /* ---------------- hero ---------------- */
    .hero {
      padding-block: var(--space-4);
      display: grid;
      grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
      align-items: center;
      gap: clamp(28px, 5vw, 64px);
      border-bottom: 1px solid var(--line-1);
    }

    .eyebrow {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      color: var(--accent-ink);
      font-size: var(--fs-xs);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .14em;
    }

    .eyebrow::before {
      content: "";
      flex: 0 0 auto;
      width: 24px;
      height: 1px;
      background: var(--accent);
      box-shadow: 0 0 12px var(--accent-glow);
    }

    h1, h2 {
      font-family: Georgia, "Times New Roman", serif;
      letter-spacing: -.03em;
      overflow-wrap: break-word;
    }

    h1 {
      margin: 14px 0 16px;
      font-size: var(--fs-h1);
      line-height: .96;
      font-weight: 700;
    }

    .hero-lede {
      margin: 0;
      max-width: 62ch;
      color: var(--text-2);
      font-size: var(--fs-lg);
      line-height: 1.6;
    }

    .hero-copy {
      max-width: 68ch;
      margin: var(--space-2) 0 0;
      color: var(--text-3);
      line-height: 1.8;
      font-size: var(--fs-md);
    }

    .actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: var(--space-3);
    }

    .btn {
      min-height: 48px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      padding: 0 clamp(14px, 2vw, 20px);
      border: 1px solid var(--line-1);
      border-radius: 9px;
      background: var(--surface-2);
      color: var(--text-1);
      font-size: var(--fs-sm);
      font-weight: 700;
      cursor: pointer;
      transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }

    .btn:hover {
      transform: translateY(-2px);
      border-color: var(--accent-line);
      box-shadow: var(--shadow-md);
    }

    .btn.primary {
      color: var(--on-accent);
      background: var(--accent);
      border-color: var(--accent);
    }

    .hero-links {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: var(--space-2);
    }

    .icon-link {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line-1);
      border-radius: 10px;
      background: var(--surface-2);
      color: var(--text-2);
      transition: .18s ease;
    }

    .icon-link:hover {
      border-color: var(--accent-line);
      color: var(--accent-ink);
      transform: translateY(-2px);
    }

    .icon-link svg { width: 19px; height: 19px; }

    .portrait-frame {
      position: relative;
      height: clamp(380px, 58vh, 600px); /* fallback for browsers without svh */
      height: clamp(380px, 58svh, 600px);
      border: 1px solid var(--line-1);
      border-radius: var(--radius-lg);
      overflow: hidden;
      background:
        radial-gradient(circle at 54% 30%, var(--accent-glow), transparent 36%),
        linear-gradient(180deg, var(--surface-2), var(--bg-1));
      box-shadow: var(--shadow-lg);
    }

    .portrait-frame::before {
      content: "";
      position: absolute;
      inset: 16px;
      z-index: 2;
      border: 1px solid var(--line-2);
      border-radius: calc(var(--radius-lg) - 8px);
      pointer-events: none;
    }

    .portrait-frame::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, transparent 58%, rgba(7,10,12,.72) 100%);
      pointer-events: none;
    }

    :root[data-theme="light"] .portrait-frame::after {
      background: linear-gradient(180deg, transparent 62%, rgba(16,22,19,.45) 100%);
    }

    .portrait-frame img.profile {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: 52% 38%;
      filter: saturate(.88) contrast(1.04);
    }

    .profile-badge {
      position: absolute;
      z-index: 3;
      left: clamp(16px, 3vw, 32px);
      bottom: clamp(16px, 3vw, 30px);
      max-width: calc(100% - clamp(32px, 6vw, 64px));
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 10px 13px;
      border: 1px solid var(--accent-line);
      border-radius: 999px;
      background: rgba(6,10,8,.76);
      backdrop-filter: blur(12px);
      color: var(--green-200);
      font-size: var(--fs-xs);
      font-weight: 800;
      box-shadow: var(--shadow-md);
    }

    .profile-badge span {
      flex: 0 0 auto;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--green-400);
      box-shadow: 0 0 14px rgba(131,255,87,.85);
    }

    /* ---------------- sections ---------------- */
    .section {
      padding-block: var(--space-4);
      border-bottom: 1px solid var(--line-1);
    }

    .section-head {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: var(--space-2);
      flex-wrap: wrap;
      margin-bottom: var(--space-3);
    }

    h2 {
      margin: 10px 0 0;
      font-size: var(--fs-h2);
      line-height: 1.06;
    }

    .section-note {
      max-width: 52ch;
      margin: 0;
      color: var(--text-3);
      line-height: 1.75;
      font-size: var(--fs-sm);
    }

    .portfolio-link {
      color: var(--accent-ink);
      font-weight: 800;
      font-size: var(--fs-sm);
      white-space: nowrap;
    }

    /* ---------------- about ---------------- */
    .about-grid {
      display: grid;
      grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
      gap: clamp(28px, 5vw, 56px);
      align-items: start;
    }

    .about-copy {
      color: var(--text-3);
      line-height: 1.85;
      font-size: var(--fs-md);
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
      gap: 12px;
      margin-top: var(--space-2);
    }

    .stat {
      padding: clamp(14px, 2vw, 18px);
      border: 1px solid var(--line-1);
      border-radius: 13px;
      background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
    }

    .stat strong {
      display: block;
      color: var(--accent-ink);
      font-size: clamp(17px, 1.4vw + 10px, 20px);
      margin-bottom: 4px;
    }

    .stat span {
      color: var(--text-3);
      font-size: var(--fs-xs);
      line-height: 1.5;
      display: block;
    }

    /* ---------------- skills ---------------- */
    .skills-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(215px, 100%), 1fr));
      gap: 12px;
    }

    .skill-card {
      min-height: 74px;
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 14px 16px;
      border: 1px solid var(--line-1);
      border-radius: 13px;
      background: var(--surface-1);
      transition: transform .18s ease, border-color .18s ease;
    }

    .skill-card:hover {
      transform: translateY(-3px);
      border-color: var(--accent-line);
    }

    /* Neutral light chip behind brand SVGs: devicon logos keep their brand
       colors and stay legible in BOTH themes (dark marks never sit on dark). */
    .skill-icon {
      flex: 0 0 auto;
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
      border-radius: 9px;
      background: var(--chip-bg);
      border: 1px solid var(--chip-line);
    }

    .skill-icon img { width: 22px; height: 22px; }

    .skill-card strong { display: block; font-size: var(--fs-sm); margin-bottom: 3px; }
    .skill-card small { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.4; display: block; }

    /* ---------------- projects ---------------- */
    .projects {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .project-card {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid var(--line-1);
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
      box-shadow: var(--shadow-md);
    }

    .project-visual {
      aspect-ratio: 16 / 6;
      display: grid;
      place-items: center;
      position: relative;
      overflow: hidden;
      border-bottom: 1px solid var(--line-1);
      background:
        radial-gradient(circle at 30% 30%, var(--accent-glow), transparent 40%),
        radial-gradient(circle at 78% 16%, rgba(95,85,255,.14), transparent 34%),
        var(--surface-3);
    }

    .project-visual .code-grid {
      width: 76%;
      display: grid;
      gap: 8px;
      opacity: .85;
    }

    .project-visual .code-grid i {
      display: block;
      height: 8px;
      border-radius: 999px;
      background: var(--line-1);
    }

    .project-visual .code-grid i:nth-child(2) { width: 72%; background: var(--accent-line); }
    .project-visual .code-grid i:nth-child(3) { width: 84%; }
    .project-visual .code-grid i:nth-child(4) { width: 54%; }

    .project-body {
      padding: clamp(16px, 2.4vw, 22px);
      display: flex;
      flex-direction: column;
      flex: 1;
    }

    .project-body h3 { margin: 0 0 8px; font-size: clamp(15px, 1vw + 10px, 17px); }
    .project-body p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.7; }

    .tags {
      display: flex;
      gap: 7px;
      flex-wrap: wrap;
      margin-top: auto;
      padding-top: 15px;
    }

    .tags span {
      padding: 6px 8px;
      border: 1px solid var(--line-1);
      border-radius: 7px;
      color: var(--text-2);
      background: var(--surface-2);
      font-size: var(--fs-xs);
    }

    /* ---------------- experience + contact ---------------- */
    .experience-contact {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
      gap: clamp(28px, 5vw, 56px);
    }

    .timeline {
      position: relative;
      margin-top: var(--space-2);
      padding-left: 20px;
    }

    .timeline::before {
      content: "";
      position: absolute;
      left: 4px;
      top: 5px;
      bottom: 6px;
      width: 1px;
      background: var(--line-1);
    }

    .job { position: relative; padding: 0 0 26px 22px; }

    .job::before {
      content: "";
      position: absolute;
      left: -20px;
      top: 5px;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 16px var(--accent-glow);
    }

    .job h3 { margin: 0 0 5px; font-size: clamp(14px, 1vw + 9px, 16px); }
    .job .meta { color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700; margin-bottom: 8px; }
    .job p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.7; }

    .education { margin-top: var(--space-3); }

    .education h3 {
      margin: 0 0 14px;
      font-size: var(--fs-xs);
      text-transform: uppercase;
      letter-spacing: .12em;
      color: var(--accent-ink);
    }

    .edu-card {
      padding: 15px 18px;
      border: 1px solid var(--line-1);
      border-radius: 13px;
      background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
      margin-bottom: 10px;
    }

    .edu-card strong { display: block; font-size: var(--fs-sm); margin-bottom: 3px; }
    .edu-card span { color: var(--text-3); font-size: var(--fs-xs); }

    .contact-card {
      margin-top: var(--space-2);
      padding: clamp(18px, 2.6vw, 26px);
      border: 1px solid var(--line-1);
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
      box-shadow: var(--shadow-md);
    }

    .contact-meta { display: grid; gap: 10px; margin-bottom: 20px; }

    .contact-meta a {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text-2);
      font-size: var(--fs-sm);
      min-width: 0;
    }

    .contact-meta a:hover { color: var(--accent-ink); }
    .contact-meta svg { flex: 0 0 auto; width: 17px; height: 17px; }

    form { display: grid; gap: 12px; }
    .split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }

    input, textarea {
      width: 100%;
      border: 1px solid var(--line-1);
      border-radius: 9px;
      background: var(--input-bg);
      color: var(--text-1);
      padding: 13px 14px;
      outline: none;
      transition: border-color .18s ease, box-shadow .18s ease;
    }

    input::placeholder, textarea::placeholder { color: var(--text-3); }

    input:focus, textarea:focus {
      border-color: var(--accent-line);
      box-shadow: 0 0 0 3px var(--accent-glow);
    }

    textarea { min-height: 132px; resize: vertical; }

    /* ---------------- footer ---------------- */
    footer {
      padding: var(--space-3) 0 var(--space-4);
      color: var(--text-3);
      font-size: var(--fs-xs);
    }

    .footer-grid {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: var(--space-2);
      flex-wrap: wrap;
    }

    .footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
    .footer-links a:hover { color: var(--accent-ink); }

    /* ------------------------------------------------------------------
       Work previews — real site screenshots inside project/gallery cards
       ------------------------------------------------------------------ */
    .project-visual img.shot,
    .work-visual img.shot {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: top center;
      transition: transform .35s ease;
    }

    .project-visual { position: relative; }

    .project-card:hover .project-visual img.shot,
    .work-card:hover .work-visual img.shot {
      transform: scale(1.03);
    }

    .visual-tag {
      position: absolute;
      left: 12px;
      bottom: 12px;
      z-index: 2;
      padding: 5px 10px;
      border-radius: 999px;
      border: 1px solid var(--accent-line);
      background: rgba(6,10,8,.72);
      color: var(--green-200);
      font-size: var(--fs-xs);
      font-weight: 800;
      backdrop-filter: blur(8px);
    }

    /* ---------------- subpage header ---------------- */
    .page-head {
      padding-block: var(--space-4) var(--space-3);
      border-bottom: 1px solid var(--line-1);
    }

    .page-head h1 {
      font-size: clamp(38px, 4.6vw + 12px, 68px);
      margin: 14px 0 14px;
    }

    .page-lede {
      margin: 0;
      max-width: 68ch;
      color: var(--text-3);
      line-height: 1.8;
      font-size: var(--fs-md);
    }

    /* ---------------- portfolio gallery ---------------- */
    .filters {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: var(--space-3) 0 var(--space-2);
    }

    .chip {
      min-height: 40px;
      padding: 0 16px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--line-1);
      border-radius: 999px;
      background: var(--surface-2);
      color: var(--text-2);
      font-size: var(--fs-sm);
      font-weight: 700;
      cursor: pointer;
      transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease;
    }

    .chip:hover {
      border-color: var(--accent-line);
      color: var(--accent-ink);
      transform: translateY(-1px);
    }

    .chip[aria-pressed="true"] {
      background: var(--accent);
      border-color: var(--accent);
      color: var(--on-accent);
    }

    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
      gap: 16px;
      padding-bottom: var(--space-4);
    }

    .work-card {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      margin: 0;
      border: 1px solid var(--line-1);
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, var(--surface-1), var(--surface-2));
      box-shadow: var(--shadow-md);
      transition: transform .18s ease, border-color .18s ease;
    }

    .work-card:hover {
      transform: translateY(-3px);
      border-color: var(--accent-line);
    }

    .work-card.is-hidden { display: none; }

    .work-visual {
      position: relative;
      aspect-ratio: 16 / 10;
      overflow: hidden;
      display: block;
      padding: 0;
      width: 100%;
      border: 0;
      border-bottom: 1px solid var(--line-1);
      background: var(--surface-3);
      cursor: zoom-in;
    }

    .work-body {
      padding: clamp(14px, 2vw, 20px);
      display: flex;
      flex-direction: column;
      flex: 1;
      gap: 6px;
    }

    .work-body .meta {
      color: var(--accent-ink);
      font-size: var(--fs-xs);
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .1em;
    }

    .work-body strong { font-size: var(--fs-sm); }
    .work-body p { margin: 0; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.65; }

    /* abstract visual for NDA / non-public work */
    .work-visual .code-grid {
      position: absolute;
      inset: 0;
      margin: auto;
      width: 72%;
      height: fit-content;
      display: grid;
      gap: 8px;
      opacity: .85;
    }

    /* ---------------- lightbox ---------------- */
    .lightbox {
      border: 1px solid var(--line-1);
      border-radius: var(--radius-md);
      padding: 0;
      max-width: min(1100px, 92vw);
      width: auto;
      background: var(--surface-1);
      box-shadow: var(--shadow-lg);
    }

    .lightbox::backdrop {
      background: rgba(4,6,5,.78);
      backdrop-filter: blur(6px);
    }

    .lightbox img {
      display: block;
      max-width: 100%;
      max-height: 82vh;
      width: auto;
      margin-inline: auto;
    }

    .lightbox figcaption {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 12px 16px;
      border-top: 1px solid var(--line-1);
      color: var(--text-2);
      font-size: var(--fs-sm);
    }

    .lightbox .close-btn {
      min-height: 36px;
      padding: 0 14px;
      border: 1px solid var(--line-1);
      border-radius: 8px;
      background: var(--surface-2);
      color: var(--text-1);
      cursor: pointer;
      font-size: var(--fs-sm);
      font-weight: 700;
    }

    .lightbox .close-btn:hover { border-color: var(--accent-line); color: var(--accent-ink); }

    .nav-links a[aria-current="page"] { color: var(--accent-ink); font-weight: 800; }

    /* ==================================================================
       RESPONSIVE SYSTEM — one standardized breakpoint scale for every
       page and component. Base styles are fluid (clamp + auto-fill
       grids); these queries only adjust structure and scale.

         ≤360px    xs    old / small phones (iPhone SE, 320-360 class)
         ≤480px    sm    phones
         ≤768px    md    large phones, tablets in portrait
         ≤1024px   lg    tablets in landscape, small laptops
         ≤1280px   xl    laptops
         ≥1536px   2xl   HD desktop
         ≥1920px   3xl   widescreen (Full HD and up)
         ≥2560px   4xl   ultrawide / 4K

       Orientation guards handle short landscape phones, and @supports
       fallbacks cover older mobile browsers (no svh / aspect-ratio).
       This block lives at the END of the stylesheet on purpose — it
       must win the cascade over the component rules above.
       ================================================================== */

    /* ---- lg ≤1024: tablets landscape / small laptops ----------------- */
    @media (max-width: 1024px) {
      .hero,
      .about-grid { grid-template-columns: 1fr; }

      .portrait-frame {
        height: clamp(360px, 52vh, 520px);
        height: clamp(360px, 52svh, 520px);
        max-width: 640px;
      }
    }

    /* ---- md ≤768: large phones / portrait tablets --------------------- */
    @media (max-width: 768px) {
      .nav-links { display: none; }
      .hero { padding-block: var(--space-3) var(--space-4); }
      .actions .btn { flex: 1 1 auto; }
      .projects { grid-template-columns: 1fr; }
    }

    /* ---- sm ≤480: phones ---------------------------------------------- */
    @media (max-width: 480px) {
      .brand-word { display: none; }

      .portrait-frame {
        height: clamp(320px, 48vh, 420px);
        height: clamp(320px, 48svh, 420px);
        border-radius: 18px;
      }

      .chip { min-height: 38px; padding: 0 14px; }
      .lightbox { max-width: 96vw; }
      .lightbox figcaption { flex-direction: column; align-items: flex-start; gap: 10px; }
    }

    /* ---- xs ≤360: old / small phones ----------------------------------- */
    @media (max-width: 360px) {
      :root {
        --gutter: 12px;
        --fs-h1: clamp(36px, 13vw, 44px);
        --fs-h2: clamp(26px, 9vw, 32px);
      }

      .nav-inner { min-height: 58px; }
      .actions { flex-direction: column; }
      .actions .btn { width: 100%; }
      .portrait-frame { height: 300px; }
      .profile-badge { font-size: 10px; padding: 8px 11px; }
      .tags span { padding: 5px 7px; }
    }

    /* ---- short landscape (phones rotated, ≤600px tall) ----------------
       Keep the hero, dialogs, and portrait inside the viewport no matter
       the aspect ratio. */
    @media (max-height: 600px) and (orientation: landscape) {
      .hero { padding-block: var(--space-2); gap: var(--space-2); }

      .portrait-frame {
        height: min(75vh, 420px);
        height: min(75svh, 420px);
      }

      .section { padding-block: var(--space-3); }
      .page-head { padding-block: var(--space-3) var(--space-2); }
      .lightbox img { max-height: 68vh; }
    }

    /* ---- 2xl ≥1536: HD desktop ----------------------------------------- */
    @media (min-width: 1536px) {
      :root { --max: 1320px; }

      .portrait-frame {
        height: clamp(420px, 56vh, 660px);
        height: clamp(420px, 56svh, 660px);
      }
    }

    /* ---- 3xl ≥1920: widescreen ------------------------------------------
       Scale the shell and type up so the layout doesn't read as a thin
       strip with oversized margins. Every component consumes these
       variables, so one override keeps them all proportionate. */
    @media (min-width: 1920px) {
      :root {
        --max: 1480px;
        --fs-xs: 13px;
        --fs-sm: 15px;
        --fs-md: 17px;
        --fs-lg: 22px;
        --fs-h2: 56px;
        --fs-h1: 104px;
        --space-4: 104px;
      }

      .portrait-frame {
        height: clamp(480px, 56vh, 720px);
        height: clamp(480px, 56svh, 720px);
      }
    }

    /* ---- 4xl ≥2560: ultrawide / 4K -------------------------------------- */
    @media (min-width: 2560px) {
      :root {
        --max: 1720px;
        --fs-xs: 14px;
        --fs-sm: 16px;
        --fs-md: 19px;
        --fs-lg: 25px;
        --fs-h2: 64px;
        --fs-h1: 120px;
        --space-4: 128px;
      }

      .skills-grid { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
      .gallery { grid-template-columns: repeat(auto-fill, minmax(min(430px, 100%), 1fr)); }

      .portrait-frame {
        height: clamp(520px, 58vh, 800px);
        height: clamp(520px, 58svh, 800px);
      }
    }

    /* ---- fallbacks for older mobile browsers ---------------------------- */
    @supports not (aspect-ratio: 1 / 1) {
      .project-visual { height: 220px; }
      .work-visual { height: 240px; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition: none !important; }
    }
