/* AlphaStage — editorial research-journal design system
   Warm bone canvas, ink type, serif display, hairline structure. */

:root {
  --canvas: #f7f6f3;
  --card: #ffffff;
  --ink: #111111;
  --ink-2: #52504b;
  --ink-3: #787774;
  --line: #eaeae7;
  --line-soft: rgba(0, 0, 0, 0.05);
  --green-bg: #edf3ec; --green-tx: #346538;
  --red-bg: #fdebec;   --red-tx: #9f2f2d;
  --yellow-bg: #fbf3db; --yellow-tx: #956400;
  --blue-bg: #e1f3fe;  --blue-tx: #1f6c9f;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Geist", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* compat aliases for older inline styles */
  --accent: var(--green-tx);
  --accent-2: var(--blue-tx);
  --accent-dim: var(--green-bg);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient warmth, barely there */
.mesh {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 420px at 85% -5%, rgba(180, 150, 90, 0.05), transparent 65%),
    radial-gradient(700px 520px at 5% 100%, rgba(120, 140, 110, 0.05), transparent 60%);
}
.grain { display: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: rgba(247, 246, 243, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-pill {
  max-width: 1100px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo {
  font-family: var(--serif); font-weight: 600; font-size: 19px;
  letter-spacing: -0.02em; margin-right: 26px;
  text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 9px;
}
.nav-logo .dot {
  width: 8px; height: 8px; background: var(--ink);
  transform: rotate(45deg);
}
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--ink-3); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  transition: all 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: rgba(0, 0, 0, 0.04); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-cta {
  margin-left: auto; text-decoration: none; color: #fff; background: var(--ink);
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 6px;
  transition: all 0.3s var(--ease);
}
.nav-cta:hover { background: #333; }
.nav-cta:active { transform: scale(0.98); }
.nav-burger { display: none; }

/* ---------- typography ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3);
  border: none; background: none; padding: 0;
}
.eyebrow::before { content: "—"; color: var(--ink-3); }
h1.display {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.05;
  font-weight: 500; letter-spacing: -0.03em; margin: 18px 0 20px;
}
h1.display .grad, .grad { font-style: italic; color: var(--ink); font-weight: 500; }
h2.title {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1.12;
  font-weight: 500; letter-spacing: -0.02em; margin: 16px 0 12px;
}
h3 { font-weight: 650; letter-spacing: -0.01em; }
.lede { color: var(--ink-2); font-size: 16.5px; max-width: 62ch; }
.small { font-size: 13px; color: var(--ink-3); }
.small a { color: var(--ink-2); }

section { padding: 96px 0; }
section.tight { padding: 56px 0; }

/* ---------- cards (flat, hairline) ---------- */
.shell { background: none; border: none; border-radius: 0; padding: 0; }
.core {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: none;
  padding: 30px;
  height: 100%;
  transition: box-shadow 0.25s var(--ease);
}
.core:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04); }
.core.pad-lg { padding: 40px; }
.core.pad-sm { padding: 20px; }

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.b-8 { grid-column: span 8; } .b-7 { grid-column: span 7; }
.b-6 { grid-column: span 6; } .b-5 { grid-column: span 5; }
.b-4 { grid-column: span 4; } .b-12 { grid-column: span 12; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  border-radius: 6px; padding: 12px 22px;
  font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: all 0.3s var(--ease); border: none; cursor: pointer;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn .ic {
  width: auto; height: auto; background: none !important; border-radius: 0;
  display: inline; font-size: 14px;
  transition: transform 0.3s var(--ease);
}
.btn:hover .ic { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #cfcecb; }

/* ---------- stats ---------- */
.stat .num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 500; letter-spacing: -0.02em;
}
.stat .lbl { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }

/* ---------- tables ---------- */
.tbl-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 760px; }
table.data th {
  text-align: left; color: var(--ink-3); font-weight: 500;
  font-family: var(--mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.09em;
  border-bottom: 1px solid var(--ink); padding: 10px 14px 10px 0;
  white-space: nowrap; cursor: pointer; user-select: none;
}
table.data th.sorted { color: var(--ink); font-weight: 700; }
table.data td {
  border-bottom: 1px solid var(--line); padding: 11px 14px 11px 0;
  vertical-align: middle; white-space: nowrap;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(0, 0, 0, 0.015); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-size: 12.5px; }
.sym { font-weight: 700; font-size: 13px; }
.co-name { color: var(--ink-3); font-size: 11.5px; }

/* tags */
.pill {
  display: inline-block; border-radius: 9999px; padding: 3px 10px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.pill-s2 { background: var(--green-bg); color: var(--green-tx); }
.pill-s2c { background: var(--blue-bg); color: var(--blue-tx); }
.pill-s1 { background: #efeeea; color: var(--ink-3); }
.pill-s3 { background: var(--yellow-bg); color: var(--yellow-tx); }
.pill-s4 { background: var(--red-bg); color: var(--red-tx); }
.pill-pass { background: var(--green-bg); color: var(--green-tx); }
.pill-cond { background: var(--yellow-bg); color: var(--yellow-tx); }
.pill-fail { background: var(--red-bg); color: var(--red-tx); }

/* RS bar */
.rs-cell { display: flex; align-items: center; gap: 9px; }
.rs-track { width: 54px; height: 4px; border-radius: 2px; background: #e7e6e2; overflow: hidden; }
.rs-fill { height: 100%; border-radius: 2px; background: var(--ink); }

/* banners */
.demo-note, .live-note {
  display: flex; align-items: center; gap: 10px;
  border-radius: 8px; font-size: 12.5px; padding: 10px 16px; margin-bottom: 18px;
  border: 1px solid var(--line);
}
.demo-note { background: var(--yellow-bg); color: var(--yellow-tx); border-color: #eee3c2; }
.live-note { background: var(--green-bg); color: var(--green-tx); border-color: #d9e6d8; }

/* ---------- forms ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: end; }
.field {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; color: var(--ink); font-family: inherit; font-size: 13.5px;
  padding: 9px 13px; outline: none; transition: border-color 0.3s var(--ease);
}
.field:focus { border-color: #b9b7b2; }
.field::placeholder { color: var(--ink-3); }
label.flabel {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  display: block; margin: 0 0 5px 2px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* tabs */
.tabs {
  display: inline-flex; gap: 0; border: 1px solid var(--line); background: var(--card);
  border-radius: 8px; padding: 4px; margin-bottom: 26px;
}
.tabs button {
  border: none; background: transparent; color: var(--ink-3); font-family: inherit;
  font-size: 13.5px; font-weight: 600; padding: 8px 18px; border-radius: 6px;
  cursor: pointer; transition: all 0.3s var(--ease);
}
.tabs button.on { background: var(--ink); color: #fff; }

.star { cursor: pointer; color: #cfcecb; font-size: 15px; background: none; border: none; transition: all 0.3s var(--ease); }
.star.on { color: var(--ink); transform: scale(1.1); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 56px 0 72px; margin-top: 40px; background: var(--card); }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
footer a { color: var(--ink-3); text-decoration: none; font-size: 13.5px; display: block; margin-bottom: 9px; transition: color 0.3s var(--ease); }
footer a:hover { color: var(--ink); }
footer .head {
  font-family: var(--mono); color: var(--ink-2); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 14px;
}

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(12px); transition: all 0.6s var(--ease); }
.rv.in { opacity: 1; transform: translateY(0); }
.rv-d1 { transition-delay: 0.07s; } .rv-d2 { transition-delay: 0.14s; } .rv-d3 { transition-delay: 0.21s; }

/* faq */
details.faq { border-bottom: 1px solid var(--line); padding: 20px 4px; }
details.faq summary {
  cursor: pointer; font-weight: 600; font-size: 15.5px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; font-family: var(--mono); transition: transform 0.35s var(--ease); }
details.faq[open] summary::after { transform: rotate(45deg); }
details.faq p { color: var(--ink-2); font-size: 14px; margin-top: 12px; max-width: 70ch; }

/* misc */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px;
  font-size: 12.5px; color: var(--ink-2); background: var(--card);
}
.good { color: var(--green-tx); } .bad { color: var(--red-tx); } .warn { color: var(--yellow-tx); }
hr.dim { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
kbd {
  font-family: var(--mono); font-size: 11px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--canvas); padding: 2px 6px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr; }
  .b-8, .b-7, .b-6, .b-5, .b-4, .b-12 { grid-column: span 1; }
  footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  section { padding: 60px 0; }
  .wrap { padding: 0 16px; }
  .nav-pill { padding: 12px 16px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px; background: none; border: none;
    cursor: pointer; padding: 8px; margin-left: auto;
  }
  .nav-burger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: all 0.4s var(--ease); }
  .nav-burger.x span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.x span:nth-child(2) { opacity: 0; }
  .nav-burger.x span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .mobile-menu {
    position: fixed; inset: 0; z-index: 39; background: rgba(247, 246, 243, 0.96);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
  }
  .mobile-menu.open { opacity: 1; pointer-events: auto; }
  .mobile-menu a {
    color: var(--ink); text-decoration: none; font-size: 26px; font-weight: 500;
    font-family: var(--serif); letter-spacing: -0.02em; padding: 10px;
    opacity: 0; transform: translateY(14px); transition: all 0.5s var(--ease);
  }
  .mobile-menu.open a { opacity: 1; transform: translateY(0); }
  .mobile-menu.open a:nth-child(1) { transition-delay: 0.06s; }
  .mobile-menu.open a:nth-child(2) { transition-delay: 0.11s; }
  .mobile-menu.open a:nth-child(3) { transition-delay: 0.16s; }
  .mobile-menu.open a:nth-child(4) { transition-delay: 0.21s; }
  .mobile-menu.open a:nth-child(5) { transition-delay: 0.26s; }
}
