/* Specia1ne-inspired system for Aleksandar */

:root {
  --color-background: #fcfcfc;
  --color-surface: #f4f4f1;
  --color-foreground: #121210;
  --color-body: #3a3a36;
  --color-muted: #706e63;
  --color-faint: #b6b5ab;
  --color-soft: rgba(18, 18, 16, 0.64);
  --color-hairline: rgba(18, 18, 16, 0.12);
  --color-hairline-strong: rgba(18, 18, 16, 0.22);
  --color-accent: #004fff;
  --color-accent-rgb: 0, 79, 255;
  --color-accent-fg: #fcfcfc;
  /* Alphas floored where they land on the accent panel: 0.86 is the point at
     which 12px mono still clears 4.5:1 against #004fff. Hierarchy on that panel
     comes from size and case, not from fading text out. */
  --color-inverted-faint: rgba(252, 252, 252, 0.62);
  --color-inverted-soft: rgba(252, 252, 252, 0.92);
  --color-inverted-muted: rgba(252, 252, 252, 0.86);
  --color-inverted-line: rgba(252, 252, 252, 0.4);
  --color-inverted-hairline: rgba(252, 252, 252, 0.22);

  --font-sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-emph: cubic-bezier(0.16, 1, 0.3, 1);

  --site-gutter: clamp(1.5rem, 0.607rem + 3.214vw, 3.5rem);
  --site-max: 100rem;

  /* Vertical rhythm — sections need room to breathe at this type scale. */
  --section-pad: clamp(4.5rem, 8vw, 7.5rem);
  --heading-gap: clamp(2.25rem, 4.5vw, 3.5rem);

  /* Axis geometry. The spine sits left of centre: right-aligned headings need
     less room than the body copy beside them. --chip-size keeps the marker
     centred on the line without magic numbers. */
  --axis-x: 44%;
  --chip-size: 1.5rem;

  --measure: 36rem;

  --rail-x: 58%;
  --rail-w: 0px;
  --rail-o: 0;
  --header-h: 4.4rem;
}

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

html {
  scroll-behavior: smooth;
  background: var(--color-background);
  color: var(--color-foreground);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.56;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

body.is-locked {
  overflow: hidden;
}

[x-cloak] {
  display: none !important;
}

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

a {
  color: inherit;
}

:where(a, button, summary, input, textarea):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.site-gutter {
  padding-inline: var(--site-gutter);
}

.shell {
  margin-inline: auto;
  width: 100%;
  max-width: var(--site-max);
}

/* Skip link — long single page, keyboard users shouldn't re-tab the header. */
.skip-link {
  position: absolute;
  left: var(--site-gutter);
  top: 0;
  z-index: 80;
  padding: 0.6rem 0.9rem;
  background: var(--color-accent);
  color: var(--color-accent-fg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-120%);
  transition: transform 0.18s var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline-offset: -2px;
}

/* —— Typography —— */
.display {
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.94;
  text-wrap: balance;
}

.display-xl {
  font-size: clamp(2.75rem, 8vw, 6.3rem);
}

.display-lg {
  font-size: clamp(2rem, 4.8vw, 3.5rem);
}

.display-md {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 700;
  text-wrap: balance;
}

.body-lg {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.55;
  color: var(--color-body);
  text-wrap: pretty;
}

.meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* Drop the hard break in display headings once the measure can't carry it. */
@media (max-width: 47.999rem) {
  br.br-wide {
    display: none;
  }
}

/* —— Text link underline —— */
.text-link {
  position: relative;
  display: inline-block;
  max-width: 100%;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.22s var(--ease-out);
}

.text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.12em;
  left: 0;
  border-top: 1px solid currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.26s var(--ease-emph);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--color-accent);
}

.text-link:hover::after,
.text-link:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.text-link--resting::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.12em;
  left: 0;
  border-top: 1px solid currentColor;
  opacity: 0.55;
}

/* Bracket CTA */
.bracket-cta {
  position: relative;
  display: inline-flex;
  /* Baseline, not centre: keeps the brackets on the first line when the label
     wraps instead of floating them at the block's mid-height. */
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: 0;
  /* Negative margin keeps the optical alignment while the padding grows the
     hit area to a usable size. */
  margin: -0.65rem -0.5rem;
  padding: 0.65rem 0.5rem;
  color: var(--color-foreground);
  cursor: pointer;
  font: inherit;
  transition: color 0.22s var(--ease-out);
}

.bracket-cta .br {
  color: var(--color-accent);
  font-weight: 500;
  transition: transform 0.16s var(--ease-out);
}

.bracket-cta:hover .br-l,
.bracket-cta:focus-visible .br-l {
  transform: translate(calc(-3px + var(--br-x, 0px)), var(--br-y, 0px));
}

.bracket-cta:hover .br-r,
.bracket-cta:focus-visible .br-r {
  transform: translate(calc(3px + var(--br-x, 0px)), var(--br-y, 0px));
}

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

.bracket-cta--lg {
  font-size: clamp(1.35rem, 3.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* The header CTA has to hold one line beside the wordmark. Below 48rem the
   full question either wraps or crowds the wordmark, so it swaps for the short
   label — which is what the case-study headers already say. */
.bracket-cta--nowrap {
  white-space: nowrap;
}

.cta-label--short {
  display: none;
}

@media (max-width: 47.999rem) {
  .cta-label--full {
    display: none;
  }

  .cta-label--short {
    display: inline;
  }
}

/* —— Wordmark —— */
.site-mark {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--color-foreground);
}

.site-mark__suffix {
  color: var(--color-accent);
}

/* —— Axis layout —— */
.axis-shell {
  position: relative;
}

.axis-shell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--axis-x);
  width: 1px;
  background: var(--color-hairline);
  transform: translateX(-0.5px);
  pointer-events: none;
}

#how-i-work .axis-shell::before {
  background: rgba(var(--color-accent-rgb), 0.5);
}

/* Mobile: the spine moves into the marker gutter and gains a fill that tracks
   how far you've read. --spine-fill is set per shell by js/site-motion.js. */
@media (max-width: 767px) {
  .axis-shell::before,
  .axis-shell::after {
    left: calc(var(--chip-size) / 2);
  }

  .axis-shell::after {
    content: "";
    position: absolute;
    top: 0;
    width: 1px;
    height: var(--spine-fill, 0px);
    background: var(--color-accent);
    transform: translateX(-0.5px);
    pointer-events: none;
  }

  .panel-accent .axis-shell::after {
    background: var(--color-accent-fg);
  }

  /* The fit axis draws its own spine, so it keeps the hairline here too. */
  .fit-axis.axis-shell::before {
    background: var(--color-hairline);
  }
}

@media (prefers-reduced-motion: reduce) {
  .axis-shell::after {
    display: none;
  }
}

.axis-chip {
  display: inline-grid;
  place-items: center;
  width: var(--chip-size);
  height: var(--chip-size);
  flex-shrink: 0;
  background: var(--color-background);
  color: var(--color-accent);
  border: 1px solid rgba(var(--color-accent-rgb), 0.4);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
  transition:
    background 0.28s var(--ease-out),
    border-color 0.28s var(--ease-out),
    color 0.28s var(--ease-out);
}

.axis-chip.is-lit {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-fg);
}

/* Principles: the current row reads at full strength, the rest step back far
   enough to register as secondary but not so far that they stop being legible.
   0.72 is the floor — below it, 18px body copy drops under 4.5:1. */
.axis-row[data-principle]:not(.is-focus):not(.is-passed) .axis-row__left,
.axis-row[data-principle]:not(.is-focus):not(.is-passed) .axis-row__right {
  opacity: 0.72;
  transition: opacity 0.28s var(--ease-out);
}

.axis-row[data-principle].is-focus .axis-row__left,
.axis-row[data-principle].is-focus .axis-row__right,
.axis-row[data-principle].is-passed .axis-row__left,
.axis-row[data-principle].is-passed .axis-row__right {
  opacity: 1;
}

.axis-row {
  position: relative;
  display: grid;
  gap: 1rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--color-hairline);
}

/* Mobile: the marker moves into a gutter beside the heading instead of
   sitting orphaned on its own line. */
@media (max-width: 767px) {
  .axis-row {
    grid-template-columns: var(--chip-size) minmax(0, 1fr);
    grid-template-areas:
      "chip head"
      ".    body";
    column-gap: 0.85rem;
    row-gap: 0.85rem;
    align-items: start;
  }

  .axis-row__chip {
    grid-area: chip;
    margin-top: 0.2rem;
    justify-self: center;
  }

  .axis-row__left {
    grid-area: head;
  }

  .axis-row__right {
    grid-area: body;
  }
}

@media (min-width: 768px) {
  .axis-row {
    grid-template-columns:
      calc(var(--axis-x) - var(--chip-size) / 2)
      var(--chip-size)
      minmax(0, 1fr);
    align-items: start;
    /* No column gap: a gap is inserted *after* the percentage column, which
       would push the marker off the spine by exactly the gap width. The cells
       carry their own inline padding instead. */
    gap: 1.25rem 0;
    padding-block: 2.25rem;
  }

  .axis-row__left {
    text-align: right;
    padding-right: 1.25rem;
  }

  .axis-row__chip {
    position: relative;
    z-index: 1;
    margin-top: 0.2rem;
  }

  .axis-row__right {
    padding-left: 1.25rem;
    max-width: calc(var(--measure) + 1.25rem);
  }
}

.axis-row:last-child {
  border-bottom: 1px solid var(--color-hairline);
}

/* Where I fit — Specia1ne spine + axis */
.fit-axis.axis-shell::before {
  background: rgba(var(--color-accent-rgb), 0.45);
}

.fit-axis .axis-row,
.fit-axis .axis-row:last-child {
  border-top: 0;
  border-bottom: 0;
}

@media (min-width: 768px) {
  .fit-axis .axis-row {
    align-items: center;
  }
}

.fit-dot {
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0;
  justify-self: center;
  align-self: center;
  background: var(--color-accent);
  border: 0;
  color: transparent;
  font-size: 0;
}

@media (min-width: 768px) {
  .fit-dot {
    margin-top: 0;
  }
}

/* —— Accent / inverted work panel —— */
.panel-accent {
  background: var(--color-accent);
  color: var(--color-accent-fg);
}

.panel-accent .meta {
  color: var(--color-inverted-muted);
}

.panel-accent .body-lg,
.panel-accent .text-muted {
  color: var(--color-inverted-soft);
}

.panel-accent .section-kicker {
  color: var(--color-inverted-muted);
}

.panel-accent .section-kicker__num {
  color: var(--color-accent-fg);
}

.panel-accent .section-kicker::after {
  border-color: var(--color-inverted-hairline);
}

.panel-accent .axis-shell::before {
  background: var(--color-inverted-hairline);
}

.panel-accent .axis-row {
  border-color: var(--color-inverted-hairline);
}

.panel-accent .axis-chip {
  /* Opaque so the spine doesn't run straight through the marker. */
  background: var(--color-accent);
  border-color: var(--color-inverted-line);
  color: var(--color-accent-fg);
}

.panel-accent .axis-chip.is-lit {
  background: var(--color-accent-fg);
  border-color: var(--color-accent-fg);
  color: var(--color-accent);
}

/* Resting state has to be readable on its own — hover is an emphasis, not the
   only legible state, and touch devices never get it at all. */
.work-item {
  color: var(--color-accent-fg);
  margin-inline: -1.25rem;
  padding-inline: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.24s var(--ease-out),
    box-shadow 0.24s var(--ease-out);
}

.work-item.is-active {
  background: rgba(252, 252, 252, 0.11);
  box-shadow:
    inset 3px 0 0 var(--color-accent-fg),
    inset 0 0 0 1px var(--color-inverted-hairline);
}

.work-item:focus-visible {
  outline: 2px solid var(--color-accent-fg);
  outline-offset: 3px;
}

.work-item .work-item__detail {
  display: block;
}

.work-item__arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-accent-fg);
  opacity: 0.88;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition:
    opacity 0.22s var(--ease-out),
    transform 0.26s var(--ease-emph);
}

.work-item.is-active .work-item__arrow {
  opacity: 1;
  transform: translateX(5px);
}

@media (max-width: 767px), (hover: none) {
  .panel-accent .work-item {
    margin-inline: calc(-1 * var(--site-gutter));
    padding-inline: var(--site-gutter);
  }

  .work-item.is-active {
    background: transparent;
    box-shadow: none;
  }

  .work-item.is-active .work-item__arrow {
    transform: none;
  }

  .work-item.is-scroll-focus .work-item__arrow {
    transform: translateX(4px);
  }
}

/* —— Header —— */
.site-header {
  position: relative;
  z-index: 40;
  background: transparent;
  border-bottom: 0;
  view-transition-name: site-header;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

/* Inverted copy of the header revealed where the hero rail passes under it.
   Content is cloned from the live header at boot — see js/site-motion.js. */
.site-header__band {
  display: none;
  position: absolute;
  inset: 0;
  padding-inline: var(--site-gutter);
  pointer-events: none;
  opacity: var(--rail-o);
  clip-path: inset(
    0 calc(100% - var(--rail-x) - var(--rail-w) / 2) 0
      calc(var(--rail-x) - var(--rail-w) / 2)
  );
}

.site-header__band .site-mark,
.site-header__band .site-mark__suffix,
.site-header__band .bracket-cta,
.site-header__band .bracket-cta .br {
  color: var(--color-accent-fg);
}

/* —— Hero + cursor rail (full viewport height, under header) —— */
.hero-reveal {
  position: relative;
  display: grid;
  min-height: 100svh;
  margin-top: calc(-1 * var(--header-h));
  overflow-x: clip;
  isolation: isolate;
  background: var(--color-background);
  color: var(--color-foreground);
}

.hero-reveal__layer {
  grid-area: 1 / 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h);
  padding-bottom: 2rem;
}

.hero-reveal__layer--base {
  z-index: 1;
}

.hero-reveal__layer--band {
  display: none;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--color-accent);
  color: var(--color-accent-fg);
  pointer-events: none;
  /* Fades in with cursor movement — a static blue line at rest reads as a
     rendering artifact rather than an effect. */
  opacity: var(--rail-o);
  clip-path: inset(
    0 calc(100% - var(--rail-x) - var(--rail-w) / 2) 0
      calc(var(--rail-x) - var(--rail-w) / 2)
  );
}

@media (min-width: 48rem) and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .hero-reveal__layer--band {
    display: flex;
  }

  .site-header__band {
    display: block;
  }
}

.hero-reveal__layer--band .body-lg,
.hero-reveal__layer--band .meta,
.hero-reveal__layer--band .hero-chips span,
.hero-reveal__layer--band .hero-chips a,
.hero-reveal__layer--band .hero-index a,
.hero-reveal__layer--band .text-muted {
  color: var(--color-inverted-soft);
}

.hero-reveal__layer--band .hero-index__num {
  color: var(--color-accent-fg);
}

.hero-reveal__layer--band .hero-index a {
  border-color: var(--color-inverted-hairline);
}

.hero-reveal__layer--band .hero-chips span::before,
.hero-reveal__layer--band .hero-chips a::before,
.hero-reveal__layer--band .live-dot {
  background: var(--color-accent-fg);
}

.hero-reveal__layer--band .bracket-cta,
.hero-reveal__layer--band .bracket-cta .br {
  color: var(--color-accent-fg);
}

.hero__main {
  flex: 1;
  display: grid;
  align-content: center;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding-block: clamp(1.5rem, 5vh, 3rem);
}

.hero__lede {
  max-width: 58rem;
  min-width: 0;
}

/* Wide screens: the index fills what was dead space and gives the page the
   navigation it was missing. */
@media (min-width: 64rem) {
  .hero__main {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: clamp(3rem, 6vw, 6rem);
  }

  .hero__lede {
    grid-column: 1;
  }

  .hero-index {
    grid-column: 2;
    /* Top-aligned so the INDEX label sits on the same line as the hero's
       location meta — the index gets an anchor instead of floating. */
    align-self: start;
  }
}

.hero-index {
  display: none;
  min-width: 15rem;
}

@media (min-width: 64rem) {
  .hero-index {
    display: block;
  }
}

.hero-index__label {
  margin: 0 0 0.5rem;
}

.hero-index a {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--color-hairline);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--color-body);
  text-decoration: none;
  transition:
    color 0.2s var(--ease-out),
    padding-left 0.24s var(--ease-emph);
}

.hero-index a:last-child {
  border-bottom: 1px solid var(--color-hairline);
}

.hero-index__num {
  color: var(--color-accent);
}

.hero-index a:hover,
.hero-index a:focus-visible {
  color: var(--color-foreground);
  padding-left: 0.35rem;
}

.hero__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-hairline);
  margin-top: auto;
}

.hero-reveal__layer--band .hero__footer {
  border-top-color: var(--color-inverted-hairline);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.hero-chips span,
.hero-chips a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  transition: color 0.22s var(--ease-out);
}

.hero-chips a:hover,
.hero-chips a:focus-visible {
  color: var(--color-accent);
}

.hero-chips span::before,
.hero-chips a::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.45rem;
  vertical-align: 0.05em;
  background: var(--color-accent);
}

@media (max-width: 47.999rem), (prefers-reduced-motion: reduce) {
  .hero-reveal__layer--band {
    display: none !important;
  }
}

/* —— Sections —— */
.section {
  padding-block: var(--section-pad);
  scroll-margin-top: 1.5rem;
}

/* Kicker carries a rule to the right edge: it anchors the left gutter and
   gives the empty half of the grid a job. */
.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-muted);
}

.section-kicker::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--color-hairline);
}

.section-kicker__num {
  color: var(--color-accent);
}

.spine-heading {
  margin-bottom: var(--heading-gap);
}

.spine-heading__title {
  margin: 0;
  max-width: 18ch;
}

/* Work panel heading: title left, framing copy right, both under the kicker. */
.panel-heading {
  display: grid;
  gap: 1.5rem;
  margin-bottom: var(--heading-gap);
}

@media (min-width: 1024px) {
  .panel-heading {
    grid-template-columns: minmax(0, 1fr) minmax(0, 28rem);
    align-items: end;
    gap: 3rem;
  }

  .panel-heading__aside {
    justify-self: end;
    text-align: right;
  }
}

.faq-item {
  padding-block: 1.5rem;
  border-top: 1px solid var(--color-hairline);
}

.faq-item:last-child {
  border-bottom: 1px solid var(--color-hairline);
}

.faq-item dt {
  /* Pull the opening quote into the margin so the glyphs line up with the
     hairline above rather than sitting a hair inside it. */
  hanging-punctuation: first;
}

.faq-list {
  margin: 0;
  /* Wider than the reading measure so the rules read as a deliberate block
     under the full-width kicker rule; the answers stay at the measure. */
  max-width: 58rem;
}

.faq-item dd {
  margin: 0.75rem 0 0;
  max-width: var(--measure);
}

/* About */
.about-copy {
  max-width: var(--measure);
}

.about-copy p {
  margin: 0;
}

/* —— Modal —— */
.inquiry {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.inquiry__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 16, 0.45);
  backdrop-filter: blur(4px);
}

.inquiry__panel {
  position: relative;
  width: min(32rem, 100%);
  max-height: calc(100dvh - 2.5rem);
  overflow-y: auto;
  background: var(--color-background);
  border: 1px solid var(--color-hairline-strong);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 24px 60px rgba(18, 18, 16, 0.18);
}

@media (min-width: 640px) {
  .inquiry__panel {
    padding: 2rem;
  }
}

/* Keep the kicker rule clear of the close button. */
.inquiry .section-kicker {
  padding-right: 2.5rem;
}

.inquiry__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  border: 0;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  transition: color 0.18s var(--ease-out);
}

.inquiry__close:hover {
  color: var(--color-accent);
}

.inquiry label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

.inquiry input,
.inquiry textarea {
  width: 100%;
  border: 1px solid var(--color-hairline-strong);
  background: #fff;
  color: var(--color-foreground);
  font: inherit;
  padding: 0.7rem 0.8rem;
  margin-bottom: 1rem;
  border-radius: 0;
  transition: border-color 0.18s var(--ease-out);
}

.inquiry input:hover,
.inquiry textarea:hover {
  border-color: var(--color-soft);
}

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

.inquiry textarea {
  min-height: 8rem;
  resize: vertical;
}

.inquiry__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-hairline);
}

.inquiry__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-muted);
  max-width: 15rem;
}

/* —— Line-by-line heading reveal ——
   js/site-motion.js measures the rendered line boxes of a [data-lines-reveal]
   heading and wraps each in a mask. `overflow: clip` with a clip margin is what
   makes this safe at line-height 0.94 — plain `hidden` would shave the
   ascenders and descenders that deliberately overflow the line box. */
.line-reveal__line {
  display: block;
  overflow: clip;
  overflow-clip-margin: 0.18em;
}

.line-reveal__inner {
  display: block;
  will-change: transform;
}

/* A split heading animates its lines, so it opts out of the block reveal. */
html.js-ready [data-reveal][data-lines] {
  opacity: 1;
  transform: none;
  transition: none;
}

html.js-ready
  :is([data-reveal][data-lines], [data-reveal] [data-lines])
  .line-reveal__inner {
  transform: translateY(105%);
  transition: transform 0.78s var(--ease-emph);
  transition-delay: var(--line-delay, 0ms);
}

html.js-ready
  :is([data-reveal].is-visible[data-lines], [data-reveal].is-visible [data-lines])
  .line-reveal__inner {
  transform: translateY(0);
}

/* —— Scroll reveal —— */
html.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(1.15rem);
  transition:
    opacity 0.55s var(--ease-out),
    transform 0.55s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

html.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Legacy class kept for existing markup */
html.js-ready .reveal:not([data-reveal]) {
  opacity: 0;
  transform: translateY(1.1rem);
  transition:
    opacity 0.52s var(--ease-out),
    transform 0.52s var(--ease-out);
}

html.js-ready .reveal:not([data-reveal]).is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 767px) {
  html.js-ready [data-reveal] {
    transform: translate3d(0, 1.6rem, 0);
    transition-duration: 0.62s, 0.62s;
    transition-timing-function: var(--ease-emph), var(--ease-emph);
  }

  /* Stagger rows inside a revealed axis group */
  html.js-ready .axis-shell[data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html.js-ready .axis-shell[data-reveal] > .axis-row,
  html.js-ready .axis-shell[data-reveal] > .work-item {
    opacity: 0;
    transform: translate3d(0, 1.35rem, 0);
    transition:
      opacity 0.55s var(--ease-emph),
      transform 0.55s var(--ease-emph),
      background-color 0.3s var(--ease-out),
      box-shadow 0.3s var(--ease-out);
    transition-delay: var(--row-delay, 0ms);
  }

  html.js-ready .axis-shell[data-reveal].is-visible > .axis-row,
  html.js-ready .axis-shell[data-reveal].is-visible > .work-item {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  html.js-ready .axis-shell[data-reveal].is-visible > .work-item.is-scroll-focus {
    background: rgba(252, 252, 252, 0.1);
    box-shadow: inset 3px 0 0 var(--color-accent-fg);
  }

  html.js-ready .axis-shell[data-reveal].is-visible > .work-item.is-scroll-focus .work-item__arrow {
    opacity: 1;
    transform: translateX(4px);
  }

  /* Principles: the row itself steps back, its text stays readable. */
  .axis-row[data-principle] {
    transition:
      opacity 0.35s var(--ease-out),
      transform 0.35s var(--ease-out);
  }

  .axis-row[data-principle]:not(.is-focus):not(.is-passed) {
    opacity: 0.72;
    transform: translate3d(0, 0.15rem, 0);
  }

  .axis-row[data-principle]:not(.is-focus):not(.is-passed) .axis-row__left,
  .axis-row[data-principle]:not(.is-focus):not(.is-passed) .axis-row__right {
    opacity: 1;
  }

  .axis-row[data-principle].is-focus {
    transform: translate3d(0, 0, 0);
  }

  .axis-row[data-principle].is-passed {
    opacity: 0.88;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js-ready [data-reveal],
  html.js-ready .reveal,
  html.js-ready .axis-shell[data-reveal] > .axis-row,
  html.js-ready .axis-shell[data-reveal] > .work-item,
  html.js-ready .axis-row[data-principle],
  /* The dimming lives on the children, so they need naming too — without
     these two the previous rule left body copy at reduced opacity. */
  html.js-ready .axis-row[data-principle] .axis-row__left,
  html.js-ready .axis-row[data-principle] .axis-row__right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
  }
}

/* —— Mobile bar ——
   Mobile has no cursor rail and no persistent CTA across 8,000px of scrolling.
   This does both jobs in one element: names the section you're in, keeps
   "Let's talk" a tap away, and carries overall page progress along its top
   edge. Hidden over the hero and again once the contact block arrives. */
.mobile-bar {
  display: none;
}

@media (max-width: 47.999rem) {
  .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem var(--site-gutter);
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--color-background) 88%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--color-hairline);
    transform: translateY(101%);
    transition: transform 0.4s var(--ease-emph);
  }

  .mobile-bar.is-visible {
    transform: translateY(0);
  }
}

/* Never let it sit under the modal backdrop and stay tabbable. */
body.is-locked .mobile-bar {
  display: none;
}

.mobile-bar__progress {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(var(--bar-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

.mobile-bar__section {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  min-width: 0;
}

.mobile-bar__num {
  color: var(--color-accent);
}

.mobile-bar__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— Touch press states ——
   Hover is the emphasis mechanism on desktop; touch needs its own
   acknowledgement that a tap landed. */
@media (hover: none) {
  .work-item,
  .hero-index a,
  .mobile-bar .bracket-cta,
  .text-link {
    -webkit-tap-highlight-color: transparent;
  }

  .panel-accent .work-item:active {
    background: rgba(252, 252, 252, 0.16);
    box-shadow: inset 3px 0 0 var(--color-accent-fg);
  }

  .work-item:active .work-item__arrow {
    opacity: 1;
    transform: translateX(4px);
  }

  .hero-index a:active,
  .text-link:active {
    color: var(--color-accent);
  }

  .mobile-bar .bracket-cta:active .br-l {
    transform: translateX(-3px);
  }

  .mobile-bar .bracket-cta:active .br-r {
    transform: translateX(3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bar {
    transition: none;
  }
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--color-hairline);
  padding-block: 1.75rem;
}

.live-dot {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.45rem;
  background: var(--color-accent);
  vertical-align: 0.05em;
}

@media (prefers-reduced-motion: no-preference) {
  .live-dot {
    animation: live-pulse 3.2s var(--ease-out) infinite;
  }
}

@keyframes live-pulse {
  0%,
  70%,
  100% {
    opacity: 1;
  }
  85% {
    opacity: 0.35;
  }
}

/* —— Case studies —— */
.stub-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.case-study-main {
  flex: 1;
  padding-block: clamp(4rem, 9vw, 8rem);
}

.case-study {
  width: min(100%, 52rem);
  margin-inline: auto;
}

.case-study__header {
  padding-bottom: clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--color-hairline);
}

.case-study__title {
  margin-top: 2rem;
  font-size: clamp(2.5rem, 7vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  text-wrap: balance;
  view-transition-name: work-title;
}

.case-study__role {
  margin-top: 1.5rem;
}

.case-study__body {
  width: min(100%, 43rem);
  margin-top: clamp(3rem, 7vw, 5.5rem);
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.7;
  color: var(--color-body);
  text-wrap: pretty;
}

.case-study__body > p + p,
.case-study__body li + li {
  margin-top: 1rem;
}

.case-study__body h2 {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  color: var(--color-foreground);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.case-study__body h3 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--color-foreground);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.case-study__body h2 + p {
  margin-top: 1.5rem;
}

.case-study__body ul {
  margin-top: 1.25rem;
  padding-left: 1.25rem;
  list-style: square;
}

.case-study__body li::marker {
  color: var(--color-accent);
}

.case-study__body strong {
  color: var(--color-foreground);
  font-weight: 600;
}

.case-study__body details {
  margin-top: clamp(3rem, 7vw, 5rem);
  border-block: 1px solid var(--color-hairline);
}

.case-study__body summary {
  padding-block: 1.25rem;
  color: var(--color-foreground);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.case-study__body details ul {
  margin: 0 0 1.5rem;
}

/* —— Cross-document view transitions (homepage ↔ work) —— */
@view-transition {
  navigation: auto;
}

::view-transition-group(root),
::view-transition-group(site-header),
::view-transition-group(work-title) {
  animation-duration: 0.48s;
  animation-timing-function: var(--ease-emph);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  animation: vt-root-out 0.36s var(--ease-out) both;
}

::view-transition-new(root) {
  animation: vt-root-in 0.5s var(--ease-emph) both;
}

html:active-view-transition-type(to-work)::view-transition-old(root) {
  animation-name: vt-root-out-to-work;
}

html:active-view-transition-type(to-work)::view-transition-new(root) {
  animation-name: vt-root-in-to-work;
}

html:active-view-transition-type(from-work)::view-transition-old(root) {
  animation-name: vt-root-out-from-work;
}

html:active-view-transition-type(from-work)::view-transition-new(root) {
  animation-name: vt-root-in-from-work;
}

::view-transition-old(work-title),
::view-transition-new(work-title) {
  height: 100%;
  overflow: clip;
  object-fit: cover;
  object-position: left top;
}

::view-transition-image-pair(work-title) {
  isolation: isolate;
}

@keyframes vt-root-out {
  to {
    opacity: 0;
  }
}

@keyframes vt-root-in {
  from {
    opacity: 0;
  }
}

@keyframes vt-root-out-to-work {
  to {
    opacity: 0;
    transform: translateY(-0.6rem) scale(0.992);
  }
}

@keyframes vt-root-in-to-work {
  from {
    opacity: 0;
    transform: translateY(1.1rem);
  }
}

@keyframes vt-root-out-from-work {
  to {
    opacity: 0;
    transform: translateY(0.8rem);
  }
}

@keyframes vt-root-in-from-work {
  from {
    opacity: 0;
    transform: translateY(-0.7rem) scale(0.994);
  }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .site-header,
  .case-study__title {
    view-transition-name: none;
  }
}
