/* ── Soritch homepage ─────────────────────────────────────────────
   Linear-style layout: tight sans headlines, grey supporting copy,
   hairline section dividers, big product visuals, mono figure labels. */

:root,
[data-theme="dark"] {
  --bg: #08090a;
  --bg-2: #0f1011;
  --bg-3: #141516;
  --fg: #f7f8f8;
  --fg-2: #d0d6e0;
  --muted: #8a8f98;
  --faint: #62666d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --art: rgba(255, 255, 255, .42);
  --btn-bg: #e6e6e6;
  --btn-fg: #08090a;
  --green: #7cc79a;
  --red: #e0806f;
  --track: #232427;
  --fade: #08090a;
}

[data-theme="light"] {
  --bg: #fcfcfc;
  --bg-2: #f4f5f5;
  --bg-3: #eeeff0;
  --fg: #0e0f10;
  --fg-2: #33363b;
  --muted: #6b6f76;
  --faint: #9a9ea5;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);
  --art: rgba(0, 0, 0, .45);
  --btn-bg: #0e0f10;
  --btn-fg: #fff;
  --green: #2f8a57;
  --red: #c4513f;
  --track: #e2e3e5;
  --fade: #fcfcfc;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }

/* Theme-aware screenshots: every figure holds a dark and a light image */
[data-theme="dark"]  .for-light,
[data-theme="light"] .for-dark { display: none; }

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 72px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}
nav .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; letter-spacing: -.02em; }
.logo svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 24px; margin-left: auto; list-style: none; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color .15s ease; }
.nav-links a:hover { color: var(--fg); }
.nav-sep { width: 1px; height: 18px; background: var(--line-2); }
.nav-right { display: flex; align-items: center; gap: 14px; }

.theme-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s ease;
}
.theme-toggle:hover { color: var(--fg); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="dark"]  .icon-moon,
[data-theme="light"] .icon-sun { display: none; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 999px;
  font: 500 13.5px/1 "Inter", sans-serif;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: opacity .15s ease, background-color .15s ease;
}
.btn-solid { background: var(--btn-bg); color: var(--btn-fg); }
.btn-solid:hover { opacity: .88; }
.btn-ghost { background: var(--bg-3); color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); }
.btn-lg { height: 40px; padding: 0 18px; font-size: 14.5px; }

.more { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; transition: color .15s ease; }
.more:hover { color: var(--fg); }
.more svg { width: 13px; height: 13px; transition: transform .15s ease; }
.more:hover svg { transform: translateX(2px); }

/* ── Hero ────────────────────────────────────────────────────── */
.hero { padding-top: 200px; }
.hero h1 {
  font-weight: 510; font-size: clamp(42px, 5.6vw, 72px);
  line-height: 1.02; letter-spacing: -.035em; max-width: 17ch;
}
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 28px; }
.hero-sub { font-size: 17px; color: var(--muted); max-width: 520px; }
.hero-new { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.hero-new b { color: var(--fg); font-weight: 500; }
.hero-new:hover { color: var(--fg); }
.hero-new svg { width: 12px; height: 12px; }
.hero-actions { display: flex; gap: 10px; margin-top: 32px; }

/* The hero window starts tilted back and flattens as the page scrolls */
.hero-visual { position: relative; margin-top: 64px; perspective: 2200px; }
.hero-visual .tilt {
  transform-origin: 50% 0%;
  transform: rotateX(var(--tilt, 22deg)) scale(var(--sc, .94));
  will-change: transform;
}
.hero-visual::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 38%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--fade) 92%);
}
.hero-visual img { width: 100%; }

/* ── Statement + figures ─────────────────────────────────────── */
.statement { padding: 120px 0 0; }
.statement > .wrap > p {
  font-weight: 510; font-size: clamp(24px, 2.7vw, 34px); line-height: 1.22; letter-spacing: -.022em;
  max-width: 900px; color: var(--muted);
}
.statement > .wrap > p b { color: var(--fg); font-weight: 510; }

.figs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 96px; padding-bottom: 140px; }
.figs > div { padding: 0 32px 0 0; }
.figs > div + div { padding-left: 32px; border-left: 1px solid var(--line); }
.fig { width: 100%; max-width: 280px; height: auto; margin: 36px auto 40px; display: block; overflow: visible; }
.fig path, .fig ellipse, .fig line, .fig circle { fill: var(--bg); stroke: var(--art); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fig .thin { stroke-width: .75; }
.fig .dash { fill: none; stroke-dasharray: 2 3; }
.fig .accent { fill: none; stroke: var(--green); stroke-width: 1.5; }
.figs h3 { font-size: 15px; font-weight: 510; color: var(--fg); }
.figs p { color: var(--muted); margin-top: 6px; max-width: 320px; }

/* ── Feature sections ────────────────────────────────────────── */
.feature { border-top: 1px solid var(--line); padding-top: 128px; overflow-x: clip; }
.feature-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.feature-head h2 { font-weight: 510; font-size: clamp(34px, 3.8vw, 48px); line-height: 1.04; letter-spacing: -.03em; }
.feature-head p { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; color: var(--fg-2); letter-spacing: -.01em; }
.feature-head .more { margin-top: 28px; }

/* Visual: a primary window, with a second one that slides up over it on scroll */
.visual { position: relative; margin-top: 72px; padding-bottom: 12%; }
.visual .back { width: 86%; }
.visual .front {
  position: absolute; right: -2%; top: 18%; width: 62%;
  transform: translateY(calc((1 - var(--p, 0)) * 120px));
  opacity: calc(.15 + var(--p, 0) * .85);
  will-change: transform, opacity;
}
.visual.solo { padding-bottom: 0; }
.visual.solo .back { width: 100%; }
.visual::after {
  content: ""; position: absolute; inset: auto -40px 0 -40px; height: 26%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--fade) 88%);
}

.subfeatures {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 48px;
  border-top: 1px solid var(--line); margin-top: 12px; padding: 36px 0 128px;
}
.subfeatures .label { color: var(--faint); font-size: 14px; }
.subfeatures ul { list-style: none; display: grid; gap: 14px; }
.subfeatures li { font-size: 14px; color: var(--fg-2); }
.subfeatures li span { display: block; color: var(--faint); font-size: 13px; margin-top: 2px; }

/* Score card overlay used in the analysis section */
.score-card {
  position: absolute; right: 0; top: 14%; width: min(360px, 38%);
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2);
  padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
  transform: translateY(calc((1 - var(--p, 0)) * 120px));
  opacity: calc(.15 + var(--p, 0) * .85);
}
.score-top { display: flex; align-items: center; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.gauge { width: 88px; height: 88px; flex: none; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); }
.gauge .g-track { stroke: var(--track); }
.gauge .g-val { stroke: var(--green); stroke-dasharray: 0 999; transition: stroke-dasharray 1.4s cubic-bezier(.2,.7,.2,1); }
.gauge .g-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-family: "JetBrains Mono", monospace; }
.gauge .g-num b { font-weight: 500; font-size: 21px; line-height: 1; }
.gauge .g-num span { font-size: 9.5px; color: var(--faint); margin-top: 3px; }
.score-top h4 { font-weight: 510; font-size: 14.5px; margin-top: 4px; }
.score-top h4 span { color: var(--green); }
.factors { list-style: none; margin-top: 6px; }
.factors li { padding: 8px 0 6px; }
.factors .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--fg-2); }
.factors .row b { font-family: "JetBrains Mono", monospace; font-weight: 400; font-size: 12px; }
.factors .bar { height: 2px; background: var(--track); margin-top: 6px; position: relative; overflow: hidden; }
.factors .bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--fg); transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.score-card.live .factors .bar i { width: var(--w); }

/* ── Closing CTA ─────────────────────────────────────────────── */
.cta { border-top: 1px solid var(--line); padding: 180px 0 200px; text-align: center; }
.cta h2 { font-weight: 510; font-size: clamp(40px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -.035em; }
.eform { display: flex; gap: 10px; max-width: 420px; margin: 40px auto 0; }
.einput {
  flex: 1; min-width: 0; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  font: 14.5px "Inter", sans-serif; outline: none; transition: border-color .15s ease;
}
.einput::placeholder { color: var(--faint); }
.einput:focus { border-color: var(--line-2); }
.einput.bad { border-color: var(--red); }
.cta .note { margin-top: 18px; font-size: 13.5px; color: var(--faint); }
.smsg { display: none; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; color: var(--green); font-size: 15px; }
.smsg svg { width: 16px; height: 16px; }
.cta .note a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.aform { display: none; margin-top: 16px; }
.aform.open { display: flex; }
.amsg { min-height: 1.4em; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.amsg.ok { color: var(--green); }
.amsg.err { color: var(--red); }

/* ── Footer ──────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding: 64px 0 48px; font-size: 13.5px; }
.foot { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.foot h4 { font-weight: 510; font-size: 13.5px; margin-bottom: 14px; }
.foot ul { list-style: none; display: grid; gap: 10px; color: var(--muted); }
.foot a:hover { color: var(--fg); }
.foot-base { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; color: var(--faint); font-size: 12.5px; flex-wrap: wrap; }

/* ── Reveal ──────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  nav { height: 60px; }
  .nav-links, .nav-sep { display: none; }
  .nav-right { margin-left: auto; }
  .hero { padding-top: 124px; }
  .hero-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-sub { font-size: 16px; }
  .hero-visual { margin-top: 44px; }

  .statement { padding-top: 72px; }
  .figs { grid-template-columns: 1fr; margin-top: 40px; padding-bottom: 88px; }
  .figs > div, .figs > div + div { padding: 0 0 36px; border-left: 0; }
  .figs > div + div { border-top: 1px solid var(--line); padding-top: 12px; }
  .fig { max-width: 220px; margin: 24px auto 28px; }

  .feature { padding-top: 88px; }
  .feature-head { grid-template-columns: 1fr; gap: 18px; }
  .visual { margin-top: 44px; }
  .visual .back { width: 100%; }
  .visual .front { position: relative; right: auto; top: auto; width: 88%; margin: -18% 0 0 auto; }
  .score-card { position: relative; top: auto; right: auto; width: 100%; margin-top: -8%; }
  .subfeatures { grid-template-columns: 1fr; gap: 14px; padding: 28px 0 88px; }

  .cta { padding: 120px 0 130px; }
  .eform { flex-direction: column; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot > div:first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .hero-visual .tilt { transform: none !important; }
  .visual .front, .score-card { transform: none !important; opacity: 1 !important; }
}
