/* KeyWise Press — site styles. Palette and type follow the Bitcoin: Eyes Open cover. */

@font-face { font-family: "Archivo Black"; src: url("/assets/fonts/archivo-black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-medium.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "Lora"; src: url("/assets/fonts/lora-italic.woff2") format("woff2"); font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #10203a;          /* cover title navy */
  --text: #20262f;
  --muted: #5a5f68;
  --accent: #c96e12;       /* cover amber — decorative and large text only */
  --accent-text: #9c520a;  /* amber darkened to pass contrast on white */
  --accent-soft: #f6e6d4;
  --paper: #f5f6f7;
  --surface: #ffffff;
  --line: #dfe2e6;
  --line-strong: #c3c8cf;
  --ok: #1f6b3a;
  --err: #a3261b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 32, 58, .06), 0 8px 24px rgba(16, 32, 58, .08);
  --wrap: 1080px;
  --display: "Archivo Black", "Arial Black", system-ui, sans-serif;
  --serif: "Lora", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- header / footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 64px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-size: 19px; letter-spacing: -.01em; }
.nav { display: flex; gap: 20px; font-weight: 500; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 72px; padding: 32px 0 40px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- type ---------- */
h1, h2, h3 { color: var(--ink); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(34px, 6vw, 56px); letter-spacing: -.02em; }
h2 { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.01em; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 1em; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px; }
.lead { font-size: clamp(18px, 2.2vw, 21px); color: var(--text); max-width: 38em; }
.serif-accent { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- sections ---------- */
section { padding: 56px 0; }
@media (min-width: 900px) { section { padding: 72px 0; } }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.hero { position: relative; overflow: hidden; background: linear-gradient(180deg, #cbced3 0%, #e4e6e9 45%, var(--paper) 100%); padding: 40px 0 48px; }
@media (min-width: 820px) { .hero { padding: 64px 0 72px; } }
.hero::before { content: ""; position: absolute; inset: 0; background: url("/assets/img/mesh.svg") center / cover no-repeat; opacity: .9; pointer-events: none; }
.hero .wrap { position: relative; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; font: 500 16px/1.2 var(--sans); text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: background .15s, color .15s, border-color .15s; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1c3257; color: #fff; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- homepage ---------- */
.book-card { display: grid; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .book-card { grid-template-columns: 220px 1fr; padding: 32px; gap: 40px; } }
.book-card .cover { max-width: 220px; }
.book-card > a { justify-self: center; }
@media (min-width: 720px) { .book-card > a { justify-self: start; } }
.book-card h3 { font-family: var(--display); font-weight: 900; font-size: 28px; margin-bottom: 2px; }
.book-card .sub { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 22px; margin-bottom: 14px; }

.principles { display: grid; gap: 20px; }
@media (min-width: 800px) { .principles { grid-template-columns: repeat(3, 1fr); } }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.principle h3 { margin-bottom: 6px; }
.principle p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---------- book page ---------- */
.cover { border-radius: 4px; box-shadow: 0 2px 4px rgba(16, 32, 58, .12), 0 18px 40px rgba(16, 32, 58, .22); border: 1px solid #c3c8cf; }
.book-hero { display: grid; gap: 36px; align-items: center; }
@media (min-width: 820px) { .book-hero { grid-template-columns: minmax(240px, 340px) 1fr; gap: 56px; } }
.book-hero .cover { max-width: 210px; width: 100%; margin: 0 auto; }
@media (min-width: 820px) { .book-hero .cover { max-width: 340px; } }
.book-title { margin-bottom: 0; font-size: clamp(48px, 8vw, 84px); line-height: 1; }
.book-subtitle { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: clamp(28px, 4.2vw, 42px); line-height: 1.2; margin: 6px 0 14px; }
.byline { font-size: 14px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }

.buy { background: rgba(255, 255, 255, .86); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-top: 24px; backdrop-filter: blur(2px); }
.buy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.buy-head strong { color: var(--ink); }
.store-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
select { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; min-height: 36px; }
.buy .btn { flex: 1 1 200px; }
.buy-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.prose { max-width: 42em; }
.prose p { font-size: 18px; }
.tagline { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 3vw, 28px); line-height: 1.35; color: var(--accent-text); border-left: 3px solid var(--accent); padding-left: 20px; margin: 32px 0 0; max-width: 30em; }

.questions { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 720px) { .questions { grid-template-columns: 1fr 1fr; } }
.question { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.question .q { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--ink); margin-bottom: 8px; }
.question p { margin: 0; color: var(--muted); }

.parts { display: grid; gap: 20px; margin-top: 28px; }
@media (min-width: 760px) { .parts { grid-template-columns: 1fr 1fr; } }
.part { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.part .num { font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.part h3 { font-size: 20px; margin: 4px 0 12px; }
.part ol { margin: 0; padding-left: 0; list-style: none; counter-reset: none; }
.part li { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 16px; }
.part li:first-child { border-top: 0; }
.part li span { color: var(--muted); min-width: 1.8em; font-variant-numeric: tabular-nums; }
.bookends { margin-top: 16px; font-size: 15px; color: var(--muted); }

.figures { display: grid; gap: 24px; margin-top: 28px; }
@media (min-width: 820px) { .figures { grid-template-columns: 1fr 1fr; } }
figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
figure img { border-radius: 4px; width: 100%; }
figcaption { font-size: 15px; color: var(--muted); margin-top: 12px; }
figcaption strong { color: var(--ink); font-weight: 500; }

.two-col { display: grid; gap: 32px; }
@media (min-width: 820px) { .two-col { grid-template-columns: 1fr 1fr; gap: 56px; } }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 8px 0 8px 30px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: 17px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 16px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; color: var(--ink); }

/* ---------- signup ---------- */
.signup { background: var(--ink); color: #e6e9ee; border-radius: 16px; padding: 28px 22px; position: relative; overflow: hidden; }
@media (min-width: 720px) { .signup { padding: 44px; } }
.signup::before { content: ""; position: absolute; inset: 0; background: url("/assets/img/mesh.svg") center / cover no-repeat; opacity: .35; filter: invert(1); pointer-events: none; }
.signup > * { position: relative; }
.signup h2 { color: #fff; }
.signup .eyebrow { color: #f0b67a; }
.signup a { color: #fff; }
.signup-grid { display: grid; gap: 28px; }
@media (min-width: 860px) { .signup-grid { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; } }
.form-row { margin-bottom: 14px; }
label.field { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #fff; }
input[type="email"] { width: 100%; font: 400 17px var(--sans); padding: 12px 14px; min-height: 48px; border-radius: 10px; border: 1px solid #3a4a66; background: #fff; color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.signup .btn-primary { background: var(--accent); color: #1a1004; }
.signup .btn-primary:hover { background: #e08425; color: #1a1004; }
.turnstile-slot { min-height: 0; margin: 4px 0 14px; }
.form-status { min-height: 1.5em; margin: 12px 0 0; font-size: 15px; }
.form-status.ok { color: #9fe0b5; }
.form-status.err { color: #ffb4a8; }
.sample-points { margin: 0; padding-left: 20px; }
.sample-points li { margin-bottom: 6px; }

/* ---------- simple pages ---------- */
.page { padding: 56px 0 24px; }
.page .prose h2 { font-size: 24px; margin-top: 1.8em; }
.page .prose h3 { margin-top: 1.4em; }
.page .prose p, .page .prose li { font-size: 17px; }
.page .prose ul { padding-left: 22px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; margin: 24px 0; }
.center-card { max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 24px; box-shadow: var(--shadow); text-align: center; }
.center-card .cover { width: 150px; margin: 0 auto 20px; }
.hidden { display: none !important; }
.mt { margin-top: 28px; }
.h-card { font-size: clamp(26px, 4vw, 32px); }
.btn-center { justify-content: center; }
@media (max-width: 719px) { .hero h1 br { display: none; } }
