/* Self-hosted (SIL OFL) so the page makes no third-party requests under a strict CSP. */
@font-face { font-family: "Cinzel"; font-weight: 400 900; font-display: swap; src: url("assets/fonts/Cinzel.woff2") format("woff2"); }
@font-face { font-family: "Saira"; font-weight: 400 500; font-display: swap; src: url("assets/fonts/Saira.woff2") format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 700; font-display: swap; src: url("assets/fonts/SairaCondensed-700.woff2") format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 800; font-display: swap; src: url("assets/fonts/SairaCondensed-800.woff2") format("woff2"); }

/* Same palette as goldoakforge.com. */
:root {
  --coal: #0d0e10;
  --iron: #1a1c20;
  --gunmetal: #2b2e33;
  --steel: #8a8f98;
  --teal-bright: #3fc4d1;
  --gold: #e0a92e;
  --gold-deep: #b9811a;
  --ember: #ff6a1a;
  --bone: #ece5d6;
  --muted: #a7a196;
  --serif: "Cinzel", Georgia, serif;
  --label: "Saira Condensed", "Arial Narrow", sans-serif;
  --body: "Saira", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--coal);
  color: var(--bone);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: .06;
  background-image: url("assets/noise.svg");
}
#embers {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 16px 56px;
  text-align: center;
  background: radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 106, 26, .14), transparent 70%);
}
.home {
  position: absolute; top: 18px; left: 16px;
  color: var(--muted); text-decoration: none;
  font-family: var(--label); font-weight: 700;
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
}
.home::before { content: "\2190  "; }
.home:hover, .home:focus-visible { color: var(--gold); }
.cover {
  display: block;
  width: auto; height: auto;
  /* Small enough that the download button shows without scrolling. */
  max-width: min(100%, 880px); max-height: calc(100svh - 210px);
  border: 1px solid #2f3238;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .7), 0 0 80px rgba(255, 106, 26, .18);
  animation: rise 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.97); } }

.actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px;
  margin-top: 36px;
}
.download {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 14px 34px;
  background: linear-gradient(180deg, #f0bd45, var(--gold) 45%, var(--gold-deep));
  color: #1a1206; text-decoration: none;
  font-family: var(--label); font-weight: 800;
  font-size: 1.15rem; letter-spacing: .16em; text-transform: uppercase;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  box-shadow: 0 10px 30px rgba(224, 169, 46, .25);
  transition: transform .15s ease, filter .15s ease;
  animation: fadeUp .9s .4s both;
}
/* Second button: a gold edge instead of a gold fill. */
.download.alt {
  background: linear-gradient(var(--coal), var(--coal)) padding-box, linear-gradient(180deg, #f0bd45, var(--gold-deep)) border-box;
  border: 2px solid transparent;
  clip-path: none;
  color: var(--gold);
  box-shadow: none;
}
.download:hover { transform: translateY(-2px); filter: brightness(1.1); }
.download:focus-visible { outline: 3px solid var(--bone); outline-offset: 4px; }
.meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--label); font-weight: 700;
  font-size: .8rem; letter-spacing: .22em; text-transform: uppercase;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Sections ---------- */
main { position: relative; z-index: 2; }
.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 16px;
}
.section-title {
  display: flex; align-items: center; gap: 18px;
  margin: 0 0 32px;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  letter-spacing: .06em;
  color: var(--gold);
  text-align: center;
}
.section-title::before, .section-title::after {
  content: ""; flex: 1; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gunmetal));
}
.section-title::after { transform: scaleX(-1); }

/* Intro: crest beside the opening words. */
.intro-section {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px 48px;
  align-items: center;
}
.crest {
  grid-row: span 2;
  width: 100%;
  padding: 0; border: 0; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.crest img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .7)) drop-shadow(0 0 30px rgba(255, 106, 26, .3));
}
.crest:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; }
.crest.strike img { animation: strike .35s ease-out; }
@keyframes strike {
  20% { transform: translateY(5px) scale(.97); filter: drop-shadow(0 10px 18px rgba(0,0,0,.7)) drop-shadow(0 0 60px rgba(255,140,40,.8)) brightness(1.25); }
}
.intro p { margin: 0 0 14px; font-size: 1.08rem; }
.intro p:first-child {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem); line-height: 1.45;
  color: var(--bone);
}
.intro p:not(:first-child) { color: var(--muted); }
.quote {
  margin: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--ember);
}
.quote p { margin: 0; font-family: var(--serif); font-size: 1.1rem; color: var(--bone); }
.quote cite {
  display: block; margin-top: 4px;
  font-family: var(--label); font-weight: 700; font-style: normal;
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.quote cite::before { content: "\2014  "; }

/* Pillars: riveted plates, as on goldoakforge.com. */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}
.plate {
  position: relative;
  padding: 28px 22px 24px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .045), transparent 40%),
    linear-gradient(180deg, var(--iron), #141519);
  border: 1px solid #2f3238;
  border-top: 3px solid var(--gold);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%, 0 14px);
  opacity: 0; transform: translateY(18px);
}
.plate.in, .tenets li.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s ease; }
.plate::before, .plate::after {
  content: ""; position: absolute; top: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #d6d9de, #5b6068 60%, #2a2c30);
}
.plate::before { left: 12px; }
.plate::after { right: 12px; }
.plate h3 {
  margin: 0 0 8px;
  font-family: var(--serif); font-weight: 700;
  font-size: 1.4rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold);
}
.plate p { margin: 0; color: var(--muted); font-size: .97rem; }
.plate .emblem {
  display: block; width: 120px; height: 120px;
  margin: 0 auto 14px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .7)) drop-shadow(0 0 18px rgba(255, 106, 26, .22));
}
.plate.in .emblem { animation: emblem-glow 4.5s ease-in-out infinite; }
@keyframes emblem-glow {
  50% { filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .7)) drop-shadow(0 0 26px rgba(255, 106, 26, .38)); }
}

/* Tenets */
.tenets {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 760px;
  display: grid; gap: 14px;
}
.tenets li {
  display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start;
  padding: 18px 20px;
  background: rgba(26, 28, 32, .7);
  border-left: 3px solid var(--gunmetal);
  opacity: 0; transform: translateY(18px);
}
.mark { display: grid; justify-items: center; gap: 2px; }
.mark .emblem {
  display: block; width: 64px; height: 64px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7));
}
.numeral {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.7rem; line-height: 1.2; color: var(--ember);
  text-align: center;
}
.mark .emblem + .numeral { font-size: 1.05rem; line-height: 1.3; letter-spacing: .06em; }
.tenets h3 {
  margin: 0;
  font-family: var(--label); font-weight: 800;
  font-size: 1.25rem; letter-spacing: .06em; text-transform: uppercase;
}
.motto { margin: 2px 0 6px; font-style: italic; color: var(--bone); }
.pillar {
  margin: 0;
  font-family: var(--label); font-weight: 700;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--teal-bright);
}

/* Contents */
.contents {
  list-style: none; margin: 0 auto; padding: 0;
  max-width: 820px;
  columns: 2 300px; column-gap: 40px;
}
.contents li {
  break-inside: avoid;
  border-bottom: 1px solid #1f2125;
}
.contents a {
  display: grid; grid-template-columns: 4.6em 1fr; align-items: baseline;
  padding: 9px 0;
  color: inherit; text-decoration: none;
}
.contents a:hover, .contents a:focus-visible { color: var(--gold); }
.part {
  font-family: var(--label); font-weight: 700;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}

/* Closing */
.closing { text-align: center; padding-bottom: 80px; }
.creed {
  margin: 0;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.3rem, 4.4vw, 2.4rem); letter-spacing: .06em;
  color: var(--bone);
  text-shadow: 0 0 30px rgba(255, 106, 26, .35);
}
.way {
  margin: 6px 0 0;
  font-family: var(--label); font-weight: 700;
  letter-spacing: .38em; text-transform: uppercase; color: var(--gold);
  padding-left: .38em;
}

/* The Nine Questions sheet, under the closing buttons. */
.actions.questions { margin-top: 30px; }
.actions.questions .download { min-height: 48px; padding: 10px 26px; font-size: 1rem; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 2;
  padding: 36px 16px 44px;
  text-align: center;
  color: var(--muted); font-size: .85rem;
  border-top: 1px solid #1f2125;
}
.footer p { margin: 0; letter-spacing: .06em; }
.maker {
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  color: var(--bone); text-decoration: none;
  font-family: var(--label); font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.maker img { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.maker:hover span { color: var(--gold); }
.fine { margin-bottom: 6px !important; font-size: .78rem; opacity: .8; }

/* ---------- Reading page (read.html, made from book.md) ---------- */
/* Chapter links land below the sticky bar. */
html:has(.reader) { scroll-padding-top: 64px; }
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 22px;
  padding: 10px 16px;
  background: rgba(13, 14, 16, .92);
  border-bottom: 1px solid #1f2125;
  backdrop-filter: blur(6px);
  font-family: var(--label); font-weight: 700;
  font-size: .82rem; letter-spacing: .2em; text-transform: uppercase;
}
.bar a { color: var(--muted); text-decoration: none; }
.bar a:hover, .bar a:focus-visible { color: var(--gold); }
.bar-home::before { content: "\2190  "; }
.bar-link { margin-left: auto; }
.bar .bar-pdf {
  padding: 6px 14px;
  border: 1px solid var(--gold-deep); color: var(--gold);
}
.book {
  position: relative; z-index: 2;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  font-size: 1.1rem; line-height: 1.8;
}
.book-head { text-align: center; padding-bottom: 12px; }
.book-head img {
  width: 150px; height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .7)) drop-shadow(0 0 26px rgba(255, 106, 26, .3));
}
.book-head h1 {
  margin: 14px 0 6px;
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.8rem); line-height: 1.15; letter-spacing: .04em;
  color: var(--bone);
}
.book-sub { margin: 0; color: var(--muted); font-family: var(--serif); font-size: 1rem; }
.book-motto {
  margin: 14px 0 0;
  font-family: var(--label); font-weight: 700;
  font-size: .9rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold);
}
.toc {
  margin: 36px 0 20px;
  padding: 22px 24px;
  background: rgba(26, 28, 32, .7);
  border-top: 3px solid var(--gold);
}
.toc h2 {
  margin: 0 0 10px;
  font-family: var(--serif); font-size: 1.3rem; color: var(--gold);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-bottom: 1px solid #24262b; }
.toc li:last-child { border-bottom: 0; }
.toc a {
  display: block; padding: 7px 0;
  color: var(--bone); text-decoration: none; font-size: 1rem; line-height: 1.4;
}
.toc a:hover, .toc a:focus-visible { color: var(--gold); }
.chapter { padding-top: 28px; }
.chapter h2 {
  margin: 36px 0 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gunmetal);
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.45rem, 4.4vw, 2rem); line-height: 1.25; letter-spacing: .03em;
  color: var(--gold);
}
.part-no {
  display: block; margin-bottom: 4px;
  font-family: var(--label); font-weight: 700;
  font-size: .85rem; letter-spacing: .28em; text-transform: uppercase; color: var(--ember);
}
.book h3 {
  margin: 40px 0 12px;
  font-family: var(--label); font-weight: 800;
  font-size: 1.3rem; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase;
  color: var(--bone);
}
.book h4 {
  margin: 30px 0 8px;
  font-family: var(--serif); font-weight: 700;
  font-size: 1.15rem; line-height: 1.35; color: var(--gold);
}
.book p { margin: 0 0 18px; }
.book ul { margin: 0 0 18px; padding-left: 1.3em; }
.book li { margin-bottom: 8px; }
.book li::marker { color: var(--ember); }
.book blockquote {
  margin: 26px 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--ember);
}
.book blockquote p { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.6; }
.book cite {
  display: block; margin-top: 6px;
  font-family: var(--label); font-weight: 700; font-style: normal;
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.book cite::before { content: "\2014  "; }
.pull { font-style: italic; color: var(--bone); }
.pillar-tag {
  margin-bottom: 4px !important;
  font-family: var(--label); font-weight: 700;
  font-size: .82rem; letter-spacing: .18em; text-transform: uppercase; color: var(--teal-bright);
}
.creed-line {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.2rem; text-align: center; color: var(--bone);
}
.book-end { margin-top: 56px; text-align: center; }
.book-end .download { margin-top: 18px; }
.back { color: var(--muted); font-family: var(--label); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; text-decoration: none; }
.back:hover { color: var(--gold); }

@media (max-width: 640px) {
  .book { font-size: 1.05rem; }
  .bar { gap: 16px; }
  .intro-section { grid-template-columns: 1fr; text-align: center; }
  .crest { grid-row: auto; width: min(60vw, 220px); justify-self: center; }
  .quote { text-align: left; }
  .tenets li { grid-template-columns: 44px 1fr; gap: 12px; padding: 16px; }
  .mark .emblem { width: 44px; height: 44px; }
  .mark .emblem + .numeral { font-size: .95rem; }
  .plate .emblem { width: 100px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .plate, .tenets li { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Forge bar: the same header on every Gold Oak Forge site ----------
   Keep this block the same on goldoakforge.com, the Tome, The Way and the 3D site
   (only the two fonts on the first line differ). Its colours are fixed, not the site's. */
.forgebar {
  --fb-brand: var(--serif); --fb-link: var(--label);
  position: sticky; top: 0; z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px;
  padding: 8px max(16px, calc((100% - 1100px) / 2));
  background: #0d0e10;
  border-bottom: 1px solid #24262b;
}
.forgebar-home {
  display: inline-flex; align-items: center; gap: 12px;
  color: #ece5d6; text-decoration: none;
  font-family: var(--fb-brand); font-weight: 700; font-size: 1.05rem; line-height: 1.2;
  text-transform: uppercase; letter-spacing: .04em;
}
.forgebar-home img { display: block; width: 30px; height: auto; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.forgebar-links { display: flex; flex-wrap: wrap; gap: 2px 20px; }
.forgebar-links a {
  color: #a7a196; text-decoration: none;
  font-family: var(--fb-link); font-weight: 700; font-size: .85rem; line-height: 1.6;
  letter-spacing: .14em; text-transform: uppercase;
}
.forgebar a:hover, .forgebar a:focus-visible { color: #e0a92e; outline: none; }
.forgebar-links a[aria-current] { color: #e0a92e; }
/* Reading pages keep their own bar at the top while you scroll; this one scrolls away. */
.reader .forgebar, .story .forgebar { position: static; }
@media (max-width: 600px) {
  .forgebar { justify-content: center; }
  .forgebar-links { justify-content: center; gap: 2px 14px; }
  .forgebar-links a { font-size: .76rem; }
}
