/* grokbought.com — one stylesheet for every page. Edit freely; no build step. */

:root {
  --bg: #0b0d12;
  --bg-raised: #131722;
  --bg-card: #171c29;
  --border: #262d3f;
  --text: #e8ebf2;
  --text-dim: #9aa3b5;
  --accent: #4ade80;
  --accent-dim: #22c55e;
  --accent-ink: #05230f;
  --warn: #fbbf24;
  --danger: #ff6b6b;
  --paper: #f6f1e7;
  --max: 1040px;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nav ---------- */
nav.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(11, 13, 18, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(38, 45, 63, .7);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; max-width: var(--max); margin: 0 auto; }
.logo { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text); }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 22px; font-size: .92rem; align-items: center; }
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links .pill { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; color: var(--accent); }
@media (max-width: 720px) { .nav-links a:not(.pill) { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 10px; font-weight: 700;
  font-size: 1rem; transition: transform .12s ease, opacity .12s ease; cursor: pointer;
  font-family: inherit; border: 1px solid transparent; line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--bg-raised); }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 8px; }

/* ---------- Flow (scroll-driven hero) ---------- */
.flow { position: relative; height: 500vh; /* 5 captions × 100vh; JS may override */ }
.flow-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.flow-canvas { position: absolute; inset: 0; }
.flow-canvas canvas { display: block; width: 100%; height: 100%; }
.flow-canvas::after {  /* soft vignette so text stays legible */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 60%, transparent 40%, rgba(11, 13, 18, .55) 100%);
}
.flow-overlay { position: absolute; inset: 0; pointer-events: none; }
.flow-caption {
  position: absolute; left: 6vw; top: 50%; transform: translateY(calc(-50% + 24px));
  width: min(460px, 88vw); opacity: 0; pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.flow-caption.is-active { opacity: 1; transform: translateY(-50%); pointer-events: auto; }
.flow-caption.flow-title { left: 50%; transform: translate(-50%, calc(-50% + 24px)); width: min(760px, 92vw); text-align: center; }
.flow-caption.flow-title.is-active { transform: translate(-50%, -50%); }
.flow-num {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--accent); font-weight: 800; font-size: .95rem; margin-bottom: 14px;
}
.flow-caption h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 12px; }
.flow-caption p { color: var(--text-dim); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.flow-caption .detail { margin-top: 12px; font-size: .88rem; color: var(--text-dim); border-left: 2px solid var(--accent); padding-left: 12px; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px;
  background: rgba(19, 23, 34, .8); margin-bottom: 22px;
}
h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); font-weight: 850; letter-spacing: -.035em; line-height: 1.04; margin-bottom: 18px; }
h1 em { font-style: normal; color: var(--accent); }
.sub { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--text-dim); max-width: 620px; margin: 0 auto 30px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scroll-hint {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.flow[data-step="0"] .scroll-hint { opacity: 1; }
.scroll-hint::after { content: ""; display: block; width: 1px; height: 34px; margin: 8px auto 0; background: linear-gradient(var(--accent), transparent); }
.flow-dots { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.flow-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: background .3s, transform .3s; }
.flow[data-step="0"] .flow-dots span:nth-child(1),
.flow[data-step="1"] .flow-dots span:nth-child(2),
.flow[data-step="2"] .flow-dots span:nth-child(3),
.flow[data-step="3"] .flow-dots span:nth-child(4),
.flow[data-step="4"] .flow-dots span:nth-child(5) { background: var(--accent); transform: scale(1.5); }
@media (max-width: 720px) {
  .flow-caption { left: 5vw; top: auto; bottom: 9vh; transform: translateY(16px); width: 90vw; }
  .flow-caption.is-active { transform: none; }
  .flow-caption.flow-title { left: 5vw; top: 50%; bottom: auto; transform: translateY(calc(-50% + 16px)); }
  .flow-caption.flow-title.is-active { transform: translateY(-50%); }
  .flow-caption h2 { font-size: 1.5rem; }
  .flow-caption p { font-size: .98rem; }
  .flow-dots { right: 12px; }
}

/* Flat fallback: no JS, no WebGL, or reduced motion → captions stack as cards. */
.no-js .flow, .flow--flat { height: auto; }
.no-js .flow-sticky, .flow--flat .flow-sticky { position: static; height: auto; overflow: visible; padding: 120px 0 40px; }
.no-js .flow-canvas, .flow--flat .flow-canvas, .no-js .scroll-hint, .flow--flat .scroll-hint,
.no-js .flow-dots, .flow--flat .flow-dots { display: none; }
.no-js .flow-overlay, .flow--flat .flow-overlay { position: static; pointer-events: auto; max-width: var(--max); margin: 0 auto; padding: 0 24px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.no-js .flow-caption, .flow--flat .flow-caption {
  position: static; opacity: 1; transform: none; width: auto; pointer-events: auto;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
@media (min-width: 900px) { .no-js .flow-overlay, .flow--flat .flow-overlay { grid-template-columns: repeat(4, 1fr); } }
.no-js .flow-caption.flow-title, .flow--flat .flow-caption.flow-title { grid-column: 1 / -1; background: none; border: none; padding: 20px 0 30px; text-align: center; }
.no-js .flow-caption.flow-title.is-active, .flow--flat .flow-caption.flow-title.is-active,
.no-js .flow-caption.is-active, .flow--flat .flow-caption.is-active { transform: none; }
.no-js .flow-caption h2, .flow--flat .flow-caption h2 { font-size: 1.15rem; }
.no-js .flow-caption p, .flow--flat .flow-caption p { font-size: .95rem; }

/* ---------- Sections ---------- */
section.block { padding: 88px 0; border-top: 1px solid var(--border); scroll-margin-top: 56px; position: relative; }
section.block h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.lede { color: var(--text-dim); max-width: 660px; margin-bottom: 40px; font-size: 1.08rem; }
.center { text-align: center; }
.center .lede { margin-left: auto; margin-right: auto; }

/* Setup checklist */
.setup { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; counter-reset: step; }
@media (min-width: 900px) { .setup { grid-template-columns: repeat(5, 1fr); gap: 14px; } .setup li { padding: 20px 18px; } }
.setup li { list-style: none; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; position: relative; }
.setup li::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--accent);
  font-weight: 800; font-size: .9rem; margin-bottom: 12px;
}
.setup h3 { font-size: 1rem; margin-bottom: 6px; }
.setup p { font-size: .9rem; color: var(--text-dim); }
.setup a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); }
.fineprint { margin-top: 22px; font-size: .82rem; color: var(--text-dim); }

/* Control cards */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
@media (min-width: 900px) { .controls { grid-template-columns: repeat(4, 1fr); } }
.control { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.control .ico { font-size: 1.6rem; margin-bottom: 10px; }
.control h3 { font-size: 1.05rem; margin-bottom: 8px; }
.control p { font-size: .93rem; color: var(--text-dim); }
.callout {
  margin-top: 28px; background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .3);
  border-radius: 12px; padding: 18px 22px; font-size: .95rem;
}
.callout strong { color: var(--warn); }

/* FAQ */
details { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
summary { cursor: pointer; padding: 18px 22px; font-weight: 700; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; font-weight: 400; flex-shrink: 0; }
details[open] summary::after { content: "–"; }
details .a { padding: 0 22px 20px; color: var(--text-dim); font-size: .95rem; }

/* ---------- The Wall ---------- */
.wall-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.wall-head .lede { margin-bottom: 0; }
.wall-3d {
  position: relative; height: clamp(420px, 72vh, 760px); border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 35%, #141a2b 0%, var(--bg) 70%);
  margin-bottom: 26px;
}
.wall-3d canvas { display: block; width: 100%; height: 100%; }
.wall-3d--off { display: none; }
.wall-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: .78rem; color: var(--text-dim); background: rgba(11, 13, 18, .7); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; pointer-events: none; white-space: nowrap;
}
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 26px; }
.wall-card {
  background: var(--paper); color: #1b1d24; border-radius: 6px 6px 0 0; padding: 18px 18px 26px; position: relative; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.45;
  transition: transform .15s ease, box-shadow .15s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  outline: none; overflow: hidden;
}
.wall-card::after {  /* serrated receipt bottom */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px;
  background: linear-gradient(-45deg, transparent 7px, var(--paper) 0) 0 100% / 14px 10px repeat-x,
              linear-gradient(45deg, transparent 7px, var(--paper) 0) 0 100% / 14px 10px repeat-x;
  background-color: var(--bg);
}
.wall-card:hover, .wall-card:focus-visible { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 16px 38px rgba(0, 0, 0, .5); }
.wall-card.featured { box-shadow: 0 0 0 2px var(--accent), 0 12px 30px rgba(74, 222, 128, .25); }
.wall-card.is-new { animation: drop-in .5s ease both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
.wall-img { width: calc(100% + 36px); margin: -18px -18px 12px; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(.9); }
.wall-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wall-emoji { font-size: 1.6rem; line-height: 1; }
.wall-badge { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; border: 1px solid #1b1d24; border-radius: 999px; padding: 1px 8px; }
.wall-badge.bot { border-color: #5b6cff; color: #3a47c9; }
.wall-item { font-size: 1rem; font-weight: 700; margin-bottom: 4px; word-wrap: break-word; }
.wall-price { font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; color: #0e7a3a; }
.wall-story { color: #4a4f5c; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.wall-date { font-size: .72rem; color: #7a8090; text-transform: uppercase; letter-spacing: .05em; }
.wall-empty { color: var(--text-dim); font-style: italic; margin-bottom: 26px; }
#wall-more { display: block; margin: 0 auto 40px; }

/* Post dialog */
.post-dialog { margin: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--paper); color: #1b1d24; padding: 0; max-width: min(640px, 94vw); width: 100%; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.post-dialog::backdrop { background: rgba(5, 7, 12, .7); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid #1b1d24; background: var(--paper); color: #1b1d24; font-size: 1.3rem; cursor: pointer; line-height: 1; z-index: 1; }
.dialog-body { padding: 26px; }
.dialog-body img { width: calc(100% + 52px); margin: -26px -26px 18px; max-height: 60vh; object-fit: cover; border-radius: 16px 16px 0 0; }
.dialog-body .wall-emoji { font-size: 2.2rem; }
.dialog-body .wall-item { font-size: 1.35rem; }
.dialog-body .wall-price { font-size: 1.4rem; }
.dialog-body .wall-story { display: block; -webkit-line-clamp: unset; white-space: pre-wrap; }
.dialog-body .wall-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: #7a8090; text-transform: uppercase; letter-spacing: .05em; margin-top: 16px; border-top: 1px dashed #b9b3a6; padding-top: 12px; }

/* ---------- Forms ---------- */
.form-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 32px; max-width: 640px; }
.form-panel h3 { font-size: 1.2rem; }
.form-panel .hint { color: var(--text-dim); font-size: .92rem; margin-top: 6px; }
label { display: block; font-size: .88rem; font-weight: 600; margin: 18px 0 6px; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--text); font-size: .95rem; font-family: inherit;
}
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; border-color: transparent; }
textarea { min-height: 96px; resize: vertical; }
input[type="file"] { color: var(--text-dim); font-size: .9rem; }
input[type="file"]::file-selector-button { background: var(--bg-raised); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-right: 12px; font-family: inherit; cursor: pointer; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 520px) { .two-col { grid-template-columns: 1fr; } }
.form-panel .btn { margin-top: 24px; width: 100%; }
.form-note { font-size: .8rem; color: var(--text-dim); margin-top: 14px; }
/* Honeypot: off-screen for people, irresistible to bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 16px; font-size: .92rem; line-height: 1.5; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: var(--danger); }

/* Emoji picker + source toggle (radio groups) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { margin: 0; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.chips span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--bg-raised); font-size: 1.25rem; transition: border-color .12s, transform .12s;
}
.chips span.txt { font-size: .9rem; font-weight: 600; }
.chips input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: translateY(-1px); }
.chips input:focus-visible + span { outline: 2px solid var(--accent-dim); outline-offset: 2px; }
#bot-name-row[hidden] { display: none; }

/* Newsletter */
.email-row { display: flex; gap: 10px; margin-top: 4px; }
.email-row input { flex: 1; }
.email-row .btn { margin-top: 0; width: auto; white-space: nowrap; }
@media (max-width: 480px) { .email-row { flex-direction: column; } .email-row .btn { width: 100%; } }
.newsletter .form-panel { margin: 0 auto; text-align: center; }
.newsletter .form-status { text-align: center; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 40px 0 48px; }
footer .wrap { display: flex; flex-direction: column; gap: 14px; }
.disclaimer { font-size: .8rem; color: var(--text-dim); max-width: 760px; }
.foot-links { display: flex; gap: 18px; font-size: .85rem; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); }

/* ---------- Docs pages (api.html) ---------- */
.doc { padding: 120px 0 80px; max-width: 800px; }
.doc h1 { font-size: clamp(2rem, 5vw, 3rem); }
.doc h2 { font-size: 1.5rem; margin: 48px 0 12px; letter-spacing: -.01em; }
.doc h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--text-dim); }
.doc li { margin-left: 22px; margin-bottom: 6px; }
.doc strong { color: var(--text); }
.doc pre { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; overflow-x: auto; font-size: .85rem; line-height: 1.55; margin: 14px 0; color: var(--text); }
.doc code { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .88em; color: var(--text); }
.doc pre code { background: none; border: none; padding: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 14px 0; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc th { color: var(--text); font-weight: 700; }
.doc td { color: var(--text-dim); }
.doc .tag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; border-radius: 6px; padding: 2px 8px; margin-right: 8px; background: var(--bg-raised); border: 1px solid var(--border); color: var(--accent); font-family: ui-monospace, monospace; }

/* ---------- Admin ---------- */
.admin { padding: 100px 0 60px; }
.admin-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.admin-bar input { width: auto; flex: 1; min-width: 200px; }
.admin-bar select { width: auto; }
.admin-counts { color: var(--text-dim); font-size: .9rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-pill { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; border: 1px solid var(--border); }
.status-pill.live { color: var(--accent); }
.status-pill.hidden { color: var(--text-dim); }
.status-pill.pending { color: var(--warn); }
.btn-danger { border-color: rgba(255, 107, 107, .5); color: var(--danger); background: transparent; }
