/* =====================================================================
   Febrianggi Caesar Immanuel Portfolio · Teal Scientific
   ---------------------------------------------------------------------
   Design direction: editorial portfolio x scientific interface.
   Dials: ENERGY 2 / RHYTHM 2 / MOTION 2 (moderate).

   Core decisions:
   - Palette: #101517 dark canvas + #56C6CF teal accent reserved for
     labels, links, active states, and primary actions so work leads.
   - Motif: subtle dot grid in the hero as a statistical cue, not repeated
     across other sections.
   - Typography: self-hosted Plus Jakarta Sans (800 display, 400 body)
     with a fluid clamp() scale.
   - Layout: left-aligned section headers; cards reserved for comparable
     items (More Projects, More Research, Certificates), open rules elsewhere.
   - Radii: 6px chips, 10px buttons, 16px cards/media, 999px status pills.
   - Glow/shadows limited to the hero photo and the active certificate card.
   ===================================================================== */

@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/plus-jakarta-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/plus-jakarta-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/plus-jakarta-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/plus-jakarta-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("../assets/fonts/plus-jakarta-sans-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  /* colors */
  --bg: #101517;
  --bg-deep: #0c1012;
  --surface: #182124;
  --surface-2: #1a292d;
  --surface-3: #21343a;
  --line: rgba(236, 249, 250, 0.10);
  --line-strong: rgba(236, 249, 250, 0.18);
  --text: #ecf9fa;
  --text-2: #b4c5c9;
  --muted: #95a9ae;          /* 6.3:1 on --bg */
  --accent: #56c6cf;
  --accent-hover: #79dce3;
  --accent-tint: rgba(86, 198, 207, 0.12);
  --accent-line: rgba(86, 198, 207, 0.42);
  --on-accent: #062226;
  --tile: #f4fbfb;
  --danger-text: #ffa79b;

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* typography scale */
  --fs-meta: 0.8125rem;                                    /* 13px */
  --fs-small: 0.875rem;                                    /* 14px */
  --fs-body: clamp(0.95rem, 0.92rem + 0.15vw, 1.0625rem);  /* 15-17px */
  --fs-card: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);  /* 18-22px */
  --fs-section: clamp(2rem, 1.5rem + 1.8vw, 2.75rem);      /* 32-44px */
  --fs-hero: clamp(2.6rem, 1.6rem + 3.6vw, 4.5rem);        /* 42-72px */

  /* spacing (4px steps) */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem;
  --section-gap: clamp(4.5rem, 3rem + 5vw, 7.5rem);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shell: 80rem;            /* 1280px */
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --t-hover: 200ms;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.7 var(--font);
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.2; text-wrap: balance; letter-spacing: -0.02em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; }
::selection { background: rgba(86, 198, 207, 0.35); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.shell { width: min(var(--shell), 100% - 2 * clamp(1.25rem, 4vw, 2.5rem)); margin-inline: auto; }
.muted { color: var(--text-2); }
.meta { font-size: var(--fs-meta); color: var(--muted); letter-spacing: 0.01em; }
.label { font-size: var(--fs-small); font-weight: 700; color: var(--accent); letter-spacing: 0.02em; }
.label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s4); }

.skip-link {
  position: absolute; left: var(--s4); top: -4rem; z-index: 100;
  padding: var(--s3) var(--s4); background: var(--accent); color: var(--on-accent);
  border-radius: var(--r-md); font-weight: 700;
}
.skip-link:focus { top: var(--s4); }

.file-banner {
  position: relative; z-index: 60;
  padding: var(--s4) clamp(1rem, 4vw, 2rem);
  background: #11292c; border-bottom: 1px solid var(--accent); font-size: 0.95rem;
}
.file-banner strong { display: block; margin-bottom: var(--s1); }

/* ---------------------------------------------------------------------
   Cursor-following glow and revealed background grid
--------------------------------------------------------------------- */
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 30;
  width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 198, 207, 0.22) 0%, rgba(86, 198, 207, 0.05) 32%, transparent 68%);
  pointer-events: none; opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
.cursor-glow.is-visible { opacity: 1; }

/* Hidden grid revealed only within the cursor glow mask (--gx, --gy).
   Lines shift vertically with scroll (--gsy) so the grid stays anchored to the page. */
.grid-reveal {
  --cell: 44px;
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(86, 198, 207, 0.21) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 198, 207, 0.21) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: 0 var(--gsy, 0px);
  -webkit-mask-image: radial-gradient(circle 250px at var(--gx, -600px) var(--gy, -600px), #000 0%, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.1) 80%, transparent 100%);
  mask-image: radial-gradient(circle 250px at var(--gx, -600px) var(--gy, -600px), #000 0%, rgba(0, 0, 0, 0.7) 30%, rgba(0, 0, 0, 0.32) 58%, rgba(0, 0, 0, 0.1) 80%, transparent 100%);
  opacity: 0; transition: opacity 0.4s ease;
}
.grid-reveal.is-visible { opacity: 1; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor-glow, .grid-reveal { display: none; } }

/* ---------------------------------------------------------------------
   Header
--------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(16, 21, 23, 0.62);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s, border-color 0.25s;
}
.site-header.is-scrolled, .site-header.menu-open { background: rgba(16, 21, 23, 0.9); border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); min-height: 44px; font-weight: 800; font-size: 1.02rem; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem; flex: none;
  border: 1px solid var(--accent-line); border-radius: 9px; background: var(--accent-tint);
  color: var(--accent); font-size: 0.95rem; font-weight: 800;
}
.brand-name > span { color: var(--text-2); font-weight: 600; }

.site-nav { display: flex; align-items: center; gap: var(--s1); }
.site-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 var(--s3); border-radius: var(--r-md);
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.92rem;
  transition: color var(--t-hover), background-color var(--t-hover);
}
.site-nav a::after {
  content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: 8px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease);
}
.site-nav a:hover { color: var(--text); }
.site-nav a.is-active { color: var(--text); font-weight: 700; }
.site-nav a.is-active::after { transform: scaleX(1); }
.site-nav .nav-cta { margin-left: var(--s2); border: 1px solid var(--accent-line); color: var(--text); }
.site-nav .nav-cta::after { display: none; }
.site-nav .nav-cta:hover, .site-nav .nav-cta.is-active { background: var(--accent-tint); border-color: var(--accent); }

.menu-toggle {
  display: none; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-weight: 600; cursor: pointer;
}
.menu-icon { position: relative; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transition: background-color 0.2s; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.25s var(--ease); }
.menu-icon::before { transform: translateY(-5px); }
.menu-icon::after { transform: translateY(5px); }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: rotate(-45deg); }

@media (max-width: 63.99rem) {
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; inset: 100% 0 auto;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--s2) clamp(1.25rem, 4vw, 2.5rem) var(--s4);
    background: rgba(16, 21, 23, 0.97); border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity 0.2s ease, transform 0.25s var(--ease); }
  .site-nav a { min-height: 48px; padding: 0 var(--s2); border-bottom: 1px solid var(--line); border-radius: 0; font-size: 1rem; }
  .site-nav a::after { left: 0; right: auto; top: 14px; bottom: 14px; width: 2px; height: auto; transform: scaleY(0); }
  .site-nav a.is-active { padding-left: var(--s4); }
  .site-nav a.is-active::after { transform: scaleY(1); }
  .site-nav .nav-cta { margin: var(--s3) 0 0; justify-content: center; border-radius: var(--r-md); border-bottom: 1px solid var(--accent-line); }
}
@media (max-width: 26rem) { .brand-name > span { display: none; } }

/* ---------------------------------------------------------------------
   Buttons & links
--------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 46px; padding: 0 1.25rem;
  border: 1px solid transparent; border-radius: var(--r-md);
  font: 600 0.95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--t-hover), border-color var(--t-hover), color var(--t-hover), transform var(--t-hover) var(--ease);
}
.btn svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-sm { min-height: 44px; padding: 0 1rem; font-size: 0.9rem; }
.btn-lg { min-height: 52px; padding: 0 1.5rem; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { border-color: var(--line-strong); background: transparent; color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-tint); }
.btn-primary svg:last-child { transition: transform var(--t-hover) var(--ease); }
.btn-primary:hover svg:last-child { transform: translateX(2px); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); cursor: pointer;
  transition: border-color var(--t-hover), background-color var(--t-hover);
}
.icon-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[hidden] { display: none; }

.text-link {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px;
  color: var(--text); font-weight: 600; font-size: 0.92rem;
  text-decoration: underline; text-decoration-color: var(--accent-line); text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: color var(--t-hover), text-decoration-color var(--t-hover);
}
.text-link:hover { color: var(--accent-hover); text-decoration-color: var(--accent); }
.text-link svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.small-link { font-size: var(--fs-small); min-height: 44px; }

@media (prefers-reduced-motion: reduce) { .btn, .btn svg { transition: none; } .btn-primary:hover, .btn-primary:hover svg:last-child { transform: none; } }

/* ---------------------------------------------------------------------
   Skeletons & UI states
--------------------------------------------------------------------- */
.sk {
  display: block; height: 0.95rem; margin-block: 0.55rem; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%) 0 0 / 200% 100%;
}
.sk-block { height: 10rem; }
.sk-card {
  min-height: 22rem; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%) 0 0 / 200% 100%;
}
.sk-short { min-height: 9rem; }
@media (prefers-reduced-motion: no-preference) { .sk, .sk-card { animation: shimmer 1.4s linear infinite; } }
@keyframes shimmer { to { background-position: -200% 0; } }

.state { padding: var(--s4) var(--s5); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); }
.state-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); border-color: rgba(255, 167, 155, 0.45); color: var(--danger-text); }

/* ---------------------------------------------------------------------
   Sections
--------------------------------------------------------------------- */
.section { padding-top: var(--section-gap); }
.hero + .section { padding-top: clamp(3rem, 2rem + 3vw, 5rem); }
.section-head { display: grid; gap: var(--s3); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.25rem); max-width: 48rem; }
.section-title { font-size: var(--fs-section); font-weight: 800; }
.section-lead { color: var(--text-2); max-width: 58ch; }

/* ---------------------------------------------------------------------
   Hero
--------------------------------------------------------------------- */
.hero { position: relative; isolation: isolate; padding-block: clamp(2.5rem, 1rem + 4vw, 4.5rem) clamp(2.5rem, 1.5rem + 3vw, 4rem); }
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 78% 30%, rgba(86, 198, 207, 0.10), transparent 70%),
    radial-gradient(circle, rgba(236, 249, 250, 0.075) 1px, transparent 1.4px) 0 0 / 28px 28px;
  -webkit-mask-image: radial-gradient(70% 80% at 70% 40%, #000 30%, transparent 85%);
  mask-image: radial-gradient(70% 80% at 70% 40%, #000 30%, transparent 85%);
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem); align-items: center;
  min-height: min(38rem, calc(100svh - var(--header-h) - 6rem));
}
.hero-copy { display: grid; gap: var(--s5); justify-items: start; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-size: var(--fs-small); font-weight: 600; color: var(--accent); letter-spacing: 0.04em;
}
.eyebrow::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.hero-title { font-size: var(--fs-hero); font-weight: 800; line-height: 1.04; letter-spacing: -0.035em; }
.hero-title .accent { display: block; color: var(--text-2); font-weight: 700; }
.hero-headline { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); font-weight: 600; line-height: 1.35; color: var(--text); max-width: 26ch; }
.hero-intro { color: var(--text-2); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); padding-top: var(--s4); border-top: 1px solid var(--line); width: min(100%, 36rem); }
.social-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.social-row a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  transition: border-color var(--t-hover), background-color var(--t-hover);
}
.social-row a:hover { border-color: var(--accent); background: var(--surface-2); }
.social-row img { width: 20px; height: 20px; object-fit: contain; }

.hero-visual { display: grid; justify-items: center; }

.scroll-cue {
  position: absolute; left: 50%; bottom: var(--s4); transform: translateX(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; text-decoration: none;
}
.scroll-cue span { width: 22px; height: 34px; border: 1.5px solid var(--line-strong); border-radius: 12px; position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .scroll-cue span::after { animation: cue 2.2s ease-in-out infinite; } }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(9px); opacity: 0.2; } }
@media (max-height: 44rem), (max-width: 47.99rem) { .scroll-cue { display: none; } }

/* Profile photo */
.photo {
  position: relative; width: min(18rem, 100%); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, rgba(86, 198, 207, 0.3), rgba(24, 33, 36, 0.92) 70%);
  border: 1px solid var(--accent-line);
}
.photo-initials { font-weight: 800; font-size: clamp(3rem, 7vw, 4.25rem); color: var(--accent); letter-spacing: 0.02em; }
.photo-note { margin-top: var(--s2); font-size: var(--fs-meta); color: var(--muted); }
/* Cutout photo layers: grid, halo ring, glass arch, floating portrait, horizon line */
.photo.has-img {
  --px: 0px; --py: 0px;
  width: min(26rem, 100%); aspect-ratio: 1;
  border-radius: 0; overflow: visible; background: none; border: 0;
  display: block; isolation: isolate;
}
.photo-grid, .photo-ring, .photo-arch, .photo-line { position: absolute; pointer-events: none; }
.photo-grid {
  z-index: -3; inset: -6% -10%;
  background:
    linear-gradient(rgba(86, 198, 207, 0.09) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(86, 198, 207, 0.09) 1px, transparent 1px) 0 0 / 20% 100%;
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent);
  mask-image: radial-gradient(closest-side, #000 40%, transparent);
}
.photo-ring {
  z-index: -2; inset: 3% 5% 5%; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(86, 198, 207, 0.26), rgba(22, 44, 48, 0.88) 58%, rgba(16, 21, 23, 0.96) 78%);
  border: 1px solid rgba(121, 220, 227, 0.26);
  box-shadow: 0 0 0 12px rgba(86, 198, 207, 0.035), 0 0 70px -14px rgba(86, 198, 207, 0.42);
  transform: translate(calc(var(--px) * -0.4), calc(var(--py) * -0.4));
}
.photo-arch {
  z-index: -1; left: 21%; right: 21%; top: 19%; bottom: 5%;
  border-radius: 999px 999px 16px 16px;
  background: linear-gradient(180deg, rgba(121, 220, 227, 0.12), rgba(121, 220, 227, 0.03) 70%, transparent);
  border: 1px solid rgba(121, 220, 227, 0.16); border-bottom: 0;
  transform: translate(calc(var(--px) * -0.2), calc(var(--py) * -0.2));
}
.photo-line {
  left: 0; right: 0; bottom: 5%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(86, 198, 207, 0.55) 15%, var(--accent-hover) 50%, rgba(86, 198, 207, 0.55) 85%, transparent);
  box-shadow: 0 0 16px 1px rgba(86, 198, 207, 0.45);
}
.photo.has-img img {
  position: relative; display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 74%, transparent 95%);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
  translate: var(--px) var(--py);
  transition: translate 0.25s ease-out;
}
@media (prefers-reduced-motion: no-preference) {
  .photo.has-img img { animation: photo-float 5s ease-in-out infinite; }
  .photo-line { animation: photo-glow 5s ease-in-out infinite; }
}
@keyframes photo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes photo-glow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .photo.has-img img, .photo-ring, .photo-arch { translate: none; transform: none; } }

/* Hero entrance animation on first load */
@media (prefers-reduced-motion: no-preference) {
  .hero-step { animation: hero-in 0.7s var(--ease) both; }
  .hero-step:nth-child(2) { animation-delay: 80ms; }
  .hero-step:nth-child(3) { animation-delay: 160ms; }
  .hero-step:nth-child(4) { animation-delay: 240ms; }
  .hero-step:nth-child(5) { animation-delay: 320ms; }
  .hero-step:nth-child(6) { animation-delay: 400ms; }
  .hero-visual .photo { animation: hero-in 0.9s var(--ease) 0.2s both; }
}
@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } }

@media (max-width: 55rem) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero-visual { order: -1; }
  .photo.has-img { width: min(19rem, 78%); }
}

/* ---------------------------------------------------------------------
   About & core competencies
--------------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.about-main .label { margin-bottom: var(--s4); }
.about-text { color: var(--text-2); font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); max-width: 62ch; }
.about-text p + p { margin-top: var(--s4); }
.about-side { display: grid; gap: var(--s5); }
.panel { padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.panel > .label { display: block; margin-bottom: var(--s4); }
.panel .label-row { margin-bottom: var(--s3); }
.panel .label-row .label { margin: 0; }

.entry-title { font-weight: 700; font-size: 1rem; line-height: 1.4; color: var(--text); }
.edu-list { display: grid; gap: var(--s4); }
.edu { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); }
.edu-mark { width: 2.5rem; height: 2.5rem; border-radius: var(--r-md); border: 1px solid var(--accent-line); background: var(--accent-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356c6cf' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M2 9l10-5 10 5-10 5z'/%3E%3Cpath d='M6 11v5c3 2.5 9 2.5 12 0v-5'/%3E%3C/svg%3E") center / 1.3rem no-repeat; }
.edu .muted { font-size: 0.95rem; }
.gpa { display: inline-block; margin-top: var(--s2); padding: 0.15rem 0.7rem; border: 1px solid var(--accent-line); border-radius: var(--r-sm); background: var(--accent-tint); font-weight: 700; }

.highlight-list { display: grid; }
.highlight-list li { display: grid; gap: 0.15rem; padding-block: var(--s3); border-top: 1px solid var(--line); }
.highlight-list li:first-child { border-top: 0; padding-top: 0; }
.highlight-list .entry-title { font-size: 0.95rem; }

/* Grouped technical skills */
.skills { margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); padding-top: var(--s6); border-top: 1px solid var(--line); }
.skills > .label-row .label { font-size: var(--fs-card); color: var(--text); letter-spacing: -0.01em; }
.skill-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: var(--s5) var(--s6); }
.skill-group-title { font-size: var(--fs-meta); font-weight: 700; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--s3); }
.tech-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tech-item {
  position: relative; display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0.3rem 0.8rem 0.3rem 0.35rem;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  text-align: left;
}
.tech-icon { display: grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 7px; background: var(--tile); }
.tech-icon img { width: 70%; height: 70%; object-fit: contain; }
.monogram { font-weight: 800; font-size: 0.68rem; color: #12343a; }
.tech-name { font-size: 0.88rem; font-weight: 500; color: var(--text-2); }
@media (max-width: 55rem) { .about-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------------
   Selected projects: editorial case studies, alternating media sides
--------------------------------------------------------------------- */
.feature-list { display: grid; gap: clamp(2.5rem, 2rem + 2.5vw, 4rem); }
.feature {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  grid-template-areas: "media body";
  gap: clamp(1.75rem, 1rem + 3vw, 4rem); align-items: center;
}
/* DOM order is always media then body; visual order flips on even rows on desktop. */
.feature:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); grid-template-areas: "body media"; }
.feature-media { grid-area: media; align-self: center; min-width: 0; }
.feature-body { grid-area: body; display: grid; gap: var(--s3); align-content: start; min-width: 0; }
.feature-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--fs-small); color: var(--text-2); font-weight: 500; }
.feature-num { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; padding-right: var(--s3); border-right: 1px solid var(--line-strong); }
.feature-title { font-size: var(--fs-card); font-weight: 700; line-height: 1.35; }
.feature-desc { color: var(--text-2); font-size: 0.95rem; max-width: 72ch; }
.meta-list { display: grid; border-top: 1px solid var(--line); }
.meta-list > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.meta-list dt { color: var(--muted); font-weight: 600; font-size: var(--fs-small); padding-top: 0.1rem; }
.meta-list dd { font-size: 0.95rem; color: var(--text); }
.feature-results { display: grid; gap: var(--s2); padding: var(--s4); border-radius: var(--r-md); background: var(--surface); border-left: 2px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); }
.feature .actions { margin-top: var(--s2); }
/* More Projects: demo button on top row, repository link bottom-left, Method notes bottom-right. */
.more-foot .actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s2) var(--s4); }
.more-foot .actions > .btn-ghost { grid-column: 1 / -1; justify-self: start; }
.more-foot .actions > .text-link { grid-column: 1; justify-self: start; }
.actions-end { grid-column: 2; }

@media (max-width: 55rem) {
  .feature, .feature:nth-child(even) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "body"; }
}
@media (max-width: 26rem) { .meta-list > div { grid-template-columns: minmax(0, 1fr); gap: var(--s1); } }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips li {
  padding: 0.12rem 0.6rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: 0.82rem; font-weight: 500; color: var(--text-2);
  transition: border-color var(--t-hover), color var(--t-hover), background-color var(--t-hover);
}

/* Media: full-ratio main image + thumbnails / tiles */
.media { display: grid; gap: var(--s3); }
.media-main {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10;
  padding: clamp(0.5rem, 1.5vw, 0.9rem); border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(86, 198, 207, 0.08), transparent 60%),
    var(--surface);
  overflow: hidden; cursor: zoom-in;
  transition: border-color var(--t-hover);
}
.media-main img {
  width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-md);
  transition: transform 0.5s var(--ease);
}
.media-main:hover { border-color: var(--accent-line); }
.media-main:hover img { transform: scale(1.025); }
.media-main:focus-visible { outline-offset: -3px; }
.media-zoom {
  position: absolute; right: var(--s3); top: var(--s3);
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: var(--r-md);
  background: rgba(16, 21, 23, 0.78); border: 1px solid var(--line-strong);
  opacity: 0.8; transition: opacity var(--t-hover);
}
.media-zoom svg { width: 1rem; height: 1rem; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.media-main:hover .media-zoom, .media-main:focus-visible .media-zoom { opacity: 1; }
.media-thumbs { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; }
.media-thumb { flex: none; width: 5.5rem; aspect-ratio: 16 / 10; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); cursor: pointer; opacity: 0.65; transition: opacity var(--t-hover), border-color var(--t-hover); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb:hover, .media-thumb[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }
/* Featured projects: main image on top, secondary screenshots tiled below. */
.media-tiled { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.media-tiled .media-main { grid-column: 1 / -1; }
.media-tiled .media-tile:only-of-type, .media-tiled .media-tile:nth-child(2):last-child { grid-column: 1 / -1; }
.media-tile {
  aspect-ratio: 16 / 10; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  transition: border-color var(--t-hover);
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.4s var(--ease); }
.media-tile:hover { border-color: var(--accent-line); }
.media-tile:hover img { transform: scale(1.03); }
.media-empty { aspect-ratio: 16 / 10; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.media-placeholder {
  display: grid; place-items: center; height: 100%; color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(236, 249, 250, 0.025) 14px 15px);
}
@media (prefers-reduced-motion: reduce) {
  .media-main img, .media-tile img { transition: none; }
  .media-main:hover img, .media-tile:hover img { transform: none; }
}

.result-list { display: grid; gap: var(--s2); color: var(--text-2); font-size: 0.95rem; }
.result-list li { position: relative; padding-left: 1.25rem; }
.result-list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); transform: rotate(45deg); }

/* ---------------------------------------------------------------------
   More projects: 3 / 2 / 1 column card gallery
--------------------------------------------------------------------- */
.more-filters { margin-bottom: var(--s5); }
.more-filters[hidden] { display: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: var(--s2); }
.seg button {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  transition: border-color var(--t-hover), background-color var(--t-hover);
}
.seg button:hover { border-color: var(--accent); }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.seg-count { font-size: 0.78rem; opacity: 0.8; font-variant-numeric: tabular-nums; }

.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
@media (max-width: 63.99rem) { .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .more-grid { grid-template-columns: minmax(0, 1fr); } }
.more-card {
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  transition: border-color var(--t-hover), transform 0.25s var(--ease), box-shadow 0.25s;
}
.more-card:hover, .more-card:focus-within { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.9); }
.more-card[hidden] { display: none; }
.more-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); overflow: hidden; cursor: zoom-in; }
.more-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 0.5s var(--ease); }
.more-card:hover .more-thumb img { transform: scale(1.04); }
.more-thumb-empty { display: grid; place-items: center; cursor: default; font-size: 1.6rem; font-weight: 800; color: var(--accent); text-transform: uppercase;
  background: radial-gradient(circle, rgba(236, 249, 250, 0.06) 1px, transparent 1.4px) 0 0 / 18px 18px, var(--surface-2); }
.more-body { padding: var(--s5); display: grid; gap: var(--s3); align-content: start; }
.more-body h3 { font-size: var(--fs-card); font-weight: 700; }
.more-desc, .more-method { color: var(--text-2); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more-method strong { color: var(--text); font-weight: 600; }
.more-foot { padding: var(--s2) var(--s5) var(--s4); border-top: 1px solid var(--line); }
.more-empty {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s5) var(--s6);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  color: var(--text-2);
}
.more-empty-mark { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px dashed var(--accent-line); display: grid; place-items: center; }
.more-empty-mark::before { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.3rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) { .more-card, .more-card:hover { transform: none; transition: none; } .more-thumb img { transition: none; } }

.is-filtered-in { animation: filter-in 0.35s var(--ease); }
@keyframes filter-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------------
   Research & publications: numbered list
--------------------------------------------------------------------- */
.pub-items { display: grid; border-top: 1px solid var(--line); }
.pub {
  display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: var(--s4) var(--s5);
  padding-block: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); border-bottom: 1px solid var(--line);
}
.pub-with-cover { grid-template-columns: 3.5rem minmax(0, 1fr) 8.5rem; }
.pub-num { font-size: var(--fs-card); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.3; }
.pub-main { display: grid; gap: var(--s2); min-width: 0; }
.pub-main h3 { font-size: var(--fs-card); font-weight: 700; line-height: 1.35; max-width: 62ch; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--fs-meta); }
.pub-meta .muted + .muted::before { content: "·"; margin-right: var(--s3); color: var(--muted); }
.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.6rem; border-radius: 999px; font-weight: 700; border: 1px solid currentColor; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.is-published { color: var(--accent); }
.status.is-progress { color: #e3c374; }
.authors { color: var(--muted); font-size: 0.92rem; }
.authors strong { color: var(--text); font-weight: 700; }
.venue { color: var(--text-2); font-size: 0.92rem; font-style: italic; }
.summary { color: var(--text-2); font-size: 0.95rem; max-width: 72ch; }
.pub-cover { align-self: start; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: zoom-in; overflow: hidden; }
.pub-cover img { width: 100%; height: auto; transition: transform 0.4s var(--ease); }
.pub-cover:hover img { transform: scale(1.03); }
@media (max-width: 40rem) {
  .pub, .pub-with-cover { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .pub-num { font-size: 1rem; }
  .pub-cover { width: 8rem; order: -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { .pub-cover img { transition: none; } .pub-cover:hover img { transform: none; } }

/* More Research: horizontal scrollable card row */
[data-slot="research"] .pub-items {
  grid-auto-flow: column; grid-auto-columns: min(22rem, 86vw); gap: var(--s4);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; cursor: grab;
  border-top: 0; padding-bottom: var(--s3);
}
[data-slot="research"] .pub {
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: var(--s2);
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
[data-slot="research"] .pub-items.is-dragging { cursor: grabbing; user-select: none; }
[data-slot="research"] .pub-num { font-size: 0.9rem; line-height: 1.2; }
[data-slot="research"] .pub-main { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
[data-slot="research"] .pub-main h3 {
  font-size: 1rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
[data-slot="research"] .authors {
  font-size: 0.85rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
[data-slot="research"] .summary {
  font-size: 0.88rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
[data-slot="research"] .chips { margin-top: var(--s1); }
[data-slot="research"] .actions { margin-top: auto; padding-top: var(--s2); gap: var(--s2) var(--s3); }
[data-slot="research"] .actions .btn-sm { padding-inline: 0.85rem; font-size: 0.85rem; }
[data-slot="research"] .actions .text-link { font-size: 0.85rem; }

/* ---------------------------------------------------------------------
   Achievements (timeline) & certificates (3D carousel)
--------------------------------------------------------------------- */
.achieve-wrap { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.achieve-col > .label, .cert-col > .label { display: block; margin-bottom: var(--s5); }
.timeline { position: relative; display: grid; gap: var(--s5); padding-left: var(--s6); }
.timeline::before { content: ""; position: absolute; left: 0.4rem; top: 0.5rem; bottom: 0.5rem; width: 1px; background: linear-gradient(var(--accent-line), var(--line)); }
.timeline-item { position: relative; display: grid; gap: 0.2rem; }
.timeline-item::before { content: ""; position: absolute; left: calc(-1 * var(--s6) + 0.12rem); top: 0.45rem; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline-year { font-size: var(--fs-meta); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.timeline-item .entry-title { font-size: 1.05rem; }
.timeline-item .muted { font-size: 0.92rem; }
.timeline-note { color: var(--text-2); font-size: 0.92rem; margin-top: var(--s1); }
.timeline-item .text-link { justify-self: start; }
button.text-link { padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; }
@media (max-width: 63.99rem) { .achieve-wrap { grid-template-columns: minmax(0, 1fr); } }

.cert-carousel { border-radius: var(--r-lg); }
.cert-carousel:focus-visible { outline-offset: 6px; }
.cert-stage {
  container-type: inline-size;
  display: grid; grid-template-columns: minmax(0, 1fr); perspective: 1400px;
  overflow: clip; padding-block: var(--s3) var(--s4); touch-action: pan-y; user-select: none;
}
.cert-card {
  grid-area: 1 / 1; justify-self: center; width: min(30rem, 82%);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden;
  transition: transform 0.55s var(--ease), opacity 0.4s ease, filter 0.4s ease;
}
.cert-card[data-pos="center"] { z-index: 2; border-color: var(--accent-line); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85); }
.cert-card[data-pos="left"] { transform: translateX(-56%) scale(0.82) rotateY(26deg); opacity: 0.42; filter: saturate(0.5); cursor: pointer; }
.cert-card[data-pos="right"] { transform: translateX(56%) scale(0.82) rotateY(-26deg); opacity: 0.42; filter: saturate(0.5); cursor: pointer; }
.cert-card[data-pos="hidden"] { transform: scale(0.7); opacity: 0; visibility: hidden; }
/* Side cards act as visual cues only; hide their text visually and from screen readers. */
.cert-card[data-pos="left"] .cert-info, .cert-card[data-pos="right"] .cert-info { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .cert-card { transition: none; } }
.cert-media { display: block; width: 100%; aspect-ratio: 1.414 / 1; padding: var(--s2); border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; }
.cert-media img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.cert-placeholder {
  display: grid; place-content: center; justify-items: center; gap: var(--s3); cursor: default;
  color: var(--text-2); font-size: 0.9rem; font-weight: 500;
  background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(236, 249, 250, 0.025) 14px 15px), var(--surface-2);
}
.cert-seal { width: 3.25rem; height: 3.25rem; border: 1px dashed var(--accent-line); border-radius: 50%; }
.cert-info { padding: var(--s4) var(--s5) var(--s5); display: grid; gap: var(--s2); }
.cert-info h4 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
/* Arrows centered vertically on the active certificate image (height = card width / 1.414). */
.cert-arrow {
  --card: min(30rem, 82%);
  grid-area: 1 / 1; z-index: 3; align-self: start; justify-self: center;
  margin-top: calc(var(--card) / 1.414 / 2 - 22px);
  border-radius: 50%; background: rgba(24, 33, 36, 0.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cert-prev { transform: translateX(calc(-1 * (min(15rem, 41cqw) + 34px))); }
.cert-next { transform: translateX(calc(min(15rem, 41cqw) + 34px)); }
.cert-controls { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin-top: var(--s2); }
.cert-count { min-width: 5rem; text-align: center; font-size: var(--fs-small); color: var(--text-2); font-variant-numeric: tabular-nums; }
.cert-dots { display: flex; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.dot { width: 32px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--accent); transition: background-color 0.2s, width 0.25s var(--ease); }
.dot[aria-current="true"]::before { background: var(--accent); width: 20px; border-radius: 4px; }
@media (max-width: 34rem) {
  .cert-arrow { --card: 88%; }
  .cert-prev { transform: translateX(calc(-44cqw + 12px)); }
  .cert-next { transform: translateX(calc(44cqw - 12px)); }
  .cert-card { width: 88%; }
  .cert-card[data-pos="left"], .cert-card[data-pos="right"] { opacity: 0; visibility: hidden; }
  .dot { width: 28px; }
}

/* ---------------------------------------------------------------------
   Contact & footer
--------------------------------------------------------------------- */
.contact-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; justify-items: center; gap: var(--s4); text-align: center;
  padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(1.25rem, 4vw, 4rem);
  border: 1px solid var(--line); border-radius: calc(var(--r-lg) + 8px);
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 70%);
}
.contact-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(40rem 18rem at 50% 0%, rgba(86, 198, 207, 0.14), transparent 70%);
}
.contact-title { font-size: var(--fs-section); font-weight: 800; max-width: 20ch; }
.contact-card [data-slot="contact"] { display: grid; justify-items: center; gap: var(--s5); width: 100%; }
.contact-lead { color: var(--text-2); max-width: 52ch; }
.contact-email { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); }
.contact-address { flex-basis: 100%; font-size: var(--fs-small); color: var(--muted); overflow-wrap: anywhere; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); width: min(100%, 40rem); }
.contact-link {
  display: inline-flex; align-items: center; gap: var(--s3); min-height: 52px; padding: var(--s2) var(--s4) var(--s2) var(--s3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(16, 21, 23, 0.5); text-decoration: none; text-align: left;
  transition: border-color var(--t-hover), background-color var(--t-hover);
}
.contact-link:hover { border-color: var(--accent); background: var(--accent-tint); }
.contact-link img { width: 24px; height: 24px; object-fit: contain; }
.contact-link > span { display: grid; line-height: 1.3; }
.contact-label { font-weight: 700; font-size: 0.92rem; }
.contact-detail { color: var(--muted); font-size: var(--fs-meta); }

.site-footer {
  margin-top: var(--section-gap); padding: var(--s6) 0;
  border-top: 1px solid var(--line); background: var(--bg-deep);
  color: var(--muted); font-size: var(--fs-small);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s5); }
.footer-inner .text-link { color: var(--text-2); }
.footer-licenses { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s4); color: var(--text-2); font-size: var(--fs-small); }

.to-top {
  position: fixed; right: clamp(1rem, 3vw, 1.75rem); bottom: clamp(1rem, 3vw, 1.75rem); z-index: 35;
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(24, 33, 36, 0.92);
  transition: border-color var(--t-hover), opacity 0.25s;
}
.to-top:hover { border-color: var(--accent); }
.to-top svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.to-top[hidden] { display: none; }

/* ---------------------------------------------------------------------
   Method notes dialog
--------------------------------------------------------------------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(6, 10, 11, 0.74); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  width: min(56rem, 100% - 2rem); max-height: min(90dvh, 60rem); padding: 0;
  border: 1px solid var(--line-strong); border-radius: calc(var(--r-lg) + 4px);
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overscroll-behavior: contain;
}
.sheet-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: start; gap: var(--s4);
  padding: var(--s5) clamp(1.25rem, 3vw, 2rem) var(--s4);
  background: rgba(24, 33, 36, 0.97); border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: clamp(1.4rem, 1rem + 1.6vw, 2rem); font-weight: 800; }
.sheet-kicker { color: var(--accent); font-size: var(--fs-small); font-weight: 600; margin-bottom: var(--s1); }
.sheet-body { padding: var(--s5) clamp(1.25rem, 3vw, 2rem) var(--s6); display: grid; gap: var(--s6); }
.sheet-body section { display: grid; gap: var(--s3); max-width: 68ch; }
.sheet-body h3 { font-size: var(--fs-small); font-weight: 700; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.sheet-body p { color: var(--text-2); }
.sheet-meta { max-width: 68ch; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise 0.26s var(--ease); }
  dialog[open]::backdrop { animation: fade 0.26s ease; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.99); } }
@keyframes fade { from { opacity: 0; } }

/* ---------------------------------------------------------------------
   Lightbox
--------------------------------------------------------------------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(9, 13, 14, 0.96); }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lightbox::backdrop { background: transparent; }
.lightbox-bar { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.lightbox-caption { flex: 1; min-width: 0; font-size: 0.92rem; color: var(--text-2); }
.lightbox-count { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.lightbox-stage { display: grid; place-items: center; overflow: auto; padding: var(--s4) clamp(var(--s4), 7vw, 5rem); }
.lightbox-stage img { max-width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; border-radius: var(--r-sm); cursor: zoom-in; }
.lightbox-stage.is-zoomed { place-items: start; }
.lightbox-stage.is-zoomed img { max-width: none; max-height: none; width: max(100%, 1800px); cursor: zoom-out; }
.lightbox-stage iframe { width: min(64rem, 100%); height: 100%; min-height: 60dvh; border: 0; border-radius: var(--r-sm); background: #fff; }
.lightbox-nav { position: fixed; top: 50%; transform: translateY(-50%); }
.lightbox-nav.prev { left: var(--s3); }
.lightbox-nav.next { right: var(--s3); }

/* ---------------------------------------------------------------------
   Toast
--------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: var(--s5); z-index: 90;
  max-width: calc(100% - 2rem); padding: var(--s3) var(--s5);
  border: 1px solid var(--accent); border-radius: var(--r-md); background: var(--surface-2);
  font-weight: 600;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
  overflow-wrap: anywhere;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; transform: translate(-50%, 0); } }

/* ---------------------------------------------------------------------
   Scroll reveal: active only after JS adds .reveal-ready (with
   IntersectionObserver and non-reduced motion) so content never stays hidden.
--------------------------------------------------------------------- */
.reveal-ready .reveal { opacity: 0; transform: translateY(18px); }
.reveal-ready .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.55s ease var(--stagger, 0ms), transform 0.6s var(--ease) var(--stagger, 0ms);
}
@media print { .reveal-ready .reveal { opacity: 1; transform: none; } }
