/* ══════════════════════════════════════════════
   TERZA STUDIO — editorial agency site
   ══════════════════════════════════════════════ */

@import url('./colors.css');
@import url('./layout.css');
@import url('./spacing.css');
@import url('./typography.css');
@import url('./animation.css');
@import url('./radius.css');

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: clamp(15px, .42vw + 14px, 17px);
  line-height: 1.6;
  font-weight: 300;
  letter-spacing: .005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none
}

.heading {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-variation-settings: 'opsz' 120, 'SOFT' 0;
  letter-spacing: -.02em;
  line-height: 1;
}

.text-accent {
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent)
}

::selection {
  background: var(--color-text);
  color: var(--color-bg)
}

/* readable by assistive tech, invisible on screen */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--color-text);
  color: var(--color-bg);
  padding: 12px 18px;
  font-size: 14px;
}

.skip-link:focus {
  left: 12px;
  top: 12px
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
  border-radius: var(--radius-xs)
}

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

/* ── glassmorphism (iOS-style) ───────────────── */
.glass {
  background: linear-gradient(180deg, rgba(255, 252, 246, .74), rgba(255, 250, 240, .42));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 253, 248, .7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(var(--color-espresso-rgb), .05),
    0 14px 34px -14px rgba(var(--color-espresso-rgb), .2),
    0 2px 6px -2px rgba(var(--color-espresso-rgb), .06);
}

/* ── buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -.01em;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform .4s var(--ease-out-expo), background .3s, color .3s, border-color .3s;
}

.btn:hover {
  transform: translateY(-2px)
}

.btn-solid {
  background: var(--color-text);
  color: var(--color-bg)
}

.btn-solid:hover {
  background: var(--color-accent)
}

.btn-ghost {
  border-color: var(--color-border);
  color: var(--color-text)
}

.btn-ghost:hover {
  border-color: var(--color-text)
}

.btn-lg {
  padding: 16px 30px;
  font-size: 15px
}

/* ══ NAV ══════════════════════════════════════ */
.nav {
  position: fixed;
  inset: 16px 0 auto;
  z-index: 100;
  transition: transform .5s var(--ease-out-expo);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: 10px 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .14em;
  /* below --nav-gutter-min the gutter is narrower than the logo,
     so fall back to aligning with the content column's left edge */
  padding-inline: var(--container-padding);
}

/* the empty margin beside the content column:
   half the leftover viewport, plus the container's own padding */
@media (min-width: 1560px) {
  .nav-logo {
    padding-inline: 0;
    width: calc((100% - var(--container-max)) / 2 + var(--container-padding));
    justify-content: center;
  }
}

.nav-logo-mark {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-xs);
  background: var(--color-accent);
  flex: none;
}

/* ══ TABLE OF CONTENTS ════════════════════════ */
.toc {
  position: fixed;
  top: 50%;
  /* hidden until the hero is scrolled past — see .is-visible below */
  translate: -10px -50%;
  opacity: 0;
  pointer-events: none;
  /* narrow gutters only fit the numerals, so centre those in the padding */
  left: calc(var(--container-padding) / 2 - 4px);
  z-index: 97;
  transition: opacity .45s var(--ease-out-expo), translate .45s var(--ease-out-expo);
}

.toc.is-visible {
  translate: 0 -50%;
  opacity: 1;
  pointer-events: auto;
}

/* under ~1560px the gutter is too narrow for the rule + label to sit
   beside the content column, so show the numerals alone */
@media (max-width: 1559px) {

  .toc-rule,
  .toc-label {
    display: none;
  }
}

/* on wide screens sit in the empty gutter, like the logo above */
@media (min-width: 1560px) {
  .toc {
    left: calc(((100% - var(--container-max)) / 2 + var(--container-padding)) / 2 - 12px);
  }
}

.toc ol {
  display: grid;
  gap: var(--space-md);
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--color-text-subtle);
  transition: color .35s var(--ease-out-expo);
}

.toc-number {
  font-family: var(--font-ui);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.toc-rule {
  display: block;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width .45s var(--ease-out-expo);
}

.toc-label {
  font-family: var(--font-serif-small);
  font-style: italic;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  translate: -6px 0;
  transition: opacity .35s var(--ease-out-expo), translate .35s var(--ease-out-expo);
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--color-text);
}

.toc-link:hover .toc-rule,
.toc-link.is-active .toc-rule {
  width: 26px;
}

.toc-link:hover .toc-label,
.toc-link.is-active .toc-label {
  opacity: 1;
  translate: 0 0;
}

.toc-link.is-active {
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  gap: 6px;
  margin-inline: auto;
}

.nav-links a {
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  transition: color .25s, background .25s;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--color-text);
  background: rgba(var(--color-espresso-rgb), .07)
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: rgba(var(--color-espresso-rgb), .07);
  border: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  width: 16px;
  height: 1.5px;
  background: var(--color-text);
  transition: transform .3s var(--ease-out-expo)
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(3.25px) rotate(45deg)
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-3.25px) rotate(-45deg)
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(247, 242, 233, .9);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  display: grid;
  place-items: center;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav {
  display: grid;
  gap: var(--space-sm);
  text-align: center
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 9vw, 52px);
  letter-spacing: -.02em;
}

/* ── floating CTA ────────────────────────────── */
.chat-dock {
  position: fixed;
  right: clamp(16px, 2vw, 32px);
  bottom: 24px;
  z-index: 98;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  /* the dock is only a rail — clicks belong to the bubble and button */
  pointer-events: none;
}

.chat-dock>* {
  pointer-events: auto;
}

.floating-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  corner-shape: round;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px) scale(.96);
  pointer-events: none;
  transition: opacity .5s var(--ease-out-expo), transform .5s var(--ease-out-expo);
}

.floating-cta.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto
}

.floating-cta:hover {
  transform: translateY(-3px)
}

.floating-cta-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  corner-shape: round;
  background: var(--color-olive);
  box-shadow: 0 0 0 0 rgba(var(--color-olive-rgb), .5);
  animation: pulse 2.4s infinite;
}

/* a message "arrives": the button gives a short nudge */
.floating-cta.is-nudging {
  animation: nudge .7s var(--ease-out-expo);
}

@keyframes nudge {

  0%,
  100% {
    transform: none
  }

  28% {
    transform: translateY(-5px) rotate(-1.6deg)
  }

  58% {
    transform: translateY(0) rotate(1deg)
  }

  80% {
    transform: translateY(-1px) rotate(-.4deg)
  }
}

/* ── chat bubble ─────────────────────────────── */
.chat-bubble {
  max-width: min(260px, 62vw);
  padding: 11px 15px;
  /* squared-off corner points at the button, like a speech tail */
  border-radius: 16px 16px 4px 16px;
  /* opt out of the global squircle, matching the button */
  corner-shape: round;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  transform-origin: bottom right;
  opacity: 0;
  translate: 0 10px;
  scale: .94;
  pointer-events: none;
  transition:
    opacity .4s var(--ease-out-expo),
    translate .4s var(--ease-out-expo),
    scale .4s var(--ease-out-expo);
}

.chat-bubble.is-visible {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

.chat-bubble-typing {
  display: none;
  align-items: center;
  gap: 4px;
  /* match a line of text so the bubble doesn't resize on swap */
  height: 1.35em;
}

.chat-bubble.is-typing .chat-bubble-typing {
  display: inline-flex;
}

.chat-bubble.is-typing .chat-bubble-text {
  display: none;
}

.chat-bubble-typing i {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  corner-shape: round;
  background: var(--color-text-subtle);
  animation: chat-dot 1.2s ease-in-out infinite;
}

.chat-bubble-typing i:nth-child(2) {
  animation-delay: .16s;
}

.chat-bubble-typing i:nth-child(3) {
  animation-delay: .32s;
}

@keyframes chat-dot {

  0%,
  62%,
  100% {
    transform: none;
    opacity: .4
  }

  31% {
    transform: translateY(-4px);
    opacity: 1
  }
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 9px rgba(var(--color-olive-rgb), 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(var(--color-olive-rgb), 0)
  }
}

/* ══ SECTION PRIMITIVES ═══════════════════════ */
.section {
  padding-block: clamp(80px, 11vw, var(--space-4xl));
  position: relative;
  /* clip, not hidden — keeps the section out of the scroll-container business */
  overflow: clip;
}

.section>.container {
  position: relative;
  z-index: 1;
}

/* ── parallax section backdrop ───────────────── */
.section-backdrop {
  position: absolute;
  /* overscan vertically so the drift never exposes a hard edge */
  inset: -25% 0;
  z-index: 0;
  pointer-events: none;
  will-change: translate;
}

.section-backdrop::before,
.section-backdrop::after {
  content: '';
  position: absolute;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
}

.section-backdrop::before {
  left: -12%;
  top: 4%;
  width: min(760px, 72vw);
  background: radial-gradient(circle, rgba(var(--color-terracotta-rgb), .10), transparent 68%);
}

.section-backdrop::after {
  right: -10%;
  bottom: 2%;
  width: min(600px, 58vw);
  background: radial-gradient(circle, rgba(var(--color-olive-rgb), .09), transparent 68%);
}

/* alternate the tints so consecutive sections don't read as a repeat */
.section-backdrop.is-flipped::before {
  background: radial-gradient(circle, rgba(var(--color-olive-rgb), .10), transparent 68%);
}

.section-backdrop.is-flipped::after {
  background: radial-gradient(circle, rgba(var(--color-terracotta-rgb), .08), transparent 68%);
}

.section+.section {
  border-top: 1px solid var(--color-border-subtle)
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-xl);
}

.section-number {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--color-accent);
}

.section-label {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  font-weight: 400;
}

.section-title {
  font-size: clamp(42px, 8vw, 108px);
  letter-spacing: -.025em;
  line-height: .94;
  margin-bottom: var(--space-2xl);
}

.eyebrow {
  margin: 0 0 var(--space-lg);
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}

/* ══ HERO ═════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  /* svh keeps mobile browser chrome from pushing content out of view */
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(96px, 13vh, 150px);
  /* clears the fixed nav so the optical centre sits below it */
  padding-bottom: clamp(48px, 7vw, 90px);
  overflow: hidden;
  text-align: center;
}

.hero-inner {
  position: relative;
  /* above the particle field and the glow */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* faded in once the field has been seeded, to avoid a first-frame pop */
  opacity: 0;
  transition: opacity 1.2s var(--ease-out-expo);
}

.hero-particles.is-visible {
  opacity: 1;
}

.hero::after {
  /* soft top glow */
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  translate: -50% 0;
  width: min(1100px, 120vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 251, 242, .3), transparent 62%);
  pointer-events: none;
}

.grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  padding-inline: var(--container-padding);
  max-width: var(--container-max);
  margin-inline: auto;
  pointer-events: none;
}

.grid-lines i {
  width: 1px;
  background: var(--color-border-subtle)
}

.hero-title {
  position: relative;
  font-size: clamp(40px, 8.6vw, 132px);
  line-height: .92;
  letter-spacing: -.03em;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.line-mask {
  display: block;
  overflow: visible;
  /* pad the mask so serif descenders aren't clipped, then pull it back
     so the extra space doesn't open a gap between lines */
  padding-bottom: .14em;
  margin-bottom: -.14em;
}

.line-mask>span {
  display: block;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease-out-expo);
}

.is-revealed .line-mask>span {
  transform: none
}

.line-mask:nth-child(2)>span {
  transition-delay: .11s
}

.hero-lede {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.hero-tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: -.015em;
  color: var(--color-text);
}

.word-swap {
  display: inline-grid;
  position: relative;
  clip-path: inset(0 -50vw 0 0);
  overflow: visible;
  vertical-align: bottom;
  color: var(--color-accent);
  font-weight: 600;
  transition: width .6s var(--ease-out-expo);
  text-align: left;
  justify-items: start;
}

.word-swap-text {
  grid-area: 1 / 1;
  white-space: nowrap;
  justify-self: start;
}

.word-swap-text.is-leaving {
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .6s var(--ease-out-expo), opacity .6s var(--ease-out-expo);
}

.word-swap-text.is-entering {
  animation: swapIn .6s var(--ease-out-expo) both;
}

@keyframes swapIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: none;
    opacity: 1;
  }
}

/* ══ 01 SERVICES ══════════════════════════════ */
.service-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md)
}

.service-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  transition: transform .55s var(--ease-out-expo), border-color .4s;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 253, 248, .9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 22px 46px -16px rgba(var(--color-espresso-rgb), .24), 0 3px 8px -3px rgba(var(--color-espresso-rgb), .08)
}

.service-card-index {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--color-text-subtle);
}

.service-card .service-title {
  font-size: clamp(24px, 2.4vw, 34px);
  letter-spacing: -.015em;
  margin: var(--space-lg) 0 var(--space-sm);
}

.service-card > .service-desc {
  margin: 0 0 var(--space-lg);
  color: var(--color-text-muted);
  font-size: 15.5px
}

.service-card ul {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md)
}

.service-card li {
  font-size: 14px;
  color: var(--color-text-subtle);
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.service-card li::before {
  content: '—';
  color: var(--color-text-subtle)
}

/* ══ 02 WORK ══════════════════════════════════ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg)
}

.project-card {
  display: block
}

.project-thumb {
  aspect-ratio: 4/3;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--color-fill), var(--color-fill-strong));
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color .4s;
}

.project-thumb img {
  width: 100%;
  /* taller than the frame so the parallax drift stays covered */
  height: 116%;
  object-fit: cover;
  will-change: translate;
  transition: scale .7s var(--ease-out-expo);
}

.project-card:hover .project-thumb {
  border-color: rgba(var(--color-espresso-rgb), .26)
}

.project-card:hover .project-thumb img {
  scale: 1.05;
}

.project-meta {
  padding-top: var(--space-md)
}

.project-meta .project-title {
  margin: 0;
  font-family: var(--font-serif-small);
  font-size: clamp(19px, 1.8vw, 24px);
  letter-spacing: -.015em
}

.project-category {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-accent)
}



.project-link {
  display: inline-flex;
  gap: 8px;
  margin-top: var(--space-md);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13.5px;
}

.project-link i {
  transition: transform .4s var(--ease-out-expo)
}

.project-card:hover .project-link i {
  transform: translateX(6px)
}

/* ══ 03 PROCESS ═══════════════════════════════ */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border-subtle);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.step {
  background: var(--color-bg);
  padding: var(--space-xl) var(--space-lg) var(--space-2xl);
  position: relative;
  transition: background .4s;
}

.step:hover {
  background: var(--color-bg-subtle)
}

.step-number {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -.02em;
  color: rgba(var(--color-terracotta-rgb), .32);
  display: block;
  margin-bottom: var(--space-lg);
  will-change: translate;
}

.step .step-title {
  font-size: 23px;
  letter-spacing: -.01em;
  margin-bottom: var(--space-sm)
}

.step .step-desc {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-muted)
}

/* ══ ABOUT ════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-3xl);
  align-items: start;
}

.about .section-title {
  margin-bottom: var(--space-lg)
}

.about-copy {
  margin: 0;
  color: var(--color-text-muted);
  max-width: 40ch
}

.team {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg)
}

.member-avatar {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 1;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  transition: transform .55s var(--ease-out-expo), border-color .4s;
}

.member:hover .member-avatar {
  transform: translateY(-6px);
  border-color: var(--color-text-subtle);
  color: var(--color-text)
}

.member .member-name {
  font-size: 20px;
  margin-top: var(--space-md);
  letter-spacing: -.01em
}

.member .member-role {
  margin: 4px 0 0;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-subtle)
}

/* ══ FOOTER ═══════════════════════════════════ */
.footer {
  padding-block: clamp(80px, 11vw, var(--space-4xl)) var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-bg), var(--color-bg-subtle));
}

.footer-headline {
  /* lead text on the left half, the swappable word on the right */
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25em;
  align-items: start;
  font-family: var(--font-serif);
  font-weight: 600;
  /* capped so the lead lines fit their half column without re-wrapping:
     "something" runs ~4em, and half the container has to hold it */
  font-size: clamp(40px, 7.6vw, 150px);
  line-height: .94;
  letter-spacing: -.03em;
  margin-bottom: var(--space-xl);
}

.footer-headline-lead .line-mask {
  /* two lines, always — never let the column re-break them */
  white-space: nowrap;
}

.footer-headline-pick {
  /* drop by exactly one line so the word starts on "something", less the
     half-leading the taller roll line-height adds above the first baseline */
  margin-block-start: .835em;
  margin-block-start: calc(1lh - .105em);
  min-width: 0;
}

/* stacked on narrow screens — half a column is too little to set in */
@media (max-width: 820px) {
  .footer-headline {
    grid-template-columns: 1fr;
  }

  .footer-headline-pick {
    margin-block-start: 0;
  }
}

/* ── the swappable word ──────────────────────── */
.word-pick {
  /* a button, but it has to sit in the sentence like plain text */
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  display: inline-block;
  text-align: left;
  /* never wider than the headline column: a word too long for the
     remaining space drops to the next line, and one too long for a
     whole line breaks inside itself instead of running off the edge */
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.word-pick-text {
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent);
  align-content: start;
  transition:
    opacity .22s var(--ease-out-expo),
    translate .22s var(--ease-out-expo);
}

/* ── odometer roll: each letter rolls to the next ── */
.word-roll {
  display: inline-flex;
  flex-wrap: wrap;
  vertical-align: baseline;
  overflow: visible;
  /* room for the glyphs: at the headline's .94 leading the box is
     shorter than an italic ascender-to-descender run, which is what
     was slicing the letters */
  line-height: 1.15;
}

.word-roll-cell {
  position: relative;
  display: block;
  /* clips top and bottom at the box edge, but the negative side insets
     let italic glyphs overhang their advance width instead of being cut */
  clip-path: inset(0 -.32em);
}

/* a cell whose letter is leaving for good needs more sideways room,
   because the incoming face is empty and gives the cell no width */
.word-roll-cell.is-vanishing {
  clip-path: inset(0 -.32em);
}

.word-roll-face {
  display: block;
  white-space: pre;
}

/* the outgoing letter is taken out of flow, so the incoming one sets the
   cell width from the very first frame — nothing shifts sideways mid-roll */
.word-roll-out {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
}

.word-roll-in {
  translate: 0 100%;
}

.word-roll-out,
.word-roll-in {
  transition: translate .62s var(--ease-out-expo);
}

/* the cell resizes only once the roll is under way, so pinning the
   outgoing width beforehand doesn't animate from nothing */
.word-roll.is-rolling .word-roll-cell {
  transition: width .62s var(--ease-out-expo);
}

.word-roll.is-rolling .word-roll-out {
  translate: 0 -100%;
}

.word-roll.is-rolling .word-roll-in {
  translate: 0 0;
}

/* a small nudge that the word is clickable, shown until first use.
   it sits outside the headline because .line-mask clips its overflow */
.word-pick-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: var(--space-md) 0 var(--space-lg);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--color-text-subtle);
  pointer-events: none;
  transition: opacity .4s var(--ease-out-expo);
}

.word-pick-hint.is-used {
  opacity: 0;
}

.word-pick-hint-mark {
  color: var(--color-accent);
  animation: hint-breathe 2.6s ease-in-out infinite;
}

@keyframes hint-breathe {

  0%,
  100% {
    opacity: .5;
    translate: 0 2px
  }

  50% {
    opacity: 1;
    translate: 0 -2px
  }
}

.footer-cta-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

.footer-cta {
  margin-bottom: var(--space-lg);
  margin-top: var(--space-lg);
}

.footer-cta-text {
  transition: opacity .22s var(--ease-out-expo);
}

.footer-cta.is-swapping .footer-cta-text {
  opacity: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-column {
  display: grid;
  gap: 8px;
  align-content: start
}

.footer-column .footer-col-title {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  font-weight: 400;
  margin-bottom: 6px;
}

.footer-column a,
.footer-column .footer-col-desc {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-muted);
  transition: color .25s
}

.footer-column a:hover {
  color: var(--color-text)
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-top: var(--space-3xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-subtle);
  font-size: 12.5px;
  color: var(--color-text-subtle);
}

/* ══ REVEAL ═══════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .85s var(--ease-out-expo), transform .85s var(--ease-out-expo);
}

.reveal.is-visible {
  opacity: 1;
  transform: none
}

/* ══ RESPONSIVE ═══════════════════════════════ */
@media (max-width:1080px) {

  .service-cards,
  .work-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .toc {
    display: none
  }

  .steps {
    grid-template-columns: repeat(2, 1fr)
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl)
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-xl)
  }

  .service-cards .service-card:last-child,
  .work-grid .project-card:last-child {
    grid-column: 1/-1
  }
}

@media (max-width:820px) {

  .nav-links,
  .nav-cta {
    display: none
  }

  .nav-toggle {
    display: flex
  }

  .nav-inner {
    padding: 8px 0
  }

  .nav-logo {
    margin-inline-end: auto
  }

  .grid-lines i:nth-child(n+3) {
    display: none
  }

  .hero-lede {
    gap: var(--space-lg)
  }

}

@media (max-width:600px) {

  .service-cards,
  .work-grid,
  .team,
  .steps {
    grid-template-columns: 1fr
  }

  .service-cards .service-card:last-child,
  .work-grid .project-card:last-child {
    grid-column: auto
  }

  .team {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm)
  }

  .footer-grid {
    grid-template-columns: 1fr
  }

  .floating-cta {
    right: 16px;
    bottom: 16px;
    padding: 12px 20px
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important
  }

  .reveal,
  .line-mask>span {
    opacity: 1;
    transform: none
  }
}