/* self-hosted fonts (no Google Fonts): Inter (SIL OFL 1.1), Caladea (SIL OFL 1.1) */
@font-face { font-family: "Toyamato Sans"; src: url("fonts/inter-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Toyamato Sans"; src: url("fonts/inter-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Toyamato Sans"; src: url("fonts/inter-700.woff") format("woff"); font-weight: 600 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Toyamato Serif"; src: url("fonts/caladea-700.woff") format("woff"); font-weight: 600 900; font-style: normal; font-display: swap; }
/* Layout: one centered column (max 1120px); hero band edge to edge; product rows alternate image/text. */
:root {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --fg: #13203F;
  --muted: #4B5672;
  --line: #D9DEEA;
  --red: #C8302A;
  --gold: #A9781C;
  --gold-bright: #F2C14E;
  --ink: #0E1630;
  --ink-fg: #EEF1F8;
  --btn-fg: #FFFFFF;
  --focus: #2F5BD3;
  --font-display: "Toyamato Serif", Cambria, Georgia, "Times New Roman", serif;
  --font-body: "Toyamato Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1122; --surface: #121A31; --fg: #E7EBF5; --muted: #A6B0C8; --line: #26304C;
    --red: #F0574B; --gold: #E9B949; --ink: #070C1A; --ink-fg: #EEF1F8; --btn-fg: #FFFFFF; --focus: #8EA9FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1122; --surface: #121A31; --fg: #E7EBF5; --muted: #A6B0C8; --line: #26304C;
  --red: #F0574B; --gold: #E9B949; --ink: #070C1A; --ink-fg: #EEF1F8; --btn-fg: #FFFFFF; --focus: #8EA9FF;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 17px; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header */
.site-header { background: var(--ink); color: var(--ink-fg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink-fg); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.brand-sun { width: 22px; height: 22px; border-radius: 50%; background: #D8352C; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
.nav a { color: #C9D1E6; text-decoration: none; padding-block: 6px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold-bright); }

/* Hero */
.hero { background: var(--ink); color: var(--ink-fg); position: relative; overflow: hidden; }
.hero-art { display: block; width: 100%; height: auto; }
.hero-text { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.hero-text .wrap { width: 100%; padding-block: 0 clamp(20px, 5vw, 56px); }
.hero .kana { font-size: clamp(13px, 1.6vw, 16px); letter-spacing: 0.45em; color: var(--gold-bright); }
.hero h1 { font-size: clamp(34px, 5.2vw, 64px); max-width: 9.5em; font-weight: 800; color: #FFFFFF; }
.hero p { max-width: 34em; margin: 10px 0 0; color: #C9D1E6; font-size: clamp(15px, 1.8vw, 19px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 640px) {
  .hero-text { position: static; }
  .hero-text .wrap { padding-block: 20px 32px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid transparent; }
.btn-primary { background: var(--red); color: var(--btn-fg); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { border-color: currentColor; color: var(--fg); }
.btn-outline:hover { color: var(--red); }
.hero .btn-outline, .band .btn-outline { color: #FFFFFF; }
.btn-link { padding: 0 6px; color: var(--red); }

/* Sections */
.section { padding-block: clamp(48px, 8vw, 96px); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.lead { color: var(--muted); max-width: 40em; }

/* Product rows */
.products { display: flex; flex-direction: column; gap: clamp(56px, 9vw, 112px); }
.product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.product.reverse { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.product.reverse .product-media { order: 2; }
.product-media a { display: block; max-width: 400px; margin-inline: auto; }
.product-media img { width: 100%; transition: transform .25s ease; }
.product-media a:hover img { transform: translateY(-4px); }
.product-body { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.product-body h2 { font-size: clamp(30px, 4vw, 44px); }
.product-body h2 .x { color: var(--red); }
.product-body p { margin: 0; color: var(--muted); max-width: 36em; }
.facts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; }
.facts .k { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.facts .v { font-weight: 700; font-size: clamp(14px, 1.6vw, 17px); line-height: 1.35; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
@media (max-width: 780px) {
  .product, .product.reverse { grid-template-columns: minmax(0, 1fr); }
  .product.reverse .product-media { order: 0; }
  .product-media a { max-width: 300px; }
}

/* Detail pages */
.detail-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.detail-head .product-media a, .detail-head .product-media > img { max-width: 340px; margin-inline: auto; }
.detail-head h1 { font-size: clamp(34px, 5vw, 56px); }
.detail-head h1 .x { color: var(--red); }
@media (max-width: 780px) { .detail-head { grid-template-columns: minmax(0, 1fr); } }
.prose { max-width: 68ch; }
.prose h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 48px; margin-bottom: 12px; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--fg); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.feature h3 { font-family: var(--font-body); font-size: 17px; margin-bottom: 6px; }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }
.table-box { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { width: 38%; color: var(--muted); font-weight: 500; }
td { font-weight: 700; font-variant-numeric: tabular-nums; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
.placeholder { color: var(--gold); font-weight: 700; }
.license-note { background: var(--surface); border: 1px solid var(--line); border-left: 0; border-radius: var(--radius); padding: 16px 20px; }

.strat-list { columns: 2 260px; column-gap: 32px; padding-left: 1.4em; margin: 0; }
.strat-list li { break-inside: avoid; padding-block: 2px; color: var(--muted); }

/* CTA band */
.band { background: var(--ink); color: var(--ink-fg); }
.band .wrap { padding-block: clamp(40px, 6vw, 64px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.band h2 { font-size: clamp(24px, 3.4vw, 34px); color: #FFFFFF; }
.band p { margin: 6px 0 0; color: #C9D1E6; }

/* Risk + footer */
.risk { border-top: 1px solid var(--line); }
.risk .wrap { padding-block: 40px; }
.risk h2 { font-family: var(--font-body); font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg); margin-bottom: 10px; }
.risk p { font-size: 14px; color: var(--muted); max-width: 90ch; margin: 0 0 10px; }
.site-footer { background: var(--ink); color: #9AA5C2; font-size: 14px; }
.site-footer .wrap { padding-block: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: #C9D1E6; text-decoration: none; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- v2 additions: notes, cards, gate, footer --- */
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0; }
.notice.gold { border-left-color: var(--gold); }
.notice p { margin: 0 0 8px; color: var(--muted); }
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--fg); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card h2, .card h3 { font-size: clamp(22px, 2.6vw, 28px); }
.card p { margin: 0; color: var(--muted); }
.card .small, .small { font-size: 13.5px; color: var(--muted); }
.card .actions { margin-top: auto; padding-top: 6px; }
.card.ic { border-top: 4px solid var(--gold); }
.card.donate { border-top: 4px solid var(--red); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.steps strong { color: var(--fg); }
.gate { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 12px; margin: 16px 0; }
.gate label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; color: var(--fg); }
.gate input[type="checkbox"] { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--red); }
.dl-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.dl-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.dl-list .name { font-weight: 700; color: var(--fg); }
.dl-list .desc { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }
.is-locked .btn, .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; filter: grayscale(1); }
.gate-msg { font-size: 14px; color: var(--red); font-weight: 700; margin: 0; }
.unlocked .gate-msg { color: var(--gold); }
pre.mail { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 14px; color: var(--fg); overflow-x: auto; }
.legal h2 { font-size: clamp(20px, 2.4vw, 26px); margin-top: 40px; }
.legal h2:first-of-type { margin-top: 24px; }
.toc-list { columns: 2 240px; padding-left: 1.3em; }
.risk .more { font-weight: 700; }
.site-footer .wrap { flex-direction: column; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; align-items: center; }
.foot-row + .foot-row { border-top: 1px solid #1F2A4A; padding-top: 14px; }
.footer-donate { color: #fff !important; background: #C8302A; padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.is-locked pre.mail, .is-locked .gate { opacity: .45; pointer-events: none; user-select: none; }

/* --- v3: sales model --- */
.promise { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; }
.promise li { background: var(--surface); border: 2px solid var(--gold); border-radius: var(--radius); padding: 12px 14px; color: var(--fg); font-size: 15px; line-height: 1.4; }
.promise li strong { display: block; font-size: 17px; color: var(--red); }
.promise-band { background: linear-gradient(90deg, rgba(200,48,42,.08), rgba(169,120,28,.10)); border-block: 1px solid var(--line); }
.promise-band .wrap { padding-block: 22px; }
.price { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 40px); color: var(--fg); line-height: 1; }
.price small { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--muted); }
.card .facts { margin-top: 0; }
.tag-free { display: inline-block; background: #1F7A57; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .12em; padding: 3px 10px; border-radius: 999px; }
.platform-pill { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 6px; }
.footnote { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.prose .promise { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* backtests */
.bt-table table { min-width: 860px; }
.bt-table th, .bt-table td { width: auto; padding: 10px 12px; white-space: nowrap; font-size: 14.5px; }
.bt-table thead th { color: var(--fg); font-weight: 700; background: color-mix(in srgb, var(--line) 45%, var(--surface)); }
.bt-table td.num { text-align: right; }
.bt-table td .btn { padding: 6px 12px; font-size: 13.5px; min-height: 0; }
.bt-table .dd { color: var(--red); }
.bt-empty { color: var(--muted); font-style: italic; }
@media (max-width: 720px) {
  .bt-table { overflow: visible; }
  .bt-table table { min-width: 0; border: 0; background: transparent; }
  .bt-table thead { display: none; }
  .bt-table tbody, .bt-table tr, .bt-table td { display: block; width: 100%; }
  .bt-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 6px 0; }
  .bt-table td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); white-space: normal; text-align: right; }
  .bt-table td:last-child { border-bottom: 0; }
  .bt-table td::before { content: attr(data-label); color: var(--muted); font-weight: 500; text-align: left; }
  .bt-table td.pair { font-size: 17px; }
  .bt-table td.bt-empty { display: block; text-align: left; }
  .bt-table td.bt-empty::before { content: none; }
}
@media (min-width: 721px) {
  .prose .bt-table { margin-inline: calc((100% - min(1120px, 100vw - 48px)) / 2); }
  .bt-table table { min-width: 0; }
}

mark { background: #FFE58A; color: #3A2A00; padding: 0 4px; border-radius: 3px; }

.steps { grid-template-columns: minmax(0, 1fr); }
.prose code, .steps code, .notice code { overflow-wrap: anywhere; }
