:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --rail: #efebe2;
  --ink: #17160f;
  --ink-2: #5b5749;
  --rule: #e2ddd0;
  --accent: #e8501c;
  --accent-soft: #fde7dd;
  --accent-ink: #ffffff;
  --font: "Archivo", system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f;
    --surface: #1e1d17;
    --rail: #1b1a14;
    --ink: #f2eee5;
    --ink-2: #aaa492;
    --rule: #34322a;
    --accent: #ff6a35;
    --accent-soft: #3a2117;
    --accent-ink: #15140f;
  }
}
:root[data-theme="dark"] {
  --bg: #15140f;
  --surface: #1e1d17;
  --rail: #1b1a14;
  --ink: #f2eee5;
  --ink-2: #aaa492;
  --rule: #34322a;
  --accent: #ff6a35;
  --accent-soft: #3a2117;
  --accent-ink: #15140f;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font); -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { letter-spacing: -0.025em; text-wrap: balance; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); }
.header-row { display: flex; align-items: center; gap: 20px; height: 72px; }
.wordmark { font: 900 1.3rem/1 var(--font); font-stretch: 112%; letter-spacing: -0.03em; text-decoration: none; margin-right: auto; }
.wordmark span { color: var(--accent); }
.phone-link { font-weight: 600; font-size: 0.95rem; text-decoration: none; color: var(--ink-2); }
.phone-link:hover { color: var(--ink); }
@media (max-width: 560px) {
  .phone-link { display: none; }
  .btn-sm .long { display: none; }
  .client-strip { gap: 8px 20px; margin-top: 36px; }
  .client-strip li { font-size: 0.92rem; }
  .client-strip li:nth-child(n+4) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font: 700 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-outline { border-color: var(--accent); color: var(--ink); background: transparent; }
.btn-sm { min-height: 42px; padding: 0 18px; font-size: 0.92rem; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(32px, 4vw, 48px); text-align: center; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface);
  font-size: 0.9rem; font-weight: 600; margin-bottom: 28px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--accent); }
.hero h1 {
  font-weight: 800; font-stretch: 105%;
  font-size: clamp(2.5rem, 6.4vw, 5.25rem); line-height: 1.02; max-width: 17ch;
}
.sub { margin: 24px 0 32px; font-size: clamp(1.1rem, 1.7vw, 1.3rem); color: var(--ink-2); max-width: 46ch; }
.client-strip {
  list-style: none; padding: 0; margin: 48px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 36px;
}
.client-strip li { font-weight: 800; font-stretch: 90%; font-size: 1.05rem; color: var(--ink-2); letter-spacing: -0.01em; opacity: 0.85; }

/* Showcase stage */
.showcase { padding-bottom: clamp(48px, 7vw, 88px); }
.stage {
  border-radius: 20px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--rule);
  box-shadow: 0 40px 80px -40px rgba(23, 22, 15, 0.35);
}
.stage-bar { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.stage-bar > span { width: 11px; height: 11px; border-radius: 50%; background: var(--rule); }
.stage-bar > span:first-child { background: var(--accent); }
.stage-url { margin-left: 14px; font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.stage-count { margin-left: auto; font-size: 0.8rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stage-screens { position: relative; aspect-ratio: 1440 / 820; background: var(--rail); }
.screen { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 0.7s ease; }
.screen.on { opacity: 1; }
.screen > a { position: absolute; inset: 0; display: block; }
.screen .desk { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.screen .phone {
  position: absolute; right: 4%; bottom: -2px; width: 17%; aspect-ratio: 390 / 700;
  border: 6px solid #17160f; border-bottom: 0; border-radius: 26px 26px 0 0; overflow: hidden; background: #fff;
  box-shadow: -16px 0 40px -16px rgba(0, 0, 0, 0.5);
}
.screen .phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.screen figcaption {
  position: absolute; left: 20px; bottom: 20px; padding: 10px 16px; border-radius: 12px;
  background: rgba(23, 22, 15, 0.82); color: #fff; font-weight: 700; font-size: 0.95rem;
}
.screen figcaption span { font-weight: 500; opacity: 0.75; margin-left: 8px; }
@media (max-width: 640px) {
  .screen .phone { width: 26%; border-width: 4px; border-radius: 16px 16px 0 0; }
  .screen figcaption { left: 10px; bottom: 10px; font-size: 0.8rem; padding: 6px 10px; }
  .screen figcaption span { display: none; }
}

/* Body: rail + main column */
.body { padding-bottom: clamp(56px, 8vw, 104px); }
.body-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.rail { position: sticky; top: 96px; align-self: start; display: grid; gap: 36px; }
.rail-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 24px; display: grid; gap: 14px; justify-items: start; }
.rail h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.rail p { color: var(--ink-2); font-size: 0.98rem; }
.rail-block { display: grid; gap: 14px; padding-top: 28px; border-top: 1px solid var(--rule); }
.rail .dots li { font-size: 0.95rem; }
@media (max-width: 880px) {
  .body-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
  .rail-card { display: none; }
  .rail-block { border-top: 0; padding-top: 0; }
}

.main-col { display: grid; gap: clamp(48px, 6vw, 72px); }
.block { display: grid; gap: 18px; justify-items: start; scroll-margin-top: 96px; }
.block h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; line-height: 1.1; }
.block > p { color: var(--ink-2); }
.dots { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dots li { position: relative; padding-left: 22px; color: var(--ink-2); }
.dots li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dots b { color: var(--ink); font-weight: 700; }
.dots.two { grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.dots.two li { color: var(--ink); }
@media (max-width: 560px) { .dots.two { grid-template-columns: 1fr; } }
.honest { font-weight: 600; color: var(--ink) !important; }

/* Form */
.check-form {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 22px; margin-top: 8px;
}
.check-form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.88rem; }
.check-form input {
  width: 100%; font: 400 1rem/1.3 var(--font); color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px;
}
.check-form input:focus { border-color: var(--accent); outline: none; }
.check-form .btn { grid-column: 1 / -1; justify-self: start; border: 0; }
.check-form .btn[disabled] { opacity: 0.6; cursor: wait; }
.form-status { grid-column: 1 / -1; font-weight: 600; min-height: 1.4em; }
.form-status.ok { color: #2f7d3a; }
.form-status.err { color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.or-call { color: var(--ink-2); }
@media (max-width: 720px) { .check-form { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 28px 0 40px; }
.footer-row { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; }
.footer-row p { color: var(--ink-2); font-size: 0.92rem; }
.footer-row a { text-decoration: none; }

/* Embedded grader (smogcheckdeals.net/embed/grade) */
.grader { width: 100%; background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 14px; }
.grader iframe { display: block; width: 100%; height: 190px; border: 0; background: transparent; color-scheme: light; transition: height 0.2s ease; }
.callback { padding-top: clamp(32px, 4vw, 48px); border-top: 1px solid var(--rule); }
.callback h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
.grader-fallback { display: grid; gap: 14px; justify-items: start; padding: 10px 6px; }
.grader-fallback[hidden] { display: none; }
.grader-fallback p { color: var(--ink-2); }
