/* ============================================================
   THE COMMON TONE — site v2 front face (homepage, Book, Lab, Subscribe)
   One shared stylesheet. Built from ADMIN/business/MOCKUPS/site-v2/.
   Fonts are self-hosted (assets/css/fonts.css) — no third-party requests.
   ============================================================ */
@import url("../assets/css/fonts.css");

:root {
  --ground: #FBF4E4;
  --ink: #2F323A;
  --ink-2: #5A5D66;
  --rule: #E4DAC3;
  --gold: #D1A866;
  --gold-fill: #EFE0BF;
  --midnight: #1C3A5A;
  --mahogany: #713D2F;
  --forest: #2F4F43;
  --field: #FFFDF7;
  --panel: #F6EDD8;
  --on-midnight: #FBF4E4;
  /* wings (DESIGN.md §5A): the home is the house (alabaster + gold, the common tone);
     each wing has a ground a shade off the alabaster and one tint of its own */
  --tint-book: #7A5230;
  --tint-lab: #4F6B78;
  --tint-essays: #9C6B4E;
  --wing-ground: var(--ground);
  --wing-tint: var(--gold);
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: Lato, "Gill Sans", "Gill Sans MT", Seravek, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #2F323A;
    --ink: #FBF4E4;
    --ink-2: #C9C3B4;
    --rule: #4A4E58;
    --gold: #D1A866;
    --gold-fill: #4A4232;
    --midnight: #9DBBD9;
    --mahogany: #D9A38F;
    --forest: #8FB8A6;
    --field: #383C45;
    --panel: #363A43;
    --on-midnight: #1C3A5A;
  }
  :root { --tint-book: #B8956A; --tint-lab: #8FAEBC; --tint-essays: #C79A7E; }
  body.wing-book   { --wing-ground: #312D27; }
  body.wing-lab    { --wing-ground: #2C3239; }
  body.wing-essays { --wing-ground: #33302B; }
}
body.wing-book   { --wing-ground: #F9F1DC; --wing-tint: var(--tint-book); }
body.wing-lab    { --wing-ground: #F4F3EA; --wing-tint: var(--tint-lab); }
body.wing-essays { --wing-ground: #FBEEDD; --wing-tint: var(--tint-essays); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--wing-ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  margin: 0;
}
a { color: var(--midnight); }
img, svg { max-width: 100%; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 28px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--midnight); color: var(--on-midnight);
  padding: 8px 12px; z-index: 10;
}
.skip-link:focus { left: 8px; top: 8px; }

button:focus-visible, input:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- header / nav ---------- */
nav.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 0 18px; flex-wrap: wrap;
  border-bottom: 3px solid var(--wing-tint);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand .name { font-family: var(--body); font-size: 36px; font-weight: 700; letter-spacing: .1em; }
.brand .name-block { display: flex; flex-direction: column; line-height: 1.1; }
.brand .brand-motto { font-family: var(--body); font-style: italic; font-weight: 400; font-size: 14px; color: var(--ink-2); margin-top: 4px; letter-spacing: .03em; }
@media (max-width: 600px) { .brand .name { font-size: 26px; letter-spacing: .07em; } .brand .brand-motto { font-size: 12px; } }
.menu { display: flex; gap: 26px; font-size: 15px; flex-wrap: wrap; align-items: center; }
.menu a {
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid transparent; padding-bottom: 2px;
}
.menu a:hover { border-bottom-color: var(--gold); }
.menu a.here { border-bottom-color: var(--wing-tint); }
.menu a.btn {
  background: var(--midnight); color: var(--on-midnight);
  padding: 8px 16px; border-radius: 3px; font-weight: 700; border: 0;
}
@media (max-width: 480px) {
  .menu { gap: 16px; }
}

/* ---------- type ---------- */
.eyebrow {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); margin: 0 0 10px;
}
h1 {
  font-family: var(--display); font-weight: 400; font-size: 44px;
  line-height: 1.1; margin: 0 0 18px; text-wrap: balance;
}
@media (max-width: 820px) { h1 { font-size: 34px; } }
h1 em { font-style: italic; }
h2 { font-family: var(--display); font-weight: 700; font-size: 28px; margin: 0 0 14px; line-height: 1.2; }
h3 { font-family: var(--display); font-weight: 700; font-size: 21px; margin: 0 0 8px; line-height: 1.25; }
p { margin: 0 0 14px; max-width: 38em; }
.lede { font-size: 19px; max-width: 34em; }
.fine { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }

section { border-top: 1px solid var(--rule); padding: 36px 0 28px; }
.sechead {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; flex-wrap: wrap; margin-bottom: 16px;
}
.more { font-size: 14px; white-space: nowrap; font-weight: 700; text-decoration: none; }

/* ---------- cards ---------- */
.card {
  border: 1px solid var(--rule); border-radius: 12px; padding: 18px 18px 16px;
  background: var(--field); display: flex; flex-direction: column; gap: 6px;
}
.card .k {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px;
}
.card .k .st { color: var(--forest); font-weight: 700; text-align: right; }
.card .k .st.soon { color: var(--mahogany); }
.card > span { font-size: 15px; color: var(--ink-2); flex: 1; }
.card .go { font-size: 14px; text-decoration: none; font-weight: 700; flex: 0; }
.card span.go { color: var(--ink-2); }

/* ---------- wing head: the wing's name is the title; the sentence is side info ---------- */
.wing-head {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 20px 48px;
  align-items: end; padding: 34px 0 28px; border-bottom: 1px solid var(--rule);
}
@media (max-width: 820px) { .wing-head { grid-template-columns: 1fr; gap: 14px; padding-top: 26px; } }
.wing-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(54px, 8vw, 92px);
  line-height: .95; letter-spacing: -.01em; margin: 0; color: var(--wing-tint); white-space: nowrap;
}
.wing-title::after { content: ""; display: block; width: 72px; height: 3px; background: var(--wing-tint); margin-top: 18px; }
.wing-aside { max-width: 34em; }
.wing-aside .line { font-family: var(--display); font-style: italic; font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.wing-aside .lede { font-size: 16px; color: var(--ink-2); margin: 0; }

/* ---------- essays wing ---------- */
.essays { display: flex; flex-direction: column; gap: 22px; padding-top: 8px; border-top: 0; max-width: 760px; }
.essay { border-left: 3px solid var(--wing-tint); padding: 2px 0 2px 18px; }
.essay .k { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 4px; }
.essay h2 { font-size: 24px; margin: 0 0 6px; }
.essay h2 a { color: var(--ink); text-decoration: none; }
.essay h2 a:hover { text-decoration: underline; text-decoration-color: var(--wing-tint); }
.essay p { margin: 0 0 8px; }
.essay .go { font-size: 14px; font-weight: 700; text-decoration: none; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule); margin-top: 10px; padding: 22px 0 60px;
  font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 24px;
}

/* ============================================================
   Homepage
   ============================================================ */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
  padding: 30px 0 40px; border-top: 1px solid var(--rule);
}
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 28px; } }
.status { font-size: 18px; max-width: 36em; }
.status .d {
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); display: block; margin-bottom: 8px;
}
.cta {
  display: inline-block; background: var(--midnight); color: var(--on-midnight);
  padding: 12px 22px; border-radius: 3px; font-weight: 700; text-decoration: none; margin-top: 8px;
}

.wheel { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 18px 18px 14px; }
.wheel svg { width: 100%; height: auto; display: block; }
.wheel .cap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-top: 10px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap;
}
.wheel .cap b { color: var(--ink); font-family: var(--display); font-size: 18px; font-weight: 700; }
.seg { cursor: pointer; }
.seg circle { fill: var(--field); stroke: var(--rule); stroke-width: 1; }
.seg text {
  font-family: var(--body); font-size: 13px; fill: var(--ink);
  text-anchor: middle; dominant-baseline: central; pointer-events: none;
}
.seg.minor circle { fill: var(--ground); }
.seg.minor text { font-size: 11px; fill: var(--ink-2); }
.seg.dim circle { opacity: .45; }
.seg.dim text { opacity: .55; }
.seg.tonic circle { fill: #D1A866; stroke: #BA7517; stroke-width: 2; }
.seg.tonic text { fill: #412402; font-weight: 700; }
.seg.sub circle { fill: #2F4F43; stroke: #2F4F43; }
.seg.sub text { fill: #FBF4E4; font-weight: 700; }
.seg.dom circle { fill: #713D2F; stroke: #713D2F; }
.seg.dom text { fill: #FBF4E4; font-weight: 700; }
.seg.rel circle { fill: #EFC77A; stroke: #BA7517; }
.seg.rel text { fill: #412402; font-weight: 700; }
.seg.sub2 circle { fill: #5F7D6B; stroke: #2F4F43; }
.seg.sub2 text { fill: #FBF4E4; font-weight: 700; }
.seg.dom2 circle { fill: #A34A3F; stroke: #713D2F; }
.seg.dom2 text { fill: #FBF4E4; font-weight: 700; }
#links line { stroke-width: 1.5; stroke-linecap: round; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle; border: 1px solid var(--rule);
}

.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 820px) { .feat { grid-template-columns: 1fr; } }
.feat .card { min-height: 190px; }
/* the foyer shows its doors, each in its wing's colour */
.feat .door { border-left: 4px solid var(--rule); }
.feat .door-book { border-left-color: var(--tint-book); }
.feat .door-lab { border-left-color: var(--tint-lab); }
.feat .door-essays { border-left-color: var(--tint-essays); }
.feat h3 a { text-decoration: none; color: var(--ink); }

/* ============================================================
   Book page
   ============================================================ */
.wing-head + .top2 { border-top: 0; padding-top: 30px; }
.top2 {
  display: grid; grid-template-columns: 190px 1fr; gap: 36px; align-items: start;
  padding: 30px 0 10px; border-top: 1px solid var(--rule);
}
@media (max-width: 640px) { .top2 { grid-template-columns: 1fr; } }
.cover {
  aspect-ratio: 2 / 3; background: var(--gold-fill); border: 1px solid var(--gold);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px 14px; font-family: var(--display); color: var(--ink); max-width: 190px;
}
.cover .t { font-size: 19px; line-height: 1.2; font-weight: 700; }
.cover .s { font-size: 13px; font-style: italic; line-height: 1.3; margin-top: 6px; }
.cover .a { font-size: 12px; font-family: var(--body); letter-spacing: .08em; text-transform: uppercase; }
.motto { font-family: var(--display); font-size: 19px; color: var(--ink-2); border-left: 3px solid var(--gold); padding-left: 14px; margin-top: 18px; }
.units { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
@media (max-width: 820px) { .units { grid-template-columns: 1fr; } }
.unit { border-top: 2px solid var(--gold); padding-top: 12px; }
.unit .k {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px;
}
.unit .k .st { font-weight: 700; color: var(--forest); }
.unit .k .st.soon { color: var(--mahogany); }
.unit ol { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.unit ol li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 3px 0; border-top: 1px dotted var(--rule); }
.unit ol li:first-child { border-top: 0; }
.unit ol li i { font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stages { list-style: none; padding: 0; margin: 0; max-width: 44em; }
.stages li {
  display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 10px 0;
  border-top: 1px dotted var(--rule); font-size: 16px;
}
@media (max-width: 480px) { .stages li { grid-template-columns: 1fr; gap: 4px; } }
.stages li:first-child { border-top: 0; }
.stages b { font-family: var(--display); font-weight: 700; }
.ideas { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 20px 22px; max-width: 46em; }
.ideas p { margin: 0 0 8px; }

/* ============================================================
   Lab page
   ============================================================ */
.intro { padding: 30px 0 10px; border-top: 1px solid var(--rule); }
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .shelf { grid-template-columns: 1fr; } }
.shelf .card { min-height: 170px; }
.shelf h3 a { text-decoration: none; color: var(--ink); }
.quizlist { list-style: none; padding: 0; margin: 0; max-width: 44em; }
.quizlist li { padding: 10px 0; border-top: 1px dotted var(--rule); }
.quizlist li:first-child { border-top: 0; }
.quizlist a { font-weight: 700; text-decoration: none; }
.quizlist small { display: block; color: var(--ink-2); font-size: 14px; }

/* ============================================================
   Subscribe page
   ============================================================ */
.centre {
  min-height: 62vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; padding: 40px 0;
}
.centre h1 { font-size: 40px; margin-bottom: 12px; }
.centre p { max-width: 30em; }
.centre .embed { width: 100%; max-width: 480px; margin: 18px auto 0; }
.centre .embed iframe { width: 100%; height: 320px; border: 1px solid var(--rule); background: #fff; display: block; }
.centre .fine { margin-top: 14px; }
.centre .back { margin-top: 34px; font-size: 14px; }
