/* ---------- Tokens ---------- */
:root,
.on-dark {
  --bg: #09090a;
  --surface: #111113;
  --surface-2: #17171a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --fg: #f2f0ec;
  --fg-muted: #a3a19c;
  --fg-subtle: #85837e;
  --fg-dim: #6f6d69;
  --accent: #ff7a45;
  --accent-text: #ff7a45;
  --accent-2: #ffb36b;
  --accent-soft: rgba(255, 122, 69, 0.14);
  --nav-bg: rgba(20, 20, 22, 0.62);
  --btn-bg: #f2f0ec;
  --btn-fg: #09090a;
  --glow-a: rgba(255, 122, 69, 0.16);
  --glow-b: rgba(120, 90, 255, 0.10);
  --media-glow: 0.22;
  --shadow-card: none;
  --shadow-lg: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
/* Blocks that stay dark in both themes (terminal, contact card) */
.on-dark { color: var(--fg); }

/* Light theme: crisp near-white ground, vivid orange, and a deeper orange for small text */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f5f3;
    --surface: #ffffff;
    --surface-2: #efedea;
    --border: rgba(20, 18, 15, 0.1);
    --border-strong: rgba(20, 18, 15, 0.18);
    --fg: #121110;
    --fg-muted: #4f4c47;
    --fg-subtle: #69655f;
    --fg-dim: #948e85;
    --accent: #2f5bff;
    --accent-text: #2441d6;
    --accent-2: #7b61ff;
    --accent-soft: rgba(47, 91, 255, 0.11);
    --nav-bg: rgba(255, 255, 255, 0.78);
    --btn-bg: #121110;
    --btn-fg: #ffffff;
    --glow-a: rgba(47, 91, 255, 0.16);
    --glow-b: rgba(255, 150, 110, 0.22);
    --media-glow: 0.3;
    --shadow-card: 0 1px 2px rgba(15, 20, 40, 0.05), 0 14px 34px -18px rgba(30, 45, 110, 0.22);
    --shadow-lg: 0 30px 60px -28px rgba(30, 45, 110, 0.3);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f5f3;
  --surface: #ffffff;
  --surface-2: #efedea;
  --border: rgba(20, 18, 15, 0.1);
  --border-strong: rgba(20, 18, 15, 0.18);
  --fg: #121110;
  --fg-muted: #4f4c47;
  --fg-subtle: #69655f;
  --fg-dim: #948e85;
  --accent: #2f5bff;
  --accent-text: #2441d6;
  --accent-2: #7b61ff;
  --accent-soft: rgba(47, 91, 255, 0.11);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --btn-bg: #121110;
  --btn-fg: #ffffff;
  --glow-a: rgba(47, 91, 255, 0.16);
  --glow-b: rgba(255, 150, 110, 0.22);
  --media-glow: 0.3;
  --shadow-card: 0 1px 2px rgba(15, 20, 40, 0.05), 0 14px 34px -18px rgba(30, 45, 110, 0.22);
  --shadow-lg: 0 30px 60px -28px rgba(30, 45, 110, 0.3);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--accent-soft); }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--fg-dim); transition: color 0.6s var(--ease); }
.eyebrow { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-subtle); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 1000; background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: 10px; transition: top 0.2s; }
.skip-link:focus { top: 16px; }

/* Ambient background */
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(50% 40% at 78% 8%, var(--glow-a), transparent 70%),
    radial-gradient(40% 35% at 10% 20%, var(--glow-b), transparent 70%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-size: 16px; font-weight: 500; white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px var(--accent); }
.btn--primary svg { transition: transform 0.25s var(--ease); }
.btn--primary:hover svg { transform: translateX(3px); }
.btn--ghost { border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 15.5px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--fg-muted); transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }

/* ---------- Floating nav ---------- */
.nav-wrap { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; padding: 0 16px; pointer-events: none; }
.nav {
  pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(920px, 100%); padding: 7px 7px 7px 10px;
  background: var(--nav-bg); border: 1px solid var(--border); border-radius: 999px;
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, var(--shadow-lg);
  transition: transform 0.4s var(--ease), box-shadow 0.3s;
}
.nav-wrap.is-hidden .nav { transform: translateY(-140%); }
.brand { position: relative; display: flex; align-items: center; height: 40px; padding: 0 6px; font-weight: 600; font-size: 15px; }
.brand__mark { width: 34px; height: 34px; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.brand__d { stroke: var(--fg); stroke-width: 1.7; }
.brand__bar { stroke: var(--accent); stroke-width: 2.2; transform-box: fill-box; transform-origin: left center; transition: transform 0.7s var(--ease); }
.brand:hover .brand__bar, .brand:focus-visible .brand__bar { transform: scaleX(1.25); }
/* The name stays tucked away and slides out beside the mark on hover, without moving the nav */
.brand__name {
  position: absolute; left: 50px; white-space: nowrap; letter-spacing: -0.02em;
  clip-path: inset(0 100% 0 0); transform: translateX(-8px); opacity: 0;
  transition: clip-path 0.7s var(--ease), transform 0.7s var(--ease), opacity 0.4s var(--ease);
}
.brand:hover .brand__name, .brand:focus-visible .brand__name { clip-path: inset(0 0 0 0); transform: none; opacity: 1; }
.nav__links { position: relative; display: flex; gap: 2px; }
.nav__link { position: relative; z-index: 1; display: block; padding: 8px 14px; font-size: 14px; color: var(--fg-muted); border-radius: 999px; transition: color 0.2s; }
.nav__link:hover, .nav__link.is-active { color: var(--fg); }
.nav__pill {
  position: absolute; top: 0; left: 0; height: 100%; width: 0; z-index: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  opacity: 0; transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.2s;
}
.nav__actions { display: flex; align-items: center; gap: 4px; }
.nav__menu { display: none; }
/* Sun and moon share one spot; the outgoing icon spins away as the new one spins in */
#themeToggle { position: relative; overflow: hidden; }
#themeToggle svg { position: absolute; transition: transform 0.7s var(--ease), opacity 0.4s var(--ease); }
#themeToggle .i-moon { transform: rotate(-90deg) scale(0.4); opacity: 0; }
:root[data-theme="light"] #themeToggle .i-sun { transform: rotate(90deg) scale(0.4); opacity: 0; }
:root[data-theme="light"] #themeToggle .i-moon { transform: none; opacity: 1; }

/* Theme switch: the browser snapshots both themes; JS grows the new one as a circle */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

.mobile-menu {
  pointer-events: auto; width: min(920px, 100%); margin-top: 8px; padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-lg); animation: drop 0.3s var(--ease);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu a:not(.btn) { padding: 12px 14px; border-radius: 12px; font-size: 16px; }
.mobile-menu a:not(.btn):hover { background: var(--surface-2); }
.mobile-menu .btn { margin-top: 6px; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 56px 64px; align-items: start;
  padding: 150px 0 96px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 13px; color: var(--fg-muted);
}
.status-pill__dot, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.hero__head { grid-column: 1 / -1; }
.hero__title { font-size: clamp(30px, 6.1vw, 74px); font-weight: 600; line-height: 0.98; letter-spacing: -0.05em; margin-top: 28px; }
.hero__title span { display: block; }
.hero__text { padding-top: 8px; }
.hero__lead { font-size: clamp(17px, 1.6vw, 21px); color: var(--fg); max-width: 40ch; line-height: 1.55; letter-spacing: -0.01em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.socials { display: flex; gap: 6px; margin-top: 32px; }
.socials a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); color: var(--fg-muted); transition: color 0.2s, border-color 0.2s, transform 0.25s var(--ease); }
.socials a:hover { color: var(--fg); border-color: var(--border-strong); transform: translateY(-2px); }

/* Terminal */
.terminal {
  position: relative; border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: rotate(1.2deg);
}
.terminal::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--accent), transparent 35%, transparent 70%, var(--accent-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0.6;
}
.terminal__bar, .browser__bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.terminal__title { font-size: 12px; color: var(--fg-subtle); }
.terminal__body { padding: 22px 20px; min-height: 270px; font-size: 13.5px; line-height: 1.7; }
.t-prompt { color: var(--fg); }
.t-sign { color: var(--accent); }
.caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.t-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.t-steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--fg-muted); opacity: 0; transform: translateY(4px); transition: opacity 0.4s, transform 0.4s var(--ease); }
.t-steps li::before { content: "✓"; color: #3ddc97; }
.t-steps li.is-on { opacity: 1; transform: none; }
.t-url { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.terminal__foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--fg-subtle); }
.terminal__foot span { display: inline-flex; align-items: center; gap: 8px; }
.live-dot { width: 6px; height: 6px; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden; border-block: 1px solid var(--border); padding: 22px 0;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__list { display: flex; flex-shrink: 0; }
.marquee__list li { display: flex; align-items: center; gap: 40px; padding-right: 40px; font-size: clamp(20px, 2.4vw, 28px); font-weight: 500; letter-spacing: -0.02em; color: var(--fg-muted); white-space: nowrap; }
.marquee__list li::after { content: "✦"; font-size: 0.55em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 120px 0 0; }
.section__head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 48px; }
.section__title { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.035em; }

.card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  overflow: hidden; isolation: isolate;
  box-shadow: var(--shadow-card);
}
/* Cursor spotlight on cards */
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 60%);
}
.card:hover::after { opacity: 1; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--fg-muted); background: var(--bg); }

/* ---------- Work ---------- */
/* At rest: logo + name. On hover: the logo lifts away, a preview window rises
   (tilting with the cursor) and a details sheet slides up from the bottom. */
.work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project {
  display: block; aspect-ratio: 1 / 1.08; perspective: 1200px;
  background:
    radial-gradient(75% 60% at 50% 0%, hsl(var(--hue) 90% 60% / var(--media-glow)), transparent 70%),
    color-mix(in srgb, var(--surface) 80%, transparent);
  transition: transform 0.6s var(--ease), border-color 0.3s;
}
.project--featured { grid-column: 1 / -1; aspect-ratio: 21 / 8; }
.project:hover, .project:focus-visible { transform: translateY(-4px); border-color: var(--border-strong); }

.project__rest {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: transform 0.75s var(--ease), opacity 0.45s var(--ease);
}
.project__logo {
  display: grid; place-items: center; width: 76px; height: 76px; border-radius: 22px;
  background: hsl(var(--hue) 80% 55%); color: #fff; font-size: 34px; font-weight: 600; letter-spacing: -0.04em;
  box-shadow: 0 18px 40px -14px hsl(var(--hue) 85% 50% / 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.project--featured .project__logo { width: 96px; height: 96px; border-radius: 28px; font-size: 44px; }
.project__label { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.project--featured .project__label { font-size: 22px; }
.project:hover .project__rest, .project:focus-visible .project__rest { transform: translateY(-28px) scale(0.88); opacity: 0; }

.project__preview {
  position: absolute; left: 7%; right: 7%; top: 8%;
  transform: translateY(190%); transition: transform 0.9s var(--ease);
}
.project--featured .project__preview { left: 5%; right: auto; width: 55%; top: 10%; }
.project:hover .project__preview, .project:focus-visible .project__preview { transform: none; transition-delay: 0.05s; }
.browser {
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); overflow: hidden;
  box-shadow: 0 24px 50px -24px hsl(var(--hue) 90% 40% / 0.55);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.4s var(--ease);
}
.browser__bar { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.browser__url { font-size: 11px; color: var(--fg-subtle); padding: 3px 10px; border-radius: 6px; background: var(--surface-2); }
.browser__screen {
  display: grid; place-items: center; aspect-ratio: 16 / 10;
  background:
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 24px 100%;
}
.mockup-label { font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fg-subtle); padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: 999px; background: var(--bg); }

.project__info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 22px 20px;
  background: var(--surface); border-top: 1px solid var(--border);
  transform: translateY(101%); transition: transform 0.7s var(--ease);
}
.project--featured .project__info {
  top: 0; left: auto; width: 40%; display: flex; flex-direction: column; justify-content: center; padding: 36px;
  border-top: 0; border-left: 1px solid var(--border); transform: translateX(101%);
}
.project:hover .project__info, .project:focus-visible .project__info { transform: none; transition-delay: 0.12s; }
.project__info .tags { margin-top: 14px; }
.project__tag { font-size: 11.5px; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.project__name { font-size: 19px; }
.project--featured .project__name { font-size: clamp(26px, 3vw, 36px); }
.project__desc { color: var(--fg-muted); font-size: 15px; margin-top: 4px; }
.project--featured .project__desc { font-size: 16px; }
.project__arrow {
  position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; align-items: center; height: 40px; padding: 0 11px;
  border-radius: 999px; background: var(--btn-bg); color: var(--btn-fg);
  opacity: 0; transform: scale(0.8) rotate(-20deg); transform-origin: right center;
  transition: opacity 0.3s, transform 0.5s var(--ease), box-shadow 0.4s var(--ease);
}
/* After 2s of hovering a card, the pill stretches left to reveal "Visit site" and the arrow turns to point ahead.
   It stays until the cursor leaves the card, then tucks away immediately. */
.project__visit {
  max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; font-size: 13.5px; font-weight: 500;
  transition: max-width 0.6s var(--ease), margin 0.6s var(--ease), opacity 0.35s var(--ease);
}
.project__arrow svg { transition: transform 0.5s var(--ease); }
.project:hover .project__arrow, .project:focus-visible .project__arrow { box-shadow: 0 8px 24px -8px var(--accent); transition-delay: 0s, 0s, 2s; }
.project:hover .project__visit, .project:focus-visible .project__visit { max-width: 90px; margin-right: 8px; opacity: 1; transition-delay: 2s, 2s, 2.1s; }
.project:hover .project__arrow svg, .project:focus-visible .project__arrow svg { transform: rotate(45deg); transition-delay: 2s; }
.project:hover .project__arrow, .project:focus-visible .project__arrow { opacity: 1; transform: none; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: start; }
.about__story { display: flex; flex-direction: column; gap: 18px; color: var(--fg-muted); font-size: 16.5px; line-height: 1.75; max-width: 62ch; }
.about__lead { color: var(--fg); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.4; letter-spacing: -0.02em; }
.traits { display: grid; gap: 0; margin-top: 12px; border-top: 1px solid var(--border); }
.traits li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.trait__k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-text); padding-top: 2px; }

.offer { padding: 28px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; }
.offer__list { display: flex; flex-direction: column; gap: 18px; }
.offer__list li { display: flex; gap: 14px; }
.offer__icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.offer__list h3 { font-size: 16px; margin-bottom: 2px; }
.offer__list p { color: var(--fg-muted); font-size: 14px; line-height: 1.55; }
.offer__cta { align-self: flex-start; margin-top: 4px; }

.path { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 56px; position: relative; }
.path::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--border-strong), var(--accent)); }
.path li { position: relative; padding: 26px 16px 0 0; font-size: 15px; font-weight: 500; }
.path li::before { content: ""; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border-strong); }
.path li.is-now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.path span { display: block; font-size: 12px; font-weight: 400; color: var(--fg-subtle); margin-bottom: 4px; }

/* ---------- Skills bento ---------- */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill { display: flex; flex-direction: column; gap: 10px; padding: 26px; min-height: 220px; }
.skill h3 { font-size: 19px; margin-top: auto; }
.skill p { color: var(--fg-muted); font-size: 16px; line-height: 1.6; }
.skill__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 18px; }
.skill--hero { grid-column: span 2; grid-row: span 2; justify-content: flex-end; background: linear-gradient(160deg, var(--accent-soft), transparent 55%), color-mix(in srgb, var(--surface) 80%, transparent); }
.skill--hero h3 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -0.035em; }
.skill--hero p { font-size: 16px; max-width: 42ch; }
.skill--hero .tags { margin-top: 10px; }
.skill--wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 18px 22px; min-height: 0; flex-wrap: wrap; }
.skill--wide .skill__icon { margin: 0; }
.skill__body { flex: 1; min-width: 200px; }
.skill--wide h3 { margin: 0 0 4px; }

/* ---------- Process ---------- */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--border); }
.step { padding: 28px 24px 0 0; position: relative; }
.step::before { content: ""; position: absolute; top: -1px; left: 0; width: 40px; height: 1px; background: var(--accent); transition: box-shadow 1.2s var(--ease); }
.step__num { display: block; font-size: 56px; line-height: 1; color: var(--fg-dim); margin-bottom: 20px; transition: color 1.2s var(--ease), text-shadow 1.2s var(--ease); }
.step.is-lit .step__num { color: var(--fg); text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.step.is-lit::before { box-shadow: 0 0 10px 1px var(--accent); }

/* A dot travels the line; JS moves it and lights each step as it passes */
.process-track { position: relative; }
.process__dot {
  position: absolute; top: -4px; left: -4px; z-index: 1; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 16px 2px var(--accent);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--fg-muted); font-size: 16px; }

/* ---------- Experience ---------- */
.exp { border-top: 1px solid var(--border); }
.exp__row { position: relative; display: grid; grid-template-columns: 160px 1fr 1.2fr; gap: 24px; align-items: baseline; padding: 28px 0; border-bottom: 1px solid var(--border); }
/* Hover: content glides right in a gentle cascade, an orange line draws in from the left
   and, on leave, sweeps out to the right instead of snapping back */
.exp__row > * { transition: transform 0.8s var(--ease), color 0.6s var(--ease); }
.exp__row > :nth-child(2) { transition-delay: 0.04s; }
.exp__row > :nth-child(3) { transition-delay: 0.08s; }
.exp__row:hover > * { transform: translateX(14px); }
.exp__row::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right center;
  transition: transform 0.9s var(--ease);
}
.exp__row:hover::after { transform: scaleX(1); transform-origin: left center; }
.exp__date { font-size: 13px; color: var(--fg-subtle); }
.exp__row:hover .exp__date { color: var(--accent-text); }
.exp__row h3 { font-size: 19px; }
.exp__org { color: var(--fg-muted); font-size: 16px; }
.exp__desc { color: var(--fg-muted); font-size: 16px; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(56px, 8vw, 96px) 24px; border-radius: 28px; border: 1px solid var(--border);
  background:
    radial-gradient(60% 80% at 50% 120%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    color-mix(in srgb, var(--surface) 85%, transparent);
}
.cta__title { font-size: clamp(44px, 7.5vw, 96px); line-height: 0.98; letter-spacing: -0.045em; margin: 18px 0 20px; }
.cta__lead { color: var(--fg-muted); font-size: 17px; }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 36px; }
.copy-email {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--fg-muted); font-size: 14px;
  transition: color 0.2s, border-color 0.2s;
}
.copy-email:hover { color: var(--fg); border-color: var(--fg-subtle); }
.copy-email svg { width: 16px; height: 16px; }

/* ---------- CTA flip card ---------- */
.flip { perspective: 1800px; }
.flip__card { display: grid; transform-style: preserve-3d; transform-origin: 50% 50%; }
.flip__face { grid-area: 1 / 1; align-self: start; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* JS sets the card's height to the side that is showing */
.flip__card.is-sized { transition: height 0.7s var(--ease-flip); }
.flip__face--front { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.flip__face--back { transform: rotateY(180deg); text-align: left; padding: clamp(28px, 5vw, 56px); }
.flip__card.is-flipped { transform: rotateY(180deg); }
.flip__card.anim-in { animation: flip-in 0.95s var(--ease-flip) both; }
.flip__card.anim-out { animation: flip-out 0.85s var(--ease-flip) both; }
:root { --ease-flip: cubic-bezier(0.65, 0, 0.25, 1); }
/* The card dips back and tilts as it turns, then settles flat */
@keyframes flip-in {
  0% { transform: rotateY(0) scale(1); }
  45% { transform: rotateY(95deg) rotateX(4deg) scale(0.9); }
  100% { transform: rotateY(180deg) scale(1); }
}
@keyframes flip-out {
  0% { transform: rotateY(180deg) scale(1); }
  45% { transform: rotateY(85deg) rotateX(-4deg) scale(0.9); }
  100% { transform: rotateY(0) scale(1); }
}
/* Form contents rise in once the card has turned */
.flip__face--back > * { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); }
.flip__card.is-flipped .flip__face--back > * { opacity: 1; transform: none; }
.flip__card.is-flipped .brief__head { transition-delay: 0.45s; }
.flip__card.is-flipped .brief, .flip__card.is-flipped .brief__done { transition-delay: 0.55s; }

.brief__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.brief__title { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.035em; }
.brief__back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; color: var(--fg-muted); font-size: 14px; transition: background 0.2s, color 0.2s;
}
.brief__back:hover { background: var(--surface-2); color: var(--fg); }
.brief__back svg { width: 16px; height: 16px; }

.brief { display: flex; flex-direction: column; gap: 20px; }
.brief[hidden] { display: none; }
.brief__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-size: 14px; font-weight: 500; color: var(--fg); padding: 0; margin-bottom: 0; }
.field legend { margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--border-strong);
  font: inherit; font-size: 16px; line-height: 1.5; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 120px; }
.field input::placeholder, .field textarea::placeholder { color: var(--fg-subtle); }
.field input:hover, .field textarea:hover { border-color: var(--fg-subtle); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: #f87171; }
.field__err { min-height: 0; font-size: 13.5px; color: #f87171; }
.field__err:empty { display: none; }

.chips-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--fg-muted); font-size: 14.5px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.chip:hover span { color: var(--fg); border-color: var(--fg-subtle); }
.chip input:checked + span { background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-bg); }
.chip input:active + span { transform: scale(0.96); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.brief__foot .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.brief__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 4px; }
.brief__note { font-size: 14px; color: var(--fg-subtle); }
.brief__note a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

.brief__done { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 12px 0; outline: none; }
.brief__done[hidden] { display: none; }
.brief__done h3 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.035em; }
.brief__done p { color: var(--fg-muted); max-width: 48ch; }
.brief__check { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #3ddc97; color: #08130e; animation: pop-in 0.5s var(--ease) both; }
.brief__check svg { width: 26px; height: 26px; stroke-width: 2.4; }
@keyframes pop-in { from { transform: scale(0.4); opacity: 0; } }

/* ---------- Footer ---------- */
.footer { padding: 96px 0 40px; }
.footer__sign { padding-bottom: 32px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.footer__name { font-size: clamp(34px, 7.4vw, 104px); font-weight: 600; line-height: 0.95; letter-spacing: -0.05em; color: var(--fg); }
.footer__role { margin-top: 16px; font-size: clamp(15px, 1.4vw, 18px); color: var(--fg-muted); }
.footer__bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--fg-subtle); }

.about__sign { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; border-left: 2px solid var(--accent); font-size: 15px; }
.about__sign-name { color: var(--fg); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.back-top { padding: 8px 0; transition: color 0.2s; }
.back-top:hover { color: var(--fg); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0s); }
.terminal.reveal { transform: translateY(18px) rotate(1.2deg); }
.reveal.is-visible { opacity: 1; transform: none; }
.terminal.reveal.is-visible { transform: rotate(1.2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 48px; padding-top: 130px; }
  .terminal, .terminal.reveal.is-visible { transform: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .work { grid-template-columns: repeat(2, 1fr); }
  /* The featured card joins the grid as a regular card */
  .project--featured { grid-column: auto; aspect-ratio: 1 / 1.08; }
  .project--featured .project__logo { width: 76px; height: 76px; border-radius: 22px; font-size: 34px; }
  .project--featured .project__label { font-size: 17px; }
  .project--featured .project__preview { left: 7%; right: 7%; width: auto; top: 8%; }
  .project--featured .project__info { top: auto; left: 0; width: auto; display: block; padding: 18px 22px 20px; border-left: 0; border-top: 1px solid var(--border); transform: translateY(101%); }
  .project--featured .project__name { font-size: 19px; }
  .project--featured .project__desc { font-size: 15px; }
  .about { grid-template-columns: 1fr; gap: 36px; }
  .offer { position: static; }
}
@media (max-width: 760px) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu { display: grid; }
  .nav__menu path { transition: transform 0.3s var(--ease); transform-origin: center; }
  .nav__menu[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
  .nav__menu[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }
  .work, .bento, .process { grid-template-columns: 1fr; }
  .skill--hero, .skill--wide { grid-column: auto; grid-row: auto; }
  .exp__row { grid-template-columns: 1fr; gap: 6px; }
  .traits li { grid-template-columns: 1fr; gap: 4px; }
  .brief__row { grid-template-columns: 1fr; }
  .brief__foot .btn { width: 100%; }
  .path { grid-template-columns: 1fr; gap: 22px; padding-left: 28px; }
  .path::before { top: 0; bottom: 0; left: 5px; right: auto; width: 1px; height: auto; background: linear-gradient(var(--border-strong), var(--accent)); }
  .path li { padding: 0; }
  .path li::before { left: -28px; top: 4px; }
  .offer { padding: 22px; }
  .section { padding-top: 88px; }
  .section__head { margin-bottom: 32px; }
  .terminal__body { min-height: 250px; font-size: 12.5px; }
  .project__arrow { opacity: 1; transform: none; }
}
@media (max-width: 420px) {
  .container { width: calc(100% - 32px); }
  .hero__ctas .btn { flex: 1; }
  .footer__bar { flex-direction: column; align-items: flex-start; }
}

@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; }
  .reveal { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
  /* Swap the flip for a simple crossfade */
  .flip__card, .flip__card.is-flipped { transform: none; animation: none !important; }
  .flip__face--back { transform: none; }
  .flip__face { transition: opacity 0.2s !important; }
  .flip__card.is-flipped .flip__face--front, .flip__card:not(.is-flipped) .flip__face--back { opacity: 0; visibility: hidden; }
}

/* ---------- Footer bar details ---------- */
.footer__left { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.footer__place { font-variant-numeric: tabular-nums; }

/* ---------- Click burst ---------- */
.click-burst {
  position: fixed; z-index: 2000; pointer-events: none; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; border: 1.5px solid var(--accent);
  box-shadow: 0 0 12px 1px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
  animation: click-ring 0.6s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.click-burst::after {
  content: ""; position: absolute; inset: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px 2px var(--accent);
  animation: click-core 0.45s ease-out forwards;
}
@keyframes click-ring { from { transform: scale(0.2); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes click-core { from { transform: scale(1); opacity: 1; } to { transform: scale(0); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .click-burst { display: none; } }

/* Dark contrast blocks: solid fill so the light page never bleeds through */
.flip.on-dark .cta { background-color: #0d0d0f; }

/* ---------- Project hover extras ---------- */
/* Two ghost windows sit behind the preview and fan out like a hand of cards */
.project__preview::before, .project__preview::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  transition: transform 0.9s var(--ease);
}
.project__preview::after { background: color-mix(in srgb, hsl(var(--hue) 80% 55%) 22%, var(--surface)); }
.project:hover .project__preview::before, .project:focus-visible .project__preview::before { transform: translate(-7%, -5%) rotate(-6deg); transition-delay: 0.35s; }
.project:hover .project__preview::after, .project:focus-visible .project__preview::after { transform: translate(6%, -3%) rotate(5deg); transition-delay: 0.45s; }

/* The logo that lifted away lands in the window's tab as its favicon */
.browser__fav {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  background: hsl(var(--hue) 80% 55%); color: #fff; font-size: 10.5px; font-weight: 700;
  transform: scale(0); transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.project:hover .browser__fav, .project:focus-visible .browser__fav { transform: scale(1); transition-delay: 0.7s; }
.browser__bar .dots + .browser__fav { margin-left: 4px; }
.browser__fav + .browser__url { margin-left: -4px; }

/* ---------- Light mode: aurora wash instead of neon glows ----------
   Glows add light, which only works on dark. On a light page we paint with soft
   pigment instead: a slow-drifting aurora of cobalt, lilac, peach and mint. */
:root[data-theme="light"] .bg-glow {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 80% 12%, rgba(47, 91, 255, 0.16), transparent 70%),
    radial-gradient(34% 30% at 18% 18%, rgba(255, 150, 110, 0.22), transparent 70%),
    radial-gradient(30% 28% at 55% 30%, rgba(150, 110, 255, 0.12), transparent 70%),
    radial-gradient(28% 26% at 30% 70%, rgba(70, 200, 185, 0.09), transparent 70%);
  filter: saturate(1.15);
  animation: aurora-drift 26s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) rotate(4deg) scale(1.05); }
  100% { transform: translate3d(-3%, 1%, 0) rotate(-3deg) scale(1.02); }
}
/* Neon glows become crisp rings and coloured shadows in daylight */
:root[data-theme="light"] .process__dot { box-shadow: 0 0 0 4px var(--accent-soft), 0 4px 10px -2px rgba(47, 91, 255, 0.55); }
:root[data-theme="light"] .step.is-lit .step__num { text-shadow: none; }
:root[data-theme="light"] .step.is-lit::before { box-shadow: 0 0 0 1px var(--accent); }
:root[data-theme="light"] .click-burst { box-shadow: 0 0 0 1px var(--accent-soft); }
:root[data-theme="light"] .click-burst::after { box-shadow: none; }
:root[data-theme="light"] .btn--primary:hover { box-shadow: 0 12px 28px -12px rgba(47, 91, 255, 0.6); }
@media (prefers-reduced-motion: reduce) { :root[data-theme="light"] .bg-glow { animation: none; } }

/* ---------- Pearl finish (light mode test) ----------
   Switched on by data-finish="pearl" on <html>. Remove that attribute to go back. */
:root[data-theme="light"][data-finish="pearl"] {
  --bg: #f7f7f9;
  --surface-2: #eeeff4;
  --nav-bg: rgba(250, 250, 253, 0.74);
  --pearl: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 244, 255, 0.92) 38%, rgba(255, 245, 240, 0.92) 68%, rgba(246, 241, 255, 0.94) 100%);
}
/* The aurora sheen is strongest at the top and melts away toward the bottom */
:root[data-theme="light"][data-finish="pearl"] .bg-glow {
  background:
    radial-gradient(42% 34% at 80% 10%, rgba(47, 91, 255, 0.20), transparent 70%),
    radial-gradient(38% 32% at 16% 14%, rgba(255, 150, 110, 0.26), transparent 70%),
    radial-gradient(34% 30% at 52% 26%, rgba(150, 110, 255, 0.17), transparent 70%),
    radial-gradient(30% 28% at 30% 62%, rgba(70, 200, 185, 0.11), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, rgba(0, 0, 0, 0.35) 100%);
}
/* Cards become polished surfaces with a faint iridescent shimmer */
:root[data-theme="light"][data-finish="pearl"] .card { background: var(--pearl); border-color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(30, 40, 90, 0.07), var(--shadow-card), inset 0 1px 0 #fff; }
:root[data-theme="light"][data-finish="pearl"] .project { background: radial-gradient(75% 60% at 50% 0%, hsl(var(--hue) 90% 60% / var(--media-glow)), transparent 70%), var(--pearl); }
:root[data-theme="light"][data-finish="pearl"] .skill--hero { background: linear-gradient(160deg, var(--accent-soft), transparent 55%), var(--pearl); }
:root[data-theme="light"][data-finish="pearl"] .nav { border-color: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(30, 40, 90, 0.07), inset 0 1px 0 #fff, var(--shadow-lg); }

/* Light mode: the contact card is a clean dark panel, without the orange light from below */
:root[data-theme="light"] .flip.on-dark .cta { background: #0d0d0f; }

/* Light mode: the dark blocks (terminal, contact card) follow the cobalt accent,
   in a brighter shade that reads well on their dark ground */
:root[data-theme="light"] .on-dark {
  --accent: #5b7cff;
  --accent-text: #8fa4ff;
  --accent-2: #9d8cff;
  --accent-soft: rgba(91, 124, 255, 0.18);
}

/* Light mode project cards: a flat pale tint of the project's colour instead of a spotlight glow.
   The logo tile casts a soft shadow in its colour, like an object resting on a tinted surface. */
:root[data-theme="light"] .card.project {
  background: hsl(var(--hue) 85% 96.5%);
  transition: transform 0.6s var(--ease), background-color 0.5s var(--ease);
}
:root[data-theme="light"] .card.project:hover,
:root[data-theme="light"] .card.project:focus-visible { background: hsl(var(--hue) 85% 93.5%); }
:root[data-theme="light"] .project__logo { box-shadow: 0 16px 30px -14px hsl(var(--hue) 80% 40% / 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
:root[data-theme="light"] .project__preview::after { background: hsl(var(--hue) 70% 88%); }

/* ==========================================================================
   Refinements from the design-taste audit (v1.1)
   Intentional lighting, no coded micro-labels, no outlined icon boxes.
   These rules use !important because they deliberately override earlier
   theme and pearl-finish rules, so keep them at the end of the file.
   ========================================================================== */

/* 1. No eyebrow labels: the headings already name every section */
.section__head .eyebrow,
.cta .eyebrow,
.status-pill { display: none !important; }

/* 2. No coded micro-labels: everything readable is set in the text face, sentence case */
.offer > .eyebrow {
  font-family: var(--font-sans) !important; text-transform: none !important; letter-spacing: -0.01em !important;
  font-size: 18px !important; font-weight: 600; color: var(--fg) !important;
}
.trait__k, .project__tag, .exp__date, .tags li, .copy-email, .footer__place, .path span, .back-top {
  font-family: var(--font-sans) !important; text-transform: none !important; letter-spacing: 0 !important;
}
.trait__k { font-size: 15px !important; font-weight: 600; color: var(--fg) !important; }
.project__tag { font-size: 14px !important; }
.exp__date { font-size: 14px !important; font-variant-numeric: tabular-nums; }
.tags li { font-size: 13px !important; border: 0 !important; background: var(--surface-2) !important; }

/* 3. Light with a reason. Dark mode drops the ambient haze; every glow that remains
      comes from something on the page (the terminal screen, a project's colour, the
      accent block, the contact card, the travelling dot). Light mode keeps its aurora. */
:root:not([data-theme="light"]) .bg-glow { display: none !important; }
.bg-grain { display: none !important; }
:root[data-theme="light"] { --bg: #efeff1 !important; --surface: #ffffff !important; --surface-2: #e6e6ea !important; }
.card, :root[data-theme="light"] .card {
  background: var(--surface) !important; border: 0 !important; box-shadow: none !important;
}
/* Each project glows in its own colour, like the light of its app icon */
.project, :root[data-theme="light"] .project {
  background:
    radial-gradient(75% 60% at 50% 0%, hsl(var(--hue) 90% 60% / var(--media-glow)), transparent 70%),
    var(--surface) !important;
}
.project__preview::after { background: var(--surface-2) !important; }

/* The terminal is a lit screen: it spills warm light onto the page around it */
.hero { position: relative; }
:root:not([data-theme="light"]) .hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  right: -6%; top: 46%; width: 60%; height: 70%;
  background: radial-gradient(closest-side, rgba(255, 122, 69, 0.22), rgba(255, 122, 69, 0.06) 60%, transparent);
  filter: blur(10px);
  animation: screen-breathe 7s ease-in-out infinite;
}
@keyframes screen-breathe { 50% { opacity: 0.7; transform: scale(0.96); } }
:root:not([data-theme="light"]) .terminal { box-shadow: 0 40px 90px -40px rgba(255, 122, 69, 0.45), 0 0 0 1px rgba(255, 122, 69, 0.18) !important; }

/* The accent block emits a soft halo of its own colour */
:root:not([data-theme="light"]) .card.skill--hero { box-shadow: 0 30px 80px -36px rgba(255, 122, 69, 0.7) !important; }
:root[data-theme="light"] .card.skill--hero { box-shadow: 0 24px 60px -30px rgba(47, 91, 255, 0.55) !important; }

/* 4. No icons in tinted squares; the boldest skill becomes a solid field of the accent */
.skill__icon, .offer__icon { display: none !important; }
.card.skill--hero, :root[data-theme="light"] .card.skill--hero { background: var(--accent) !important; color: #fff; }
:root:not([data-theme="light"]) .skill--hero { color: #120a06; }
.skill--hero p { color: inherit !important; opacity: 0.85; }
.skill--hero .tags li { background: rgba(255, 255, 255, 0.18) !important; color: inherit !important; }
:root:not([data-theme="light"]) .skill--hero .tags li { background: rgba(0, 0, 0, 0.14) !important; }

/* 5. The Skills section sits on one full-width field of colour: a deliberate change of ground */
#skills { position: relative; }
#skills::before {
  content: ""; position: absolute; z-index: -1; top: 56px; bottom: -64px; left: 50%; width: 100vw; transform: translateX(-50%);
  background: var(--surface-2);
}
:root:not([data-theme="light"]) #skills::before { background: #101012; }
:root:not([data-theme="light"]) #skills .card:not(.skill--hero) { background: #18181b !important; }

/* 6. No thin rules where space can do the job */
.marquee { border-block: 0 !important; }
.marquee__list li::after { content: "/" !important; font-size: 0.8em !important; color: var(--fg-dim) !important; }
.traits, .traits li { border: 0 !important; }
.traits li { padding: 8px 0 !important; }
.exp, .exp__row { border-color: transparent !important; }
.exp__row { background: transparent; }
.exp__row:nth-child(odd) { background: color-mix(in srgb, var(--surface) 60%, transparent); border-radius: 16px; }
.exp__row { padding-left: 20px !important; padding-right: 20px !important; }
.footer__sign { border-bottom: 0 !important; }
.nav__pill { border: 0 !important; }

/* 7. The contact card keeps its light rising from below, like a door left ajar */
.flip.on-dark .cta {
  background: radial-gradient(60% 80% at 50% 125%, rgba(255, 122, 69, 0.42), transparent 70%), #141416 !important;
  border: 0 !important;
}
.status-pill__dot { animation: none !important; }

/* 8. Nothing readable below 13px */
.terminal__title, .terminal__foot, .browser__url, .mockup-label { font-size: 12.5px !important; }
.small { font-size: 14px !important; }

/* Light mode: no orange light under the contact card */
:root[data-theme="light"] .flip.on-dark .cta { background: #141416 !important; }

/* Dark mode: one soft ambient light behind the hero only. It sits behind the headline,
   in the brand orange, and fades away as you scroll so it never becomes wallpaper. */
:root:not([data-theme="light"]) .hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -18%; top: -35%; width: 85%; height: 110%;
  background: radial-gradient(closest-side, rgba(255, 122, 69, 0.15), rgba(255, 122, 69, 0.05) 55%, transparent);
  filter: blur(20px);
}
@supports (animation-timeline: scroll()) {
  :root:not([data-theme="light"]) .hero::before {
    animation: hero-light-fade linear both;
    animation-timeline: scroll(root);
    animation-range: 0 85vh;
  }
}
@keyframes hero-light-fade { to { opacity: 0; transform: translateY(-60px) scale(0.92); } }
@media (prefers-reduced-motion: reduce) { :root:not([data-theme="light"]) .hero::before { animation: none; } }

/* Light mode project cards: flat pale tint of the project colour, no spotlight glow */
:root[data-theme="light"] .card.project { background: hsl(var(--hue) 85% 96.5%) !important; }
:root[data-theme="light"] .card.project:hover,
:root[data-theme="light"] .card.project:focus-visible { background: hsl(var(--hue) 85% 93.5%) !important; }
:root[data-theme="light"] .project__preview::after { background: hsl(var(--hue) 70% 88%) !important; }

/* ---------- Real project screenshots (v1.3) ---------- */
/* A project can set its own logo colours; otherwise the tile uses its hue */
.project__logo, .browser__fav { background: var(--logo-bg, hsl(var(--hue) 80% 55%)); color: var(--logo-fg, #fff); }

/* The preview window shows the real homepage, cropped from the top */
.browser__screen--shot { display: block; background: var(--bg); }
.browser__screen--shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* The two fanned windows behind it carry the site's other pages */
.project .project__preview--shots::before,
.project .project__preview--shots::after {
  background-size: cover !important; background-position: center top !important; background-repeat: no-repeat !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}
.project .project__preview--shots::before { background-image: var(--shot-a) !important; }
.project .project__preview--shots::after { background-image: var(--shot-b) !important; }
/* Fan them further so more of each page shows: one up and left, one out to the right */
.project:hover .project__preview--shots::before, .project:focus-visible .project__preview--shots::before { transform: translate(-3%, -11%) rotate(-5deg); }
.project:hover .project__preview--shots::after, .project:focus-visible .project__preview--shots::after { transform: translate(10%, -6%) rotate(4deg); }

/* Project cards clip their hidden preview without becoming scrollable
   (overflow: hidden can still be scrolled by in-page search or focus, which shifts the card's contents) */
.project { overflow: hidden; overflow: clip; }

/* Featured card framing (v1.3.2): the whole homepage fits inside the card, and the two pages
   behind it fan out to the left so their bold titles ("Recent work", "From sketch to garden") peek out */
@media (min-width: 1001px) {
  .project--featured { aspect-ratio: 21 / 8.6; }
  .project--featured .project__preview { left: 10%; width: 47%; top: 9%; }
  .project .project__preview--shots::before { background-position: left center !important; }
  .project .project__preview--shots::after { background-position: left center !important; }
  .project:hover .project__preview--shots::before, .project:focus-visible .project__preview--shots::before { transform: translate(-13%, -2%) rotate(-7deg); }
  .project:hover .project__preview--shots::after, .project:focus-visible .project__preview--shots::after { transform: translate(-7%, -8%) rotate(-3deg); }
}

/* First screen holds one mood (v1.3.6): on desktop the hero plus the tool strip fill the screen,
   so the projects (and their coloured glows) start just below the fold */
@media (min-width: 1001px) {
  .hero { min-height: calc(100svh - 92px); align-content: center; padding-top: 120px; padding-bottom: 64px; }
}

/* ---------- Certifications (v1.3.7) ---------- */
.certs { margin-top: 64px; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 32px 48px; align-items: start; }
.certs__title { font-size: clamp(24px, 2.4vw, 30px); letter-spacing: -0.03em; }
.certs__lead { margin-top: 8px; color: var(--fg-muted); font-size: 16px; max-width: 30ch; }
.certs__list { display: flex; flex-direction: column; gap: 8px; }
.cert {
  display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: transform 0.6s var(--ease), background-color 0.4s var(--ease);
}
.cert:hover { transform: translateX(6px); background: var(--surface); }
.cert__issuer { font-size: 14px; color: var(--fg-subtle); }
.cert__name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.cert__meta { font-size: 14px; color: var(--fg-muted); margin-top: 2px; }
.cert__status {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--fg-muted); background: var(--surface-2); white-space: nowrap;
}
.cert__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: cert-pulse 2.4s ease-in-out infinite; }
@keyframes cert-pulse { 50% { opacity: 0.35; } }
.cert__verify {
  font-size: 14px; font-weight: 500; color: var(--accent-text); white-space: nowrap; padding: 6px 0;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent);
}
.cert__verify:hover { text-decoration-color: currentColor; }
@media (max-width: 1000px) { .certs { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 560px) {
  .cert { grid-template-columns: 1fr auto; padding: 16px; }
  .cert__issuer { grid-column: 1 / -1; }
}

/* Planned certifications: a quieter pill with a hollow, still dot */
.cert__status--planned { background: transparent; color: var(--fg-subtle); padding-left: 0; }
.cert__status--planned .cert__dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg-subtle); animation: none; }
@media (min-width: 1001px) { .certs__head { position: sticky; top: 110px; } }

/* ---------- Certifications as a compact grid (v1.3.9) ---------- */
.certs { grid-template-columns: 1fr; gap: 20px; }
.certs__head { position: static !important; display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.certs__lead { margin-top: 0; max-width: none; }
.certs__list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cert {
  grid-template-columns: 1fr auto; grid-template-areas: "issuer status" "name name" "meta meta";
  align-items: center; align-content: start; gap: 4px 10px; padding: 16px 18px 18px; min-height: 0;
}
.cert:hover { transform: translateY(-3px); }
.cert__issuer { grid-area: issuer; font-size: 13px; }
.cert__body { display: contents; }
.cert__name { grid-area: name; margin-top: 10px; font-size: 16px; line-height: 1.35; }
.cert__meta { grid-area: meta; margin-top: 0; font-size: 13.5px; }
.cert__status, .cert__verify { grid-area: status; justify-self: end; }
.cert__status { padding: 4px 10px; font-size: 12.5px; gap: 6px; }
.cert__status--planned { padding: 4px 0; }
@media (max-width: 1000px) { .certs__list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .cert { grid-template-columns: 1fr auto; padding: 14px; }
  .cert__issuer { grid-column: auto; }
  .certs__list { gap: 8px; }
}
/* Phones: two narrow columns, so the status moves under the course name */
@media (max-width: 560px) {
  .certs__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cert { grid-template-columns: minmax(0, 1fr); grid-template-areas: "issuer" "name" "meta" "status"; }
  .cert__name { margin-top: 6px; font-size: 15px; overflow-wrap: anywhere; }
  .cert__status, .cert__verify { justify-self: start; margin-top: 8px; }
  .cert__status--planned { padding-left: 0; }
}
/* Nine certifications: a clean 3 x 3 on desktop */
@media (min-width: 1001px) { .certs__list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Accent with meaning in Experience (v1.4.2) ---------- */
/* The current role is marked with an accent edge and an accent date */
.exp__row:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.exp__row:first-child .exp__date { color: var(--accent-text) !important; font-weight: 500; }

/* Courses in progress carry a warm tint of the accent; planned ones stay neutral */
.cert:has(.cert__status:not(.cert__status--planned)) {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.cert:has(.cert__status:not(.cert__status--planned)):hover {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.cert__status:not(.cert__status--planned) { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }

/* Brief form: shown only if sending fails, instead of opening the email app unasked */
.brief__error { margin-top: 4px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; color: #fecaca; background: rgba(248, 113, 113, 0.12); }
.brief__error[hidden] { display: none; }
.brief__error a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Smaller project cards with real screenshots (v1.5.0): the pages behind fan out on both sides,
   and the crop starts at the top of each page */
.project:not(.project--featured) .project__preview--shots::before,
.project:not(.project--featured) .project__preview--shots::after { background-position: center top !important; }
.project:not(.project--featured):hover .project__preview--shots::before,
.project:not(.project--featured):focus-visible .project__preview--shots::before { transform: translate(-6%, -6%) rotate(-6deg); }
.project:not(.project--featured):hover .project__preview--shots::after,
.project:not(.project--featured):focus-visible .project__preview--shots::after { transform: translate(6%, -4%) rotate(5deg); }
/* Smaller cards: a wider crop anchored low, so a hero's headline stays visible above the details sheet */
.project:not(.project--featured) .browser__screen--shot { aspect-ratio: 2.35 / 1; }
.project:not(.project--featured) .browser__screen--shot img { object-position: center bottom; }
/* The wider crop makes these windows shorter, so they need further to travel to clear the card at rest */
.project:not(.project--featured):not(:hover):not(:focus-visible) .project__preview--shots { transform: translateY(320%); }
