/* partain.dev — Split Portrait. Light mode, phone first, one column on phones.
   Desktop: a 4:5 portrait in the left column, the headline block vertically centred in the right, the three stats
   pinned to the bottom of that column. Then Pep AI and Milo as two big wash panels, Castline as a full-width third
   (copy left, three AI takes right), the other five behind one
   full-width hairline row (a native <details>), About in two columns.
   White paper, near-black ink (never #000), wash panels, hairlines; cobalt only for focus. Geist / Geist Mono.
   Six type sizes, each with one job: display 44–84 (the headline) / title 32–48 (panel names) / statement 24–32
   (section heads, the About statement, numbers) / lede 20 / body 18 (also the big buttons) / small 15. No JS. */

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Tokens ────────────────────────────────────────────────────────── */
:root {
  --f-body: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* paper + ink — AA on white; on the wash panels secondary text steps up to ink-2 (ink-3 is 4.46:1 there) */
  --paper: #ffffff;
  --wash: #f5f5f7;
  --ink: #1b1c20;           /* 16.9:1 */
  --ink-hover: #34363d;
  --ink-2: #55585f;         /* 7.2:1 on white, 6.5:1 on wash */
  --ink-3: #6e7179;         /* 4.9:1 on white only */
  --hair: #e8e8eb;
  --hair-2: #d6d7dc;
  --cobalt: #2558f0;        /* focus rings */

  /* layout — phone first */
  --container: 1200px;
  --gutter: 20px;
  --section-y: 80px;
  --nav-h: 64px;
  --hero-gap: 28px;
  --portrait-w: 100%;
  --portrait-r: 20px;
  --panel-r: 24px;
  --panel-pad: 24px;
  --thumb-r: 14px;

  /* spacing scale */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 48px; --s-10: 64px; --s-11: 96px;

  /* buttons: BIG in the hero and About (56 / 18px), small in the nav and panels (44 / 15px) */
  --btn-h: 56px;
  --btn-px: 28px;
  --btn-s-h: 44px;
  --btn-s-px: 18px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.22, .7, .2, 1);
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --nav-h: 72px; --section-y: 112px; --hero-gap: 40px; --portrait-r: 24px; --panel-pad: 40px; }
}
@media (min-width: 1200px) {
  :root { --gutter: 48px; --nav-h: 80px; --section-y: 136px; --hero-gap: 96px; }
}

/* ── Type ramp ── */
.t-display   { font-family: var(--f-body); font-weight: 600; font-size: clamp(44px, 6vw, 84px); line-height: .98; letter-spacing: -.045em; }
.t-title     { font-family: var(--f-body); font-weight: 600; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.02; letter-spacing: -.035em; }
.t-statement { font-family: var(--f-body); font-weight: 500; font-size: clamp(24px, 2.3vw, 32px); line-height: 1.28; letter-spacing: -.022em; }
.t-lede      { font-family: var(--f-body); font-weight: 400; font-size: 20px; line-height: 1.5; letter-spacing: -.005em; }
.t-body      { font-family: var(--f-body); font-weight: 400; font-size: 18px; line-height: 1.55; }
.t-small     { font-family: var(--f-body); font-weight: 400; font-size: 15px; line-height: 1.45; }
@media (max-width: 599px) { .t-lede { font-size: 18px; } .t-body { font-size: 17px; } }

/* ── Components ──────────────────────────────────────────────────── */

/* ── Base ── */
html { background: var(--paper); }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 18px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
::selection { background: var(--ink); color: var(--paper); }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }
.i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); }
.skip:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--section-y); }

/* ── Buttons ── */
.btn, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--btn-h); padding: 0 var(--btn-px);
  border-radius: var(--radius-pill); font-size: 18px; font-weight: 500; line-height: 1; white-space: nowrap; letter-spacing: -.005em;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn { background: var(--ink); color: var(--paper); }
.btn:hover { background: var(--ink-hover); transform: translateY(-1px); }
.ghost { border: 1px solid var(--hair-2); color: var(--ink); background: transparent; }
.ghost:hover { background: var(--wash); border-color: var(--ink-3); }
.btn .i, .ghost .i { font-size: 20px; }
.btn--s, .ghost--s { height: var(--btn-s-h); padding: 0 var(--btn-s-px); font-size: 15px; gap: 6px; }
.btn--s .i, .ghost--s .i { font-size: 16px; }

/* quiet text links (the five) */
.go { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-inline: 2px; color: var(--ink); font-size: 15px; font-weight: 500; }
.go .i { font-size: 14px; color: var(--ink-3); }
.go:hover { text-decoration: underline; text-underline-offset: 4px; }
.go:hover .i { color: var(--ink); }

/* ── Nav: name left, three section links right (the hero's big Book a call sits in the first screen at every width) ── */
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); height: var(--nav-h); }
.nav__brand { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.nav__brand:hover { color: var(--ink-2); }
.nav__links { display: flex; gap: 2px; margin-right: -10px; }
.nav__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 15px; color: var(--ink-2); transition: background-color .2s, color .2s; }
.nav__links a:hover { color: var(--ink); background: var(--wash); }

/* ── Hero ── */
.hero { padding-top: var(--s-2); }
.hero__grid { display: grid; gap: var(--hero-gap); }
.portrait { position: relative; width: var(--portrait-w); aspect-ratio: 4 / 5; margin: 0; overflow: hidden; border-radius: var(--portrait-r); background: #2a2b30; align-self: start; }
/* the 720² seated portrait, nudged in so the face carries the frame */
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transform: scale(1.14); transform-origin: 50% 12%; }
.hero__col { display: flex; flex-direction: column; gap: var(--s-8); }
.hero__main { display: grid; justify-items: start; }
.hero__eyebrow { color: var(--ink-3); }
.hero__title { margin-top: var(--s-3); text-wrap: balance; padding-bottom: .04em; }
.hero__lede { margin-top: var(--s-5); color: var(--ink-2); max-width: 32ch; text-wrap: pretty; }
.hero__actions { display: grid; gap: var(--s-3); width: 100%; margin-top: var(--s-7); }
.hero__actions > a { width: 100%; }

/* the three stats: a hairline row at the foot of the column */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hair-2); }
.stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: var(--s-4) var(--s-3) 0 0; }
.stats > div + div { padding-left: var(--s-4); border-left: 1px solid var(--hair); }
.stats dt { color: var(--ink-3); font-size: 15px; line-height: 1.35; }
.stats dd { font-size: clamp(24px, 2.3vw, 32px); font-weight: 600; line-height: 1.15; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ── Section head ── */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-4); margin-bottom: var(--s-7); }
.sec-head__title { font-weight: 600; }
.sec-head__note { color: var(--ink-3); }

/* ── Work: two large wash panels ── */
.panels { display: grid; gap: var(--s-4); }
.panel { display: flex; flex-direction: column; gap: var(--s-6); padding: var(--panel-pad); border-radius: var(--panel-r); background: var(--wash); }
.panel__head { display: grid; gap: var(--s-2); }
.panel__kicker { color: var(--ink-2); }
.panel__name { padding-bottom: .04em; }
.panel__stage { flex: 1; display: grid; place-items: center; padding-block: var(--s-6); }
.panel__icon { width: clamp(132px, 34vw, 184px); height: auto; aspect-ratio: 1; border-radius: 22.5%;
  box-shadow: 0 0 0 1px rgba(27, 28, 32, .06), 0 22px 40px -22px rgba(27, 28, 32, .38); }
.panel__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--hair-2); }
.panel__nums > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: var(--s-4) var(--s-2) var(--s-4) 0; }
.panel__nums > div + div { padding-left: var(--s-4); border-left: 1px solid var(--hair-2); }
.panel__nums dt { color: var(--ink-2); font-size: 15px; line-height: 1.35; }
.panel__nums dd { font-size: clamp(22px, 2.3vw, 32px); font-weight: 600; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.panel__foot { display: grid; justify-items: start; gap: var(--s-3); }
.panel__foot .t-body { max-width: 46ch; }
.panel__meta { color: var(--ink-2); }
.panel .ghost { margin-top: var(--s-2); border-color: var(--hair-2); }
/* Castline: three AI takes (9:16 ad frames) fanned like phones on a table. */
.takes { display: flex; justify-content: center; align-items: center; }
.takes img { width: clamp(96px, 24vw, 168px); height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(27, 28, 32, .06), 0 22px 40px -22px rgba(27, 28, 32, .45); }
.takes img:nth-child(1) { transform: rotate(-6deg) translateX(14%); }
.takes img:nth-child(2) { position: relative; z-index: 1; transform: translateY(-4%); }
.takes img:nth-child(3) { transform: rotate(6deg) translateX(-14%); }
.panel .ghost:hover { background: var(--paper); border-color: var(--ink-3); }

/* ── More projects: a full-width hairline row that opens a thumbnail grid ── */
:root { interpolate-size: allow-keywords; }
.more { margin-top: var(--s-10); border-block: 1px solid var(--hair-2); }
.more__sum { display: flex; align-items: center; gap: var(--s-3); min-height: 80px; cursor: pointer; list-style: none; -webkit-user-select: none; user-select: none; }
.more__sum::-webkit-details-marker { display: none; }
.more__title { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.more__count { font-size: 20px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: -4px; }
.more__names { display: none; margin-left: auto; color: var(--ink-3); font-size: 15px; transition: color .2s; }
.more__chev { display: grid; place-items: center; width: 44px; height: 44px; margin-left: auto; flex: none; border: 1px solid var(--hair-2); border-radius: 50%;
  font-size: 18px; color: var(--ink); transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .35s var(--ease); }
.more__sum:hover .more__chev { background: var(--wash); border-color: var(--ink-3); }
.more__sum:hover .more__names { color: var(--ink-2); }
.more[open] .more__chev { transform: rotate(180deg); }
.more[open] .more__names { visibility: hidden; }
.more::details-content { height: 0; overflow: clip; transition: height .45s var(--ease), content-visibility .45s allow-discrete; }
.more[open]::details-content { height: auto; }

.grid { display: grid; gap: var(--s-9) var(--s-7); padding-block: var(--s-6) var(--s-9); }
.card { display: grid; align-content: start; }
.card__thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--thumb-r); background: #0d0f15; box-shadow: 0 0 0 1px var(--hair); }
.card__thumb > img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card__thumb > .slab__screen { position: absolute; inset: 0; }
.card__kicker { margin-top: var(--s-4); color: var(--ink-3); }
.card__name { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.card__line { margin-top: var(--s-2); color: var(--ink); max-width: 46ch; }
.card__meta { margin-top: var(--s-1); color: var(--ink-3); }
.card__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin-top: var(--s-1); }

/* ── Illustrated screens (from r8/v01, container-query sized): AI Ad Studio, AlgolRun ── */
.slab__screen { position: relative; overflow: hidden; background: #0d0f15; }
.slab__screen.ad { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr auto; gap: 4.5% 5%; padding: 5.5% 6% 5%;
  background: radial-gradient(90% 80% at 80% 10%, #121a33 0%, #05070d 70%); container-type: inline-size; }
.ad__label { font-family: var(--f-mono); font-size: 2.1cqw; letter-spacing: .14em; text-transform: uppercase; color: #8a92a4; }
.ad__brief { display: grid; align-content: start; gap: 3cqw; padding-top: 2cqw; }
.ad__prompt { font-size: 4.6cqw; line-height: 1.15; letter-spacing: -.03em; font-weight: 500; color: #f3f5f9; }
.ad__agent { display: inline-flex; align-items: center; gap: 1.4cqw; justify-self: start; padding: 1.2cqw 2.2cqw; border-radius: 99px; border: 1px solid rgba(200, 212, 240, .28); font-size: 2.3cqw; color: #b9c0cf; }
.ad__agent i { width: 1.4cqw; height: 1.4cqw; border-radius: 50%; background: #5d86ff; }
.ad__preview { position: relative; justify-self: center; height: 100%; aspect-ratio: 9 / 16; max-height: 46cqw; overflow: hidden; border-radius: 2.2cqw; padding: 3cqw;
  display: grid; align-content: start; gap: 2.4cqw;
  background: radial-gradient(120% 70% at 50% 110%, #2558f0 0%, #12245f 45%, #070a14 80%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
.ad__preview b { position: relative; z-index: 1; font-size: 4.4cqw; line-height: 1; letter-spacing: -.04em; font-weight: 600; color: #fff; }
.ad__orb { position: absolute; left: 50%; bottom: -30%; width: 86%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle at 50% 18%, #e8eeff 0%, #7d9cff 12%, #2558f0 34%, #0b1640 70%); }
.ad__timeline { grid-column: 1 / -1; position: relative; display: grid; grid-template-columns: repeat(8, 1fr) auto; gap: 1.2cqw; align-items: center; padding-top: 2cqw; border-top: 1px solid rgba(200, 212, 240, .14); }
.ad__timeline i { aspect-ratio: 9 / 12; border-radius: .8cqw; background: linear-gradient(180deg, #1b2a5c, #2558f0 140%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ad__timeline i:nth-child(odd) { background: linear-gradient(180deg, #2a2f3a, #0d0f15); }
.ad__timeline i:nth-child(3) { box-shadow: inset 0 0 0 1px #8eadff; }
.ad__head { position: absolute; left: 26%; top: 0; bottom: -1cqw; width: 2px; background: #fff; }
.ad__export { margin-left: 1cqw; padding: 1cqw 2cqw; border-radius: 99px; background: #fff; color: #05070d; font-family: var(--f-mono); font-size: 2.2cqw; font-weight: 500; }

.slab__screen.run { background: #04060c; container-type: inline-size; }
.run__sky { position: absolute; inset: 0 0 46% 0; background: linear-gradient(180deg, #03050b 0%, #0b1537 70%, #2a4fc9 100%); }
.run__floor { position: absolute; inset: 54% 0 0 0; overflow: hidden; background: linear-gradient(180deg, #0a1230, #04060c 60%); }
.run__floor svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.run__rails path { fill: none; stroke: rgba(142, 173, 255, .5); stroke-width: .25; vector-effect: non-scaling-stroke; }
.run__ties path { fill: none; stroke: rgba(142, 173, 255, .38); stroke-width: 1; vector-effect: non-scaling-stroke; }
.run__lane { fill: rgba(37, 88, 240, .22); }
.run__floor::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #cfdcff 50%, transparent); z-index: 1; }
.run__runner { position: absolute; left: 50%; top: 66%; width: 7cqw; aspect-ratio: 1; transform: translateX(-50%); }
.run__runner i { position: absolute; inset: 0; border-radius: 1.2cqw; background: linear-gradient(150deg, #ffffff, #b9c4dc 45%, #4a5674); box-shadow: 0 2.4cqw 2cqw -1cqw rgba(37, 88, 240, .7); }
.run__title { position: absolute; left: 0; right: 0; top: 16%; display: grid; justify-items: center; gap: 1.6cqw; text-align: center; }
.run__title b { font-size: 10cqw; font-weight: 600; letter-spacing: -.05em; line-height: .9; color: transparent; background: linear-gradient(180deg, #ffffff 0%, #e8ebf1 42%, #a6adbb 100%); -webkit-background-clip: text; background-clip: text; }
.run__title span { font-family: var(--f-mono); font-size: 2.2cqw; letter-spacing: .16em; text-transform: uppercase; color: #b9c0cf; }

/* ── About: a large statement left; interests + contact right ── */
.work { padding-bottom: 0; }   /* the More projects hairline closes Work; About needs no second rule */
.about__grid { display: grid; gap: var(--s-9); }
.about__label { color: var(--ink-3); margin-bottom: var(--s-3); font-weight: 400; }
.about__statement { max-width: 22em; text-wrap: pretty; }
.about__em { color: var(--ink-3); }
.about__right { display: grid; gap: var(--s-8); }
.rows { border-top: 1px solid var(--hair); }
.row { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding-block: var(--s-2); border-bottom: 1px solid var(--hair); font-size: 18px; }
.row--link { transition: color .2s; }
.row--link .i { font-size: 18px; color: var(--ink-3); }
.row__text { min-width: 0; overflow-wrap: anywhere; }
.row__ne { margin-left: auto; }
.row--link:hover .row__text { text-decoration: underline; text-underline-offset: 4px; }
.row--link:hover .i { color: var(--ink); }
.about__cta { margin-top: var(--s-6); width: 100%; }

/* ── Footer ── */
.foot { border-top: 1px solid var(--hair); }
.foot__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-6); padding-block: var(--s-4) var(--s-7); }
.foot p { color: var(--ink-3); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); }
.foot__links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink-2); }
.foot__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* ── 404: one line, one way home ── */
.lost { min-height: calc(100svh - var(--nav-h)); display: grid; align-content: center; justify-items: center; gap: var(--s-4); padding-block: 48px 120px; text-align: center; }
.lost__code { color: var(--ink-3); }
.lost__lede { color: var(--ink-2); max-width: 34ch; }
.lost .btn { margin-top: var(--s-4); }

/* ── Tablet ── */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__actions { display: flex; flex-wrap: wrap; width: auto; }
  .hero__actions > a { width: auto; }
  .about__cta { width: auto; }
}
@media (min-width: 768px) {
  .nav__links { gap: var(--s-1); margin-right: -14px; }
  .nav__links a { padding: 0 14px; }
  .hero { padding-top: var(--s-4); }
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 28px; }
  .panel--wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "head stage" "nums stage" "foot stage"; column-gap: var(--s-10); row-gap: var(--s-6); align-content: start; }
  .panel--wide .panel__head { grid-area: head; }
  .panel--wide .panel__nums { grid-area: nums; }
  .panel--wide .panel__foot { grid-area: foot; }
  .panel--wide .takes { grid-area: stage; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .hero__col { justify-content: space-between; }
  .hero__main { margin-block: auto; }
  .hero__lede { font-size: 18px; }
}
@media (min-width: 900px) {
  .panels { gap: var(--s-6); }
  .panel { min-height: 680px; }
  .panel--wide { min-height: 0; }
  .more__names { display: inline; }
  .more__chev { margin-left: var(--s-4); }
  .about__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s-10); }
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__grid { grid-template-columns: min(432px, 40%) minmax(0, 1fr); }
  .hero__lede { font-size: 20px; }
}
@media (min-width: 1200px) { .panel { padding: var(--panel-pad); } }

/* ── Reduced motion: no transitions, the five open instantly ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
