:root {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel2: #10233a;
  --ink: #ecf4ff;
  --muted: #a9bcd2;
  --line: #213956;
  --brand: #66e3c4;
  --brand2: #7ba6ff;
  --warn: #ffcf66;
  --bad: #ff7d8d;
  --good: #6be39d;
  --radius: 18px;
  --wrap: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
p { margin: 0 0 14px; }

a { color: var(--brand); }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.wrap.narrow { width: min(760px, 100% - 40px); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #04121c; padding: 10px 16px; border-radius: 0 0 10px 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--brand2);
  outline-offset: 2px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 17, 31, .92);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 62px; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .2px; }
.brand-mark {
  width: 15px; height: 15px; border-radius: 50%;
  border: 3px solid var(--brand); border-right-color: transparent;
}
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-btn {
  background: transparent; color: var(--muted); border: 0;
  padding: 7px 15px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.lang-btn[aria-pressed="true"] { background: var(--panel2); color: var(--ink); }

/* Hero */
.hero {
  padding: 64px 0 52px;
  background:
    radial-gradient(1000px 460px at 15% -10%, rgba(102, 227, 196, .13), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(123, 166, 255, .11), transparent 62%);
}
.eyebrow {
  color: var(--brand); font-size: .82rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  font-weight: 900; max-width: 18ch;
}
.promise {
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 800; color: #f4f8ff; max-width: 30ch; margin-bottom: 16px;
}
.lede { color: var(--muted); max-width: 62ch; }

.url-form {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 26px 0 10px; max-width: 620px;
}
.url-form input {
  flex: 1 1 280px; min-width: 0;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font: inherit;
}
.url-form input::placeholder { color: #7c93ac; }

.btn-primary {
  background: var(--brand); color: #04121c;
  border: 0; border-radius: 12px; padding: 14px 22px;
  font: inherit; font-weight: 800; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-primary.wide { width: 100%; padding: 15px; margin-top: 8px; }

.form-note { color: var(--muted); font-size: .88rem; }
.form-note.err { color: var(--bad); }

.stat-row {
  list-style: none; display: grid; gap: 12px; padding: 0; margin: 30px 0 0;
  grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 620px;
}
.stat-row li {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 14px; padding: 13px 15px;
}
.stat-row b { display: block; font-size: 1.02rem; }
.stat-row span { color: var(--muted); font-size: .82rem; }

/* Sections */
.section { padding: 54px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); font-weight: 800; }
.section-lede { color: var(--muted); max-width: 62ch; margin-bottom: 26px; }

/* Loop rail */
.loop-rail {
  list-style: none; padding: 0; margin: 22px 0 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.loop-rail li {
  border: 1px solid var(--line); background: var(--panel2);
  border-radius: 14px; padding: 14px;
}
.loop-rail li.core { border-color: #3c837b; background: #103035; }
.loop-rail b { display: block; margin-bottom: 5px; font-size: .93rem; }
.loop-rail span { color: var(--muted); font-size: .82rem; }

/* Wireframe mocks (ported from spec v1.3.1) */
.mock-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; margin: 8px 0 0;
}
.mock-card {
  border: 1px solid #294561; background: #091827;
  border-radius: 16px; overflow: hidden; min-width: 0; margin: 0;
}
.mock-title {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  background: var(--panel2); font-size: .82rem; font-weight: 800;
}
.chip {
  border-radius: 999px; padding: 3px 9px; font-size: .68rem; font-weight: 800;
  white-space: nowrap; border: 1px solid;
}
.chip.good { color: var(--good); border-color: rgba(107, 227, 157, .45); background: rgba(107, 227, 157, .1); }
.chip.warn { color: var(--warn); border-color: rgba(255, 207, 102, .45); background: rgba(255, 207, 102, .1); }
.chip.brand { color: var(--brand); border-color: rgba(102, 227, 196, .45); background: rgba(102, 227, 196, .1); }

.mock-window {
  height: 300px; display: grid; grid-template-columns: 76px minmax(0, 1fr);
  font-size: 10px; line-height: 1.45;
}
.mock-window.one-col { grid-template-columns: 1fr; }
.mock-side { background: #0c1c30; padding: 10px 7px; border-right: 1px solid var(--line); }
.mock-side div { height: 18px; border-radius: 5px; background: #132b47; margin: 0 0 7px; }
.mock-side div.on { background: #2f6285; }
.mock-main {
  padding: 13px; overflow: hidden;
  background: linear-gradient(160deg, #0b1a2c, #0a1726);
}
.mock-main.pad { padding: 22px; }
.mock-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 9px; }
.mock-stat, .mock-panel {
  border: 1px solid #203a55; background: #102139; border-radius: 8px; padding: 8px;
}
.mock-stat b { font-size: 12px; color: #eaf5ff; display: block; }
.mock-stat span { color: #93aac2; }
.mock-panel { margin-bottom: 8px; }
.mock-panel p { margin: 3px 0 0; color: #b6c8dc; }
.mock-panel.tall { min-height: 70px; color: #b6c8dc; }
.mock-panel.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mock-lines i { display: block; height: 5px; background: #2b4a69; border-radius: 4px; margin: 5px 0; }
.mock-lines i:nth-child(2) { width: 82%; }
.mock-lines i:nth-child(3) { width: 60%; }
.mock-table .row {
  display: grid; grid-template-columns: 20px 1.3fr .7fr; gap: 6px;
  border-bottom: 1px solid #20364f; padding: 6px 2px;
}
.mock-action { color: var(--brand); font-weight: 700; white-space: nowrap; }
.mock-danger { color: var(--bad); }
.plain-label { color: #a9bcd2; font-size: 11px; }
.mock-hero-line { font-size: 17px; font-weight: 900; margin: 8px 0 12px; }
.microcopy { color: #94aac2; font-size: .78rem; margin: 6px 0 0; }
.mock-caption {
  padding: 12px 14px; color: #a9bcd2; border-top: 1px solid var(--line);
  background: #0b1c2e; font-size: .78rem; margin: 0;
}

/* Waitlist */
.waitlist-section { background: linear-gradient(180deg, rgba(16, 35, 58, .5), transparent); }
.waitlist-form { margin-top: 8px; }
.field { margin-bottom: 20px; border: 0; padding: 0; }
.field > label, .field legend { display: block; font-weight: 700; margin-bottom: 7px; padding: 0; }
.field input[type="email"], .field select {
  width: 100%; background: var(--panel); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; font: inherit;
}
.field input::placeholder { color: #7c93ac; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.choice { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--brand); }
.field-error { color: var(--bad); font-size: .85rem; margin: 6px 0 0; }
.form-status { margin-top: 14px; font-weight: 700; min-height: 1.6em; }
.form-status.ok { color: var(--good); }
.form-status.err { color: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* FAQ */
.faq { margin: 0; }
.faq dt { font-weight: 800; margin-top: 20px; }
.faq dd { margin: 6px 0 0; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: .87rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-inner .microcopy { margin: 0; }

@media (max-width: 900px) {
  .loop-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mock-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding: 44px 0 38px; }
  .loop-rail, .stat-row { grid-template-columns: 1fr; }
  .url-form button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
