/* Ace Countertops — one-page landing.
   Brand: black-tie card table meets shop floor (design/VOICE.md).
   Tokens mirror assets/theme.css; the double gold+white keyline from the
   printed door-hanger is the signature section divider. */

:root {
  color-scheme: dark;
  --bg: #141414;
  --bg-deep: #0F0F0E;
  --surface: #1B1A17;
  --surface-hover: #262420;
  --fg: #F5F1E6;
  --fg-muted: #C8C1B2;
  --fg-subtle: #9B9483;
  --border: #2D2A24;
  --border-strong: #4A4232;
  --gold-hi: #F1E2A0;
  --gold: #D2AE5A;
  --gold-deep: #8C6E2E;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); }
section, header.hero { scroll-margin-top: 4.5rem; }

/* skip link — off-screen until a keyboard lands on it (mirrors .skip in
   assets/site.css so the landing behaves like every server-rendered page) */
.skip {
  position: absolute; left: -999px;
  background: var(--surface); color: var(--fg);
  padding: 10px 16px; border-radius: var(--radius);
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 0.6em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 6.5vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4.4vw, 3rem); }

.kicker {
  font: 600 0.78rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.section-sub { color: var(--fg-muted); max-width: 42rem; margin: 0 0 2rem; }

section { padding: clamp(3.5rem, 9vh, 6.5rem) var(--pad); max-width: 78rem; margin: 0 auto; }

/* signature divider: thin gold rule over a white hairline */
.rule {
  height: 0;
  max-width: 78rem;
  margin: 0 auto;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-deep), var(--gold) 22%, var(--gold-hi) 50%, var(--gold) 78%, var(--gold-deep)) 1;
  position: relative;
}
.rule::after {
  content: "";
  position: absolute;
  inset: 3px 8% auto;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}

/* ── buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 0.95rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #B08F45);
  color: #141414;
  border-color: var(--gold-deep);
}
.btn-gold:hover { filter: brightness(1.08); }
.btn-line {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-line:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-wide { width: 100%; text-align: center; }

/* ── nav ─────────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem var(--pad);
  background: rgba(15, 15, 14, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-brand img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 1.2rem; margin-left: auto; }
.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.92rem;
}
.nav-links a:hover { color: var(--gold-hi); }
.nav-cta { padding: 0.5rem 1rem; font-size: 0.88rem; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; cursor: pointer; color: var(--fg); font-size: 18px; }
.nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(15, 15, 14, 0.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
    padding: 4px var(--pad) 12px; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav-links a:last-child { border-bottom: 0; }
  .nav[data-open="true"] .nav-links { display: flex; }
  /* JS off: no toggle, menu laid out in flow — same fallback as the content site */
  .no-js .nav-toggle { display: none; }
  .no-js .nav-links { display: flex; position: static; padding: 0; }
}

/* ── 1 · hero ────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 6rem var(--pad) 4rem;
  background:
    radial-gradient(120% 90% at 50% 0%, #23201a 0%, var(--bg-deep) 70%);
  overflow: hidden;
}
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 100% at 50% 0%, rgba(20, 20, 20, 0.42), rgba(15, 15, 14, 0.8));
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 52rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}
/* reduced motion / no video: hold on the poster still */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none !important; }
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url(/assets/video/hero-poster.jpg) center / cover no-repeat;
  }
}
.hero-mark { margin: 0 auto 1.5rem; width: clamp(160px, 24vw, 270px); height: auto;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.6)); }
.hero-sub { color: var(--fg-muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 36rem; margin: 0 auto 2rem; }
.hero-ctas { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero-hint {
  position: absolute;
  bottom: 1.2rem; left: 50%;
  translate: -50%;
  color: var(--gold);
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(6px); opacity: 0.5; } }

/* ── 2 · pitch ───────────────────────────────────────────────────────── */
.pitch { max-width: 56rem; }
.pitch-lines { display: grid; gap: 1.4rem; margin-top: 2.5rem; }
.pitch-line {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--fg-muted);
  padding-left: 1.2rem;
  border-left: 2px solid var(--border-strong);
  opacity: 0;               /* revealed by WAAPI; forced on if JS is off */
}
.no-js .pitch-line, .pitch-line.shown { opacity: 1; }
.pitch-line em { color: var(--gold-hi); font-style: normal; }
.pitch-line-big { color: var(--fg); font-weight: 650; border-left-color: var(--gold); }
.pitch-serious { color: var(--fg); }

/* ── 3 · color wall ──────────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.wall-controls {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.8rem;
}
.wall-controls .chip-row { margin-bottom: 0; }
.wall-search {
  flex: 0 1 15rem; min-width: 10rem;
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font: 500 0.85rem/1.2 var(--font);
}
.wall-search::placeholder { color: var(--fg-subtle); }
.wall-search:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 1px; border-color: var(--gold); }
.wall-more-row { display: flex; justify-content: center; margin-top: 1.1rem; }
.wall-more {
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--gold-hi);
  font: 600 0.9rem/1.2 var(--font);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.wall-more:hover { border-color: var(--gold); color: var(--fg); }
.chip {
  padding: 0.38rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg-muted);
  font: 500 0.85rem/1.2 var(--font);
  cursor: pointer;
}
.chip:hover { border-color: var(--gold); color: var(--fg); }
.chip[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: var(--gold-deep);
  color: #141414;
  font-weight: 650;
}
.color-count { font: 500 0.8rem/1 var(--mono); color: var(--fg-subtle); margin: 0 0 1.2rem; }
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.9rem;
}
.swatch {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.swatch:hover { border-color: var(--gold); transform: translateY(-2px); }
.swatch-img { aspect-ratio: 1; background: #201d18; overflow: hidden; }
.swatch-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.swatch-img img.loaded { opacity: 1; }
.swatch-name { padding: 0.55rem 0.7rem 0.1rem; font-size: 0.86rem; font-weight: 600; }
.swatch-family { padding: 0 0.7rem 0.6rem; font-size: 0.74rem; color: var(--fg-subtle); }

/* ── 4 · loupe ───────────────────────────────────────────────────────── */
.loupe-stage { margin: 0; }
#loupe-canvas {
  width: 100%;
  height: clamp(300px, 52vw, 520px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #1a1815;
  cursor: crosshair;
  touch-action: none;
}
#loupe-caption {
  margin-top: 0.7rem;
  font: 500 0.85rem/1 var(--mono);
  color: var(--gold);
}

/* ── 5 · estimate ────────────────────────────────────────────────────── */
.est-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px) { .est-grid { grid-template-columns: 1fr; } }
.est-controls { display: grid; gap: 1.1rem; }
.est-controls label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-muted);
}
.est-controls output { float: right; color: var(--gold-hi); font: 600 0.88rem/1.4 var(--mono); }
.est-controls input[type="range"] { width: 100%; margin-top: 0.45rem; accent-color: var(--gold); }
.est-controls select, .est-controls input[type="number"] {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}
.est-steppers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.est-receipt {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.6rem;
  font-family: var(--mono);
  position: sticky;
  top: 5rem;
}
.est-row { display: flex; gap: 0.5rem; align-items: baseline; color: var(--fg-muted); font-size: 0.9rem; }
.est-row span:first-child { font-size: 1.6rem; font-weight: 700; color: var(--fg); }
.est-lines { margin: 1.1rem 0; display: grid; gap: 0.45rem; }
.est-lines div { display: flex; justify-content: space-between; font-size: 0.88rem; }
.est-lines dt { color: var(--fg-subtle); }
.est-lines dd { margin: 0; }
.est-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px solid var(--gold);
  padding-top: 0.9rem;
}
.est-total strong { font-size: 2rem; color: var(--gold-hi); }
.est-engine { font-size: 0.7rem; color: var(--fg-subtle); letter-spacing: 0.06em; }
.est-note, .est-studio { font-family: var(--font); font-size: 0.84rem; color: var(--fg-muted); }

/* ── 6 · scenes ──────────────────────────────────────────────────────── */
.scene-list { display: grid; gap: 2.2rem; margin-top: 2.5rem; }
.scene {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}
.scene img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  scale: 1.14;              /* headroom for parallax drift */
  background: #201d18;
}
.scene figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 2.2rem 1.4rem 1rem;
  background: linear-gradient(transparent, rgba(15, 15, 14, 0.88));
  font-size: 0.95rem;
  font-weight: 600;
}
/* scroll-driven parallax where supported; scenes.js provides the fallback */
@supports (animation-timeline: view()) {
  html.has-sda .scene img {
    animation: scene-drift linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
  @keyframes scene-drift {
    from { translate: 0 -5.5%; }
    to   { translate: 0 5.5%; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene img { animation: none !important; translate: 0 !important; scale: 1; }
  .hero-hint { animation: none; }
}

/* ── 7 · edges ───────────────────────────────────────────────────────── */
.edge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}
.edge-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1rem 0.9rem;
}
.edge-card canvas { width: 100%; height: 110px; display: block; }
.edge-card h3 { font-size: 0.95rem; margin: 0.6rem 0 0.1rem; }
.edge-card p { margin: 0; font: 500 0.8rem/1.4 var(--mono); color: var(--gold); }

/* ── 8 · process ─────────────────────────────────────────────────────── */
.process-track { display: grid; grid-template-columns: 24px 1fr; gap: 1.4rem; margin-top: 2.5rem; }
.process-svg { width: 8px; height: 100%; justify-self: center; overflow: visible; }
.process-rail { stroke: var(--border-strong); stroke-width: 2; }
.process-fill { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; }
.process-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; counter-reset: step; }
.process-step { position: relative; opacity: 0.45; transition: opacity 0.4s; }
.process-step.lit { opacity: 1; }
.process-step h3 { font-size: 1.35rem; color: var(--gold-hi); }
.process-step h3::before {
  counter-increment: step;
  content: counter(step) " · ";
  font-family: var(--mono);
  color: var(--gold);
}
.process-step p { max-width: 38rem; color: var(--fg-muted); margin: 0; }

/* ── 9 · share ───────────────────────────────────────────────────────── */
.share-stage { max-width: 40rem; }
#share-canvas {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.8);
}
.share-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.share-status { font: 500 0.82rem/1.4 var(--mono); color: var(--gold); min-height: 1.2em; }

/* ── 10 · quote ──────────────────────────────────────────────────────── */
.quote-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 860px) { .quote-grid { grid-template-columns: 1fr; } }
#quote-form { display: grid; gap: 1.1rem; }
#quote-form label { font-size: 0.88rem; font-weight: 600; color: var(--fg-muted); }
#quote-form input, #quote-form textarea {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
#quote-form input:user-invalid, #quote-form input.invalid { border-color: #D98A7B; }
.q-attach { font-size: 0.82rem; color: var(--fg-subtle); margin: 0; }
.q-status { font: 500 0.9rem/1.5 var(--mono); color: var(--gold-hi); min-height: 1.4em; margin: 0; }
.quote-direct {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.6rem;
  display: grid;
  gap: 0.9rem;
}
.quote-direct > p { margin: 0; font-weight: 650; }
.quote-fine { font-size: 0.78rem; color: var(--fg-subtle); }

/* ── footer ──────────────────────────────────────────────────────────── */
.footer { text-align: center; padding: 0 var(--pad) 3.5rem; }
.footer .rule { margin-bottom: 2.5rem; }
.footer img { margin: 0 auto 1rem; width: 90px; height: auto; }
.footer p { color: var(--fg-muted); margin: 0.3rem 0; }
.footer-fine { font-size: 0.78rem; color: var(--fg-subtle); max-width: 44rem; margin: 0.8rem auto 0; }
.footer-links { display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 58rem; margin: 0 auto 2.5rem; text-align: left; }
.footer-links h4 { font: 600 0.76rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.6rem; }
.footer-links a { display: block; padding: 0.26rem 0; color: var(--fg-muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--gold-hi); }
@media (max-width: 640px) { .footer-links { grid-template-columns: 1fr 1fr; } }
