:root {
  /* palette: change these three; everything else (including the photo duotone) derives from them.
     ratio target 60-30-10: --bg fills pages, --fg is text plus the dark band, --accent marks actions */
  --bg: #dddac4;
  --fg: #2b313f;
  --accent: #efb356;

  --paper: var(--bg);
  --ink: var(--fg);
  /* readable pairings; script.js adjusts them when the accent is too dark */
  --on-accent: var(--fg);       /* text on accent fills */
  --accent-on-dark: var(--accent); /* accent marks on dark bands */
  --accent-edge: color-mix(in srgb, var(--accent) 50%, var(--fg)); /* outlines accent shapes so they read on the background */
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --serif: "Newsreader", Georgia, serif;
}
/* .invert swaps background and text for a dark band */
.invert { --paper: var(--fg); --ink: var(--bg); }
/* dark theme: same three colors, page and text swapped; the band goes a shade deeper so it still reads as a band */
:root[data-theme="dark"] { --paper: var(--fg); --ink: var(--bg); color-scheme: dark; }
:root[data-theme="dark"] .invert { --paper: color-mix(in srgb, var(--fg) 65%, #000); }
/* shades are re-derived wherever paper/ink change */
:root, .invert {
  --paper-deep: color-mix(in srgb, var(--ink) 6%, var(--paper));
  --line: color-mix(in srgb, var(--ink) 32%, var(--paper));
  --muted: color-mix(in srgb, var(--ink) 78%, var(--paper)); /* lowest mix that keeps 4.5:1 on mid-tone backgrounds */
  --ink-soft: color-mix(in srgb, var(--paper) 10%, var(--ink));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.55; overflow-x: hidden; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
section.invert { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); } /* full-bleed past .wrap */
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; } /* ink, not accent: always contrasts with the background */

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
/* every section fills one screen; min-height so long content can still grow */
.screen { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-block: 88px; }
h1, h2 { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .86; letter-spacing: -.005em; }
h2 { font-size: clamp(44px, 6vw, 76px); }
h3 { font-weight: 500; font-size: 19px; line-height: 1.3; }

/* nav */
/* sticky bar; its full-bleed backdrop follows the tokens, so .invert (set by script.js over dark bands) flips it */
.nav { position: sticky; top: 0; z-index: 10; color: var(--ink); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); } /* no color transition: a fade shows a grey in-between bar over the dark band */
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding-block: 14px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { all: unset; cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); }
.icon-btn:hover { background: var(--paper-deep); }
.icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lang-toggle { font: 800 15px/1 var(--display); letter-spacing: .04em; }
.theme-toggle svg { width: 18px; height: 18px; }
/* show the theme you'd switch to */
:root[data-theme="dark"] .theme-toggle .moon, :root:not([data-theme="dark"]) .theme-toggle .sun { display: none; }
.brand { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-edge); }
.menu { position: relative; }
.menu summary, .pill { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 12px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: 999px; padding: 11px 22px; font: 500 16px/1 var(--serif); text-decoration: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { width: 16px; height: 8px; border-block: 1.5px solid currentColor; }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); background: var(--ink); border-radius: 18px; padding: 10px; display: grid; min-width: 190px; }
.menu nav a { color: var(--paper); text-decoration: none; font-size: 18px; padding: 8px 12px; border-radius: 10px; }
.menu nav a:hover { background: var(--accent); color: var(--on-accent); }
/* primary action = accent; --on-accent keeps its text readable */
.pill { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); }
.pill:hover { background: color-mix(in srgb, var(--on-accent) 12%, var(--accent)); }
.pill.ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.pill.ghost:hover { background: var(--paper-deep); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* hero + about share one screen; nav is ~68px tall, so nav + hero = 100svh */
.hero { display: grid; grid-template-columns: 1fr 1fr minmax(240px, 340px); column-gap: 40px; align-content: center; min-height: calc(100svh - 68px); padding-block: 12px 32px; }
.role { grid-column: 1 / 3; font-size: 21px; line-height: 1.25; color: var(--muted); }
.hero h1 { grid-column: 1 / -1; grid-row: 2; position: relative; z-index: 1; font-size: clamp(80px, min(16vw, 20svh), 220px); margin-top: 20px; }
.hero h1 span { display: block; animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero h1 span + span { animation-delay: .12s; }
.portrait { grid-column: 3; grid-row: 1 / 3; position: relative; z-index: 2; align-self: start; max-height: 46svh; overflow: hidden; aspect-ratio: 4 / 5; isolation: isolate; background: color-mix(in srgb, var(--fg) 4%, var(--bg)); box-shadow: -14px 14px 0 var(--accent); } /* offset accent block */
/* duotone from the palette: grayscale photo multiplied onto the paper, then ink lifts the shadows */
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; transform: scale(1.12); }
.portrait::after { content: ""; position: absolute; inset: 0; background: var(--fg); mix-blend-mode: lighten; pointer-events: none; }
.hero-foot { grid-column: 1; grid-row: 3; margin-top: 28px; }
.hero-foot .lead { font-size: 21px; line-height: 1.3; }
.hero-foot .bio { margin: 12px 0 20px; color: var(--muted); font-size: 15.5px; line-height: 1.55; max-width: 60ch; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.strengths { grid-column: 2 / 4; grid-row: 3; align-self: start; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin-top: 28px; }
.strengths div { border-top: 2px solid var(--ink); padding-top: 12px; }
.strengths p { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }

/* projects: empty state until there is something to show */
.wip { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center; padding: clamp(28px, 5vw, 56px); border: 1.5px dashed var(--line); border-radius: 28px; }
.wip h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: clamp(32px, 3.6vw, 48px); line-height: .95; margin: 14px 0 12px; }
.wip p:not(.status) { color: var(--muted); margin-bottom: 24px; max-width: 42ch; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent-edge); font-size: 15px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--on-accent) 25%, transparent); } }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.slots span { aspect-ratio: 4 / 5; border: 1.5px dashed var(--line); border-radius: 999px 999px 16px 16px; background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--paper-deep) 70%, transparent) 10px 11px); }
.slots span:nth-child(2) { transform: translateY(24px); border-color: var(--accent-edge); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--accent) 45%, transparent) 10px 11px); }

/* stack */
.head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 40px; }
.head p { max-width: 340px; color: var(--muted); }
.group { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 22px 0; border-top: 1px solid var(--line); }
.group:last-child { border-bottom: 1px solid var(--line); }
.group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.group li { display: inline-flex; align-items: center; gap: 9px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 16px; line-height: 1.2; background: color-mix(in srgb, var(--paper-deep) 45%, transparent); }
/* icons use the accent; stack sits on the dark band where it reads */
.group i { width: 18px; height: 18px; flex: none; background: var(--accent-on-dark); -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }

/* contact */
/* footer (~70px) shares the last screen */
.contact { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: end; align-content: center; min-height: calc(100svh - 70px); }
.contact h2 { font-size: clamp(52px, 8vw, 112px); }
.contact p { font-size: 20px; margin-bottom: 24px; }

footer { display: flex; justify-content: space-between; padding: 20px 0 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }

@media (max-width: 860px) {
  .brand { white-space: nowrap; }
  .nav-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
  .menu summary { padding: 10px 14px; gap: 8px; }
  .screen { padding-block: 64px; }
  .role { font-size: 18px; }
  .hero-foot, .strengths { grid-column: 1 / -1; grid-row: auto; }
  /* phones: full-width photo, the name sits over its darker lower edge */
  .hero { grid-template-columns: 1fr; padding-block: 20px 48px; }
  .role { grid-column: 1; }
  .portrait { grid-column: 1; grid-row: 2; width: 100%; height: clamp(360px, 62svh, 560px); max-height: none; aspect-ratio: auto; margin-top: 16px; box-shadow: 0 10px 0 var(--accent); }
  .portrait img { object-position: 50% 20%; }
  .portrait::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, var(--fg) 8%, transparent 50%); pointer-events: none; }
  .hero h1 { grid-column: 1; grid-row: 2; align-self: end; z-index: 3; color: var(--bg); font-size: 21vw; margin: 0; padding: 0 16px 14px; }
  .strengths { gap: 24px 20px; margin-top: 48px; }
  .contact, .wip { grid-template-columns: 1fr; gap: 32px; }
  .head { flex-direction: column; align-items: start; gap: 8px; }
  .group { grid-template-columns: 1fr; gap: 12px; }
}
/* very small phones: brand + three header controls must share ~320px */
@media (max-width: 360px) {
  .brand { font-size: 18px; gap: 0; }
  .brand::before { display: none; }
  .menu summary { padding: 10px 12px; }
}
/* snap a full section per scroll; desktop only, because on phones About and Stack are taller than the screen */
@media (min-width: 861px) and (min-height: 640px) {
  html { scroll-snap-type: y mandatory; }
  .screen { scroll-snap-align: start; }
  .hero { scroll-snap-align: start; scroll-margin-top: 68px; } /* lands at y=0 under the sticky bar */
  footer { scroll-snap-align: end; }
}

/* parallax: layers drift at different speeds as a section passes; browsers without scroll timelines skip it */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .portrait img { animation: drift-img linear both; animation-timeline: view(); }
    .hero h1 { animation: drift-up linear both; animation-timeline: view(); animation-range: exit; }
    .screen h2 { animation: drift-in linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
    .group ul, .wip, .contact > div { animation: fade-in linear both; animation-timeline: view(); animation-range: entry 0% entry 100%; }
  }
}
@keyframes drift-img { from { transform: scale(1.12) translateY(-6%); } to { transform: scale(1.12) translateY(6%); } }
@keyframes drift-up { to { transform: translateY(-30%); opacity: .15; } }
@keyframes drift-in { from { transform: translateY(80px); opacity: 0; } }
@keyframes fade-in { from { transform: translateY(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero h1 span, .dot { animation: none; }
}
