/* TorcLoop — marketing site.
   Hand-written CSS on purpose: one page, no build step, so it can be dropped on
   a static host as-is. Colours mirror the app's palette so the two don't feel
   like different products. */

:root {
  --bg:        #08080b;
  --bg-raised: #0e0e13;
  --card:      #121218;
  --edge:      #22222b;
  --edge-soft: #1a1a22;
  --ink:       #ffffff;
  --text:      #a1a1aa;
  --muted:     #71717a;
  --faint:     #52525b;

  /* Pulled from the logo: violet → fuchsia → orange. */
  --v1: #7c3aed;
  --v2: #a855f7;
  --f1: #d946ef;
  --o1: #fb7185;
  --o2: #fb923c;

  --accent:      #a78bfa;
  --accent-text: #c4b5fd;

  --radius:    16px;
  --radius-lg: 22px;
  --wrap:      1140px;
  --shadow:    0 24px 70px -20px rgba(0,0,0,.7);
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-raised: #fafafa;
  --card:      #ffffff;
  --edge:      #e4e4e7;
  --edge-soft: #efeff1;
  --ink:       #0b0b12;
  --text:      #52525b;
  --muted:     #71717a;
  --faint:     #a1a1aa;

  --accent:      #7c3aed;
  --accent-text: #6d28d9;

  --shadow: 0 24px 60px -24px rgba(24,24,40,.22);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { color: var(--ink); line-height: 1.12; letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.1rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 750; }
h3 { font-size: 1.06rem; font-weight: 650; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap.narrow { max-width: 780px; }

.grad {
  background: linear-gradient(100deg, var(--v2), var(--f1) 42%, var(--o1) 72%, var(--o2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Theme-swapped artwork. The logo ships as two cuts rather than being tinted. */
:root[data-theme="dark"]  .only-light { display: none !important; }
:root[data-theme="light"] .only-dark  { display: none !important; }

/* ───────────────────────────── nav ───────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--edge); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand .wordmark { opacity: .95; }

.nav-links { display: flex; gap: 26px; margin-left: 8px; font-size: .89rem; }
.nav-links a { color: var(--muted); transition: color .18s ease; }
.nav-links a:hover { color: var(--ink); }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: transparent; border: 1px solid var(--edge);
  color: var(--muted); cursor: pointer; transition: all .18s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--faint); }

/* ──────────────────────────── buttons ────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 17px; border-radius: 11px;
  font-size: .89rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn.lg { padding: 13px 24px; font-size: .97rem; border-radius: 13px; }
.btn.block { width: 100%; }

.btn.primary {
  color: #fff;
  background: linear-gradient(100deg, var(--v1), var(--f1) 60%, var(--o1));
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--f1) 70%, transparent);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--f1) 80%, transparent); }
.btn.primary span { transition: transform .18s ease; }
.btn.primary:hover span { transform: translateX(3px); }

.btn.ghost { color: var(--ink); background: var(--card); border-color: var(--edge); }
.btn.ghost:hover { border-color: var(--faint); transform: translateY(-1px); }

/* ───────────────────────────── hero ──────────────────────────── */

.hero { position: relative; padding: clamp(56px, 9vw, 104px) 0 0; text-align: center; overflow: hidden; }

.glow {
  position: absolute; inset: -20% 0 auto 50%; translate: -50% 0;
  width: min(1100px, 130vw); height: 620px; pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--v1) 34%, transparent), transparent) 30% 40% / 62% 78% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--f1) 26%, transparent), transparent) 70% 30% / 58% 70% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--o2) 18%, transparent), transparent) 55% 70% / 52% 60% no-repeat;
  filter: blur(46px); opacity: .75;
}
:root[data-theme="light"] .glow { opacity: .3; }
.glow.soft { height: 420px; opacity: .5; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 14px 6px 10px; margin-bottom: 26px;
  font-size: .81rem; color: var(--text);
  background: var(--card); border: 1px solid var(--edge); border-radius: 999px;
  transition: border-color .2s ease, color .2s ease;
}
.eyebrow:hover { border-color: var(--accent); color: var(--ink); }
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--o2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--o2) 22%, transparent);
}
.eyebrow .chev { color: var(--muted); }

.lede {
  max-width: 660px; margin: 22px auto 0;
  font-size: clamp(1rem, 1.5vw, 1.14rem); color: var(--text);
}

.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.cta-row.center { justify-content: center; }
.fineprint { margin-top: 14px; font-size: .81rem; color: var(--faint); }

/* screenshot frames */
.shot {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--edge); background: var(--card); box-shadow: var(--shadow);
}
.hero-shot { margin-top: clamp(40px, 6vw, 68px); }
/* height:auto is required, not optional. These <img> tags carry width/height
   attributes so the browser can reserve space before they load; without this
   the attribute height sticks while width scales to the column, and every
   screenshot stretches. Not on the global img rule — the logos size themselves
   from their height attribute and would blow up. */
.shot img { width: 100%; height: auto; }
.shot.inset { margin-top: 20px; border-radius: 12px; box-shadow: none; }

.chrome {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; border-bottom: 1px solid var(--edge-soft);
  background: var(--bg-raised);
}
.chrome span { width: 10px; height: 10px; border-radius: 50%; background: var(--edge); }
.chrome i {
  margin-left: 10px; font-style: normal; font-size: .74rem; color: var(--faint);
}

/* ──────────────────────────── proof ──────────────────────────── */

.proof { padding: clamp(44px, 6vw, 68px) 0; border-block: 1px solid var(--edge-soft); margin-top: clamp(48px, 7vw, 88px); }
.proof-inner { text-align: center; }
.proof p { font-size: .87rem; color: var(--muted); }
.proof strong { color: var(--ink); font-weight: 650; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: 26px;
}
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: clamp(1.3rem, 2.4vw, 1.75rem); color: var(--ink); font-weight: 750; letter-spacing: -.02em; }
.stats span { font-size: .78rem; color: var(--faint); }

/* ─────────────────────────── sections ────────────────────────── */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section.alt { background: var(--bg-raised); border-block: 1px solid var(--edge-soft); }

.kicker {
  font-size: .76rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 14px;
}
.section h2 { max-width: 720px; }
.sub { max-width: 620px; margin-top: 16px; color: var(--text); font-size: 1.02rem; }
.sub.left { margin-inline: 0; }

.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 68px); align-items: center; }
.split .btn { margin-top: 30px; }

.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 11px; }
.ticks li { position: relative; padding-left: 28px; font-size: .95rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 14px; height: 8px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  rotate: -45deg;
}

/* ──────────────────────────── modes ──────────────────────────── */

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 44px; }
.mode {
  display: flex; flex-direction: column;
  padding: 28px; border: 1px solid var(--edge); border-radius: var(--radius-lg);
  background: var(--card);
}
.mode.accent { border-color: color-mix(in srgb, var(--v1) 42%, var(--edge)); }
.mode.accent .pill { background: color-mix(in srgb, var(--v1) 18%, transparent); color: var(--accent-text); border-color: color-mix(in srgb, var(--v1) 34%, transparent); }
.mode-head p { margin-top: 12px; font-size: .95rem; }
.mode h3 { margin-top: 14px; font-size: 1.35rem; font-weight: 700; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-raised); border: 1px solid var(--edge);
}

.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; }
.steps li { display: flex; align-items: center; gap: 11px; font-size: .89rem; color: var(--text); }
.steps span {
  display: grid; place-items: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 7px;
  font-size: .72rem; font-weight: 700; color: var(--ink);
  background: var(--bg-raised); border: 1px solid var(--edge);
}
.mode .shot { margin-top: 24px; border-radius: 12px; box-shadow: none; }

/* ──────────────────────────── agents ─────────────────────────── */

.agents {
  list-style: none; padding: 0; margin: 44px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  counter-reset: agent;
}
.agents li {
  position: relative; padding: 22px;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--card);
  transition: border-color .2s ease, transform .2s ease;
}
.agents li:hover { border-color: color-mix(in srgb, var(--v1) 40%, var(--edge)); transform: translateY(-2px); }
.agents .n {
  display: inline-block; margin-bottom: 10px;
  font-size: .72rem; font-weight: 800; letter-spacing: .1em;
  background: linear-gradient(100deg, var(--v2), var(--f1));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.agents h3 { font-size: 1.02rem; }
.agents p { margin-top: 7px; font-size: .87rem; }

/* The hand-off between agents, drawn only where a card has a neighbour. */
.agents li::after {
  content: ""; position: absolute; top: 50%; right: -16px; width: 16px; height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--v1) 55%, transparent), transparent);
}
.agents li:nth-child(3n)::after, .agents li:last-child::after { display: none; }

.agents-note {
  margin-top: 22px; font-size: .88rem; color: var(--muted); max-width: 72ch;
}

/* ──────────────────────────── bento ──────────────────────────── */

.bento {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px;
}
.card {
  padding: 26px; border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--card); transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--v1) 38%, var(--edge)); transform: translateY(-2px); }
.card p { margin-top: 10px; font-size: .92rem; }
.card.wide { grid-column: span 3; display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(24px, 4vw, 44px); align-items: center; }
.card.wide h3 { font-size: 1.35rem; }
.card.wide p { max-width: 46ch; }
.card.wide .shot.inset { margin-top: 0; }

/* ────────────────────────── comparison ───────────────────────── */

.table-scroll { margin-top: 40px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.compare {
  width: 100%; min-width: 560px; border-collapse: collapse;
  border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden;
}
.compare th, .compare td { padding: 14px 18px; text-align: left; font-size: .91rem; }
.compare thead th {
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--bg-raised);
  border-bottom: 1px solid var(--edge);
}
.compare tbody th { font-weight: 500; color: var(--text); }
.compare tbody tr + tr th, .compare tbody tr + tr td { border-top: 1px solid var(--edge-soft); }
.compare td { text-align: center; width: 22%; color: var(--muted); }
.compare td.y { color: var(--ink); font-weight: 600; }
.compare td.n { color: var(--faint); }
.compare em { color: var(--ink); font-style: italic; }

/* The column that's us gets a tinted lane down the table. */
.compare .us { background: color-mix(in srgb, var(--v1) 9%, transparent); }
.compare thead th.us { color: var(--accent-text); }

/* ──────────────────────────── plans ──────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; align-items: start; }
.plan {
  position: relative; padding: 30px 26px;
  border: 1px solid var(--edge); border-radius: var(--radius-lg); background: var(--card);
}
.plan.popular {
  border-color: color-mix(in srgb, var(--v1) 52%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--v1) 22%, transparent), var(--shadow);
}
.badge {
  position: absolute; top: -12px; left: 50%; translate: -50% 0;
  padding: 4px 13px; border-radius: 999px;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: linear-gradient(100deg, var(--v1), var(--f1));
}
.price { margin: 10px 0 4px; }
.price b { font-size: 2.5rem; color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
.price span { font-size: .88rem; color: var(--muted); }
.plan-for { font-size: .85rem; color: var(--muted); margin-bottom: 22px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.plan li { position: relative; padding-left: 26px; font-size: .89rem; }
.plan li::before {
  content: ""; position: absolute; left: 2px; top: .5em;
  width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  rotate: -45deg;
}
.plan strong { color: var(--ink); font-weight: 650; }

/* ───────────────────────────── faq ───────────────────────────── */

.faq { margin-top: 38px; border-top: 1px solid var(--edge-soft); }
.faq details { border-bottom: 1px solid var(--edge-soft); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 0; cursor: pointer; list-style: none;
  color: var(--ink); font-weight: 600; font-size: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex-shrink: 0; font-size: 1.35rem; font-weight: 400; color: var(--muted);
  transition: rotate .2s ease, color .2s ease;
}
.faq details[open] summary::after { rotate: 45deg; color: var(--accent); }
.faq details p { padding-bottom: 22px; font-size: .95rem; max-width: 68ch; }
.faq em { color: var(--ink); font-style: italic; }

/* ──────────────────────── final + footer ─────────────────────── */

.final { position: relative; overflow: hidden; padding: clamp(72px, 10vw, 118px) 0; text-align: center; border-top: 1px solid var(--edge-soft); }
.final h2 { margin-inline: auto; }
.final p { margin-top: 14px; color: var(--text); font-size: 1.06rem; }

.footer { padding: 44px 0; border-top: 1px solid var(--edge-soft); background: var(--bg-raised); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer .tagline { font-size: .88rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; font-size: .85rem; }
.footer-links a { color: var(--muted); transition: color .18s ease; }
.footer-links a:hover { color: var(--ink); }
.copy { font-size: .78rem; color: var(--faint); }

/* ─────────────────────────── motion ──────────────────────────── */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
}

/* ─────────────────────────── responsive ──────────────────────── */

.mobile-only { display: none; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .modes, .bento, .plans, .split { grid-template-columns: 1fr; }
  /* Two across still reads; the hand-off lines only make sense in the 3-wide
     layout, so they go. */
  .agents { grid-template-columns: repeat(2, 1fr); }
  .agents li::after { display: none; }
  .card.wide { grid-column: auto; grid-template-columns: 1fr; }
  .card.wide > figure { grid-row: auto; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .split figure { order: -1; }
}

@media (max-width: 620px) {
  .desktop-only { display: none; }
  .mobile-only { display: inline; }
  .agents { grid-template-columns: 1fr; }
  .brand .wordmark { display: none; }
  :root[data-theme="dark"]  .brand .only-dark.wordmark  { display: none !important; }
  :root[data-theme="light"] .brand .only-light.wordmark { display: none !important; }
  .cta-row .btn { width: 100%; }
  .chrome i { display: none; }
}

/* ---------------------------------------------------------------------------
   Legal pages (privacy, terms)

   Long-form prose, so it gets a narrower measure than the marketing layout —
   ~70 characters is where reading comfort sits, and the 1140px wrap would push
   lines past twice that.
   --------------------------------------------------------------------------- */
.legal {
  max-width: 760px;
  padding-block: 96px 80px;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.75;
}
.legal h1 {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 10px;
}
.legal h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-top: 44px;
  margin-bottom: 12px;
}
.legal h3 {
  font-size: 16px;
  color: var(--ink);
  margin-top: 26px;
  margin-bottom: 6px;
}
.legal p { margin-bottom: 16px; }
.legal ul { margin: 0 0 18px; padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover { color: var(--ink); }

.legal-meta { color: var(--faint); font-size: 14px; margin-bottom: 34px; }

/* The processor table is the widest thing on these pages; let it scroll rather
   than force the whole document to. */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 22px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.legal-table th, .legal-table td {
  text-align: left;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--edge-soft);
  vertical-align: top;
  white-space: nowrap;
}
.legal-table th { color: var(--ink); font-weight: 600; }
.legal-table td:last-child, .legal-table th:last-child { white-space: normal; }
