/* Towfu site. Dark, calm, one indigo accent. No external fonts or requests. */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0b0c10;
  --bg-elev: #101218;
  --surface: #151820;
  --surface-2: #1b1f29;
  --border: #252a36;
  --border-strong: #343a49;

  /* Text (contrast on --bg: text 16:1, muted 8.5:1, subtle 5.2:1) */
  --text: #eceef4;
  --text-muted: #aab0bf;
  --text-subtle: #8a91a2;

  /* Brand */
  --brand: #474cf5;          /* icon indigo: white text on it is 5.9:1 */
  --brand-hover: #5a5ff7;
  --accent-text: #a4a8ff;    /* links on dark */
  --sky: #89c8fd;
  --lilac: #c1a3fb;

  /* Status */
  --ok: #5fd39a;
  --warn: #f2c14e;
  --idle: #7d8494;
  --danger: #f2766b;

  /* Shape and rhythm */
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --gutter: 16px;
  --max: 1120px;
  --shadow: 0 20px 60px -20px rgb(0 0 0 / 0.6), 0 0 0 1px var(--border);

  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
kbd { background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; }
code { background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: var(--radius-s); }
.skip-link:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- header ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(11 12 16 / 0.82); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.logo img { width: auto; height: 26px; }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--text-muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--text); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius-s); padding: 6px 10px; font: inherit; cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 8px var(--gutter) 16px; margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 12px; justify-content: center; }
}

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; 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-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-subtle); color: var(--text); }
.btn-small { padding: 7px 12px; font-size: 0.875rem; }
.btn-lg { padding: 13px 20px; font-size: 1rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; }
.placeholder-note { display: inline-block; margin-left: 6px; font: 600 0.7rem/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 999px; padding: 3px 7px; vertical-align: middle; }

/* ---- hero ---- */
.hero { padding: 72px 0 40px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -30% -10% auto; height: 520px; background: radial-gradient(closest-side, rgb(71 76 245 / 0.22), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: 0.875rem; border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; background: var(--bg-elev); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
h1 { font-size: clamp(2.3rem, 5.6vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; margin: 18px 0 16px; font-weight: 720; }
h1 .grad { background: linear-gradient(90deg, var(--sky), var(--lilac)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 640px; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.fine { color: var(--text-subtle); font-size: 0.875rem; margin-top: 14px; }

/* ---- app illustration ---- */
figure { margin: 0; }
.app-shot { margin-top: 48px; border-radius: var(--radius-l); background: var(--bg-elev); box-shadow: var(--shadow); overflow: hidden; font-family: var(--mono); font-size: 12px; }
.app-titlebar { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--text-subtle); }
.app-titlebar img { width: 16px; height: 16px; }
.app-titlebar .tabs { display: flex; gap: 6px; margin-left: 8px; overflow: hidden; }
.app-titlebar .tab { padding: 3px 9px; border-radius: 5px; background: var(--surface); color: var(--text-muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.app-titlebar .tab.on { background: var(--surface-2); color: var(--text); }
.app-titlebar .usage { margin-left: auto; display: flex; gap: 10px; white-space: nowrap; }
.meter { display: inline-flex; align-items: center; gap: 6px; }
.meter i { display: inline-block; width: 42px; height: 5px; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.meter i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--sky); border-radius: 3px; }
.app-body { display: grid; grid-template-columns: 170px 1fr 220px; min-height: 360px; }
.app-side { border-right: 1px solid var(--border); padding: 10px; color: var(--text-subtle); display: grid; align-content: start; gap: 4px; }
.app-side b { color: var(--text-muted); font-weight: 600; margin: 8px 0 2px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.app-side span { padding: 4px 6px; border-radius: 5px; display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-side span.on { background: var(--surface-2); color: var(--text); }
.grid-panes { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; background: var(--border); }
.pane { background: var(--bg); padding: 0; display: flex; flex-direction: column; min-width: 0; }
.pane header { display: flex; gap: 6px; align-items: center; padding: 5px 9px; border-bottom: 1px solid var(--border); color: var(--text-muted); background: var(--bg-elev); white-space: nowrap; overflow: hidden; }
.pane header em { font-style: normal; color: var(--text-subtle); margin-left: auto; }
.pane pre { margin: 0; padding: 8px 10px; color: var(--text-muted); white-space: pre-wrap; line-height: 1.55; overflow: hidden; }
.pane .c-sky { color: var(--sky); } .pane .c-lilac { color: var(--lilac); } .pane .c-ok { color: var(--ok); } .pane .c-warn { color: var(--warn); } .pane .c-dim { color: var(--text-subtle); }
.dash { border-left: 1px solid var(--border); padding: 10px; display: grid; align-content: start; gap: 6px; }
.dash b { color: var(--text-muted); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; }
.dash .row { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 7px 8px; display: grid; gap: 2px; }
.dash .row span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.dash .row small { color: var(--text-subtle); font-size: 11px; }
.st { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.st.working { background: var(--ok); } .st.needs { background: var(--warn); } .st.idle { background: var(--idle); }
.shot-caption { color: var(--text-subtle); font-size: 0.8rem; text-align: center; margin-top: 10px; }
@media (max-width: 900px) { .app-body { grid-template-columns: 1fr; } .app-side, .dash { display: none; } .app-titlebar .usage { display: none; } }
@media (max-width: 560px) { .grid-panes { grid-template-columns: 1fr; grid-template-rows: none; } .pane:nth-child(n+3) { display: none; } }

/* ---- sections ---- */
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 36px; }
.kicker { font: 600 0.8rem/1 var(--mono); color: var(--sky); letter-spacing: 0.08em; text-transform: uppercase; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.025em; margin: 10px 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.section-head p { color: var(--text-muted); margin: 0; font-size: 1.05rem; }

.problems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.problem { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--bg-elev); }
.problem p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.problem strong { display: block; color: var(--text); margin-bottom: 4px; }
@media (max-width: 900px) { .problems { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .problems { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 22px; }
.feature p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }
.feature .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 14px; background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--accent-text); }
.feature .ico svg { width: 20px; height: 20px; }
.feature .tag { display: inline-block; font: 600 0.7rem/1 var(--mono); color: var(--lilac); border: 1px solid color-mix(in srgb, var(--lilac) 40%, transparent); padding: 3px 6px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--bg-elev); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: 0.9rem; margin-bottom: 12px; }
.step p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.panel { border: 1px solid var(--border); border-radius: var(--radius-l); padding: 22px; background: var(--surface); }
.panel ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.panel li { margin: 6px 0; }
.panel.note { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 880px; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { border: 1px solid var(--border); border-radius: var(--radius-l); padding: 26px; background: var(--surface); display: flex; flex-direction: column; }
.plan.pro { border-color: color-mix(in srgb, var(--brand) 60%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), var(--surface) 55%); }
.plan h3 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.badge { font: 600 0.72rem/1 var(--mono); padding: 4px 8px; border-radius: 999px; background: var(--brand); color: #fff; }
.price { font-size: 2.4rem; font-weight: 720; letter-spacing: -0.03em; margin: 8px 0 0; }
.price s { color: var(--text-subtle); font-size: 1.2rem; font-weight: 500; margin-left: 6px; }
.price-sub { color: var(--text-subtle); font-size: 0.9rem; margin: 2px 0 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; }
.plan li { display: flex; gap: 10px; color: var(--text-muted); font-size: 0.95rem; }
.plan li svg { width: 18px; height: 18px; flex: none; color: var(--ok); margin-top: 3px; }
.plan .btn { margin-top: auto; justify-content: center; }
.pricing-notes { color: var(--text-subtle); font-size: 0.9rem; margin-top: 18px; max-width: 880px; }

/* ---- FAQ ---- */
.faq { max-width: 820px; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--text-subtle); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq .answer { padding: 0 18px 16px; color: var(--text-muted); }
.faq .answer p { margin: 0 0 10px; }
.faq .answer p:last-child { margin: 0; }

/* ---- download ---- */
.download-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; border: 1px solid var(--border); border-radius: var(--radius-l); padding: 28px; background: var(--surface); }
@media (max-width: 800px) { .download-card { grid-template-columns: 1fr; } }
.req { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--text-muted); font-size: 0.95rem; }
.req li { display: flex; gap: 10px; }
.req li::before { content: '→'; color: var(--text-subtle); }
.smartscreen { border-left: 3px solid var(--warn); padding: 10px 14px; background: var(--bg-elev); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--text-muted); font-size: 0.9rem; margin-top: 18px; }

/* ---- docs pages (legal, activation) ---- */
.doc { max-width: 780px; padding: 56px 0 72px; }
.doc h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); margin-top: 0; }
.doc h2 { font-size: 1.35rem; margin: 36px 0 8px; }
.doc h3 { margin-top: 22px; }
.doc p, .doc li { color: var(--text-muted); }
.doc strong { color: var(--text); }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.93rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-muted); }
.doc th { color: var(--text); font-weight: 600; }
.draft-banner { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 8%, var(--bg-elev)); color: var(--text); border-radius: var(--radius); padding: 12px 16px; font-size: 0.92rem; margin-bottom: 28px; }
.updated { color: var(--text-subtle); font-size: 0.9rem; }

/* ---- forms ---- */
.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field input { font: 500 1rem/1.4 var(--mono); color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 10px 12px; width: 100%; }
.field input:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.field .hint { color: var(--text-subtle); font-size: 0.85rem; }
.status { font-size: 0.92rem; min-height: 1.4em; margin: 6px 0 0; }
.status.ok { color: var(--ok); } .status.bad { color: var(--danger); } .status.info { color: var(--text-muted); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row .field { flex: 1 1 260px; margin: 0; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 48px; color: var(--text-subtle); font-size: 0.9rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.tm { margin-top: 20px; max-width: 760px; font-size: 0.8rem; line-height: 1.5; }
