/* stakism.com — editorial, static-first, dark/light.
   Palette drawn from the book cover: navy ink, cream paper, restrained gold.
   Body = readable serif (echoes the book interior); UI = clean grotesque. */

/* Dark is the default (owner: "make the dark version default"). Light is opt-in
   via the toggle, which stamps data-theme="light". */
:root {
  --paper: #0b1020;
  --paper-2: #121734;
  --ink: #e9e5d9;
  --ink-soft: #a9adbb;
  --gold: #d4af69;
  --gold-bright: #e2c485;
  --rule: #26304f;
  --maxw: 68rem;
  --serif: Georgia, "Iowan Old Style", "Noto Serif", Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="light"] {
  --paper: #f6f2e9;
  --paper-2: #efe9db;
  --ink: #16191f;
  --ink-soft: #4a4f57;
  --gold: #9a6f2f;
  --gold-bright: #b8894a;
  --rule: #d9d1bf;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.4rem; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; font-weight: 700; }
img, svg { max-width: 100%; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--ink); color: var(--paper);
  padding: .5rem .8rem; border-radius: .3rem; z-index: 20; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); position: sticky; top: 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 1.2rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark { font-family: var(--sans); font-weight: 800; letter-spacing: .04em;
  font-size: 1.35rem; color: var(--ink); }
.tagline { font-style: italic; color: var(--ink-soft); font-size: .8rem; }
.mainnav { display: flex; gap: 1.05rem; margin-left: auto; font-family: var(--sans); font-size: .93rem; }
.mainnav a { color: var(--ink-soft); }
.mainnav a:hover, .mainnav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.mainnav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold); }
.header-actions { display: flex; align-items: center; gap: .7rem; font-family: var(--sans); }
.lang { font-size: .85rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--rule);
  border-radius: .3rem; padding: .15rem .45rem; }
.theme-toggle { background: none; border: 1px solid var(--rule); color: var(--ink-soft);
  border-radius: .3rem; width: 2rem; height: 1.9rem; cursor: pointer; font-size: 1rem; }
.theme-toggle:hover { color: var(--ink); }

/* Buttons */
.btn { font-family: var(--sans); font-weight: 600; font-size: .95rem; border-radius: .35rem;
  padding: .6rem 1.1rem; display: inline-block; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--gold); color: #14110a; }
.btn-primary:hover { background: var(--gold-bright); text-decoration: none; }
.btn-ghost { border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); text-decoration: none; }
.btn-buy { background: transparent; border-color: var(--gold); color: var(--gold); padding: .35rem .8rem; font-size: .9rem; }
.btn-buy:hover { background: var(--gold); color: #14110a; text-decoration: none; }
.btn.disabled { opacity: .55; pointer-events: none; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.6fr .7fr; gap: 2rem; align-items: center;
  padding: 4rem 1.4rem 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 1rem; letter-spacing: -.01em; }
.hero-sub { font-size: 1.2rem; color: var(--ink-soft); margin: 0 0 1.6rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; }
.ladder { width: 150px; height: 300px; }
.ladder .rail, .ladder .rung { stroke: var(--gold); stroke-width: 2.5; }
.ladder .rung { opacity: .8; }
.ladder .floor { stroke: var(--gold-bright); stroke-width: 3.5; }

/* Pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem;
  padding: 2rem 1.4rem; border-top: 1px solid var(--rule); }
.pillar h3 { font-family: var(--sans); font-size: 1.15rem; margin: 0 0 .4rem; color: var(--gold); }
.pillar p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

.closing { padding: 2.5rem 1.4rem 4rem; text-align: center; }
.closing p { font-size: 1.3rem; font-style: italic; max-width: 42rem; margin: 0 auto; }

/* Prose pages */
.page { padding: 2.5rem 0 3.5rem; }
.prose { max-width: 44rem; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 1rem; }
.prose .lead { font-size: 1.25rem; color: var(--ink-soft); margin: 0 0 1.6rem; }
.prose p { margin: 0 0 1.15rem; }
.made-note { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule);
  font-style: italic; color: var(--ink-soft); font-size: 1rem; }

/* Book formats */
.formats { margin: 1.6rem 0; border-top: 1px solid var(--rule); }
.fmt { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0;
  border-bottom: 1px solid var(--rule); }
.fmt-name { font-weight: 700; } .fmt-status { color: var(--ink-soft); font-family: var(--sans); font-size: .95rem; }

/* Buy grid */
.buy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.8rem; }
.buy-card { border: 1px solid var(--rule); border-radius: .6rem; padding: 1.4rem; background: var(--paper-2); }
.buy-card h3 { margin: 0 0 .5rem; font-family: var(--sans); }
.buy-card p { color: var(--ink-soft); font-size: 1rem; min-height: 3.5rem; }
.buy-card.soon { opacity: .85; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 2.2rem 0 3rem;
  font-family: var(--sans); font-size: .92rem; color: var(--ink-soft); }
.footer-note { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink); margin: 0 0 .4rem; }
.footer-made { max-width: 40rem; margin: 0 0 1rem; }
.footer-nav { display: flex; gap: 1.1rem; margin-bottom: .6rem; }
.footer-nav a { color: var(--ink-soft); }
.copyright { margin: 0; }

/* Read-more callout + sample chapter */
.read-more { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: 1rem; }
.kicker { font-family: var(--sans); font-size: .85rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 .4rem; }
.prose.sample blockquote { border-left: 3px solid var(--gold); padding-left: 1rem;
  color: var(--ink-soft); }
.prose.sample .epi-attr { text-align: right; font-style: italic; color: var(--ink-soft);
  margin-top: -.6rem; }
.prose.sample h2 { font-size: 1.4rem; margin-top: 2rem; }
.prose.sample .lead-p { font-weight: 600; }
.srcref { border-bottom: 1px dotted var(--gold); }
.sample-cta { margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.sample-cta p { font-family: var(--sans); margin: 0 0 .8rem; color: var(--ink-soft); }

/* Sources — traceability showcase */
.sources { max-width: 52rem; }
.sources h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .8rem; }
.src-count { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin: 0 0 1rem; }
.src-filter { width: 100%; font-family: var(--sans); font-size: 1rem; padding: .7rem .9rem;
  border: 1px solid var(--rule); border-radius: .4rem; background: var(--paper-2);
  color: var(--ink); margin-bottom: 1.6rem; }
.src-filter::placeholder { color: var(--ink-soft); }
.src-chapter { margin-bottom: 2rem; }
.src-chapter h2 { font-size: 1.2rem; font-family: var(--sans); color: var(--gold);
  border-bottom: 1px solid var(--rule); padding-bottom: .4rem; margin: 0 0 1rem; }
.src { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--rule);
  scroll-margin-top: 5rem; }
.src-n { font-family: var(--sans); font-weight: 700; color: var(--gold); flex: 0 0 2.4rem; }
.src-body { font-size: 1.02rem; }
.src:target { background: color-mix(in srgb, var(--gold) 14%, transparent);
  border-radius: .4rem; padding-left: .6rem; padding-right: .6rem; }
.src.hide, .src-chapter.hide { display: none; }

/* /links hub (link-in-bio) */
.links-hub { padding: 3rem 1.2rem 4rem; }
.links-wrap { max-width: 34rem; margin: 0 auto; text-align: center; }
.links-name { font-family: var(--sans); font-weight: 800; letter-spacing: .04em;
  font-size: 1.6rem; margin: 0 0 .4rem; }
.links-tagline { font-style: italic; color: var(--ink-soft); margin: 0 0 2rem; text-indent: 0; }
.link-list { display: flex; flex-direction: column; gap: .8rem; text-align: left; }
.link-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem; border: 1px solid var(--rule); border-radius: .6rem;
  background: var(--paper-2); transition: border-color .15s, transform .15s; }
.link-card:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-1px); }
.lc-main { display: flex; flex-direction: column; }
.lc-title { font-family: var(--sans); font-weight: 600; color: var(--ink); }
.lc-sub { font-size: .85rem; color: var(--ink-soft); }
.lc-arrow { color: var(--gold); font-size: 1.1rem; flex: 0 0 auto; }
.link-card.soon { opacity: .6; cursor: default; }
.link-card.soon:hover { border-color: var(--rule); transform: none; }
.lc-soon { font-family: var(--sans); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gold); border: 1px solid var(--rule);
  border-radius: 1rem; padding: .1rem .55rem; flex: 0 0 auto; }
.links-follow { margin-top: 2rem; font-family: var(--sans); font-size: .9rem; }
.links-follow .lf-label { color: var(--ink-soft); margin-right: .6rem; }
.links-follow a { margin: 0 .45rem; color: var(--ink-soft); }
.links-follow a:hover { color: var(--gold); }

@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .hero-art { display: none; }
  .pillars, .buy-grid { grid-template-columns: 1fr; }
  .mainnav { display: none; }
}
