/* Quest2Learning: the parent page for the Quest2 learning sites. Tokens follow docs/BRAND-SPEC.md: the shared
   paper and ink of all four sites, with the hub's own warm charcoal and antique brass (data-site="hub" on <html>).
   Fraunces for headings, Outfit for text, as on the quest sites. Fonts are SIL OFL 1.1. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/fraunces-latin.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/outfit-latin.woff2) format("woff2"); }

/* Shared base tokens (the same on all four sites). Light by default; dark follows the device setting.
   Contrast rule: brass (--accent-secondary) is decoration only (borders, rules, icons, the top bar). Text that
   wants a brass colour uses --accent-text, a deeper brass that passes 4.5:1 (6.1:1 on paper). */
:root {
  color-scheme: light;
  --bg-paper: #FAF7F2;
  --bg-card: #FFFFFF;
  --text-ink: #23211E;
  --text-muted: #5E5952;
  --border-subtle: #E5DFD5;
  --shadow: rgba(35, 33, 30, 0.12);
  /* The three sister sites, for the top bar and the portal cards */
  --reason: #3B4275;
  --order: #9E3B2B;
  --plan: #1E5B63;
  --on-site: #FFFFFF;
  --radius-pill: 999px;
  --wrap: 72rem;
}

/* Quest2Learning (parent hub) */
[data-site="hub"] {
  --accent-primary: #2C2A27;
  --accent-secondary: #B5892E;
  --accent-tint: #F3EFE6;
  --accent-text: #7A5718;
  --on-accent: #FAF7F2;
  --card-radius: 8px;
  --divider-style: solid;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg-paper: #181715;
    --bg-card: #211F1C;
    --text-ink: #EAE6DF;
    --text-muted: #A9A298;
    --border-subtle: #37332E;
    --shadow: rgba(0, 0, 0, 0.45);
    --reason: #8B95D6;
    --order: #E07A66;
    --plan: #5BB5C0;
    --on-site: #181715;
  }
  [data-site="hub"] {
    --accent-primary: #D9B25F;
    --accent-tint: #24211C;
    --accent-text: #D9B25F;
    --on-accent: #181715;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg-paper); color: var(--text-ink); font-family: "Outfit", "Segoe UI", sans-serif; line-height: 1.5; }
/* The hub's signature: a 4px bar in the three sister colours along the very top */
[data-site="hub"] body::before { content: ""; display: block; height: 4px; background: linear-gradient(to right, #3B4275 0%, #3B4275 33.33%, #9E3B2B 33.33%, #9E3B2B 66.66%, #1E5B63 66.66%, #1E5B63 100%); }
img { max-width: 100%; height: auto; }
a { color: var(--accent-primary); text-decoration-thickness: 1px; text-underline-offset: 0.15em; text-decoration-color: var(--accent-secondary); }
a:hover { color: var(--text-ink); text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 520; line-height: 1.1; overflow-wrap: break-word; margin: 0.3rem 0 0.6rem; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.6rem; }
h3 a { color: inherit; text-decoration: none; }
h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent-secondary); }
p { margin: 0.5rem 0; }
.kicker { letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.75rem; font-weight: 700; color: var(--accent-text); margin: 0 0 0.2rem; }
.lede { max-width: 40rem; font-size: 1.15rem; line-height: 1.6; }
.muted { color: var(--text-muted); }
.muted a { color: var(--accent-primary); }
.tag { font-size: 1.05rem; color: var(--text-muted); font-style: italic; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; padding: 0.6rem 1rem; background: var(--accent-primary); color: var(--on-accent); border-radius: var(--card-radius); z-index: 10; }
.skip:focus { top: 1rem; }

/* Buttons: charcoal (gold in dark mode) for the main action, an outline for the second */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.8rem; padding: 0 1.2rem; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--accent-primary); color: var(--on-accent); font-weight: 650; text-decoration: none; cursor: pointer; }
.btn.gold { background: var(--accent-primary); color: var(--on-accent); }
.btn.gold:hover { background: var(--text-ink); color: var(--bg-paper); }
.btn.ghost { background: transparent; color: var(--accent-primary); border-color: var(--accent-primary); }
.btn.ghost:hover { background: var(--accent-tint); color: var(--text-ink); }
.btn:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 2px; }
.btn .cup { flex: none; }
a:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 2px; border-radius: 2px; }
.cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0.6rem; }

/* Inline emblems (assets/brand/*.svg, pasted in without their <style> because the CSP allows no inline styles).
   Each emblem's main dark colour is --emblem-ink; dark mode lightens it so the shapes stay visible. */
.emblem { display: block; flex: none; }
.hk { fill: var(--emblem-ink, #252B45); } .hks { stroke: var(--emblem-ink, #252B45); }
.rk { fill: var(--emblem-ink, #3B4275); } .rks { stroke: var(--emblem-ink, #3B4275); }
.okf { fill: var(--emblem-ink, #9E3B2B); } .ok { stroke: var(--emblem-ink, #9E3B2B); }
.pkf { fill: var(--emblem-ink, #1E5B63); } .pk { stroke: var(--emblem-ink, #1E5B63); }
@media (prefers-color-scheme: dark) {
  .emblem-hub { --emblem-ink: #EAE6DF; }
  .emblem-reason { --emblem-ink: #8B95D6; }
  .emblem-order { --emblem-ink: #E07A66; }
  .emblem-plan { --emblem-ink: #5BB5C0; }
}

/* Header: calm paper and charcoal, the compass before the wordmark */
.top { width: min(calc(100% - 2rem), var(--wrap)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; padding: 1rem 0 0.9rem; border-bottom: 1px solid var(--border-subtle); color: var(--text-ink); }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text-ink); min-width: 0; }
.brand .emblem { width: 2.75rem; height: 2.75rem; }
.brand strong { display: block; font-family: Fraunces, Georgia, serif; font-weight: 520; font-size: 1.6rem; letter-spacing: 0.02em; color: var(--text-ink); line-height: 1.1; }
.brand small { display: block; color: var(--text-muted); font-size: 0.85rem; }
.brand-text { display: flex; align-items: baseline; gap: 0.2rem 0.8rem; flex-wrap: wrap; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; }
.top nav a { padding: 0.55rem 0.8rem; border-radius: var(--radius-pill); text-decoration: none; font-weight: 600; color: var(--text-ink); }
.top nav a:hover { background: var(--accent-tint); color: var(--text-ink); }

/* Layout */
main { width: min(calc(100% - 2rem), var(--wrap)); margin: 0 auto; }
section { padding: 2.6rem 0; border-bottom: 1px solid var(--border-subtle); }
section:last-of-type { border-bottom: 0; }

.hero { display: grid; gap: 1.6rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; padding-top: 2.2rem; }
.hero.single { grid-template-columns: 1fr; }
.prose { max-width: 42rem; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6rem; }
.hero-art { margin: 0; }
.hero-art img { display: block; width: 100%; border-radius: var(--card-radius); box-shadow: 0 0.8rem 2rem var(--shadow); }
.hero-art figcaption:not(.sr-only) { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.facts { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; list-style: none; margin: 1.2rem 0 0; padding: 0.9rem 0 0; border-top: 1px solid var(--border-subtle); }
.facts li { font-size: 0.95rem; }
.facts b { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; margin-right: 0.2rem; color: var(--accent-text); }

/* Cards: the hub's own are 8px */
.cards { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); margin-top: 1rem; }
.card { position: relative; padding: 1.4rem 1.4rem 1.2rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--card-radius); display: flex; flex-direction: column; gap: 0.2rem; }
.card:hover { border-color: var(--accent-primary); box-shadow: 0 0.5rem 1.5rem var(--shadow); }
.card-mark { width: 4rem; height: 4rem; border-radius: var(--card-radius); border: 1px solid var(--border-subtle); margin-bottom: 0.4rem; }
.card h3 { margin-top: 0; }
/* The heading link stretches over the whole card, so the hover is honest. Buttons and other links sit above it. */
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(h3 a:focus-visible) { border-color: var(--accent-primary); box-shadow: 0 0.5rem 1.5rem var(--shadow); }
.card-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; padding-top: 0.8rem; }
.card p a:not(.btn) { position: relative; z-index: 1; display: inline-block; padding: 0.2rem 0; }
.foot .muted a { display: inline-block; padding: 0.3rem 0; }

/* The three portal cards are "Volumes": each previews its own site's stripe, emblem, journey painting, verb and
   card shape (Reason 12px soft; Order 6px with a double line; Plan 4px with dashed tick dividers). */
.vol { --vol: var(--accent-primary); padding-top: 0; overflow: hidden; border-top: 4px solid var(--vol); }
.vol-reason { --vol: var(--reason); border-radius: 12px; }
.vol-order { --vol: var(--order); border-radius: 6px; border-style: double; border-width: 4px 3px 3px; border-top-style: solid; }
.vol-plan { --vol: var(--plan); border-radius: 4px; }
.vol:hover, .vol:has(h3 a:focus-visible) { border-color: var(--vol); }
.vol-thumb { display: block; width: calc(100% + 2.8rem); max-width: none; margin: 0 -1.4rem 0.9rem; aspect-ratio: 12 / 5; object-fit: cover; border-bottom: 1px solid var(--border-subtle); }
.vol-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.3rem; min-height: 3.6rem; }
.vol-head .emblem { width: 2.75rem; height: 2.75rem; }
.vol-head .kicker { margin: 0; }
.vol-no { display: block; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.vol .card-actions { margin-top: auto; padding-top: 0.9rem; border-top: 1px solid var(--border-subtle); }
.vol-order .card-actions { border-top: 3px double var(--border-subtle); }
/* Plan: one flat dashed rule in the Plan teal, like a charted route line. No downward tick marks: under the last line of
   text they read as cut-off descenders. */
.vol-plan .card-actions { border-top: 0; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--plan) 55%, transparent) 0 8px, transparent 8px 14px) top left / 100% 2px no-repeat; }
.vol .btn.gold { background: var(--vol); color: var(--on-site); }
.vol .btn.gold:hover { background: var(--text-ink); color: var(--bg-paper); }

/* The painted horizon between the projects and the method: violet peaks, the terracotta valley town and the teal
   coast with its lighthouse (source-images/brand/hub-horizon-divider.jpg, the paper around it made transparent).
   Both ends fade out into the page. In dark mode it is dimmed a little so the pale sky doesn't glare. */
.projects:has(+ .horizon) { border-bottom: 0; }
.horizon { margin: 0.4rem auto 0; max-width: 52rem; }
.horizon img { display: block; width: 100%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
@media (prefers-color-scheme: dark) {
  .horizon img { opacity: 0.72; filter: saturate(0.9); }
}

/* The placeholder card for the next quest: the same card, quieter */
.card.next { border-style: dashed; background: transparent; max-width: 36rem; }
.card.next:hover { box-shadow: none; border-color: var(--border-subtle); }
.card.next h3 { color: var(--text-muted); }
/* Its picture: a blank parchment map with a faint compass (hub-next-quest.jpg) */
.card.next .card-mark { width: 8rem; height: 8rem; }
@media (prefers-color-scheme: dark) {
  .card.next .card-mark { opacity: 0.85; }
}

/* How it works */
.steps { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); list-style: none; margin: 1rem 0 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 1rem 1.1rem; border: 1px solid var(--border-subtle); border-radius: var(--card-radius); display: grid; gap: 0.3rem; align-content: start; background: var(--bg-card); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent-primary); color: var(--on-accent); font-weight: 700; box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3px var(--accent-secondary); }
.steps strong { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.promises { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 0.5rem 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
.promises li { padding-left: 1.4rem; position: relative; }
.promises li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-secondary); font-weight: 700; }

/* Support: a calm tinted panel with a brass edge */
.support { padding: 2.6rem 1.4rem; margin: 2.6rem 0; background: var(--accent-tint); border: 1px solid var(--border-subtle); border-top: 3px solid var(--accent-secondary); border-radius: var(--card-radius); }

/* Footer */
.foot { width: min(calc(100% - 2rem), var(--wrap)); margin: 1.6rem auto 1.2rem; padding: 1rem 0 0.4rem; border-top: 1px solid var(--border-subtle); font-size: 0.88rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0 1.2rem; margin-bottom: 0.3rem; }
.foot nav a { display: inline-block; padding: 0.7rem 0; }
.foot p { margin: 0.3rem 0; }

/* Narrow screens: the headline comes first, the painting after it, so the pitch is on the first screen */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { padding: 0.7rem 0 0.4rem; }
  .brand .emblem { width: 2.2rem; height: 2.2rem; }
  .brand strong { font-size: 1.3rem; }
  .brand small { display: none; }
  .top nav { width: 100%; justify-content: space-between; }
  .top nav a { padding: 0.5rem 0.4rem; font-size: 0.9rem; }
  section { padding: 2rem 0; }
  .support { padding: 1.8rem 1rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
