/* ─────────────────────────────────────────────
   Bitwise Editors — shared design system
   ───────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:      #0b0e14;
  --bg-surface:   #11151f;
  --bg-elevated:  #161c29;
  --bg-hover:     #1c2333;
  --border:       rgba(255, 255, 255, 0.07);
  --border-solid: #1e2736;

  --text:   #e6edf3;
  --muted:  #8b95a6;
  --dim:    #4d5566;

  --amber:   #f59e0b;
  --cyan:    #38bdf8;
  --emerald: #34d399;
  --green:   #4ade80;
  --red:     #f87171;

  /* product accent — overridden per page via body class */
  --accent:      #e6edf3;
  --accent-dim:  rgba(230, 237, 243, 0.10);
  --accent-dim2: rgba(230, 237, 243, 0.22);

  --radius:    8px;
  --radius-lg: 14px;

  --mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;

  --max-w: 1120px;
}

body.theme-lispcraft  { --accent: var(--amber);   --accent-dim: rgba(245,158,11,.10);  --accent-dim2: rgba(245,158,11,.25); }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ── Fade-in on scroll (only when JS is available) ── */
html.js .fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s ease, transform .55s ease;
}
html.js .fade-in.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ── Announcement bar ── */
.announce-bar {
  background: linear-gradient(90deg, rgba(245,158,11,.16), rgba(56,189,248,.10));
  border-bottom: 1px solid var(--border);
  padding: .5rem 1.5rem;
  text-align: center;
  font-size: .84rem;
}
.announce-bar strong { color: var(--amber); }
.announce-bar svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; }

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.nav-logo .mark {
  font-family: var(--mono);
  font-size: .8rem;
  background: var(--text);
  color: var(--bg-base);
  border-radius: 6px;
  padding: .15rem .4rem;
  font-weight: 700;
}
.nav-links {
  display: flex;
  gap: 1.4rem;
  font-size: .9rem;
  color: var(--muted);
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-cta { margin-left: auto; display: flex; gap: .75rem; align-items: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: .92rem;
  border-radius: var(--radius);
  padding: .65rem 1.3rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #0b0e14; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-solid);
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--dim); }
.btn-lg { padding: .85rem 1.7rem; font-size: 1rem; border-radius: 10px; }
.btn-soon {
  background: var(--bg-hover);
  color: var(--muted);
  border-color: var(--border-solid);
  cursor: default;
}
.btn-soon:hover { filter: none; background: var(--bg-hover); border-color: var(--border-solid); }

/* ── "Coming soon" badge ── */
.badge-soon {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-solid);
  border-radius: 999px;
  padding: .2rem .65rem;
  white-space: nowrap;
}
.badge-soon::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

/* ── Hero ── */
.hero {
  padding: 5.5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: -40% 0 auto;
  height: 130%;
  background:
    radial-gradient(600px 300px at 30% 0%, var(--accent-dim), transparent 70%),
    radial-gradient(600px 300px at 70% 10%, rgba(56,189,248,.07), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-dim2);
  border-radius: 999px;
  padding: .3rem .9rem;
  margin-bottom: 1.4rem;
}
.hero .eyebrow svg { width: 14px; height: 14px; }
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.12;
  max-width: 820px;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--accent); }
.hero .sub {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 1.3rem auto 0;
}
.hero .cta-row {
  margin-top: 2.2rem;
  display: flex;
  gap: .9rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero .fine-print {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--dim);
  font-family: var(--mono);
}

/* ── Sections ── */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.section-head p { color: var(--muted); margin-top: .8rem; font-size: 1.05rem; }

/* ── Product cards (homepage) ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  justify-content: center;
  gap: 1.4rem;
}
.product-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  transition: border-color .2s ease, transform .2s ease;
}
.product-card .badge-soon,
.price-card .badge-soon { position: absolute; top: 1.1rem; right: 1.1rem; }
.product-card.soon .card-link { color: var(--muted); }
.product-card:hover { transform: translateY(-3px); }
.product-card.lispcraft:hover  { border-color: rgba(245,158,11,.5); }
.product-card .icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
}
.product-card.lispcraft .icon  { background: rgba(245,158,11,.14); color: var(--amber); }
.product-card h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.product-card .lang {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.product-card p { color: var(--muted); font-size: .94rem; flex: 1; }
.product-card .card-link {
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.product-card.lispcraft .card-link  { color: var(--amber); }

/* ── Feature grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}
.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.feature .f-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .9rem;
}
.feature .f-icon svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: .35rem; }
.feature p { color: var(--muted); font-size: .9rem; }

/* ── Editor mockup window ── */
.editor-window {
  background: #0d1117;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  text-align: left;
}
.editor-titlebar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1rem;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}
.editor-titlebar .dots { display: flex; gap: .4rem; }
.editor-titlebar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.editor-titlebar .title { margin: 0 auto; }
.editor-body {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.75;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  white-space: pre;
}
.editor-body .ln { color: var(--dim); user-select: none; display: inline-block; width: 2.2em; }
.tok-kw  { color: #c678dd; }
.tok-fn  { color: #61afef; }
.tok-str { color: #98c379; }
.tok-num { color: #d19a66; }
.tok-cm  { color: #5c6370; font-style: italic; }
.tok-ty  { color: #e5c07b; }
.tok-var { color: #e06c75; }
.editor-statusbar {
  display: flex;
  gap: 1.2rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: .4rem 1rem;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
}
.editor-statusbar .ok { color: var(--green); }

/* ── Screenshot ── */
.screenshot-wrap {
  margin-top: 3.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-solid);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
.screenshot-wrap img { width: 100%; height: auto; display: block; }

/* ── Stats band ── */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.3rem;
  text-align: center;
}
.stat .num {
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.02em;
}
.stat .label { color: var(--muted); font-size: .88rem; margin-top: .2rem; }

/* ── Comparison table ── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.compare-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-solid); }
.compare-table th, .compare-table td {
  padding: .9rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  background: var(--bg-hover);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.compare-table thead th.us { color: var(--text); }
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table td.us { color: var(--text); font-weight: 600; }
.compare-table td { color: var(--muted); }
.compare-table .yes { color: var(--green); }
.compare-table .no  { color: var(--red); }

/* ── Keybinding table ── */
.kbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  background: var(--bg-elevated);
}
.kbd-table th, .kbd-table td {
  padding: .7rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.kbd-table thead th {
  background: var(--bg-hover);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.kbd-table td:first-child { color: var(--muted); }
kbd {
  font-family: var(--mono);
  font-size: .78rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-solid);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .12rem .45rem;
  white-space: nowrap;
}
.kbd-caption {
  caption-side: top;
  padding: .8rem 1.1rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: .82rem;
  color: var(--muted);
}
/* Equivalent binding in another editor — a translation column, not a "before".
   Kept legible and unstruck: it's a migration aid for people who already have
   those chords in their fingers. */
.kbd-table .kbd-alt { color: var(--muted); }

/* ── User guide ── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
}
.guide-card h4 {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  margin-bottom: .7rem;
}
.guide-card .kbd-table td:last-child { text-align: right; white-space: nowrap; }
.guide-card .kbd-table td:first-child { color: var(--fg, var(--muted)); }
.guide-note {
  margin-top: .8rem;
  font-size: .82rem;
  color: var(--dim);
  border-left: 2px solid var(--accent-dim2);
  padding-left: .8rem;
}
@media (max-width: 720px) {
  .guide-grid { grid-template-columns: 1fr; }
}

/* ── Pricing ── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
  justify-content: center;
  gap: 1.4rem;
  align-items: stretch;
}
.price-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.price-card.soon { opacity: .82; }
.price-card.lispcraft  { border-top: 3px solid var(--amber); }
.price-card h3 { font-size: 1.3rem; font-weight: 800; }
.price-card .lang { font-family: var(--mono); font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.price-card .price { display: flex; align-items: baseline; gap: .5rem; }
.price-card .price .amount { font-size: 2.6rem; font-weight: 800; font-family: var(--mono); letter-spacing: -.03em; }
.price-card .price .terms { color: var(--muted); font-size: .85rem; }
.price-card ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; color: var(--muted); flex: 1; }
.price-card ul li::before { content: '✓  '; color: var(--green); font-weight: 700; }
.price-card .btn { justify-content: center; }
.price-card.lispcraft .btn-primary  { background: var(--amber); }

/* ── FAQ ── */
.faq { max-width: 760px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: .8rem;
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  padding: 1rem 1.3rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-family: var(--mono); font-size: 1.1rem; }
.faq details[open] summary::after { content: '–'; }
.faq .answer { padding: 0 1.3rem 1.1rem; color: var(--muted); font-size: .94rem; }

/* ── CTA band ── */
.cta-band {
  text-align: center;
  padding: 5rem 1.5rem;
  background:
    radial-gradient(500px 250px at 50% 0%, var(--accent-dim), transparent 70%),
    var(--bg-surface);
  border-top: 1px solid var(--border);
}
.cta-band h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); margin-top: .7rem; }
.cta-band .cta-row { margin-top: 1.8rem; display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2.5rem;
  font-size: .88rem;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer h4 { color: var(--text); font-size: .85rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .8rem; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.footer a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .8rem;
  color: var(--dim);
}

/* ── Two-column splits ── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.split h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.split p { color: var(--muted); margin-top: .8rem; }
.split ul { margin-top: 1rem; list-style: none; display: flex; flex-direction: column; gap: .6rem; color: var(--muted); font-size: .95rem; }
.split ul li::before { content: '✓  '; color: var(--accent); font-weight: 700; }

/* ── Responsive ── */
@media (max-width: 920px) {
  .product-grid, .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
  .stats-band { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
