/* ============================================================
   Sam Sabeti — personal site
   Quiet editorial system: soft sage paper, pine ink, one red thread.
   ============================================================ */

:root {
  --bg: #EFF0EA;
  --bg-alt: #E7E9E2;
  --ink: #161a18;
  --ink-2: #4a524d;
  --accent: #d63356;
  --footer: #1A3A2B;
  --tile: #F7F8F4;
  --on-dark: #EEF2EE;

  /* RGB channels for translucent variants: rgba(var(--ink-rgb), .14) */
  --ink-rgb: 22, 26, 24;
  --bg-rgb: 239, 240, 234;
  --accent-rgb: 214, 51, 86;
  --footer-rgb: 26, 58, 43;
  --on-dark-rgb: 238, 242, 238;

  --line: rgba(var(--ink-rgb), .14);
  --line-soft: rgba(var(--ink-rgb), .08);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  /* Type scale (~1.25 ratio, fluid at the top end) */
  --step--2: .82rem;    /* small sans labels */
  --step--1: .9rem;     /* sans UI, notes, meta values */
  --step-0: 1.12rem;    /* body */
  --step-1: clamp(1.18rem, 1.5vw, 1.32rem);   /* prose, intros */
  --step-2: clamp(1.5rem, 2.2vw, 1.9rem);     /* subheads, row titles */
  --step-3: clamp(2rem, 3.6vw, 2.9rem);       /* lead statements, contact title */
  --step-4: clamp(3rem, 6.6vw, 5.6rem);       /* hero name */

  /* Spacing */
  --space-2xs: .5rem;
  --space-xs: .75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(56px, 7vw, 96px);   /* between blocks inside a section */
  --space: clamp(80px, 10vw, 140px);    /* section padding */
  --gutter: clamp(20px, 4.5vw, 64px);
  --measure: 58ch;

  /* Grid: narrow label rail + main column */
  --rail: minmax(0, 2fr);
  --main: minmax(0, 7fr);
  --col-gap: clamp(24px, 4vw, 64px);

  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body { padding-top: 60px; }

/* Land each section's top rule just below the nav. */
#about, #work, #contact { scroll-margin-top: calc(76px - var(--space)); }
/* Home (the nav name) goes to the very top, not the hero's edge under the nav. */
#top { scroll-margin-top: 60px; }

h1, h2, h3, .prose p:first-child { text-wrap: balance; }
p { text-wrap: pretty; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

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

.col {
  max-width: 1216px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- links ---------- */

.u-link {
  position: relative;
  text-decoration: none;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s cubic-bezier(.2, .7, .2, 1);
}

.u-link:hover { background-size: 35% 1px; }

/* Social icons — mono glyphs from one inline sprite, tinted by currentColor */

.social {
  display: inline-flex;
  padding: .4rem;
  margin: -.4rem;
  color: var(--ink-2);
  transition: color .25s ease;
}

.social:hover, .social:focus-visible { color: var(--ink); }

.social svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.footer .social { color: rgba(var(--on-dark-rgb), .72); }
.footer .social:hover, .footer .social:focus-visible { color: var(--on-dark); }

/* ============================================================
   NAV — smart-sticky: transparent at top, hides on scroll down,
   slides back with a quiet blurred backdrop on scroll up
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(var(--gutter), calc((100% - 1216px) / 2 + var(--gutter)));
  transition:
    transform .3s ease,
    background-color .3s ease,
    box-shadow .3s ease;
}

.nav.is-scrolled {
  background: rgba(var(--bg-rgb), .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line-soft);
}

.nav.is-hidden { transform: translateY(-100%); }

/* The nav name is the hero name, docked: same serif, tracking and optical
   size; main.js eases the hero's weight up to this one on the way, so the
   hand-off lands glyph-for-glyph. */
.nav__name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 460;          /* heavier than the hero's 360 so it holds up small */
  letter-spacing: -.02em;
  font-variation-settings: "opsz" 72;
  color: var(--ink-2);       /* same grey as the nav links; ink on hover */
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  opacity: 0;
  pointer-events: none;
  transition: color .25s ease, opacity .3s ease;
}

.nav__name-text,
.hero__name {
  display: inline-block;
  line-height: 1;   /* box scales exactly with font size, so the two align */
}

/* While the hero name is flying, the swap is instant (it lands on top of this) */
.has-flight .nav__name { transition: color .25s ease; }

.nav.has-name .nav__name {
  opacity: 1;
  pointer-events: auto;
}


@media (hover: hover) {
  .nav__name:hover { color: var(--ink); }
}

.nav__links { display: flex; gap: clamp(18px, 3vw, 34px); }

.nav__links a {
  position: relative;
  font-family: var(--sans);
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: 4px 0;
  transition: color .25s ease;
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

@media (hover: hover) {
  .nav__links a:hover { color: var(--ink); }
  .nav__links a:hover::after { transform: scaleX(1); }
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: min(max(520px, calc(100svh - 120px)), 720px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
  width: 100%;
  max-width: 1216px;
  margin: 0 auto;
  padding-left: var(--gutter);
}

.hero__title {
  font-size: var(--step-4);
  font-weight: 360;
  line-height: .98;
  letter-spacing: -.02em;
  margin-bottom: var(--space-l);
}

.hero__sub {
  font-size: var(--step-1);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 30em;
  margin-bottom: var(--space-l);
}

.hero__sub p + p { margin-top: 1em; }

.hero__links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

/* Portrait — bleeds to the right edge of the window */

.hero__portrait {
  position: relative;
  justify-self: end;
  /* bleed to the window's right edge, but never overflow the column,
     and never taller than 78svh */
  width: min(100%, calc((100vw - 1216px) / 2 + 100%), calc(78svh * 46 / 52));
  aspect-ratio: 46 / 52;
}

.hero__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 3px 0 0 3px;
  transform: scale(1.07);
  opacity: 0;
  transition:
    transform .9s cubic-bezier(.19, .68, .2, 1) .15s,
    opacity .6s ease .15s;
  will-change: transform;
}

.hero__portrait img.is-in {
  transform: scale(1);
  opacity: 1;
}

/* ============================================================
   GENERIC SECTION SCAFFOLD
   ============================================================ */

.section {
  position: relative;
  padding: var(--space) 0;
}

.section--alt { background: var(--bg-alt); }

.sec-grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail) var(--main);
  column-gap: var(--col-gap);
  padding-top: var(--space-m);
}

/* Section rule spans the content width, not the gutters. */
.sec-grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}

/* Section labels sit in the rail and follow you down the section. */
.sec-label {
  position: sticky;
  top: 88px;
  align-self: start;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink-2);
}

.sec-main { min-width: 0; }

.subhead {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: var(--space-xl) 0 var(--space-xs);
}

.subhead--first { margin-top: 0; }

.sec-note {
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--ink-2);
  margin-bottom: var(--space-l);
}

/* ============================================================
   01 · ABOUT
   ============================================================ */

.prose {
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.72;
}

.prose p + p { margin-top: 1.35em; }

/* The opening line reads as a statement. */
.prose p:first-child {
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.02em;
  max-width: 22ch;
  margin-bottom: .5em;
}

.offduty {
  margin-top: 3.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-soft);
  max-width: var(--measure);
}

.offduty__label {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink-2);
  margin-bottom: .7rem;
}

.offduty p:not(.offduty__label) {
  color: var(--ink-2);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ============================================================
   TIMELINE — a reading line: the rail fills as you scroll,
   each entry wakes as it crosses ~60% of the viewport
   ============================================================ */

.tl {
  --indent: 44px;                        /* text starts this far right of the rail */
  --rail-x: 5.5px;                       /* dot's left edge sits on the column edge */
  --pad: clamp(28px, 3.6vw, 44px);       /* entry top/bottom padding */
  --dot-y: calc(var(--pad) + .88rem * .8);  /* beside the year label */
  --rail-top: var(--dot-y);
  --rail-h: 0px;
  --p: 1;                                /* fill progress, set by main.js */
  position: relative;
  max-width: 720px;
  margin-top: var(--space-xl);
}

.tl__rail {
  position: absolute;
  top: var(--rail-top);
  left: var(--rail-x);
  width: 1px;
  height: var(--rail-h);
  background: var(--line);
  pointer-events: none;
}

/* Ink that runs into the red thread as it reaches "now" */
.tl__fill {
  position: absolute;
  inset: 0 -.25px;
  background: linear-gradient(to bottom,
    rgba(var(--ink-rgb), .7) 0%,
    rgba(var(--ink-rgb), .7) 62%,
    var(--accent) 100%);
  clip-path: inset(0 0 calc(100% - var(--p) * 100%) 0);
}

.tl__head {
  position: absolute;
  top: 0;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 5px rgba(var(--ink-rgb), .07);
  transform: translate(-50%, calc(var(--rail-h) * var(--p) - 50%));
  opacity: 0;
  transition: opacity .4s ease;
}

.tl.is-live .tl__head { opacity: 1; }
.tl.is-done .tl__head, .tl.is-idle .tl__head { opacity: 0; }

.tl__entry {
  position: relative;
  padding: var(--pad) 0 var(--pad) var(--indent);
}

/* Hairline divider starts at the text, so the rail runs clear */
.tl__entry + .tl__entry::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--indent);
  border-top: 1px solid var(--line-soft);
}

.tl__years {
  font-family: var(--sans);
  font-size: .88rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--ink-2);
  margin-bottom: .5rem;
}

.tl__dot {
  position: absolute;
  z-index: 1;
  top: var(--dot-y);
  left: var(--rail-x);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  outline: 5px solid var(--bg);
  transform: translate(-50%, -50%);
  transition:
    background-color .45s ease,
    box-shadow .45s ease,
    transform .55s cubic-bezier(.3, 1.6, .5, 1);
}

.section--alt .tl__dot { outline-color: var(--bg-alt); }

/* One soft ring each time a dot wakes */
.tl__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--ink-rgb), .45);
  opacity: 0;
}

.tl__dot--now { background: var(--accent); }
.tl__dot--now::after { border-color: rgba(var(--accent-rgb), .6); }

.tl:not(.is-live) .tl__dot--now,
.tl.is-live .tl__entry.is-active .tl__dot--now {
  animation: pulse 2.6s ease-in-out .6s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .38); }
  55%      { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0); }
}

@keyframes ping {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(3.2); }
}

.tl__role {
  font-size: var(--step-2);
  font-weight: 560;
  letter-spacing: -.01em;
  line-height: 1.25;
}

.tl__at {
  font-family: var(--sans);
  font-size: .78em;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-2);
}

.tl__desc {
  margin-top: .7rem;
  color: var(--ink-2);
  max-width: 52ch;
}

/* Live state (JS on, motion allowed): entries ahead of the line wait, quiet */
.tl.is-live .tl__years,
.tl.is-live .tl__role,
.tl.is-live .tl__desc {
  transition:
    opacity .7s var(--ease),
    transform .8s var(--ease),
    color .5s ease;
}
.tl.is-live .tl__role { transition-delay: 60ms; }
.tl.is-live .tl__desc { transition-delay: 140ms; }

.tl.is-live .tl__entry:not(.is-active) .tl__years,
.tl.is-live .tl__entry:not(.is-active) .tl__role,
.tl.is-live .tl__entry:not(.is-active) .tl__desc {
  opacity: .28;
  transform: translateY(12px);
  transition-delay: 0ms;
}

.tl.is-live .tl__entry:not(.is-active) .tl__dot {
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px rgba(var(--ink-rgb), .3);
  transform: translate(-50%, -50%) scale(.8);
}
.section--alt .tl.is-live .tl__entry:not(.is-active) .tl__dot { background: var(--bg-alt); }

.tl.is-live .tl__entry.is-active .tl__years { color: var(--ink); }
.tl.is-live .tl__entry.is-active .tl__dot::after { animation: ping .9s var(--ease) both; }

/* ============================================================
   WORK — TEAMS GRID (name at rest, descriptor on hover/tap)
   ============================================================ */

.clients {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.client {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.client__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  height: clamp(116px, 10vw, 136px);
  padding: 1rem;
  text-align: center;
  overflow: hidden;
  transition: background-color .5s var(--ease);
}

/* At rest every logo is flattened to ink so the wall reads as one tone.
   Each logo's width (--lw, set inline) is tuned so they read at the same
   optical size: equal visual area, nudged for how dense the mark is. */
.client__logo {
  width: var(--lw, 96px);
  max-width: 80%;
  height: auto;
  filter: grayscale(1) brightness(0);
  opacity: .62;
  transition:
    filter .5s var(--ease),
    opacity .5s var(--ease),
    transform .6s var(--ease);
}

/* Logos with knocked-out lettering lose it when flattened; keep their tones. */
.client .client__logo--tonal { filter: grayscale(1) contrast(1.1); opacity: .8; }
.client.is-tapped .client__logo--tonal { filter: none; opacity: 1; }

.client__face--sub {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 1rem);   /* same start line in every tile, 1 or 2 lines */
  padding: 0 .9rem;
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.45;
  letter-spacing: .01em;
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity .35s var(--ease),
    transform .5s var(--ease);
}

/* Revealed: by hover on mouse devices, by tap (.is-tapped) on touch. Hover is
   scoped to real pointers so a tap doesn't leave a sticky :hover behind. */
.client.is-tapped .client__inner { background: var(--tile); }

.client.is-tapped .client__logo {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-10px);
}

.client.is-tapped .client__face--sub {
  opacity: 1;
  transform: none;
  transition-delay: .08s;  /* the logo lifts first, the line follows */
}

@media (hover: hover) {
  .client:hover .client__inner { background: var(--tile); }
  .client:hover .client__logo { filter: grayscale(0); opacity: 1; transform: translateY(-10px); }
  .client:hover .client__logo--tonal { filter: none; }
  .client:hover .client__face--sub { opacity: 1; transform: none; transition-delay: .08s; }
}

/* The official stacked wordmark is white; keep it legible on light tiles. */
.client .client__logo--twinmind,
.client:hover .client__logo--twinmind,
.client.is-tapped .client__logo--twinmind {
  filter: brightness(0);
}

/* The link covers the whole tile, so the tile is the click target. */
.client__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.client__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.client:has(.client__link:focus-visible) .client__inner { background: var(--tile); }



/* ============================================================
   WORK — ENGAGEMENT CARDS
   ============================================================ */

.ways { border-bottom: 1px solid var(--line); }

/* Each option is a row: icon | title + subline | body | time and fee. */
.way {
  display: grid;
  grid-template-columns: 26px minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(180px, .7fr);
  grid-template-areas:
    "icon title body meta"
    "icon sub   body meta"
    ".    .     body meta";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(16px, 2.4vw, 32px);
  padding: var(--space-l) 0;
  border-top: 1px solid var(--line);
}

.way__icon {
  grid-area: icon;
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-top: .15rem;
}

/* Icons draw their lines in once the row reveals. Each shape has pathLength="1";
   select by child, not [pathLength] (Chrome won't match that on SVG shapes). */
.way__icon > * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset .9s var(--ease) .25s;
}
.way__icon > :nth-child(2) { transition-delay: .4s; }
.way__icon > :nth-child(n+3) { transition-delay: .55s; }
.way.is-in .way__icon > * { stroke-dashoffset: 0; }

.way__title {
  grid-area: title;
  font-size: clamp(1.4rem, 1.9vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.15;
}

.way__sub {
  grid-area: sub;
  text-wrap: balance;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-2);
  margin-top: .4rem;
}

.way__body {
  grid-area: body;
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.62;
  max-width: 44ch;
}

.way__meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.way__meta > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.way__meta dt {
  font-family: var(--sans);
  font-size: var(--step--2);
  letter-spacing: .01em;
  color: var(--ink-2);
}

.way__meta dd {
  white-space: nowrap;
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  text-align: right;
}

/* ============================================================
   FOOTER / CONTACT
   ============================================================ */

.footer {
  position: relative;
  background: var(--footer);
  color: var(--on-dark);
  padding: calc(var(--space) * .95) 0 40px;
  overflow: clip;
}

.sec-grid--dark::before { background: rgba(var(--on-dark-rgb), .16); }

.footer .sec-label { color: rgba(var(--on-dark-rgb), .55); }

.contact__title {
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--on-dark);
}

.contact__note {
  font-family: var(--sans);
  font-size: .95rem;
  color: rgba(var(--on-dark-rgb), .65);
  margin: var(--space-xs) 0 var(--space-l);
}

/* Contact form — quiet hairlines on pine */

.cform {
  max-width: 560px;
  margin: 0 0 var(--space-l);
}

.cform__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(24px, 4vw, 48px);
}

.cform__field { margin-bottom: 2rem; }

.cform__label {
  display: block;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .01em;
  color: rgba(var(--on-dark-rgb), .55);
  margin-bottom: .45rem;
}

.cform__input {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(var(--on-dark-rgb), .26);
  border-radius: 0;
  padding: .5rem 0 .65rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 450;
  color: var(--on-dark);
  caret-color: var(--on-dark);
  transition: border-color .25s ease;
}

.cform__input::placeholder { color: rgba(var(--on-dark-rgb), .35); }

.cform__input:focus {
  outline: none;
  border-bottom-color: rgba(var(--on-dark-rgb), .8);
}

.cform__input--area {
  resize: vertical;
  min-height: 3.2em;
  line-height: 1.55;
}

.cform__foot {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.cform__send {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(var(--on-dark-rgb), .4);
  border-radius: 999px;
  color: var(--on-dark);
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .72em 1.9em;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease;
}

.cform__send:hover {
  background: rgba(var(--on-dark-rgb), .1);
  border-color: rgba(var(--on-dark-rgb), .75);
}

.cform__send:disabled { opacity: .55; cursor: default; }

.cform__status {
  font-family: var(--sans);
  font-size: .9rem;
  font-style: italic;
  color: rgba(var(--on-dark-rgb), .72);
  margin: 0;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.35rem;
  margin-bottom: var(--space-xl);
}

.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(var(--on-dark-rgb), .16);
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .01em;
  color: rgba(var(--on-dark-rgb), .5);
}

.footer__made {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.footer__mark { height: 18px; width: auto; opacity: .8; }

/* ============================================================
   REVEAL ON SCROLL — quick, quiet
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .45s ease,
    transform .45s ease;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   SCROLL TOUCHES (main.js adds the classes; all off with reduced motion)
   ============================================================ */

/* Hero name hand-off: main.js scrubs a translate + scale so the name travels
   up and docks exactly onto the nav name, then swaps to it. */
.hero__name {
  position: relative;
  z-index: 61;                 /* rides over the fixed nav (60) while docking */
  font-variation-settings: "opsz" 72;
  transform-origin: 0 0;
}
.has-flight .hero__name { will-change: transform; }
.hero__name.is-docked { visibility: hidden; }

/* About lead line: words ink in as they pass the reading line */
.lead-word { transition: color .5s var(--ease); }
.is-reading .lead-word { color: rgba(var(--ink-rgb), .2); }
.is-reading .lead-word.is-lit { color: var(--ink); }

/* Page tint: the background eases between the two section shades as a
   boundary crosses mid-screen, instead of a hard edge. @property lets the
   color itself transition; its initial value mirrors --bg. */
@property --page {
  syntax: "<color>";
  inherits: true;
  initial-value: #EFF0EA;
}

html.has-tint {
  --page: var(--bg);
  transition: --page .9s var(--ease);
}
html.has-tint.on-alt { --page: var(--bg-alt); }
html.has-tint body { background: var(--page); }
html.has-tint .section--alt { background: transparent; }
html.has-tint .tl__dot { outline-color: var(--page); }
html.has-tint .tl.is-live .tl__entry:not(.is-active) .tl__dot { background: var(--page); }
html.has-tint .nav.is-scrolled { background: color-mix(in srgb, var(--page) 88%, transparent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Filler cells complete the last row of the logo wall: 13 logos + 3 at 4 columns. */
.client--filler { display: block; }

@media (max-width: 1080px) {
  .clients { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client--filler:last-child { display: none; }
}

@media (max-width: 900px) {
  .hero {
    min-height: 0;
    padding-top: 40px;
    justify-content: flex-start;
  }
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero__portrait {
    width: calc(100% + var(--gutter));
    max-width: 520px;
    justify-self: end;
    aspect-ratio: 5 / 4;
  }
  .hero__portrait img { object-position: 50% 18%; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-label { position: static; margin-bottom: var(--space-l); }
  .way {
    grid-template-columns: 26px minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "icon sub"
      ".    body"
      ".    meta";
    grid-template-rows: auto;
    row-gap: 0;
  }
  .way__body { margin-top: var(--space-s); max-width: none; }
  .way__meta { margin-top: var(--space-m); max-width: 420px; }
}

@media (max-width: 720px) {
  body { font-size: 1.06rem; }
  .clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client--filler:nth-last-child(2) { display: none; }
  .client__inner { height: 120px; }
  .client__logo { width: calc(var(--lw, 96px) * .88); }  /* scale all evenly so none hit the cap */
  .client__face--sub { font-size: .74rem; top: calc(50% + .85rem); padding: 0 .65rem; line-height: 1.4; }
  .client.is-tapped .client__logo,
  .client:hover .client__logo { transform: translateY(-9px); }
  .tl { --indent: 34px; }
  .cform__row { grid-template-columns: 1fr; }
  .cform__input { font-size: 1.02rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal], .hero__portrait img { opacity: 1; transform: none; transition: none; }
  .tl__dot--now, .tl__dot::after { animation: none !important; }
  .way__icon > * { stroke-dashoffset: 0; transition: none; }
  .nav__links a::after, .u-link, .social { transition: none; }
  .nav, .nav__name { transition: none; }
  .client__inner, .client__logo, .client__face--sub { transition: none; }
  .cform__input, .cform__send { transition: none; }
}
