/* ==========================================================================
   Tavo Automation — REDESIGN SANDBOX stylesheet
   "Light studio, dark instrument."
   Warm paper ground + editorial serif headlines (SideKick-inspired),
   keeping Tavo's technical DNA: mono labels, hairlines, amber, survey
   grid, contour field, and two full-dark inverted sections.
   ========================================================================== */

/* ---------- Fonts (shared with main site) -------------------------------- */
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Regular.woff2") format("woff2"),
       url("../fonts/Satoshi-Regular.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-Bold.woff2") format("woff2"),
       url("../fonts/Satoshi-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Design tokens ------------------------------------------------- */
:root {
  /* Light world — warm paper */
  --paper: #f4f1ea;
  --paper-2: #fbfaf6;
  --card: #ffffff;
  --ink: #191712;
  --ink-2: #6f695c;
  --ink-3: #9a937f;
  --line: rgba(25, 23, 18, 0.12);
  --line-strong: rgba(25, 23, 18, 0.24);

  /* Dark world — the original instrument */
  --night: #0c0b08;
  --night-raise: #13120d;
  --night-ink: #f4f2ea;
  --night-ink-2: #b8b5aa;
  --night-ink-3: #85826f;
  --night-line: rgba(244, 242, 234, 0.1);

  /* Shared accent */
  --amber: #ffb224;
  --amber-deep: #a86e00;      /* legible amber for text on paper */
  --amber-dim: rgba(255, 178, 36, 0.14);
  --amber-alt: var(--amber);  /* amber sitting on the inverted sections */

  /* Theme-dependent surfaces (redefined wholesale for the dark theme) */
  --logo-filter: invert(1) hue-rotate(180deg) brightness(0.92);
  --logo-filter-alt: none;
  --nav-veil: rgba(244, 241, 234, 0.85);
  --grid-line: rgba(25, 23, 18, 0.055);
  --dot-grid: rgba(25, 23, 18, 0.1);
  --veil-a: rgba(244, 241, 234, 0.4);
  --veil-b: rgba(244, 241, 234, 0.05);
  --veil-c: rgba(244, 241, 234, 0.5);
  --band-bg: #1b1915;
  --band-line: rgba(244, 242, 234, 0.12);
  --band-suffix: var(--amber);
  --btn-hover: #2a2823;
  --btn-hover-alt: #ffffff;
  --shadow-soft: 0 1px 2px rgba(25, 23, 18, 0.04), 0 24px 48px -32px rgba(25, 23, 18, 0.25);
  --shadow-card: 0 1px 2px rgba(25, 23, 18, 0.03), 0 20px 40px -32px rgba(25, 23, 18, 0.2);
  --shadow-drop: drop-shadow(0 24px 40px rgba(25, 23, 18, 0.3));

  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-body: "Satoshi", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 12px;
  --radius-sm: 7px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}
p { margin: 0; }
ul { margin: 0; }
button { font-family: inherit; }

::selection { background: var(--amber); color: #191712; }

:focus-visible {
  outline: 2px solid var(--amber-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Serif accent — the editorial signature */
.ser {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---------- Layout helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container-wide { max-width: 1460px; }

.section { position: relative; }
.section-pad { padding: clamp(96px, 13vw, 150px) 0; }

/* Dark inverted sections — the instrument inside the studio */
.section-dark {
  background: var(--night);
  color: var(--night-ink);
}

/* ---------- Stats banner (directly under the hero) ---------------------- */
.stats-band {
  /* Warm charcoal rather than the full-black night — softer against paper */
  --charcoal: var(--band-bg);
  --charcoal-line: var(--band-line);
  background: var(--charcoal);
  color: var(--night-ink);
  border-top: 1px solid var(--charcoal-line);
  border-bottom: 1px solid var(--charcoal-line);
}
.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: clamp(28px, 3.5vw, 44px) 16px;
  border-left: 1px solid var(--charcoal-line);
}
.stat:first-child { border-left: 0; }
.stat-num {
  /* Same serif as the hero headline, so the band reads as one voice */
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 3.8vw, 52px);
  line-height: 1;
  letter-spacing: -0.015em;
  font-variant-numeric: lining-nums;
  color: var(--night-ink);
}
.stat-suffix {
  color: var(--band-suffix);
  font-size: 0.6em;
  margin-left: 3px;
  vertical-align: 0.3em;
  letter-spacing: 0;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--night-ink-3);
}

@media screen and (max-width: 767px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 26px 12px; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--charcoal-line); }
}

/* Section heading: mono meta + display h2 */
.sec-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: clamp(48px, 6vw, 80px);
}
.sec-meta {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sec-meta .idx { color: var(--amber-deep); }
.sec-meta .lbl { color: var(--ink-3); }
.sec-meta::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 10px;
}
.section-dark .sec-meta .idx { color: var(--amber-alt); }
.section-dark .sec-meta .lbl { color: var(--night-ink-3); }
.section-dark .sec-meta::after { background: var(--night-line); }

.sec-head h2 {
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 24ch;
}
.sec-head h2 .ser {
  font-size: 1.06em;
  line-height: 0;
}

/* Mono micro-label utility */
.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.section-dark .mono-label { color: var(--night-ink-3); }

/* ---------- Buttons ----------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out),
              border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out),
              box-shadow 0.25s var(--ease-out);
}
.btn .arr {
  font-family: var(--font-display);
  font-size: 0.9em;
  color: var(--amber);
  transition: transform 0.25s var(--ease-out);
}
.btn:hover .arr { transform: translate(2px, -2px); }

/* Primary — ink on paper; inverts to paper on ink inside dark sections */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  padding: 17px 28px;
}
.btn-primary:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
  box-shadow: 0 12px 28px -14px rgba(25, 23, 18, 0.5);
  transform: translateY(-1px);
}
.section-dark .btn-primary,
.contact-head .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.section-dark .btn-primary:hover,
.contact-head .btn-primary:hover {
  background: var(--btn-hover-alt);
  border-color: var(--btn-hover-alt);
  box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.6);
}

/* Secondary — hairline ink outline, fills on hover */
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  padding: 16px 26px;
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-sm { padding: 12px 20px; font-size: 14px; }
.btn-lg { padding: 20px 36px; font-size: 16px; }

/* ---------- Navbar ------------------------------------------------------ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
/* The blur lives on a pseudo-element, NOT the navbar itself: a
   backdrop-filter on the header would turn it into the containing block
   for the position:fixed mobile menu and pin the menu inside the 76px bar. */
.navbar.scrolled { border-bottom-color: var(--line); }
.navbar.scrolled::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--nav-veil);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 24px;
}
.nav-brand { display: inline-flex; align-items: center; position: relative; z-index: 130; }
/* The wordmark is white — invert it to ink for the light ground */
.nav-brand img,
.footer-brand img { filter: var(--logo-filter); }
.section-dark .footer-brand img { filter: var(--logo-filter-alt); }
.nav-brand img { width: 118px; height: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.25s ease;
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: var(--amber-deep);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-links .btn { display: none; }

.nav-actions { display: flex; align-items: center; gap: 18px; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 8px;
  position: relative;
  z-index: 130;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  margin: 5px auto;
  background: var(--ink);
  transition: transform 0.3s var(--ease-out), opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero -------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 140px 0 0;
  overflow: hidden;
}

/* Generative canvas layer — light-paper variant of the contour field */
.hero-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(110% 80% at 85% 10%, rgba(255, 178, 36, 0.12), transparent 55%),
    var(--paper);
}
.hero-field canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
/* Faint survey grid — the instrument DNA, drawn on paper */
.hero-field::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(130% 100% at 50% 20%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(130% 100% at 50% 20%, #000 25%, transparent 78%);
  pointer-events: none;
}
/* Legibility veil */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
    var(--veil-a) 0%,
    var(--veil-b) 38%,
    var(--veil-c) 82%,
    var(--paper) 100%);
  pointer-events: none;
}

.hero > .container { position: relative; z-index: 2; width: 100%; margin-top: auto; margin-bottom: auto; }

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 30px;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
.hero-kicker { animation: hero-in 0.8s var(--ease-out) 0.05s both; }
.hero h1 { animation: hero-in 0.9s var(--ease-out) 0.14s both; }
.hero-sub { animation: hero-in 0.9s var(--ease-out) 0.26s both; }
.hero-cta { animation: hero-in 0.9s var(--ease-out) 0.38s both; }
.hero-meta-inner { animation: hero-in 1s var(--ease-out) 0.55s both; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--amber-deep);
}

/* The editorial headline: serif, with an italic accent line */
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(48px, 7.2vw, 96px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.hero h1 .accent {
  font-style: italic;
  color: var(--amber-deep);
}

.hero-sub {
  color: var(--ink-2);
  max-width: 48ch;
  font-size: clamp(17px, 1.6vw, 19px);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Bottom meta strip */
.hero-meta {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
  margin-top: clamp(24px, 4vh, 48px);
}
.hero-meta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.hero-meta .scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.scroll-cue .tick {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--amber-deep);
  animation: cue-drop 2.2s var(--ease-out) infinite;
}
@keyframes cue-drop {
  0%   { transform: translateY(-4px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(6px); opacity: 0; }
}

/* ---------- About ------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.about-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}
.about-copy .sec-head { margin-bottom: 4px; align-self: stretch; }
.about-copy p {
  color: var(--ink-2);
  max-width: 58ch;
}
.about-copy .btn { margin-top: 10px; }

/* Rocket as a technical figure — white card on paper */
.about-visual { position: relative; }
.figure-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--card);
  padding: clamp(28px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
}
.figure-panel img {
  width: 100%;
  max-width: 240px;
  filter: var(--shadow-drop);
  animation: rocket-drift 19s ease-in-out infinite;
}
@keyframes rocket-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  13%  { transform: translate(3px, -5px) rotate(0.6deg); }
  27%  { transform: translate(-2px, -8px) rotate(-0.4deg); }
  41%  { transform: translate(-5px, -3px) rotate(0.3deg); }
  56%  { transform: translate(2px, -6px) rotate(0.8deg); }
  71%  { transform: translate(5px, -1px) rotate(-0.5deg); }
  86%  { transform: translate(-3px, -4px) rotate(0.2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Corner ticks */
.corner-ticks { position: relative; }
.corner-ticks::before,
.corner-ticks::after {
  content: "+";
  position: absolute;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--amber-deep);
  line-height: 1;
}
.corner-ticks::before { top: 10px; left: 12px; }
.corner-ticks::after { bottom: 10px; right: 12px; }
.section-dark .corner-ticks::before,
.section-dark .corner-ticks::after { color: var(--amber); }

/* ---------- Case studies (DARK instrument section) ----------------------- */
.case-carousel { position: relative; }
.case-viewport { overflow: hidden; }
.case-track {
  display: flex;
  align-items: stretch;
  transition: transform 0.55s var(--ease-out);
}
.case-card {
  flex: 0 0 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 3.5vw, 48px);
  border: 1px solid var(--night-line);
  border-radius: var(--radius);
  background: var(--night-raise);
}
.case-card:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.case-card:nth-child(even) .case-video { order: -1; }

.case-index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--amber);
  margin-bottom: 18px;
  display: block;
}
.case-text h3 {
  font-size: clamp(24px, 2.4vw, 32px);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--night-ink);
}
.case-text p { color: var(--night-ink-2); }
.case-tools {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.case-tools .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--night-ink-3);
  margin-right: 4px;
}
.tool-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--night-ink-2);
  padding: 5px 12px;
  border: 1px solid var(--night-line);
  border-radius: 999px;
  background: rgba(255, 178, 36, 0.05);
}

.case-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--night-line);
  background: #000;
}
.case-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Arrows */
.case-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(244, 242, 234, 0.25);
  background: #191712;
  color: var(--night-ink);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.case-arrow:hover {
  border-color: var(--amber);
  color: var(--amber);
}
.case-arrow.prev { left: -24px; }
.case-arrow.next { right: -24px; }
.case-arrow[hidden] { display: none; }

/* Pager */
.case-pager {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 28px;
}
.pager-num {
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--night-ink-3);
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.pager-num:hover { color: var(--night-ink); }
.pager-num[aria-current="true"] {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

/* YouTube link under the carousel */
.yt-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--night-ink-2);
  transition: color 0.25s ease;
}
.yt-more:hover { color: var(--amber); }
.yt-more .arr { transition: transform 0.25s var(--ease-out); }
.yt-more:hover .arr { transform: translate(2px, -2px); }

/* ---------- Services ---------------------------------------------------- */
/* White cards on paper, hairline grid — SideKick rhythm, Tavo details */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: clamp(30px, 3.2vw, 44px);
  background: var(--card);
  transition: background-color 0.35s ease;
}
.service-card:hover { background: var(--paper-2); }
.service-idx {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  transition: color 0.35s ease;
}
.service-card:hover .service-idx { color: var(--amber-deep); }
.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--night);
  border: 1px solid rgba(25, 23, 18, 0.9);
}
.service-icon img {
  width: 34px;
  height: 34px;
  transition: transform 0.35s var(--ease-out);
}
.service-card:hover .service-icon img { transform: translateY(-3px); }
.service-card h3 { font-size: 20px; letter-spacing: -0.01em; }
.service-card p { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Testimonials (horizontal scroller, 2-up) --------------------- */
.testimonial-scroller { position: relative; }
.testimonial-track {
  display: flex;
  gap: clamp(20px, 2.5vw, 28px);
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;
  /* room for card shadows so overflow doesn't clip them */
  padding: 6px 6px 26px;
  margin: -6px -6px 0;
}
.testimonial-track::-webkit-scrollbar { display: none; }

/* Marquee mode (JS-enhanced): the lane is transformed, so the track itself
   no longer scrolls. Transform gives sub-pixel, GPU-composited motion —
   scrollLeft snaps to whole pixels and stutters at slow speeds. */
.testimonial-track.is-marquee {
  /* block, not flex: the lane must be a full-width block child so the cards'
     50% flex-basis resolves against the track, not the lane's max-content */
  display: block;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}
.testimonial-track.is-marquee.is-dragging {
  cursor: grabbing;
  user-select: none;
}
.testimonial-lane {
  display: flex;
  gap: clamp(20px, 2.5vw, 28px);
  will-change: transform;
}

.review-card {
  flex: 0 0 calc(50% - clamp(20px, 2.5vw, 28px) / 2 - 6px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(26px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

/* Arrows — light-paper variant of the case-study arrows */
.t-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(25, 23, 18, 0.3);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.t-arrow:hover {
  border-color: var(--amber-deep);
  color: var(--amber-deep);
}
.t-arrow.prev { left: -24px; }
.t-arrow.next { right: -24px; }
.t-arrow[hidden] { display: none; }
.stars {
  display: flex;
  gap: 5px;
  color: var(--amber);
}
.stars svg { width: 15px; height: 15px; }
.review-text {
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.75;
}
.review-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.review-author img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.review-author .name { font-family: var(--font-display); font-weight: 500; font-size: 15.5px; }
.review-author .role {
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 3px;
}

/* ---------- Team / Bio -------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.team-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.team-portrait {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  width: min(100%, 340px);
  box-shadow: 0 1px 2px rgba(25, 23, 18, 0.04), 0 28px 56px -36px rgba(25, 23, 18, 0.3);
}
.team-portrait img {
  width: 100%;
  aspect-ratio: 7 / 8;
  object-fit: cover;
}
.team-card .name { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.team-card .role {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-deep);
}
.team-bio {
  color: var(--ink-2);
  font-size: clamp(18px, 1.7vw, 21px);
  line-height: 1.75;
}
.team-bio .ser { color: var(--ink); font-size: 1.05em; }

/* ---------- FAQ --------------------------------------------------------- */
.faq-list {
  max-width: 860px;
  border-top: 1px solid var(--line);
}
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px 4px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-align: left;
  transition: color 0.25s ease;
}
.faq-q:hover { color: var(--amber-deep); }
.faq-num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  flex: 0 0 auto;
  transition: color 0.25s ease;
}
.faq-item.open .faq-num,
.faq-q:hover .faq-num { color: var(--amber-deep); }
.faq-q .q-text { flex: 1; }
.faq-icon {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background: var(--ink-2);
  transition: transform 0.35s var(--ease-out), opacity 0.3s ease, background-color 0.3s ease;
}
.faq-icon::before { top: 7px; left: 0; width: 16px; height: 1.5px; }
.faq-icon::after { left: 7px; top: 0; width: 1.5px; height: 16px; }
.faq-item.open .faq-icon::before { background: var(--amber-deep); }
.faq-item.open .faq-icon::after { transform: rotate(90deg); opacity: 0; }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}
.faq-a p {
  padding: 0 40px 28px 4px;
  color: var(--ink-2);
  font-size: 16px;
  max-width: 68ch;
}

/* ---------- Contact (DARK closing statement) ----------------------------- */
.contact-head {
  margin-bottom: 0;
  align-items: center;
  text-align: center;
}
.contact-head .sec-meta::before {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--night-line);
  margin-right: 10px;
}
.contact-head h2 { color: var(--night-ink); }
.contact-head .btn { margin-top: 24px; }

/* Contour-field echo behind the dark contact section */
#contact.section-dark {
  background:
    radial-gradient(90% 120% at 50% 115%, rgba(255, 178, 36, 0.13), transparent 60%),
    var(--night);
}

/* ---------- Footer (dark, continuous with contact) ----------------------- */
.footer {
  position: relative;
  background: var(--night);
  color: var(--night-ink);
  border-top: 1px solid var(--night-line);
  padding: clamp(56px, 7vw, 88px) 0 36px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: clamp(40px, 5vw, 64px);
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-brand img { width: 128px; margin-bottom: 10px; filter: none; }
.footer-brand .body-text {
  color: var(--night-ink-3);
  font-family: var(--font-mono);
  font-size: 13px;
}
.footer-brand a.body-text:hover { color: var(--amber); }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--night-ink-3);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--night-ink-2); font-size: 15px; transition: color 0.25s ease; }
.footer-col a:hover { color: var(--night-ink); }
.footer-col .pending { color: var(--night-ink-3); cursor: default; font-size: 15px; }
.footer-divider { height: 1px; background: var(--night-line); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  color: var(--night-ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.footer-bottom a:hover { color: var(--night-ink); }

/* ---------- Privacy page (light theme) ----------------------------------- */
.legal { padding: 170px 0 110px; }
.legal-inner { max-width: 780px; }
.legal h1 {
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.legal .updated {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 52px;
}
.legal h2 {
  font-size: 24px;
  margin: 48px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.legal p { color: var(--ink-2); margin-bottom: 14px; }
.legal ul { color: var(--ink-2); padding-left: 22px; margin-bottom: 14px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--amber-deep); }
.legal a:hover { text-decoration: underline; }
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.back-home:hover { color: var(--amber-deep); }

/* ---------- Reveal-on-scroll -------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive -------------------------------------------------- */
@media screen and (max-width: 991px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { order: -1; max-width: 420px; }
  .team-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media screen and (max-width: 767px) {
  body { font-size: 16px; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: block; }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 120;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 96px var(--gutter) 48px;
    background: var(--paper);   /* fully opaque: must hide page content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }
  .nav-links.open { opacity: 1; visibility: visible; }
  .nav-links { counter-reset: menu; }
  .nav-links .nav-link {
    width: 100%;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--ink);
    counter-increment: menu;
    display: flex;
    align-items: baseline;
    gap: 16px;
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.45s var(--ease-out), opacity 0.45s ease;
  }
  .nav-links .nav-link::before {
    content: "0" counter(menu);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--amber-deep);
  }
  .nav-links .nav-link::after { display: none; }
  .nav-links.open .nav-link { transform: none; opacity: 1; }
  .nav-links.open .nav-link:nth-child(1) { transition-delay: 0.06s; }
  .nav-links.open .nav-link:nth-child(2) { transition-delay: 0.12s; }
  .nav-links.open .nav-link:nth-child(3) { transition-delay: 0.18s; }
  .nav-links .btn {
    display: inline-flex;
    margin-top: 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: transform 0.45s var(--ease-out) 0.24s, opacity 0.45s ease 0.24s,
                background-color 0.25s ease;
  }
  .nav-links.open .btn { opacity: 1; transform: none; }

  .hero { padding-top: 110px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { width: 100%; }
  .hero-meta-inner { flex-wrap: wrap; gap: 10px 20px; }
  .hero-coords .coords { display: none; }

  .case-card,
  .case-card:nth-child(even) { grid-template-columns: 1fr; }
  .case-card .case-video,
  .case-card:nth-child(even) .case-video { order: -1; }
  .case-arrow { width: 40px; height: 40px; font-size: 16px; }
  .case-arrow.prev { left: 6px; }
  .case-arrow.next { right: 6px; }
  .services-grid { grid-template-columns: 1fr; }
  .review-card { flex-basis: calc(100% - 12px); }
  .t-arrow { width: 40px; height: 40px; font-size: 16px; }
  .t-arrow.prev { left: 6px; }
  .t-arrow.next { right: 6px; }
  .faq-a p { padding-right: 8px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .scroll-cue .tick { animation: none; opacity: 1; }
}

@media (prefers-color-scheme: dark) {
/* ==========================================================================
   DARK THEME
   Same design, inverted: warm near-black ground, cream type, amber contour
   hero. The "inverted" sections flip to paper so the alternating rhythm of
   the page survives the inversion.
   Applied for prefers-color-scheme (unless the visitor picked light) and
   for an explicit [data-theme="dark"] choice.
   ========================================================================== */
:root:not([data-theme="light"]) {
  --paper: #12100c;
  --paper-2: #171410;
  --card: #1b1813;
  --ink: #f4f1ea;
  --ink-2: #b3ad9e;
  --ink-3: #857f6f;
  --line: rgba(244, 241, 234, 0.13);
  --line-strong: rgba(244, 241, 234, 0.26);

  --night: #f4f1ea;
  --night-raise: #ffffff;
  --night-ink: #191712;
  --night-ink-2: #6f695c;
  --night-ink-3: #9a937f;
  --night-line: rgba(25, 23, 18, 0.12);

  --amber-deep: #ffc457;
  --amber-alt: #a86e00;
  --amber-dim: rgba(255, 178, 36, 0.16);

  --logo-filter: none;
  --logo-filter-alt: invert(1) hue-rotate(180deg) brightness(0.92);
  --nav-veil: rgba(18, 16, 12, 0.85);
  --grid-line: rgba(244, 241, 234, 0.055);
  --dot-grid: rgba(244, 241, 234, 0.11);
  --veil-a: rgba(18, 16, 12, 0.35);
  --veil-b: rgba(18, 16, 12, 0.05);
  --veil-c: rgba(18, 16, 12, 0.55);
  --band-bg: #f4f1ea;
  --band-line: rgba(25, 23, 18, 0.14);
  --band-suffix: #a86e00;
  --btn-hover: #ffffff;
  --btn-hover-alt: #2a2823;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 26px 50px -34px rgba(0, 0, 0, 0.8);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -34px rgba(0, 0, 0, 0.75);
  --shadow-drop: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}
}

/* ==========================================================================
   DARK THEME
   Same design, inverted: warm near-black ground, cream type, amber contour
   hero. The "inverted" sections flip to paper so the alternating rhythm of
   the page survives the inversion.
   Applied for prefers-color-scheme (unless the visitor picked light) and
   for an explicit [data-theme="dark"] choice.
   ========================================================================== */
:root[data-theme="dark"] {
  --paper: #12100c;
  --paper-2: #171410;
  --card: #1b1813;
  --ink: #f4f1ea;
  --ink-2: #b3ad9e;
  --ink-3: #857f6f;
  --line: rgba(244, 241, 234, 0.13);
  --line-strong: rgba(244, 241, 234, 0.26);

  --night: #f4f1ea;
  --night-raise: #ffffff;
  --night-ink: #191712;
  --night-ink-2: #6f695c;
  --night-ink-3: #9a937f;
  --night-line: rgba(25, 23, 18, 0.12);

  --amber-deep: #ffc457;
  --amber-alt: #a86e00;
  --amber-dim: rgba(255, 178, 36, 0.16);

  --logo-filter: none;
  --logo-filter-alt: invert(1) hue-rotate(180deg) brightness(0.92);
  --nav-veil: rgba(18, 16, 12, 0.85);
  --grid-line: rgba(244, 241, 234, 0.055);
  --dot-grid: rgba(244, 241, 234, 0.11);
  --veil-a: rgba(18, 16, 12, 0.35);
  --veil-b: rgba(18, 16, 12, 0.05);
  --veil-c: rgba(18, 16, 12, 0.55);
  --band-bg: #f4f1ea;
  --band-line: rgba(25, 23, 18, 0.14);
  --band-suffix: #a86e00;
  --btn-hover: #ffffff;
  --btn-hover-alt: #2a2823;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 26px 50px -34px rgba(0, 0, 0, 0.8);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 22px 44px -34px rgba(0, 0, 0, 0.75);
  --shadow-drop: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}

/* ---------- Theme toggle (quiet, in the nav) ---------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
              background-color 0.25s var(--ease-out);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line); background: var(--amber-dim); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Show the icon for the theme you'd switch TO */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
