/* Tandem — Editorial mono design system */

:root {
  /* Colors — light ivory canvas */
  --ink: #0E0E0C;
  --ink-2: #2A2A26;
  --ink-3: #5C5C57;
  --ink-4: #8A8A82;
  --rule: #D9D5CB;
  --rule-soft: #E6E2D7;
  --paper: #F4F1EA;
  --paper-2: #ECE8DD;
  --paper-3: #E0DBCB;
  --accent: #0E0E0C;     /* default = ink (mono); tweakable */
  --on-accent: #F4F1EA;
  --tomato: #EC2D01;     /* brand red — header logo + footer mark */

  /* Type */
  --display: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Density */
  --pad-section-y: clamp(50px, 6.25vw, 100px);
  --pad-x: clamp(20px, 4vw, 56px);
  --gap: clamp(16px, 2vw, 28px);
  --stack: clamp(12px, 1.4vw, 20px);

  /* Radius/shadow — minimal */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
}

[data-theme="dark"] {
  --ink: #F4F1EA;
  --ink-2: #D9D5CB;
  --ink-3: #A8A49A;
  --ink-4: #6E6A60;
  --rule: #2A2A26;
  --rule-soft: #1A1A18;
  --paper: #0E0E0C;
  --paper-2: #15140F;
  --paper-3: #1E1C16;
  --accent: #F4F1EA;
  --on-accent: #0E0E0C;
  --tomato: #FF4A22;
}

[data-density="tight"] {
  --pad-section-y: clamp(48px, 6vw, 96px);
  --pad-x: clamp(16px, 3vw, 40px);
  --gap: clamp(12px, 1.4vw, 20px);
  --stack: clamp(8px, 1vw, 14px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  cursor: none;
}

@media (max-width: 900px) {
  body { cursor: auto; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: none; }

/* Type scale */
.display-xxl {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(42px, 9vw, 150px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
}
.display-xl {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(39px, 7vw, 116px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.display-l {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.display-m {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.body-lg {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}
p { text-wrap: pretty; }

/* Layout */
.page {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
}
.section {
  padding: var(--pad-section-y) var(--pad-x);
  border-top: 1px solid var(--rule);
  position: relative;
}
.section:first-of-type { border-top: 0; }
.container {
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), background 0.3s, color 0.3s;
  position: relative;
  overflow: hidden;
}
.btn .arrow {
  width: 18px;
  height: 18px;
  display: inline-flex;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.btn:hover .arrow { transform: translate(3px, -3px); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 18px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in oklab, var(--paper) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--tomato);
}
.nav-logo .mark {
  width: 32px;
  height: 32px;
  display: inline-block;
  color: var(--tomato);
}
.nav-logo .mark circle {
  stroke-width: 1.8;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
}
.nav-cta {
  margin-left: 16px;
  padding: 12px 20px;
  font-size: 14px;
  background: var(--tomato);
  border-color: var(--tomato);
  color: #F4F1EA;
}
.nav-cta:hover {
  background: #C42500;
  border-color: #C42500;
  color: #F4F1EA;
}
/* Nav burger + mobile panel */
.nav-burger {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  cursor: pointer;
  margin-left: 8px;
  position: relative;
  z-index: 1001;
}
.nav-burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s, background 0.3s;
}
.nav-burger.open {
  background: var(--ink);
  border-color: var(--ink);
}
.nav-burger.open span { background: var(--paper); }
.nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav-panel {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  padding: 88px 24px 32px;
  transform: translateY(-100%);
  transition: transform 0.5s cubic-bezier(.7,0,.2,1);
  overflow-y: auto;
  visibility: hidden;
}
.mobile-nav-panel.open {
  transform: translateY(0);
  visibility: visible;
}
.mobile-nav-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.mobile-nav-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mobile-nav-close svg { width: 20px; height: 20px; display: block; }
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}
.mobile-nav-link {
  display: grid;
  grid-template-columns: 40px 1fr 24px;
  align-items: center;
  gap: 16px;
  padding: 20px 4px;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  transition: padding 0.2s;
}
.mobile-nav-link:last-of-type { border-bottom: 1px solid var(--rule); }
.mobile-nav-link.active { color: var(--ink); }
.mobile-nav-link.active .mobile-nav-label { font-weight: 600; }
.mobile-nav-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.mobile-nav-label {
  font-family: var(--display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1;
}
.mobile-nav-arr {
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
}
.mobile-nav-cta {
  margin-top: 32px;
  justify-content: space-between;
  width: 100%;
  padding: 22px 24px;
  font-size: 16px;
}
.mobile-nav-foot {
  margin-top: auto;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav-foot .label { margin: 0 0 4px; }
.mobile-nav-foot a { font-family: var(--display); font-weight: 600; font-size: 18px; }
.mobile-nav-foot p { margin: 0; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-cta { display: none; }
}

/* Footer */
.footer {
  padding: 80px var(--pad-x) 32px;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink);
}
.footer .footer-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(80px, 18vw, 280px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin: 80px 0 40px;
  color: var(--tomato);
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.18em;
}
.footer .footer-mark-icon {
  /* Header reference: 32px box on 28px font = 1.143em square, stroke-width 1.8 in 22u viewBox.
     Same em ratios reproduce the exact header proportions at any size. */
  width: 1.143em;
  height: 1.143em;
  flex: 0 0 auto;
  margin-bottom: 0.05em; /* optical baseline alignment with the wordmark */
}
.footer .footer-mark-icon circle {
  stroke-width: 1.8;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid #2a2a26;
}
.footer-grid h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8a82;
  margin: 0 0 18px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a {
  color: #D9D5CB;
  font-size: 15px;
  transition: color 0.2s;
}
.footer-grid a:hover { color: #F4F1EA; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: #8a8a82;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.marquee-track {
  display: inline-flex;
  gap: 60px;
  animation: marquee 38s linear infinite;
  align-items: center;
}
.marquee-item {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2vw, 32px);
  letter-spacing: -0.02em;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.marquee-item::after {
  content: "✦";
  color: var(--accent);
  font-size: 0.7em;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(.2,.7,.2,1), transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* Magnetic cursor */
#magnetic-cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 999px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s cubic-bezier(.2,.7,.2,1),
              height 0.3s cubic-bezier(.2,.7,.2,1),
              background 0.3s,
              border-color 0.3s,
              opacity 0.2s,
              mix-blend-mode 0s;
  background: var(--tomato);
}
#magnetic-cursor.hover {
  width: 60px; height: 60px;
  background: var(--paper);
  border: 1px solid var(--paper);
  mix-blend-mode: difference;
}
#magnetic-cursor.dot {
  width: 6px; height: 6px;
  background: var(--tomato);
  border: none;
}
@media (max-width: 900px) { #magnetic-cursor { display: none; } }

/* Odometer counter */
.odo {
  display: inline-flex;
  vertical-align: baseline;
  overflow: hidden;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.odo-digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  position: relative;
}
.odo-strip {
  display: flex;
  flex-direction: column;
  transition: transform 1.4s cubic-bezier(.2,.7,.2,1);
}
.odo-strip span {
  height: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Service / FAQ accordion */
.accordion-item {
  border-top: 1px solid var(--rule);
  cursor: none;
  scroll-margin-top: clamp(80px, 12vh, 120px);
}
.accordion-item:last-child { border-bottom: 1px solid var(--rule); }
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  background: none;
  border: 0;
  text-align: left;
  color: var(--ink);
}
.accordion-trigger .q {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  flex: 1;
}
.accordion-trigger .pm {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s, transform 0.3s;
  position: relative;
}
.accordion-trigger .pm::before,
.accordion-trigger .pm::after {
  content: "";
  position: absolute;
  background: var(--ink);
  transition: transform 0.3s, background 0.3s;
}
.accordion-trigger .pm::before { width: 12px; height: 1.5px; }
.accordion-trigger .pm::after { width: 1.5px; height: 12px; }
.accordion-item.open .pm::after { transform: scaleY(0); }
.accordion-item.open .pm {
  background: var(--ink);
}
.accordion-item.open .pm::before { background: var(--paper); }
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(.2,.7,.2,1);
}
.accordion-content > div {
  padding: 0 0 28px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
  max-width: 70ch;
}

/* Work tile */
.work-tile {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 16 / 11;
  cursor: none;
}
.work-tile-thumb {
  position: absolute; inset: 0;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.work-tile:hover .work-tile-thumb { transform: scale(1.04); }
.work-tile-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  color: #fff;
  z-index: 2;
}
.work-tile-meta .title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 2vw, 32px);
  letter-spacing: -0.02em;
  margin: 0;
}
.work-tile-meta .meta {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
}
.work-tile-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(14,14,12,0.7) 100%);
  z-index: 1;
}
.work-tile-cta {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 3;
  width: 52px; height: 52px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.6);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1), opacity 0.3s;
}
.work-tile:hover .work-tile-cta { transform: scale(1); opacity: 1; }

/* Placeholder thumb (striped) */
.thumb-placeholder {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(0,0,0,0.06) 0 14px,
      transparent 14px 28px
    ),
    var(--bg, #C7BEA8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(14,14,12,0.5);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Process steps (sticky) */
.process {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}
.process-sticky {
  position: sticky;
  top: 120px;
}
.process-step {
  border-top: 1px solid var(--rule);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
}
.process-step:last-child { border-bottom: 1px solid var(--rule); }
.process-step .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.process-step h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(28px, 3vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.05;
}
.process-step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
  max-width: 52ch;
}
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr; }
  .process-sticky { position: static; }
}

/* Testimonials */
.testimonial-stage {
  position: relative;
  user-select: none;
}
.testimonial-track {
  display: flex;
  gap: 24px;
  cursor: grab;
  will-change: transform;
}
.testimonial-track.grabbing { cursor: grabbing; }
.testimonial-card {
  flex: 0 0 min(560px, 86vw);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.testimonial-card .q {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.testimonial-card .who {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
}
.testimonial-card .who .av {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--paper-3);
  font-family: var(--display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.testimonial-card .who .name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.testimonial-card .who .role {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Stat block */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  border-top: 1px solid var(--rule);
}
.stat {
  padding: 40px 0;
  border-right: 1px solid var(--rule);
  padding-right: 24px;
}
.stat:last-child { border-right: 0; }
.stat .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(56px, 8vw, 120px);
  letter-spacing: -0.04em;
  line-height: 0.95;
  display: flex;
  align-items: baseline;
  white-space: nowrap;
}
.stat .label-stat {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #000000;
  margin-top: 12px;
}
@media (max-width: 800px) {
  .stat-row { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--rule); }
}

/* Form */
input, textarea, select {
  font-family: inherit;
  font-size: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.field input,
.field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 0.3s;
}
.field input:focus,
.field textarea:focus { border-bottom-color: var(--ink); }

/* Chip — used as either <label> or <button>. Button defaults are reset so
   the styling renders the same regardless of which element it's on. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  font-size: 13px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  cursor: none;
  transition: all 0.2s;
  /* Button-element resets */
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  /* Eliminate iOS tap delay and double-tap-zoom interference on this
     interactive tap target. */
  touch-action: manipulation;
}
/* Hover only applies on devices that can actually hover. On touch-only
   iOS Safari the :hover state was sticking after tap and visually looking
   identical to .selected — users couldn't tell whether their tap had
   registered, and the apparent "fail to deselect" was actually a sticky
   hover state mid-tap. */
@media (hover: hover) {
  .chip:hover {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
}
.chip.selected {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Hero variants */
.hero {
  min-height: 100vh;
  padding: 140px var(--pad-x) 60px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.hero-headline {
  display: grid;
  gap: 6px;
  padding-bottom: 0.12em; /* breathing room for descenders (line-height < 1) */
  padding-right: 0.2em;   /* room for the italic line's right overhang vs .hero overflow:hidden */
}
.hero-line { display: block; }
.hero-meta {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  align-items: end;
}
@media (max-width: 800px) {
  .hero-meta { grid-template-columns: 1fr; gap: 24px; }
}

.hero-grid {
  position: absolute;
  inset: 80px var(--pad-x) 200px;
  pointer-events: auto;
  z-index: 0;
  opacity: 0.85;
}
.hero-grid-canvas {
  width: 100%; height: 100%;
}

/* Eva-style hero — WebGL liquid distortion canvas behind title */
.hero-liquid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-liquid-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Glyph-scramble / lens-rollover characters — Eva-style. The runtime
   styles for .esc-char / .esc-real / .esc-fake are injected by
   hero-eva.js (so every page picks them up). The only thing we keep
   here is the line wrapper rule for first-paint correctness. */
.hero .hero-line { display: block; }
/* hero-eva.js lifts the (now-vestigial) hero line-mask and adds descender
   room when it boots — but it doesn't take effect on mobile, leaving the
   italic line's descenders and right overhang clipped by the leftover
   overflow:hidden. Apply the same relief here so it never depends on
   hero-eva booting. (runIntro is a no-op; nothing animates that needs the
   mask, so making it visible is safe on every device.) */
.display-xxl { padding-bottom: 0.18em; }
/* Emphasis inside display headings + hero heading offset/measure (formerly inline styles) */
.display-xxl em, .display-xl em { font-style: italic; font-weight: 500; }
.hero-title { margin-top: 28px; }
.mw-14ch { max-width: 14ch; }
.mw-18ch { max-width: 18ch; }

/* Visually-hidden utility. Used by chip toggles on the-primer.html —
   keeps the underlying <input> in the document flow, focusable, and
   reachable by label clicks (which display:none breaks on iOS Safari
   when toggling off a previously-checked state). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hero .display-xxl .hero-line,
.hero .display-xl .hero-line { overflow: visible !important; }
/* Italic glyph slants in display headings outside .hero (e.g. the-jump,
   the-primer) need overflow relief too. Apply to the heading itself and
   to the per-char wrappers hero-eva.js injects, plus a touch of right
   padding on em so the slant of the last italic letter has room. */
.display-xxl, .display-xl,
.display-xxl .hero-word, .display-xl .hero-word,
.display-xxl .hero-char, .display-xl .hero-char {
  overflow: visible;
}
.display-xxl em, .display-xl em { padding-right: 0.08em; }

.hero-marquee-stack {
  position: absolute;
  inset: 80px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  overflow: hidden;
}
.hero-marquee-stack .row {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(80px, 18vw, 220px);
  letter-spacing: -0.04em;
  line-height: 0.9;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
}
.hero-marquee-stack .row:nth-child(2) { animation-direction: reverse; animation-duration: 40s; }
.hero-marquee-stack .row:nth-child(3) { animation-duration: 50s; }

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 30% 70%, color-mix(in oklab, var(--accent) 25%, transparent), transparent 60%),
    repeating-linear-gradient(
      45deg,
      var(--paper-2) 0 12px,
      var(--paper-3) 12px 24px
    );
}
.hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: contrast(1.05) saturate(0.85);
  mix-blend-mode: multiply;
}
[data-theme="dark"] .hero-video video {
  opacity: 0.45;
  mix-blend-mode: screen;
}

.hero-tag {
  position: absolute;
  top: 110px; right: var(--pad-x);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  z-index: 3;
}

/* Big numeric counters in hero */
.hero-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--rule);
}
.hero-counters .stat {
  border-right: 1px solid var(--rule);
  padding: 24px 24px 0 10px;
}
.hero-counters .stat:last-child { border-right: 0; }
.hero-counters .stat .num { font-size: clamp(40px, 5vw, 72px); }

@media (max-width: 800px) {
  .hero-counters { grid-template-columns: 1fr; }
  .hero-counters .stat { border-right: 0; border-bottom: 1px solid var(--rule); padding: 24px 0; }
}

/* Service rows */
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 60px;
  gap: 24px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  align-items: center;
  cursor: none;
  transition: padding 0.3s;
}
.service-row:last-child { border-bottom: 1px solid var(--rule); }
.service-row:hover { padding-left: 12px; }
.service-row .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
}
.service-row .name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(24px, 2.4vw, 36px);
  letter-spacing: -0.02em;
}
.service-row .desc {
  color: var(--ink-2);
  font-size: 15px;
  max-width: 50ch;
}
.service-row .arr {
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s;
  margin-left: auto;
}
.service-row:hover .arr {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 1100px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .team-grid { grid-template-columns: 1fr; } }
.team-card .ph {
  aspect-ratio: 4/5;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
}
.team-card .name {
  margin-top: 18px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.team-card .role {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* Section header */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: end;
  margin-bottom: 56px;
}
@media (max-width: 800px) {
  .section-head { grid-template-columns: 1fr; }
}

/* §5 Diagnosis compare */
.diagnosis-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.diagnosis-compare > div {
  padding: 36px 28px 36px 0;
}
.diagnosis-compare > div + div {
  padding: 36px 0 36px 28px;
}
.diagnosis-compare > div:first-child {
  border-right: 1px solid var(--rule);
}
@media (max-width: 800px) {
  .diagnosis-compare { grid-template-columns: 1fr; }
  .diagnosis-compare > div,
  .diagnosis-compare > div + div {
    padding: 28px 0;
    border-right: none;
  }
  .diagnosis-compare > div + div {
    border-top: 1px solid var(--rule);
  }
}

/* §6 Disciplines strip */
.disciplines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.disciplines-grid > .discipline {
  padding: 32px 20px 32px 0;
  border-right: 1px solid var(--rule);
}
.disciplines-grid > .discipline + .discipline {
  padding-left: 20px;
}
.disciplines-grid > .discipline:last-child {
  border-right: none;
  padding-right: 0;
}
.discipline-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.discipline-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 18px 0 12px;
  color: var(--ink);
}
.discipline-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
}
@media (max-width: 900px) {
  .disciplines-grid { grid-template-columns: 1fr; }
  .disciplines-grid > .discipline,
  .disciplines-grid > .discipline + .discipline {
    padding: 24px 0;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .disciplines-grid > .discipline:last-child {
    border-bottom: none;
  }
}

/* §8 What's the catch — Q&A list */
.catch-list {
  border-top: 1px solid var(--rule);
}
.catch-item {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: var(--gap);
  padding: 48px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.catch-q {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  max-width: 24ch;
}
.catch-a {
  font-family: var(--sans);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
}
@media (max-width: 800px) {
  .catch-item {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 36px 0;
  }
}

/* ========== Mobile fixes ========== */
@media (max-width: 800px) {
  /* Hero — smaller, less crammed */
  .hero {
    min-height: auto;
    padding: 120px 20px 48px;
  }
  .hero-tag {
    top: 88px;
    right: 20px;
    font-size: 10px;
  }
  .hero-counters .stat .num { font-size: clamp(36px, 12vw, 56px); }

  /* Display type — clamp already handles, but tighten line-height on tiny screens */
  .display-xxl { font-size: clamp(44px, 13vw, 72px); }
  .display-xl  { font-size: clamp(36px, 11vw, 56px); }
  .display-l   { font-size: clamp(28px, 8vw, 40px); }

  /* Featured work tiles — single column, no spans */
  #work > .container > div[style*="grid-template-columns: 1fr 1fr"],
  section.section > .container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .work-tile,
  .work-tile[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
    aspect-ratio: 4/3;
  }
  .work-tile-meta { padding: 18px 18px; }

  /* Services list row — collapse 4-col grid to stacked */
  .service-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 24px 0;
    align-items: start;
    position: relative;
  }
  .service-row .num { grid-row: 1; }
  .service-row .name { grid-row: 2; font-size: 26px; }
  .service-row .desc { grid-row: 3; font-size: 14px; }
  .service-row .arr {
    position: absolute;
    top: 24px; right: 0;
    width: 36px; height: 36px;
    margin: 0;
  }
  .service-row:hover { padding-left: 0; }

  /* Engagement shapes (services page), principles grid (about page) */
  section.section > .container > div[style*="grid-template-columns: repeat(3, 1fr)"],
  section.section > .container > div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Contact page — form column + sidebar stack */
  section.section > .container > div[style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }
  /* §10 Stay-in-the-Loop (1.2fr 1fr) — stack the copy above the email form */
  section.section > .container > div[style*="grid-template-columns: 1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  #contact-form > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  #contact-form > div[style*="grid-template-columns: 1fr 1fr"] > .field {
    grid-column: span 1 !important;
  }

  /* About page — two-column intro paragraphs stack */
  section.section > .container > div[style*="grid-template-columns: 1fr 1fr"][style*="margin-top: 64px"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* Footer — top CTA grid stacks, mark scales down */
  .footer > .container > div[style*="grid-template-columns: 1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .footer > .container > div > div[style*="grid-template-columns: 1fr 1fr"][style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }
  .footer .footer-mark {
    font-size: clamp(34px, 12vw, 72px);
    margin: 48px 0 32px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Process step — narrower number column */
  .process-step {
    grid-template-columns: 60px 1fr;
    gap: 16px;
    padding: 28px 0;
  }
  .process-step h3 { font-size: clamp(24px, 7vw, 32px); }

  /* Section padding */
  .section { padding: 64px 20px; }

  /* Nav — make logo smaller, hide CTA label, keep arrow */
  .nav { padding: 14px 20px; }
  .nav-logo span { display: none; }
  .nav-cta { padding: 10px 14px; font-size: 13px; }
  .nav-cta .arrow { width: 14px; height: 14px; }

  /* Marquee — slow type a touch */
  .marquee-item { font-size: 22px; gap: 32px; }
  .marquee-track { gap: 32px; }

  /* Testimonial card — slimmer */
  .testimonial-card { padding: 24px; flex-basis: 84vw; }

  /* Chips wrap nicely already */

  /* Big footer mark must not overflow viewport */
  .footer { padding: 56px 20px 28px; }

  /* Section-head bottom margin tighter */
  .section-head { margin-bottom: 32px; gap: 20px; }

  /* Hero meta button row aligns left on mobile */
  .hero-meta > div[style*="justify-content:flex-end"],
  .hero-meta > div[style*="justify-content: flex-end"] {
    justify-content: flex-start !important;
  }

  /* Ensure no horizontal scroll from oversized type */
  .page { overflow-x: hidden; }
  .hero-marquee-stack { overflow: hidden; }

  /* Body slightly smaller */
  .body-lg { font-size: 16px; }

  /* Stat numbers */
  .stat .num { font-size: clamp(48px, 16vw, 80px); }
}

/* Very small phones */
@media (max-width: 480px) {
  .nav-cta { padding: 8px 12px; }
  .display-xxl { font-size: clamp(40px, 12vw, 56px); }
  .work-tile-meta .title { font-size: 18px; }
  .work-tile-meta .meta { font-size: 10px; }
  .stat-row .stat .num { font-size: clamp(44px, 14vw, 64px); }
}

