/* =================================================================
   Trace — landing page styles
   Mobile-first, dark by default, no external fonts, no build step.
   Light theme is supported via [data-theme="light"] for completeness,
   but the page ships dark to match the technical / privacy audience.
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Dark theme (default) */
  --bg:           #0b0e14;
  --bg-alt:       #11151f;
  --bg-card:      #161b27;
  --bg-elev:      #1c2230;
  --border:       #232a3a;
  --border-soft:  #1b2230;

  --text:         #e7ebf3;
  --text-soft:    #aab3c5;
  --text-dim:     #6f7b91;

  --brand:        #6ea8fe;   /* calm blue — "trace" line color */
  --brand-2:      #8b7dfb;   /* violet accent for gradients */
  --brand-ink:    #0b0e14;   /* text on brand buttons */

  --ok:           #4ade80;
  --warnc:        #fbbf24;
  --bad:          #fb7185;

  --radius:       14px;
  --radius-sm:    10px;
  --maxw:         1080px;
  --shadow:       0 10px 40px rgba(0, 0, 0, .45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
          Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* Optional light theme */
[data-theme="light"] {
  --bg:           #f7f8fb;
  --bg-alt:       #eef1f7;
  --bg-card:      #ffffff;
  --bg-elev:      #ffffff;
  --border:       #e1e6ef;
  --border-soft:  #eaeef5;

  --text:         #131722;
  --text-soft:    #3f4859;
  --text-dim:     #707b90;

  --brand:        #2f6fed;
  --brand-2:      #6d5cf0;
  --brand-ink:    #ffffff;

  --shadow:       0 10px 30px rgba(20, 30, 60, .12);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.02em; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: 9px 16px; font-size: .92rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
  box-shadow: 0 6px 20px rgba(110, 168, 254, .25);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(110, 168, 254, .35); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-card); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 12px; }

.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--brand); }
.brand-name { font-size: 1.18rem; letter-spacing: -.02em; }
.brand-tag {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 6px; font-weight: 600;
}

.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-link { color: var(--text-soft); font-size: .94rem; font-weight: 500; }
.nav-link:hover { color: var(--text); text-decoration: none; }

/* Hide secondary nav links on small screens; keep CTA + lang toggle */
@media (max-width: 720px) {
  .nav-link { display: none; }
}

/* Language toggle */
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-btn {
  background: transparent; color: var(--text-soft); border: 0; cursor: pointer;
  padding: 6px 11px; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
  transition: background .2s, color .2s;
}
.lang-btn[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 40px;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(110, 168, 254, .16), transparent 70%),
    radial-gradient(700px 360px at 85% 0, rgba(139, 125, 251, .12), transparent 70%);
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.pill {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(2rem, 7vw, 3.4rem);
  max-width: 16ch; margin-bottom: .35em;
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 70%, var(--brand)));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--text-soft); max-width: 56ch; margin: 0 auto 28px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-note { color: var(--text-dim); font-size: .86rem; margin-top: 16px; }

/* Hero product mock */
.hero-mock { width: 100%; max-width: 680px; margin-top: 44px; }
.mock-window {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; text-align: left;
}
.mock-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); background: var(--bg-elev); }
.mock-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.mock-dot:nth-child(1) { background: #fb7185; }
.mock-dot:nth-child(2) { background: #fbbf24; }
.mock-dot:nth-child(3) { background: #4ade80; }
.mock-search {
  display: flex; align-items: center; gap: 8px; flex: 1; margin-left: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text-dim);
}
.mock-query { font-size: .9rem; color: var(--text-soft); }

.mock-results { padding: 8px; }
.mock-row {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 8px;
}
.mock-row:hover { background: var(--bg-elev); }
.mock-time { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: .82rem; }
.mock-kind { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 5px; }
.mock-kind--web { color: #6ea8fe; background: rgba(110,168,254,.14); }
.mock-kind--doc { color: #4ade80; background: rgba(74,222,128,.14); }
.mock-kind--app { color: #8b7dfb; background: rgba(139,125,251,.16); }
.mock-text { color: var(--text); font-size: .92rem; }

/* ---------- Section headings ---------- */
.section-title { font-size: clamp(1.6rem, 4.5vw, 2.3rem); text-align: center; }
.section-lead { color: var(--text-soft); font-size: 1.08rem; max-width: 60ch; margin: 0 auto 8px; }
.kicker {
  display: block; text-align: center; text-transform: uppercase; letter-spacing: .12em;
  font-size: .76rem; font-weight: 700; color: var(--brand); margin-bottom: 8px;
}

/* ---------- Problem ---------- */
.problem-grid { display: grid; gap: 16px; margin-top: 36px; }
.problem-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.problem-card p { margin: 0; color: var(--text-soft); }
.problem-emoji { font-size: 1.7rem; display: block; margin-bottom: 10px; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 18px; margin-top: 40px; }
.step {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; position: relative;
}
.step-num {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; margin-bottom: 14px;
  color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.step-title { font-size: 1.2rem; }
.step p { margin: 0; color: var(--text-soft); }

/* ---------- Privacy / feature grid ---------- */
.feature-grid { display: grid; gap: 16px; margin-top: 38px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.feature-icon { font-size: 1.6rem; display: block; margin-bottom: 10px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: .4em; }
.feature-card p { margin: 0; color: var(--text-soft); font-size: .98rem; }

/* ---------- Comparison table ---------- */
.table-wrap { margin-top: 34px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 720px; font-size: .92rem; }
.compare-table th, .compare-table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.compare-table thead th { background: var(--bg-elev); font-size: .9rem; color: var(--text); position: sticky; top: 0; }
.compare-table tbody th { color: var(--text-soft); font-weight: 600; }
.compare-table .is-us { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.compare-table thead .is-us { color: var(--brand); font-weight: 800; }
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: 0; }

.yes  { color: var(--ok); font-weight: 600; }
.no   { color: var(--bad); font-weight: 600; }
.warn { color: var(--warnc); font-weight: 600; }

.fine-print { color: var(--text-dim); font-size: .8rem; margin-top: 14px; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; gap: 18px; margin-top: 38px; }
.price-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; display: flex; flex-direction: column;
}
.price-card--featured {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent), var(--shadow);
}
.price-badge {
  position: absolute; top: -12px; left: 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink);
  font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 11px; border-radius: 999px;
}
.price-badge--soon { background: var(--bg-elev); color: var(--text-soft); border: 1px solid var(--border); }
.price-name { font-size: 1.3rem; margin-top: 4px; }
.price-amount { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 2px; }
.price-now { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; }
.price-was { font-size: 1.2rem; color: var(--text-dim); text-decoration: line-through; }
.price-cycle { color: var(--text-dim); font-size: .9rem; margin: 0 0 18px; }
.price-list { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 11px; }
.price-list li { position: relative; padding-left: 26px; color: var(--text-soft); font-size: .96rem; }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px;
  border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg); transform-origin: left;
}
.price-foot { color: var(--text-dim); font-size: .82rem; margin: 14px 0 0; text-align: center; }
.price-card .btn { margin-top: auto; }

/* ---------- Waitlist ---------- */
.section--cta {
  background:
    radial-gradient(700px 300px at 50% 0, rgba(110, 168, 254, .12), transparent 70%),
    var(--bg);
}
.waitlist-form { margin-top: 26px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row input[type="email"] {
  flex: 1; min-width: 0; padding: 14px 16px; font-size: 1rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.field-row input[type="email"]::placeholder { color: var(--text-dim); }
.field-row input[type="email"]:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.field-row .btn { flex-shrink: 0; }

.form-msg { min-height: 1.4em; margin: 14px 0 0; font-weight: 600; text-align: center; }
.form-msg.is-ok  { color: var(--ok); }
.form-msg.is-err { color: var(--bad); }
.form-fine { color: var(--text-dim); font-size: .82rem; text-align: center; margin: 10px 0 0; }

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-top: 12px;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--brand); font-weight: 700; font-size: 1.3rem; line-height: 1;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { margin: 0 0 16px; color: var(--text-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border-soft); padding: 40px 0; background: var(--bg-alt); }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.footer-brand .brand-mark { color: var(--brand); }
.footer-tag { color: var(--text-soft); margin: 2px 0; }
.footer-legal { color: var(--text-dim); font-size: .82rem; margin: 0; }
.footer-sep { margin: 0 8px; opacity: .5; }

/* ---------- Responsive: tablet & up ---------- */
@media (min-width: 680px) {
  .section { padding: 84px 0; }
  .problem-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); align-items: start; }
}

@media (min-width: 980px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
}
