/* ==========================================================================
   Thowdan Al-Eryani — portfolio styles
   Apple design system: one accent (Action Blue), alternating full-bleed tiles,
   SF Pro typography with negative tracking, exactly ONE shadow in the whole
   system (under the hero photo), zero gradients, pill CTA grammar.
   Weight ladder: 300 / 400 / 600 / 700 — weight 500 is deliberately absent.
   Themed via [data-theme="light|dark"] on <html> (set before paint).
   ========================================================================== */

/* ==========================================================================
   Typeface — self-hosted Inter variable font
   Apple devices resolve -apple-system (true SF Pro) before this face is ever
   requested, so the ~344 KB download only happens on non-Apple devices. The
   site uses no italics, so only the upright face ships.
   ========================================================================== */

@font-face {
  font-family: 'InterVariable';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/InterVariable.woff2') format('woff2');
}

/* Display typeface — self-hosted Anton (SIL OFL 1.1), single static weight 400.
   Source: fonts.google.com/specimen/Anton via the google/fonts repo, latin subset.
   Scoped to specific heading classes only — never a bare h1/h2/h3 — so admin's
   unstyled headings are unaffected. */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Anton-Regular.woff2') format('woff2');
}

/* ==========================================================================
   Design tokens
   Dark is now the default, cinematic identity (bare :root + [data-theme='dark']
   share the same near-black palette); [data-theme='light'] keeps the original
   Apple light palette byte-for-byte as the toggle-reachable alternate — this
   also keeps /admin's default appearance unchanged (it shares this stylesheet).
   ========================================================================== */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --font-display: 'Anton', 'Arial Narrow', -apple-system, sans-serif;

  /* Surfaces */
  --canvas: #0b0b0d;
  --parchment: #131316;
  --pearl: #17171a;
  --nav-bg: #000000;
  --tile-dark-1: #131315;
  --tile-dark-2: #17171a;
  --tile-dark-3: #111113;
  --subnav-bg: rgba(11, 11, 13, 0.65);

  /* Ink */
  --ink: #f5f5f7;
  --ink-2: rgba(245, 245, 247, 0.72);
  --muted: #86868b;
  --muted-2: #86868b;

  /* The single interactive color */
  --action: #0071e3;
  --action-hover: #0077ed;
  --focus: #0071e3;
  --link: #2997ff;

  /* Hairlines — deliberately light against the near-black canvas */
  --hairline: rgba(255, 255, 255, 0.16);
  --divider-soft: rgba(255, 255, 255, 0.08);

  /* The one and only shadow in the system (hero photo) */
  --img-shadow: 3px 5px 30px rgba(0, 0, 0, 0.22);

  /* Admin semantics (utility surface only) */
  --ok: #30d158;
  --err: #ff453a;
  --warn: #ffd60a;
}

:root[data-theme='light'] {
  color-scheme: light;

  --font-display: 'Anton', 'Arial Narrow', -apple-system, sans-serif;

  /* Surfaces */
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --nav-bg: #000000;
  --tile-dark-1: #272729;
  --tile-dark-2: #2a2a2c;
  --tile-dark-3: #252527;
  --subnav-bg: rgba(245, 245, 247, 0.8);

  /* Ink */
  --ink: #1d1d1f;
  --ink-2: rgba(29, 29, 31, 0.72);
  --muted: #6e6e73;
  --muted-2: #7a7a7a;

  /* The single interactive color */
  --action: #0066cc;
  --action-hover: #0071e3;
  --focus: #0071e3;
  --link: #0066cc;

  /* Hairlines */
  --hairline: #e0e0e0;
  --divider-soft: #f0f0f0;

  /* The one and only shadow in the system (hero photo) */
  --img-shadow: 3px 5px 30px rgba(0, 0, 0, 0.22);

  /* Admin semantics (utility surface only) */
  --ok: #1d7f37;
  --err: #d70015;
  --warn: #9a6700;
}

/* ==========================================================================
   Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
  -webkit-text-size-adjust: 100%;
}

/* Safety net: nothing may create sideways scroll on phones. clip (not hidden)
   so no scroll container forms and the sticky sub-nav keeps working. */
html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text',
    'SF Pro Display', 'InterVariable', system-ui, 'Helvetica Neue', 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

::selection {
  background: rgba(0, 102, 204, 0.18);
}

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

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* Skip link — visually hidden until keyboard focus */
.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--action);
  color: #fff;
  border-radius: 9999px;
  font-size: 14px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

/* ==========================================================================
   Type atoms
   ========================================================================== */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Buttons — pill grammar. Press state everywhere: scale(0.95).
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.374px;
  line-height: 1.24;
  cursor: pointer;
  transition: background-color 0.25s ease, border-color 0.25s ease,
    color 0.25s ease, transform 0.18s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.95);
}

.btn-accent {
  background: var(--action);
  color: #fff;
}

.btn-accent:hover {
  background: var(--action-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}

.btn-ghost:hover {
  background: var(--divider-soft);
  border-color: var(--muted);
  color: var(--ink);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  letter-spacing: -0.224px;
}

/* Pearl capsule — quiet utility button (admin “View / Remove / + Add”) */
.btn-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--pearl);
  color: var(--ink-2);
  border: 1px solid var(--divider-soft);
  border-radius: 11px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.224px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.18s ease;
}

.btn-soft:hover {
  border-color: var(--hairline);
  color: var(--ink);
  text-decoration: none;
}

.btn-soft:active {
  transform: scale(0.95);
}

.btn-danger,
.btn-danger:hover {
  color: var(--err);
}

/* Theme toggle — circular ghost control */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.25s ease;
  opacity: 0.8;
}

.theme-toggle:hover {
  opacity: 1;
}

.theme-toggle:active {
  transform: scale(0.95);
}

:root[data-theme='light'] .icon-sun {
  display: none;
}

:root[data-theme='dark'] .icon-moon {
  display: none;
}

/* Chips — configurator-chip grammar */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--ink-2);
  transition: border-color 0.25s ease, color 0.25s ease;
}

.chip:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.text-link {
  color: var(--link);
  font-size: 17px;
  letter-spacing: -0.374px;
}

/* ==========================================================================
   Tile system — full-bleed alternating canvases. The color change IS the
   divider: no borders, no shadows between tiles.
   ========================================================================== */

.tile {
  padding: 80px 0;
}

.tile--canvas {
  background: var(--canvas);
}

.tile--parchment {
  background: var(--parchment);
}

.tile--pearl {
  background: var(--pearl);
}

.tile--dark-1,
.tile--dark-2,
.tile--dark-3 {
  color: #f5f5f7;
  --ink: #ffffff;
  --ink-2: #cccccc;
  --muted: #a1a1a6;
  --muted-2: #a1a1a6;
  --link: #2997ff;
  --hairline: rgba(255, 255, 255, 0.22);
  --divider-soft: rgba(255, 255, 255, 0.1);
  --pearl: rgba(255, 255, 255, 0.06);
}

.tile--dark-1 {
  background: var(--tile-dark-1);
}

.tile--dark-2 {
  background: var(--tile-dark-2);
}

.tile--dark-3 {
  background: var(--tile-dark-3);
}

.tile-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.tile-inner--wide {
  max-width: 1440px;
}

/* ==========================================================================
   Global nav — 44px, pure black in BOTH themes.
   ========================================================================== */

.gnav {
  background: var(--nav-bg);
  color: #fff;
  height: 44px;
}

.gnav-inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.gnav-brand {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.224px;
}

.gnav-brand:hover {
  text-decoration: none;
}

.gnav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.gnav-link {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.12px;
  transition: color 0.25s ease;
}

.gnav-link:hover {
  color: #fff;
  text-decoration: none;
}

/* ==========================================================================
   Sub-nav — 52px frosted ribbon, sticky. Name left, blue pill right.
   ========================================================================== */

.subnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  background: var(--subnav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.subnav--raised {
  border-bottom-color: var(--hairline);
}

.subnav-inner {
  max-width: 1024px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.subnav-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.231px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subnav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.subnav-link {
  color: var(--ink-2);
  font-size: 14px;
  letter-spacing: -0.224px;
  transition: color 0.25s ease;
  /* 44px hit target inside the 52px bar, no layout shift */
  padding: 14px 8px;
  margin: -14px -8px;
}

.subnav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

/* Mobile menu trigger — lives in the sticky sub-nav (the gnav scrolls away),
   hidden until the nav links collapse at 834px. */
.subnav-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.subnav-menu:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Cine-nav — the homepage's single glassy, sticky nav (logo, evenly spaced
   links, CTA pill). 403/404/500 keep the plain .gnav above; admin keeps its
   own .admin-topbar — this block is homepage-only. Reuses .subnav-menu for
   the hamburger and .mobile-menu for the panel so js/theme.js needs no
   changes for the mobile menu.
   ========================================================================== */

.cine-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 64px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.cine-nav.scrolled {
  background: var(--subnav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--hairline);
}

.cine-nav-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-transform: lowercase;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.nav-link {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  transition: color 0.25s ease;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.cine-nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

/* ==========================================================================
   Mobile menu — full-screen frosted overlay (Apple LocalNav pattern).
   Reuses --subnav-bg so both themes come free. Links reveal with the
   signature stagger; reduced-motion collapses every transition to instant.
   ========================================================================== */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--subnav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

.mobile-menu-close {
  position: absolute;
  top: 8px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  font-size: 21px;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.mobile-menu-close:active {
  transform: scale(0.95);
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 96px 32px;
}

.mobile-menu-links a {
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.28px;
  line-height: 1.14;
  padding: 12px 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-menu-links a:hover {
  text-decoration: none;
  color: var(--link);
}

.mobile-menu.is-open .mobile-menu-links a {
  opacity: 1;
  transform: none;
  transition-delay: calc(60ms + var(--i, 0) * 40ms);
}

/* Self-contained pill so it doesn't inherit .mobile-menu-links a's type scale */
.mobile-menu-links .mobile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 12px;
  padding: 12px 24px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.224px;
  line-height: 1.2;
}

.mobile-menu-links .mobile-cta:hover {
  background: var(--divider-soft);
  text-decoration: none;
}

/* Scroll lock while the menu is open */
html.menu-open,
html.menu-open body {
  overflow: hidden;
}

/* ==========================================================================
   Reveal system — fade + rise on scroll. Gated on <html>.reveal-on so no-JS
   never hides content; theme.js adds .is-visible per element. Stagger comes
   from a server-emitted --reveal-delay.
   ========================================================================== */

html.reveal-on .reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
}

html.reveal-on .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.8s cubic-bezier(0.28, 0.11, 0.32, 1) var(--reveal-delay, 0ms),
    transform 0.8s cubic-bezier(0.28, 0.11, 0.32, 1) var(--reveal-delay, 0ms);
}

/* ==========================================================================
   Hero — full-bleed pinned canvas scroll-scrub sequence. Pin/scrub/frame
   drawing is owned by js/hero-scroll.js; this only lays out the fixed
   content and the vignette that hides the frames' studio background.
   Colors here are deliberately hardcoded, not theme tokens — the hero is
   always dark regardless of the light/dark toggle.
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: #0b0b0d;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* No flat wash over the center — the subject stays at full brightness/quality.
     A generous transparent hold around the face, then a much stronger falloff
     to the edges, plus a top/bottom fade so the vignette reads consistently
     whether the canvas is wide (desktop) or tall (mobile). */
  background: radial-gradient(58% 62% at 50% 38%, transparent 0%, transparent 34%, rgba(11, 11, 13, 0.94) 100%),
    linear-gradient(to bottom, rgba(11, 11, 13, 0.34) 0%, transparent 16%, transparent 58%, #0b0b0d 100%);
}

.hero-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0d;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: opacity 0.4s ease;
}

.hero-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px 64px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
}

.hero-left {
  flex: 0 0 auto;
}

.hero-eyebrow {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .hero-eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.hero-name {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 9vw, 160px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #fff;
}

.line-mask {
  display: block;
  overflow: hidden;
}

.line-mask .line {
  display: block;
  white-space: nowrap;
}

.hero-title .line-mask:first-of-type .line {
  color: rgba(255, 255, 255, 0.5);
}

.hero-right {
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.hero .btn-accent {
  background: #fff;
  color: #0b0b0d;
}

.hero .btn-accent:hover {
  background: #e2e2e2;
}

.hero .btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.hero-scroll-hint {
  position: absolute;
  left: 40px;
  bottom: 40px;
  z-index: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  transition: opacity 0.3s ease;
}

.hero-progress {
  position: absolute;
  top: 100px;
  bottom: 140px;
  right: 20px;
  z-index: 1;
  width: 2px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 2px;
}

.hero-progress-fill {
  position: absolute;
  inset: 0;
  transform: scaleY(0);
  transform-origin: top;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 767px) {
  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0 24px 28px;
    gap: 24px;
  }

  .hero-left {
    max-width: 100%;
  }

  .hero-title {
    font-size: 11vw;
  }

  .hero-right {
    align-items: flex-start;
    text-align: left;
    max-width: 100%;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .hero-scroll-hint {
    left: 24px;
    bottom: 20px;
  }

  .hero-progress {
    display: none;
  }
}

/* ==========================================================================
   Stats — parchment strip, big quiet numerals. Ink, not blue: blue is for
   interaction only.
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}

.stat-value {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 8px;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

/* ==========================================================================
   Section heads
   ========================================================================== */

.section-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.section-lead {
  margin: 14px 0 0;
  font-size: 21px;
  line-height: 1.38;
  letter-spacing: 0.011em;
  color: var(--muted);
  max-width: 640px;
}

.section-head--center {
  text-align: center;
}

.section-head--center .section-lead {
  margin-inline: auto;
}

/* Headline-only beat between stats and the project tiles */
.work-intro {
  padding: 80px 0 72px;
}

/* ==========================================================================
   Project tiles — each project is its own full-bleed product tile,
   alternating near-black and parchment. Centered Apple-product stack.
   ========================================================================== */

.project-tile {
  text-align: center;
}

.project-stack {
  max-width: 860px;
  margin: 0 auto;
  will-change: transform;
}

.project-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.project-name {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.project-desc {
  margin: 0 auto 22px;
  max-width: 720px;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.42;
  letter-spacing: 0.011em;
  color: var(--ink-2);
}

.project-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  font-size: 17px;
  letter-spacing: -0.374px;
  color: var(--link);
}

.project-note i {
  font-size: 13px;
}

.project-chips {
  justify-content: center;
  margin-bottom: 30px;
}

.project-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  letter-spacing: -0.374px;
  color: var(--link);
  /* 44px hit target, no layout shift */
  padding: 12px 0;
  margin: -12px 0;
}

.project-link i {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.project-link:hover i {
  transform: translate(2px, -2px);
}

.project-meta {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

/* ==========================================================================
   Skills — store utility cards: hairline, 18px radius, flat. Hover darkens
   the hairline only; no lift, no shadow.
   ========================================================================== */

.skills-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.ucard {
  background: var(--pearl);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 24px;
  transition: border-color 0.25s ease;
}

.ucard:hover {
  border-color: var(--muted);
}

.ucard .eyebrow {
  margin-bottom: 16px;
}

/* ==========================================================================
   Recruiter configurator — Apple buy-page grammar. Options are pill chips
   (selected = 2px focus-blue stroke, NO fill change); the evidence panels all
   stack in one grid cell and crossfade from a single class toggle. Tokens
   only, so both themes come free.
   ========================================================================== */

.cfg-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 40px 0 32px;
}

.cfg-chip {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: -0.224px;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.18s ease;
}

.cfg-chip:hover {
  border-color: var(--muted);
}

.cfg-chip:active {
  transform: scale(0.95);
}

/* Selected = 2px stroke; padding compensates so nothing shifts */
.cfg-chip.is-selected {
  border: 2px solid var(--focus);
  padding: 11px 15px;
  font-weight: 600;
}

/* Every panel shares one grid cell: the container holds the tallest panel's
   height so switching never reflows the page. visibility also drops inactive
   panels from the accessibility tree. */
.cfg-panels {
  display: grid;
  max-width: 860px;
  margin: 0 auto;
}

.cfg-panel {
  grid-area: 1 / 1;
  background: var(--pearl);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 36px 40px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.cfg-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.45s ease 0.08s, transform 0.45s ease 0.08s;
}

.cfg-statement {
  margin: 0 0 24px;
  font-size: 24px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink);
}

.cfg-proof {
  margin-bottom: 24px;
}

.cfg-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.cfg-stat {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--divider-soft);
}

.cfg-stat-value {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.2px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cfg-stat-label {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

/* ==========================================================================
   About — editorial beat. Paragraphs use the rare weight-300 “airy” voice.
   ========================================================================== */

.about-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.about-text {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--ink);
}

.about-text:last-child {
  margin-bottom: 0;
}

.about-side {
  display: grid;
  gap: 16px;
}

.side-capsule {
  background: var(--pearl);
  border: 1px solid var(--divider-soft);
  border-radius: 11px;
  padding: 22px 24px;
}

.side-capsule .eyebrow {
  margin-bottom: 12px;
}

.side-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.374px;
  color: var(--ink);
}

.side-detail {
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: -0.224px;
  line-height: 1.5;
  color: var(--muted);
}

.lang-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  font-size: 15px;
  letter-spacing: -0.224px;
}

.lang-row + .lang-row {
  border-top: 1px solid var(--divider-soft);
}

/* ==========================================================================
   Recognition — quiet 2-col utility cards
   ========================================================================== */

.recognition {
  margin-top: 72px;
}

.awards-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.award {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--pearl);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 22px 24px;
  transition: border-color 0.25s ease;
}

.award:hover {
  border-color: var(--muted);
}

.award-icon {
  flex: none;
  font-size: 20px;
  color: var(--action);
  line-height: 1.3;
}

.award-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.374px;
  color: var(--ink);
}

.award-sub {
  margin-top: 3px;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

/* ==========================================================================
   Contact — the dark finale tile
   ========================================================================== */

.contact-tile {
  text-align: center;
}

.contact-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.contact-sub {
  margin: 0 auto 34px;
  max-width: 560px;
  font-size: 21px;
  line-height: 1.38;
  letter-spacing: 0.011em;
  color: var(--ink-2);
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

.contact-links a,
.contact-links span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  transition: color 0.25s ease;
}

.contact-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

/* ==========================================================================
   Footer — parchment, deliberately dense. Link columns at 17px with the
   relaxed 2.41 leading; 12px legal row.
   ========================================================================== */

.site-footer {
  background: var(--parchment);
  padding: 56px 0 40px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.footer-head {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.224px;
  color: var(--ink);
  margin: 0 0 6px;
}

.footer-col a,
.footer-col span {
  display: block;
  font-size: 17px;
  font-weight: 400;
  line-height: 2.41;
  letter-spacing: 0;
  color: var(--ink-2);
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.footer-legal {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 12px;
  letter-spacing: -0.12px;
  color: var(--muted-2);
}

/* ==========================================================================
   Error pages — near-blank canvas, giant tight headline, one pill.
   ========================================================================== */

.error-main {
  min-height: calc(100vh - 44px - 80px);
  /* svh sidesteps the iOS dynamic-toolbar 100vh overshoot; vh above is the fallback */
  min-height: calc(100svh - 44px - 80px);
  display: grid;
  place-items: center;
  padding: 80px 24px;
  text-align: center;
}

.error-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.error-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.error-msg {
  margin: 0 auto 32px;
  max-width: 46ch;
  font-size: 17px;
  letter-spacing: -0.374px;
  color: var(--muted);
}

.error-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.error-footer {
  padding: 28px 24px;
  text-align: center;
  font-size: 12px;
  letter-spacing: -0.12px;
  color: var(--muted-2);
}

/* ==========================================================================
   Admin editor — utility surface on parchment. Pearl cards, hairlines,
   pill CTAs. All class names are the js/admin.js contract — do not rename.
   ========================================================================== */

.admin-body {
  background: var(--parchment);
}

.admin-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -24px 28px;
  padding: 18px 24px 14px;
  background: var(--subnav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}

.admin-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.231px;
}

.admin-sub {
  margin: 4px 0 0;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

.btn-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-card {
  background: var(--pearl);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
}

.admin-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.374px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% + 48px);
  margin: -24px;
  padding: 20px 24px;
  background: transparent;
  border: none;
  border-radius: 18px;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.card-chevron {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.3s ease;
}

.admin-card:not(.collapsed) .card-chevron {
  transform: rotate(180deg);
}

.admin-card-body {
  padding-top: 32px;
}

.admin-card.collapsed .admin-card-body {
  display: none;
}

.admin-login {
  max-width: 480px;
  margin: 48px auto 0;
}

.admin-login h2 {
  margin: 0 0 18px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.196px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.224px;
  margin-bottom: 7px;
}

.field small {
  display: block;
  font-size: 12px;
  letter-spacing: -0.12px;
  margin: -3px 0 8px;
}

.field input,
.field textarea,
input[type='email'],
input[type='password'],
input[type='text'],
textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: -0.374px;
  transition: border-color 0.25s ease;
}

.field textarea,
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.47;
}

.field input:focus,
.field textarea:focus,
input:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.repeat-item {
  background: var(--canvas);
  border: 1px solid var(--divider-soft);
  border-radius: 11px;
  padding: 18px;
  margin-bottom: 14px;
}

.repeat-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
  letter-spacing: -0.224px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.admin-nav-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  background: var(--pearl);
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--ink-2);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.18s ease;
}

.admin-nav-chip:hover {
  border-color: var(--muted);
  color: var(--ink);
  text-decoration: none;
}

.admin-nav-chip:active {
  transform: scale(0.95);
}

.admin-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px -24px 0;
  padding: 14px 24px;
  background: var(--subnav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--hairline);
}

.admin-status {
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--muted);
}

.admin-status.ok {
  color: var(--ok);
}

.admin-status.err {
  color: var(--err);
}

.admin-status.warn {
  color: var(--warn);
}

.notice {
  background: var(--pearl);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  letter-spacing: -0.224px;
  color: var(--ink-2);
}

.notice.warn {
  border-color: var(--warn);
  color: var(--ink);
}

.resume-current {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.resume-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.224px;
}

.resume-upload {
  margin-bottom: 10px;
}

.resume-upload input[type='file'] {
  display: none;
}

/* ==========================================================================
   Responsive — structural breakpoints: 1440 / 1068 / 834 / 734 / 640 / 480 / 419
   ========================================================================== */

@media (max-width: 1068px) {
  .stat-value {
    font-size: 34px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-text {
    font-size: 21px;
  }
}

@media (max-width: 834px) {
  .gnav-links .gnav-link {
    display: none;
  }

  .subnav-menu {
    display: inline-flex;
  }

  .nav-links,
  .nav-cta {
    display: none;
  }

  .tile {
    padding: 64px 0;
  }

  .work-intro {
    padding: 64px 0 56px;
  }

  .section-title,
  .project-name,
  .contact-title,
  .error-title {
    font-size: 34px;
  }

  .about-cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .awards-grid {
    grid-template-columns: 1fr;
  }

  .footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 734px) {
  .subnav-links .subnav-link {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .tile {
    padding: 48px 0;
  }

  .work-intro {
    padding: 48px 0 40px;
  }

  .section-title,
  .project-name,
  .contact-title,
  .error-title {
    font-size: 32px;
  }

  .project-desc,
  .section-lead,
  .contact-sub {
    font-size: 19px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .about-text {
    font-size: 19px;
  }

  /* Configurator options stack full-width, like Apple's phone buy page */
  .cfg-chips {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cfg-chip {
    justify-content: center;
  }

  .cfg-panel {
    padding: 24px 20px;
  }

  .cfg-statement {
    font-size: 19px;
  }

  .cfg-stat-value {
    font-size: 34px;
  }

  /* Stats become a dense Apple spec-table instead of a three-screen stack */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0;
    text-align: left;
  }

  .stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
  }

  .stat + .stat {
    border-top: 1px solid var(--hairline);
  }

  .stat-value {
    font-size: 28px;
  }

  .stat-label {
    margin-top: 0;
    text-align: right;
  }

  .recognition {
    margin-top: 48px;
  }

  .award,
  .side-capsule {
    padding: 18px 20px;
  }

  .ucard {
    padding: 20px;
  }

  .site-footer {
    padding: 40px 0 32px;
  }

  .footer-legal {
    margin-top: 28px;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .subnav-name {
    font-size: 17px;
  }

  .contact-actions .btn {
    width: 100%;
  }

  .contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-topbar {
    flex-direction: column;
  }
}

@media (max-width: 419px) {
  .section-title,
  .project-name,
  .contact-title,
  .error-title {
    font-size: 28px;
  }

  .tile-inner {
    padding: 0 20px;
  }

  .stat-value {
    font-size: 26px;
  }

  .cfg-statement {
    font-size: 17px;
  }
}

/* ==========================================================================
   Reduced motion — kill every animation and reveal transform; content is
   always visible and static.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html.reveal-on .reveal {
    opacity: 1;
    transform: none;
  }
}
