/* ==========================================================================
   Nik Mohamad Affnan — portfolio
   Single stylesheet, rebuilt against the supplied design reference.
   Organised as:
     1. Tokens & themes      2. Reset & base       3. Layout
     4. Type & eyebrow       5. Buttons & pills    6. Header / nav
     7. Hero                 8. About              9. Work
    10. Services (bento)    11. Skills (tiers)    12. Education
    13. FAQ                 14. Contact / start   15. Footer
    16. Modal & toast       17. Reveal            18. Responsive
    19. Print
   ========================================================================== */

/* ── 1. Tokens ───────────────────────────────────────────────────────────── */
:root {
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  /* Surfaces */
  --page: #E9EDF2;
  --page-soft: #F2F5F9;
  --hero-top: #C7CCD8;
  --card: #F5F7FB;
  --surface: #FFFFFF;

  /* Ink */
  --ink: #05070E;
  --ink-2: #0D1220;
  --muted: #5B6478;
  --faint: #8A93A6;

  /* Brand */
  --blue: #3A5EFD;
  --blue-ink: #2440E8;
  --blue-mid: #9FADF2;
  --blue-soft: #E4E9FF;
  --navy: #03236C;
  --navy-deep: #021947;
  --navy-lift: #0B3488;

  /* Lines & shadows */
  --line: rgba(5, 7, 14, 0.09);
  --line-strong: rgba(5, 7, 14, 0.16);
  --line-dark: rgba(255, 255, 255, 0.14);

  /* The high-contrast pill pair. Inverts with the theme so a "solid" control
     always reads against the page it sits on. */
  --solid-bg: #05070E;
  --solid-fg: #FFFFFF;
  --on-solid: #05070E;
  --shadow-sm: 0 1px 2px rgba(9, 15, 35, 0.06), 0 2px 8px rgba(9, 15, 35, 0.05);
  --shadow-md: 0 10px 26px -14px rgba(9, 15, 35, 0.28), 0 2px 8px rgba(9, 15, 35, 0.05);
  --shadow-lg: 0 32px 60px -30px rgba(9, 15, 35, 0.42), 0 8px 22px -12px rgba(9, 15, 35, 0.14);

  /* Radii — the reference leans on very generous rounding */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 36px;
  --r-pill: 999px;

  --shell: 1200px;
  --gutter: 24px;
  --section-y: clamp(64px, 8vw, 118px);

  --t-fast: 140ms ease;
  --t: 260ms cubic-bezier(0.2, 0.7, 0.3, 1);
  --header-h: 84px;

  color-scheme: light;
}

[data-theme="dark"] {
  --page: #070B16;
  --page-soft: #0B1120;
  --hero-top: #0C1322;
  --card: #111A2C;
  --surface: #0E1626;

  --ink: #EEF2FB;
  --ink-2: #FFFFFF;
  --muted: #9BA7BF;
  --faint: #78859E;

  --blue: #7E97FF;
  --blue-ink: #A3B5FF;
  --blue-mid: #4E63C8;
  --blue-soft: rgba(126, 151, 255, 0.14);
  --navy: #041B4E;
  --navy-deep: #020E2B;
  --navy-lift: #0A2A73;

  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.20);
  --line-dark: rgba(255, 255, 255, 0.14);

  --solid-bg: #FFFFFF;
  --solid-fg: #05070E;
  --on-solid: #05070E;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 26px -14px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 32px 60px -30px rgba(0, 0, 0, 0.85), 0 8px 22px -12px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ── 2. Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--ink-2);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}
h3 { font-size: 1.22rem; letter-spacing: -0.022em; line-height: 1.25; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--blue-soft);
  color: var(--blue-ink);
  padding: 2px 6px;
  border-radius: 6px;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 300;
  background: var(--ink); color: var(--surface);
  padding: 12px 20px; border-radius: var(--r-pill);
  font-weight: 700; transition: top var(--t-fast);
}
.skip-link:focus { top: 12px; }

/* ── 3. Layout ───────────────────────────────────────────────────────────── */
.shell { width: min(var(--shell), 100% - var(--gutter) * 2); margin-inline: auto; }

.section { position: relative; padding-block: var(--section-y); }

.section-head { max-width: 46rem; margin-bottom: clamp(34px, 4.5vw, 58px); }
.section-head-center { max-width: 52rem; margin-inline: auto; text-align: center; }

.section-title { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: 0.55em; }
.section-lead { color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.09rem); max-width: 40rem; }
.section-head-center .section-lead { margin-inline: auto; }

/* ── 4. Type helpers ─────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--blue-ink);
}
.eyebrow svg { color: var(--blue); flex: none; }
.eyebrow-on-dark { color: #B9C7FF; }
.eyebrow-on-dark svg { color: #9FB4FF; }
.eyebrow-on-blue { color: rgba(255, 255, 255, 0.9); }
.eyebrow-on-blue svg { color: #FFFFFF; }

/* ── 5. Buttons & pills ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn svg { transition: transform var(--t); }
.btn:hover svg { transform: translateX(3px); }
.btn-sm { padding: 10px 19px; font-size: 0.89rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 10px 24px -12px rgba(58, 94, 253, 0.7); }
.btn-primary:hover { background: var(--blue-ink); }
[data-theme="dark"] .btn-primary { color: var(--on-solid); }
[data-theme="dark"] .btn-primary:hover { background: var(--blue-ink); color: #fff; }

.btn-dark { background: var(--solid-bg); color: var(--solid-fg); }
[data-theme="dark"] .btn-dark { border-color: transparent; }
.btn-dark:hover { transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }

.btn-light { background: #fff; color: var(--on-solid); }
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* The reference's signature control: a solid pill with a circular arrow beside it. */
.pill-group { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em;
  transition: transform var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.pill-sm { padding: 10px 20px; font-size: 0.88rem; }
.pill-dark { background: var(--solid-bg); color: var(--solid-fg); }
.pill-dark:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pill-light { background: #fff; color: var(--on-solid); }
.pill-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.pill-circle {
  display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  transition: transform var(--t-fast), background-color var(--t-fast), color var(--t-fast);
}
.pill-circle:hover { transform: translateX(3px); background: var(--solid-bg); color: var(--solid-fg); border-color: var(--solid-bg); }
.pill-circle-light { background: rgba(255, 255, 255, 0.16); color: #fff; border-color: var(--line-dark); }
.pill-circle-light:hover { background: #fff; color: var(--on-solid); border-color: #fff; }

.icon-btn {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.icon-btn:hover { border-color: var(--ink); }

/* ── 6. Header / nav ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  padding-block: 14px;
  transition: background-color var(--t), box-shadow var(--t), backdrop-filter var(--t);
}
.site-header.is-stuck {
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 22px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { border-radius: 12px; width: 36px; height: 36px; }
.brand-text { font-weight: 800; letter-spacing: -0.03em; font-size: 1.16rem; }

.nav { display: flex; align-items: center; gap: 18px; margin-right: auto; }
.nav ul { display: flex; align-items: center; gap: 4px; }
.nav ul a {
  display: block; padding: 9px 15px; border-radius: var(--r-pill);
  font-size: 0.94rem; font-weight: 600; color: var(--muted);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav ul a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav ul a.is-active { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.nav-toggle { display: none; }
.bars { display: grid; gap: 4px; width: 18px; }
.bars i { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform var(--t), opacity var(--t); }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* ── 7. Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(20px, 3vw, 44px) clamp(48px, 6vw, 90px);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--hero-top) 0%, color-mix(in srgb, var(--page) 92%, var(--hero-top)) 46%, var(--page) 100%);
}

.hero-stage { position: relative; }

.hero-visual {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: clamp(320px, 44vw, 560px);
}

.hero-watermark {
  position: absolute; left: 50%; top: 7%;
  transform: translateX(-50%);
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: clamp(2.6rem, 13.2vw, 12rem);
  font-weight: 800; letter-spacing: -0.045em; line-height: 0.9;
  color: color-mix(in srgb, var(--surface) 62%, transparent);
  white-space: nowrap;
  user-select: none; pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] .hero-watermark { color: color-mix(in srgb, #ffffff 8%, transparent); }

.hero-arch {
  position: relative;
  z-index: 1;
  width: clamp(230px, 33vw, 410px);
  aspect-ratio: 100 / 134;
}
.arch-fill {
  position: absolute; inset: 0; width: 100%; height: 100%;
  /* The reference lets the arch melt into the page instead of ending on a line. */
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, rgba(0, 0, 0, 0.5) 92%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 74%, rgba(0, 0, 0, 0.5) 92%, transparent 100%);
}

.arch-portrait {
  position: absolute; left: 50%; bottom: 0;
  width: 118%; height: auto;
  transform: translateX(-50%);
}

.badge {
  position: absolute;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem; font-weight: 700; white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.badge-a { top: 12%; right: -14%; transform: rotate(-7deg); }
.badge-b { top: 34%; left: -20%; transform: rotate(-15deg); }
.badge-c { top: 52%; right: -16%; transform: rotate(6deg); }

.hero-foot {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
  margin-top: calc(-1 * clamp(30px, 8.5vw, 124px));
}

.hero-hey { margin: 0 0 10px; font-size: 1.02rem; font-weight: 600; color: var(--muted); }

.hero-intro h1 {
  font-size: clamp(2.1rem, 5.6vw, 4.15rem);
  line-height: 1.03;
  margin-bottom: 0.42em;
}
.hero-intro .lead { max-width: 34rem; color: var(--muted); font-size: 1.02rem; }

.hero-cards { display: grid; gap: 12px; width: clamp(230px, 24vw, 292px); }

.mini-card {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.mini-card p { margin: 0; font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.mini-card p span { display: block; font-weight: 500; color: var(--faint); font-size: 0.8rem; }
.mini-figure { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; color: var(--ink-2); }
.mini-figure small { font-size: 0.62em; font-weight: 700; }

/* ── 8. About ────────────────────────────────────────────────────────────── */
.section-about { background: var(--page); padding-top: clamp(34px, 4.4vw, 64px); }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(24px, 3.4vw, 52px);
  align-items: center;
}

.about-figure { margin: 0; display: flex; justify-content: center; align-items: flex-end; }
.about-figure img { width: 100%; max-width: 480px; }

.about-copy {
  max-width: 54rem;
  margin: clamp(34px, 4.4vw, 60px) auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 1.03rem;
}
.about-copy p { margin-bottom: 1.1em; }

.about-tiles {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tile {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.tile-label { margin: 0; font-size: 0.89rem; font-weight: 600; line-height: 1.45; color: var(--muted); }
.tile-figure { display: block; font-size: 2rem; font-weight: 800; letter-spacing: -0.035em; color: var(--ink-2); }
.tile-figure-sm { font-size: 2rem; margin-bottom: 6px; }
.tile-figure small { font-size: 0.6em; }
.tile-title { margin-bottom: 14px; }

.tile-mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tile-mosaic img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud li {
  padding: 8px 15px; border-radius: var(--r-pill);
  background: var(--page); border: 1px solid var(--line);
  font-size: 0.83rem; font-weight: 600; color: var(--muted);
}
.tag-cloud li:nth-child(odd) { transform: rotate(-2.4deg); }
.tag-cloud li:nth-child(even) { transform: rotate(1.8deg); }
.tag-cloud-on-blue li { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.22); color: #fff; }

/* ── 9. Work ─────────────────────────────────────────────────────────────── */
.section-work { background: var(--page); }

.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: clamp(24px, 3vw, 38px); }
.filter {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 0.9rem; font-weight: 600; color: var(--muted);
  cursor: pointer;
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast);
}
.filter:hover { color: var(--ink); border-color: var(--line-strong); }
.filter.is-active { background: var(--solid-bg); border-color: var(--solid-bg); color: var(--solid-fg); }
[data-theme="dark"] .filter.is-active { background: var(--surface); color: var(--ink); }

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(16px, 2vw, 24px);
}

.project-card { position: relative; }
.project-card.is-hidden { display: none; }

.project-open {
  display: block; width: 100%; height: 100%; text-align: left;
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.project-open:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

.project-media { display: block; overflow: hidden; }
.project-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 520ms cubic-bezier(0.2, 0.7, 0.3, 1); }
.project-open:hover .project-media img { transform: scale(1.04); }

.project-body { display: block; position: relative; padding: clamp(20px, 2.4vw, 28px); }
.project-tag {
  display: inline-block; margin-bottom: 12px;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--blue-soft); color: var(--blue-ink);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.project-name { display: block; font-size: 1.24rem; font-weight: 800; letter-spacing: -0.025em; color: var(--ink-2); line-height: 1.25; }
.project-snippet { display: block; margin-top: 8px; font-size: 0.94rem; color: var(--muted); }
.project-tech { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.project-tech i {
  font-style: normal; padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--page); border: 1px solid var(--line);
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
}

/* Sits on the card's white area, so it never fights the dark cover underneath. */
.project-num {
  position: absolute;
  top: clamp(18px, 2vw, 24px); right: clamp(20px, 2.4vw, 26px);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.04em;
  color: color-mix(in srgb, var(--ink) 18%, transparent);
}
[data-theme="dark"] .project-num { color: color-mix(in srgb, #ffffff 24%, transparent); }
.project-card.is-featured .project-num { top: clamp(24px, 3vw, 42px); right: clamp(24px, 3vw, 42px); }

.project-view {
  position: absolute; right: clamp(18px, 2.2vw, 26px); bottom: clamp(18px, 2.2vw, 26px);
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--page); color: var(--ink);
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.project-open:hover .project-view { background: var(--solid-bg); color: var(--solid-fg); transform: rotate(-45deg); }

/* The first card gets the reference's wide "hero project" treatment. */
.project-card.is-featured { grid-column: 1 / -1; }
.project-card.is-featured .project-open {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
}
.project-card.is-featured .project-media { order: 2; height: 100%; }
.project-card.is-featured .project-media img { height: 100%; aspect-ratio: auto; min-height: 260px; }
.project-card.is-featured .project-body { order: 1; padding: clamp(26px, 3.4vw, 48px); }
.project-card.is-featured .project-name { font-size: clamp(1.5rem, 2.6vw, 2.05rem); margin-top: 4px; }
.project-card.is-featured .project-snippet { font-size: 1rem; max-width: 34rem; margin-top: 14px; }
.project-card.is-featured .project-view { display: none; }
.project-card.is-featured .pill { margin-top: 24px; }

.work-note {
  margin: clamp(26px, 3vw, 40px) 0 0;
  padding: 16px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  font-size: 0.87rem; color: var(--faint);
}

/* ── 10. Services (bento) ────────────────────────────────────────────────── */
.section-navy {
  position: relative;
  background: var(--navy);
  color: #EAF0FB;
}
.section-navy::before {
  content: ""; position: absolute; inset: 0 0 auto 0;
  height: clamp(90px, 14vw, 210px);
  background: linear-gradient(180deg, var(--page) 0%, color-mix(in srgb, var(--page) 40%, transparent) 45%, transparent 100%);
  pointer-events: none;
}
.section-navy > .shell { position: relative; z-index: 1; }

.section-navy .section-title { color: #fff; }
.section-navy .section-lead { color: rgba(234, 240, 251, 0.72); }

.section-navy-alt { padding-top: 0; }
.section-navy-alt::before { display: none; }
.section-navy-alt::after {
  content: ""; position: absolute; inset: auto 0 0 0;
  height: clamp(70px, 11vw, 170px);
  background: linear-gradient(0deg, var(--page) 0%, color-mix(in srgb, var(--page) 35%, transparent) 55%, transparent 100%);
  pointer-events: none;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 20px);
}

.bento-card {
  position: relative;
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.bento-card h3 { margin-bottom: 10px; }
.bento-card > p { font-size: 0.94rem; line-height: 1.6; }

.bento-blue {
  display: flex; flex-direction: column;
  background: linear-gradient(150deg, #4A6BFF 0%, #7E97FF 55%, #C3CEFF 100%);
  color: #fff;
}
.bento-blue h3 { color: #fff; }
.bento-blue > p { color: rgba(255, 255, 255, 0.86); }
.bento-blue .tag-cloud { margin-top: auto; padding-top: 30px; gap: 10px; }
.bento-blue .tag-cloud li { padding: 9px 17px; font-size: 0.86rem; }

.bento-plain {
  background: var(--surface);
  color: var(--ink);
}
.bento-plain h3 { color: var(--ink-2); }
.bento-plain > p { color: var(--muted); }

.bento-shot { width: 100%; margin-top: 20px; border-radius: var(--r-md); }

.bento-cta {
  grid-column: 3;
  grid-row: 1 / span 2;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
}
.bento-cover { width: 100%; height: clamp(180px, 22vw, 300px); object-fit: cover; object-position: center 22%; }
.bento-cta-body {
  padding: clamp(22px, 2.4vw, 30px);
  border-top: 1px solid var(--line);
}
.bento-cta-body h3 { color: var(--ink-2); font-size: 1.5rem; margin: 14px 0 8px; }
.bento-cta-body > p { color: var(--muted); font-size: 0.94rem; }
.bento-pill {
  display: inline-block;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--page); border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
}

/* ── 11. Skills (tiers) ──────────────────────────────────────────────────── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}

.tier-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(26px, 3vw, 40px);
  border-radius: var(--r-xl);
}
.tier-card-dark {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
  color: #EAF0FB;
  backdrop-filter: blur(6px);
}
.tier-card-light { background: var(--surface); color: var(--ink); }

.tier-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tier-name { margin: 0; font-size: 1rem; font-weight: 700; }
.tier-star { color: var(--blue-mid); }
.tier-card-light .tier-star { color: var(--blue); }
.tier-title { font-size: 1.5rem; }
.tier-card-dark .tier-title { color: #fff; }
.tier-desc { font-size: 0.94rem; color: rgba(234, 240, 251, 0.7); margin: 0; }
.tier-card-light .tier-desc { color: var(--muted); }

.tier-includes {
  margin: 6px 0 0;
  font-size: 0.9rem; font-weight: 700;
  color: rgba(234, 240, 251, 0.92);
}
.tier-card-light .tier-includes { color: var(--ink-2); }

.tier-list { display: grid; gap: 12px; margin-top: -4px; }
.tier-list li { position: relative; padding-left: 26px; }
.tier-list li::before {
  content: ""; position: absolute; left: 6px; top: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue-mid);
}
.tier-card-light .tier-list li::before { background: var(--blue); }
.tier-list strong { display: block; font-size: 0.98rem; font-weight: 700; color: #fff; }
.tier-card-light .tier-list strong { color: var(--ink-2); }
.tier-list span { display: block; font-size: 0.9rem; color: rgba(234, 240, 251, 0.66); }
.tier-card-light .tier-list span { color: var(--muted); }

.tier-card .pill-group { margin-top: auto; padding-top: 10px; }

.chip-cloud { margin-top: clamp(34px, 4.5vw, 60px); text-align: center; }
.chip-label {
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(234, 240, 251, 0.6); margin-bottom: 16px;
}
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.chips li {
  padding: 9px 18px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-dark);
  font-size: 0.88rem; font-weight: 600; color: rgba(234, 240, 251, 0.9);
}

/* ── 12. Education ───────────────────────────────────────────────────────── */
.section-education { background: var(--page); }

.edu-panel {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 3.4vw, 52px);
  align-items: center;
  padding: clamp(26px, 3.6vw, 52px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.edu-copy { color: var(--muted); font-size: 1.01rem; }

.edu-figure { margin: 0; border-radius: var(--r-lg); overflow: hidden; }
.edu-figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

.timeline { display: grid; gap: 4px; margin-top: clamp(22px, 2.6vw, 32px); }
.timeline li {
  position: relative;
  display: grid; grid-template-columns: 118px minmax(0, 1fr);
  gap: 4px 20px;
  padding: 18px 0 18px 20px;
  border-left: 2px solid var(--line-strong);
}
.timeline li:last-child { border-left-color: var(--blue); }
.timeline li:last-child::before {
  content: ""; position: absolute; left: -7px; top: 24px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft);
}
.timeline-year { font-size: 0.84rem; font-weight: 800; letter-spacing: 0.02em; color: var(--blue-ink); padding-top: 2px; }
.timeline h3 { font-size: 1.05rem; color: var(--ink-2); }
.timeline p { margin: 4px 0 0; font-size: 0.93rem; color: var(--muted); }

/* ── 13. FAQ ─────────────────────────────────────────────────────────────── */
.section-faq { background: var(--page); }

.faq-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: clamp(16px, 2vw, 26px); align-items: start; }

.faq-promo {
  position: sticky; top: calc(var(--header-h) + 20px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(30px, 4vw, 52px) clamp(22px, 3vw, 38px);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #5C7BFF 0%, #8FA4FF 52%, #C6D1FF 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.faq-title { color: #fff; font-size: clamp(1.7rem, 3vw, 2.5rem); margin-bottom: 6px; }
.faq-promo .pill-group { margin-top: 26px; }
.faq-promo .pill { background: #fff; color: var(--on-solid); }
.faq-promo .pill-circle { background: var(--on-solid); color: #fff; border-color: var(--on-solid); }
.faq-promo .pill-circle:hover { background: #fff; color: var(--on-solid); }

.faq-list { display: grid; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px clamp(20px, 2.4vw, 28px);
  font-size: 1.02rem; font-weight: 700; color: var(--ink-2);
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-mark { position: relative; flex: none; width: 18px; height: 18px; }
.faq-mark::before, .faq-mark::after {
  content: ""; position: absolute; inset: 50% 0 auto 0;
  height: 2px; border-radius: 2px; background: var(--muted);
  transition: transform var(--t), opacity var(--t);
}
.faq-mark::after { transform: rotate(90deg); }
.faq-item[open] .faq-mark::after { transform: rotate(0deg); opacity: 0; }
.faq-item p {
  padding: 0 clamp(20px, 2.4vw, 28px) 24px;
  margin: 0; font-size: 0.95rem; color: var(--muted); max-width: 44rem;
}

/* ── 14. Contact / start ─────────────────────────────────────────────────── */
.section-start {
  position: relative;
  background: var(--navy);
  color: #EAF0FB;
  padding-bottom: clamp(48px, 6vw, 88px);
}
.section-start::before {
  content: ""; position: absolute; inset: 0 0 auto 0;
  height: clamp(80px, 12vw, 180px);
  background: linear-gradient(180deg, var(--page) 0%, color-mix(in srgb, var(--page) 38%, transparent) 48%, transparent 100%);
  pointer-events: none;
}
.section-start > .shell { position: relative; z-index: 1; }

.section-start .section-title { color: #fff; font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
.section-start .section-lead { color: rgba(234, 240, 251, 0.75); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(16px, 2vw, 26px); align-items: start; }

.contact-cards { display: grid; gap: 12px; }
.contact-card {
  display: flex; align-items: center; gap: 15px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-lg);
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.contact-card:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }
.contact-card.is-static:hover { transform: none; background: rgba(255, 255, 255, 0.07); }

.cc-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
}
.cc-body { display: grid; gap: 2px; min-width: 0; }
.cc-body small { font-size: 0.78rem; font-weight: 600; color: rgba(234, 240, 251, 0.58); }
.cc-body strong { font-size: 0.95rem; font-weight: 700; overflow-wrap: anywhere; }

.copy-btn {
  margin-left: auto; flex: none;
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line-dark); color: #fff;
  cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.copy-btn:hover { background: #fff; color: var(--on-solid); border-color: #fff; }

.contact-form {
  padding: clamp(22px, 2.8vw, 34px);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-xl);
}

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 0.87rem; font-weight: 600; color: rgba(234, 240, 251, 0.86); }
.field label span { color: #9FB4FF; }
.field input, .field textarea {
  width: 100%;
  padding: 13px 16px;
  font: inherit; font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-dark);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), background-color var(--t-fast);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(234, 240, 251, 0.4); }
.field input:focus, .field textarea:focus { outline: none; border-color: #9FB4FF; background: rgba(255, 255, 255, 0.1); }
.field textarea { resize: vertical; min-height: 110px; }
.field.has-error input, .field.has-error textarea { border-color: #FF9D9D; }
.field-error { margin: 6px 0 0; font-size: 0.83rem; color: #FFB4B4; min-height: 0; }

.form-note { margin: 14px 0 0; font-size: 0.83rem; color: rgba(234, 240, 251, 0.6); line-height: 1.6; text-align: center; }
.form-status { margin: 10px 0 0; font-size: 0.9rem; font-weight: 700; color: #86EFAC; text-align: center; }

/* ── 15. Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: #EAF0FB;
  padding-bottom: 34px;
}

.footer-cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  padding-bottom: clamp(30px, 4vw, 48px);
}

.footer-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 132px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.02rem; font-weight: 700;
  transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.footer-card:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-3px); }
.footer-card.is-active { background: #fff; border-color: #fff; color: var(--on-solid); }
.fc-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.12); color: inherit;
}
.footer-card.is-active .fc-icon { background: rgba(5, 7, 14, 0.07); }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 20px 28px;
  align-items: center; justify-content: space-between;
  padding-top: clamp(24px, 3vw, 34px);
  border-top: 1px solid var(--line-dark);
}
.footer-credit { margin: 0; font-size: 0.89rem; color: rgba(234, 240, 251, 0.68); }

.socials { display: flex; gap: 10px; }
.socials a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.socials a:hover { background: #fff; color: var(--on-solid); transform: translateY(-2px); }

.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { font-size: 0.89rem; font-weight: 600; color: rgba(234, 240, 251, 0.72); }
.footer-links a:hover { color: #fff; }

.footer-fine { margin: 26px 0 0; font-size: 0.82rem; color: rgba(234, 240, 251, 0.45); text-align: center; }

/* ── 16. Modal & toast ───────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 9, 22, 0.7); backdrop-filter: blur(6px); animation: fade 200ms ease; }
.modal-panel {
  position: relative; width: min(760px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  animation: pop 280ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } }

.modal-close {
  position: absolute; right: 16px; top: 16px; z-index: 2;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); border: 0; color: #05070E;
  box-shadow: var(--shadow-md); cursor: pointer;
}
.modal-close:hover { background: #fff; }
.modal-media { background: #061539; }
.modal-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.modal-body { padding: 28px clamp(22px, 3vw, 38px) 34px; }
.modal-body h3 { font-size: 1.45rem; margin-bottom: 12px; }
.modal-body p { color: var(--muted); font-size: 0.98rem; }
.modal-body ul { display: grid; gap: 9px; margin: 18px 0 0; }
.modal-body ul li { position: relative; padding-left: 24px; font-size: 0.94rem; color: var(--muted); }
.modal-body ul li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.tech-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 0.91rem; font-weight: 700; color: var(--ink);
}
.tech-line span { font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); font-weight: 800; }

body.modal-open { overflow: hidden; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translateX(-50%) translateY(10px);
  padding: 13px 24px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--page);
  font-size: 0.91rem; font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity var(--t), transform var(--t);
  max-width: calc(100vw - 40px); text-align: center;
}
.toast[hidden] { display: none; }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 17. Reveal ──────────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(20px);
  transition: opacity 640ms ease, transform 640ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ── 18. Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento-cta { grid-column: 2; grid-row: 1 / span 2; }
  .badge-b { left: -10%; }
  .badge-a, .badge-c { right: -8%; }
}

@media (max-width: 960px) {
  :root { --header-h: 74px; }

  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--page); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 16px var(--gutter) 28px;
    transform: translateY(-120%); opacity: 0; visibility: hidden;
    transition: transform var(--t), opacity var(--t), visibility var(--t);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav ul a { padding: 15px 14px; font-size: 1.02rem; border-radius: var(--r-sm); }
  .nav-cta { display: inline-flex; margin-top: 14px; justify-content: center; padding: 14px 20px; }
  .nav-toggle { display: grid; }
  .header-cta { display: none; }

  .hero-foot { grid-template-columns: 1fr; gap: 30px; margin-top: 34px; }
  .hero-cards { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-visual { min-height: clamp(260px, 58vw, 400px); }
  .hero-arch { width: clamp(200px, 46vw, 300px); }
  .badge { font-size: 0.78rem; padding: 8px 14px; }

  .about-grid { grid-template-columns: 1fr; grid-template-areas: "figure" "copy" "tiles"; }
  .about-figure { justify-content: center; }
  .about-figure img { max-width: 340px; }

  .projects { grid-template-columns: 1fr; }
  .project-card.is-featured .project-open { grid-template-columns: 1fr; }
  .project-card.is-featured .project-media { order: 1; }
  .project-card.is-featured .project-body { order: 2; }
  .project-card.is-featured .project-media img { min-height: 0; aspect-ratio: 16 / 10; }

  .tier-grid { grid-template-columns: 1fr; }
  .edu-panel { grid-template-columns: 1fr; }
  .edu-figure { order: -1; }
  .faq-grid { grid-template-columns: 1fr; }
  .faq-promo { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { gap: 12px; padding: 7px 7px 7px 12px; }

  .hero-visual { min-height: 0; }
  .hero-watermark { position: static; transform: none; font-size: clamp(2.2rem, 15vw, 4rem); margin-bottom: 14px; }
  .hero-visual { display: block; }
  .hero-arch { margin-inline: auto; }
  .badge-a { right: -4%; }
  .badge-b { left: -4%; }
  .badge-c { right: -2%; }

  .hero-cards { grid-template-columns: 1fr; }
  .pill-group { flex-wrap: wrap; }

  .about-tiles { grid-template-columns: 1fr; }

  .bento { grid-template-columns: 1fr; }
  .bento-cta { grid-column: 1; grid-row: auto; }

  .projects { grid-template-columns: 1fr; }
  .filters { gap: 7px; }
  .filter { padding: 8px 15px; font-size: 0.85rem; }

  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .tier-card { padding: 24px 20px; }
  .faq-item summary { padding: 18px 20px; font-size: 0.96rem; }

  .footer-cards { grid-template-columns: 1fr; }
  .footer-card { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; }
  .footer-links { justify-content: center; }
}

@media (max-width: 400px) {
  .brand-text { display: none; }
}

/* ── 19. Print ───────────────────────────────────────────────────────────── */
@media print {
  .site-header, .filters, .modal, .toast, .pill-group, .contact-form,
  .hero-watermark, .badge, .footer-cards, .socials { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .section, .hero { padding-block: 14px; }

  .project-card, .bento-card, .tier-card, .tile, .faq-item, .timeline li,
  .edu-panel, .mini-card, .contact-card { break-inside: avoid; box-shadow: none; }

  .section-navy, .section-start, .site-footer {
    background: #fff !important; color: #000 !important;
  }
  .section-navy::before, .section-navy::after, .section-start::before { display: none; }
  .section-navy .section-title, .section-start .section-title, .section-navy .section-lead,
  .section-start .section-lead, .tier-title, .tier-list strong, .cc-body strong,
  .footer-card, .chip-label { color: #000 !important; }
  .bento-blue, .faq-promo { background: #f2f2f2 !important; color: #000 !important; }
  .bento-blue h3, .faq-title, .eyebrow-on-blue { color: #000 !important; }
  .tier-card-dark { background: #fff; border-color: #ccc; }
  .arch-fill { -webkit-mask-image: none; mask-image: none; }
}
