/* Opening Bell Algo. One stylesheet, system fonts, no external requests. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --text: #1a2230;
  --muted: #566070;
  --line: #e2ded4;
  --navy: #13233a;
  --accent: #9a6a12;
  --accent-soft: #f6ecd6;
  --link: #1d4f91;
  --warn-bg: #fff4e5;
  --warn-line: #e8b866;
  --bad: #b3261e;
  --good: #1f6f43;
  --hypo: #a14a00;
  --hypo-bg: #fff0df;
  --live: #1d6b40;
  --live-bg: #e2f3e8;
  --band: #f1eee6;
  --btn-line: var(--navy);
  --btn-fg: var(--navy);
  --btn-primary-bg: var(--navy);
  --btn-primary-fg: #f7f3e8;
  --tl-s1: #1d4f91;
  color-scheme: light;
  --radius: 10px;
  --wrap: 1080px;
  --text-w: 72ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

/* Dark theme: follows the system unless the visitor picked a theme with the button. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1520;
    --surface: #151d2b;
    --surface-2: #1b2535;
    --text: #e6e9ef;
    --muted: #a3acbb;
    --line: #2a3546;
    --navy: #0a111c;
    --accent: #e0b25a;
    --accent-soft: #2a2416;
    --link: #8db8f0;
    --warn-bg: #2a2214;
    --warn-line: #8a6a2c;
    --bad: #f08a80;
    --good: #7fd1a3;
    --hypo: #f3a65f;
    --hypo-bg: #2f2112;
    --live: #7fd1a3;
    --live-bg: #11281c;
    --band: #131b28;
    --btn-line: var(--accent);
    --btn-fg: var(--accent);
    --btn-primary-bg: var(--accent);
    --btn-primary-fg: #141a24;
    --tl-s1: #3f74bd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1520;
  --surface: #151d2b;
  --surface-2: #1b2535;
  --text: #e6e9ef;
  --muted: #a3acbb;
  --line: #2a3546;
  --navy: #0a111c;
  --accent: #e0b25a;
  --accent-soft: #2a2416;
  --link: #8db8f0;
  --warn-bg: #2a2214;
  --warn-line: #8a6a2c;
  --bad: #f08a80;
  --good: #7fd1a3;
  --hypo: #f3a65f;
  --hypo-bg: #2f2112;
  --live: #7fd1a3;
  --live-bg: #11281c;
  --band: #131b28;
  --btn-line: var(--accent);
  --btn-fg: var(--accent);
  --btn-primary-bg: var(--accent);
  --btn-primary-fg: #141a24;
  --tl-s1: #3f74bd;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--navy);
  color: #f2efe6;
  border-bottom: 3px solid #d9a441;
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 60px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #f2efe6; text-decoration: none; font-size: 1.1rem; letter-spacing: .01em;
}
.brand b { color: #d9a441; font-weight: 600; }
.brand-mark { color: #d9a441; flex: none; }

.site-header nav ul { list-style: none; margin: 0; padding: 0; }
.site-header nav a { color: #f2efe6; text-decoration: none; font-size: .95rem; }
.site-header nav a:hover { color: #ffd88a; }
.site-header nav a[aria-current="page"] { color: #d9a441; }

.nav-wide { display: none; }
.nav-wide ul { display: flex; gap: 18px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-header {
  display: none; padding: 7px 14px; border-radius: 6px; background: #d9a441; color: #141a24;
  font-weight: 650; font-size: .9rem; text-decoration: none; white-space: nowrap;
}
.btn-header:hover { background: #e8b95c; }
@media (min-width: 480px) { .btn-header { display: inline-block; } }

.menu summary {
  cursor: pointer; list-style: none; padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.35); border-radius: 6px; font-size: .95rem;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] nav {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--navy); border-bottom: 3px solid #d9a441; z-index: 5;
}
.menu[open] nav ul { padding: 8px 16px 16px; }
.menu[open] nav li a { display: block; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.1); }

@media (min-width: 960px) {
  .menu { display: none; }
  .nav-wide { display: block; }
}

/* Content */
main { display: block; }

.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 0 0 8px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: var(--text-w); margin: 0 0 8px; }

h1, h2, h3 { line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 48px 0 12px; }
h3 { font-size: 1.15rem; margin: 28px 0 8px; }

.prose { max-width: var(--text-w); }
.prose p, .prose li { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 1.3em; }

section { padding-bottom: 8px; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }

code, kbd { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* Hero */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
.hero .lead { font-size: 1.2rem; }
.eyebrow {
  display: inline-block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 8px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 8px; text-decoration: none;
  font-weight: 600; border: 2px solid var(--btn-line); color: var(--btn-fg); background: transparent;
}
.btn-primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn:hover { text-decoration: none; filter: brightness(1.1); }
.pending { font-size: .85rem; color: var(--muted); }

/* Cards and grids */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.checklist, .crosslist { list-style: none; padding: 0; margin: 0; }
.checklist li, .crosslist li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.checklist li::before { content: "+"; position: absolute; left: 4px; top: 0; color: var(--good); font-weight: 700; }
.crosslist li::before { content: "\00d7"; position: absolute; left: 5px; top: -1px; color: var(--bad); font-weight: 700; font-size: 1.1em; }

/* Figures panel */
.figures {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin: 16px 0;
}
.label-hypo, .label-live {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem;
  letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; margin: 0 0 12px;
}
.label-hypo { color: var(--hypo); background: var(--hypo-bg); }
.label-hypo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hypo); }
.label-live { color: var(--live); background: var(--live-bg); }
.label-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }
.card-hypo { border-top: 4px solid var(--hypo); }
.card-live { border-top: 4px solid var(--live); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 0; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: var(--surface-2); border-radius: 8px; padding: 12px; }
.stats dt { font-size: .85rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats dd.neg { color: var(--bad); }

/* Notices */
.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-left-width: 5px;
  border-radius: 8px; padding: 14px 16px; margin: 16px 0; max-width: var(--text-w);
}
.notice p:last-child { margin-bottom: 0; }
.notice-caps { font-size: .85rem; letter-spacing: .01em; }

.todo {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface);
  color: var(--muted);
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.neg { color: var(--bad); font-weight: 600; }
caption { text-align: left; padding: 10px 12px; color: var(--muted); font-size: .9rem; caption-side: bottom; }

/* Charts */
figure.chart { margin: 20px 0 28px; }
figure.chart picture, figure.chart img {
  border: 1px solid var(--line); border-radius: 8px; background: #fcfcfb;
}
figure.chart figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; max-width: var(--text-w); }

/* FAQ */
details.qa { border-bottom: 1px solid var(--line); padding: 4px 0; max-width: var(--text-w); }
details.qa summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
details.qa[open] summary { color: var(--accent); }
details.qa > div { padding: 0 0 12px; }

/* Changelog */
.release { border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; margin: 24px 0; max-width: var(--text-w); }
.release h2 { margin-top: 0; }

/* Steps */
ol.steps { counter-reset: step; list-style: none; padding: 0; max-width: var(--text-w); }
ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 16px; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #f2efe6;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}

/* Footer */
.site-footer {
  margin-top: 64px; background: var(--surface-2); border-top: 1px solid var(--line);
  padding: 28px 0 32px; font-size: .9rem; color: var(--muted);
}
.footer-risk { max-width: var(--text-w); color: var(--text); }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 24px; margin: 20px 0; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 6px; }
.footer-small { font-size: .8rem; max-width: var(--text-w); }

/* Full-width bands (home page) */
.band { padding: 8px 0 40px; }
.band-alt { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { margin-top: 40px; }
.section-lead { color: var(--muted); max-width: var(--text-w); margin: -4px 0 20px; }

/* Fact strip */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 8px 0 0; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts div { background: var(--surface); padding: 16px; }
.facts dt { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.facts dd { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }

/* Timeline illustration */
.timeline-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; margin: 24px 0 0; }
.timeline-card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.timeline-card p { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.timeline-scroll { overflow-x: auto; }
.timeline { display: block; width: 100%; min-width: 620px; height: auto; font-family: var(--font); }
.tl-label, .tl-tick { font-size: 12px; fill: var(--muted); }
.tl-label { font-weight: 600; fill: var(--text); }
.tl-in { font-size: 11px; fill: var(--text); }
.tl-in-dark { fill: #f5f1e6; }
.tl-track { fill: var(--surface-2); }
.tl-halt { fill: var(--muted); opacity: .45; }
.tl-s1 { fill: var(--tl-s1); }
.tl-s2 { fill: #d9a441; }
.tl-s2hold { fill: #d9a441; opacity: .35; }
.tl-axis { stroke: var(--line); stroke-width: 1.5; }
.tl-open { stroke: #d9a441; stroke-width: 1.5; stroke-dasharray: 4 3; }
.tl-open-text { font-size: 11px; font-weight: 700; fill: var(--accent); }

/* Comparison */
.compare td:first-child { width: 50%; }
.compare th { width: 50%; }

/* Icons in cards */
.icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.icon svg { width: 20px; height: 20px; }

/* Trade log placeholder */
.log-empty td { color: var(--muted); text-align: center; font-style: italic; }

/* Guides */
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.guide-list a { font-weight: 650; font-size: 1.1rem; }
.byline { color: var(--muted); font-size: .9rem; }
.stats-2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stats-2 { grid-template-columns: repeat(2, 1fr); } }
.timeline-list { margin: 4px 0 8px; padding-left: 1.2em; font-size: .95rem; }
.timeline-list li { margin-bottom: 6px; }
@media (max-width: 639px) { .timeline-scroll { display: none; } }
@media (min-width: 640px) { .timeline-list { display: none; } }

/* Theme switch (shown only when the script runs) */
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 34px; padding: 0;
  border: 1px solid rgba(255,255,255,.35); border-radius: 6px; background: transparent;
  color: #f2efe6; cursor: pointer;
}
.theme-toggle:hover { color: #ffd88a; border-color: #ffd88a; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .i-sun { display: none; }
.theme-toggle[data-mode="dark"] .i-sun { display: block; }
.theme-toggle[data-mode="dark"] .i-moon { display: none; }

/* Home hero: dark in both themes, with the bell illustration */
.hero-band {
  background-color: #13233a;
  background-image: radial-gradient(circle at 100% 0%, rgba(217,164,65,.28), rgba(217,164,65,0) 55%);
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) {
  .hero-band {
    background-image: linear-gradient(90deg, rgba(19,35,58,1) 0%, rgba(19,35,58,1) 45%, rgba(19,35,58,0) 70%), url("/assets/img/hero-bell.webp");
    background-size: 100% 100%, auto 100%;
    background-position: 0 0, right center;
  }
  .hero-band .hero { padding: 80px 0 72px; }
}
.hero-band .hero { padding: 64px 0 56px; max-width: 640px; }
.hero-band h1 { color: #f5f1e6; }
.hero-band .lead { color: #c9d1de; }
.hero-band .eyebrow { color: #d9a441; }
.hero-band .pending { color: #9fabbd; }
.hero-band .btn { border-color: #d9a441; color: #f5f1e6; }
.hero-band .btn-primary { background: #d9a441; border-color: #d9a441; color: #141a24; }

/* Pricing */
.plan { display: flex; flex-direction: column; gap: 4px; }
.plan .btn { align-self: flex-start; margin-top: auto; }
.plan .checklist { margin-bottom: 16px; }
.price { margin: 0 0 12px; }
.price .amount { font-size: 2.4rem; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; }
.price .per { color: var(--muted); }

/* Forms: cancel and withdraw */
.form label { display: block; font-weight: 600; margin: 14px 0 4px; }
.form label.choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 8px 0; }
.form label.choice input { margin-top: 5px; }
.form input[type=text], .form input[type=email], .form input[type=date], .form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit;
}
.form fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 16px 0 0; padding: 4px 12px 8px; }
.form legend { font-weight: 600; padding: 0 4px; }
.form .btn { margin-top: 18px; cursor: pointer; font: inherit; font-weight: 600; }
.form .hint { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.form .req, .form .opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.statement { font-style: italic; border-left: 3px solid var(--accent); padding-left: 12px; }
