/* Eclipse project site. The page is the road from Last Hearth to the Void: colours, weather and the road itself
   change with the ring in view (body[data-ring], set by main.js). */

/* Fonts are served from here, not from Google (no visitor data leaves for a third party). Latin subset, all SIL OFL,
   see assets/fonts/. Alegreya and Grenze Gotisch are variable, one file covers every weight. */
@font-face { font-family: "Alegreya"; font-weight: 400 700; font-display: swap; src: url(fonts/alegreya.woff2) format("woff2"); }
@font-face { font-family: "Alegreya"; font-style: italic; font-weight: 400 700; font-display: swap; src: url(fonts/alegreya-italic.woff2) format("woff2"); }
@font-face { font-family: "Alegreya SC"; font-weight: 700; font-display: swap; src: url(fonts/alegreya-sc.woff2) format("woff2"); }
@font-face { font-family: "Grenze Gotisch"; font-weight: 600 700; font-display: swap; src: url(fonts/grenze-gotisch.woff2) format("woff2"); }

@property --sky { syntax: "<color>"; inherits: true; initial-value: #24140b; }
@property --fog { syntax: "<color>"; inherits: true; initial-value: #d0701f; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #fff4e0; }
@property --dim { syntax: "<color>"; inherits: true; initial-value: #f0d3a4; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #ffbe45; }

:root {
  --text: "Alegreya", "Iowan Old Style", Georgia, serif;
  --caps: "Alegreya SC", "Alegreya", Georgia, serif;
  --black: "Grenze Gotisch", "UnifrakturMaguntia", "Old English Text MT", serif;
  --rail: 0px;
  --gutter: 20px;
  --paper: #efe2c0;
  --paper-ink: #2b2116;
  --wax: #7d1717;
}
@media (min-width: 900px) { :root { --rail: 64px; --gutter: 56px; } }

body[data-ring="hearth"], body[data-ring="cage"] {
  --sky: #24140b; --fog: #d0701f; --ink: #fff4e0; --dim: #f0d3a4; --accent: #ffbe45;
}
body[data-ring="weald"] {
  --sky: #08201b; --fog: #1f8a6a; --ink: #f0f7e8; --dim: #c4dcc0; --accent: #d4ea4c;
}
body[data-ring="scars"] {
  --sky: #1a0712; --fog: #a3173f; --ink: #fff0f3; --dim: #f0bfcd; --accent: #ff7a2e;
}
body[data-ring="edge"] {
  --sky: #0b0d1c; --fog: #34407a; --ink: #eef0ff; --dim: #b8c0e6; --accent: #9fb4ff;
}
body[data-ring="void"] {
  --sky: #000; --fog: #000; --ink: #f2f2f2; --dim: #a8a8a8; --accent: #f2f2f2;
}
body[data-ring="board"] {
  --sky: #2b1408; --fog: #b4521a; --ink: #fff3e0; --dim: #f2d3a6; --accent: #ffc24d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font: 400 1.25rem/1.7 var(--text);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  overflow-x: hidden;
  transition: --sky 1.6s ease, --fog 1.6s ease, --ink 1.6s ease, --dim 1.6s ease, --accent 1.6s ease;
}
/* Ground fog: one fixed layer whose colour follows the ring. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 75% 110%, color-mix(in srgb, var(--fog) 75%, transparent), transparent 70%),
    radial-gradient(80% 45% at 0% 105%, color-mix(in srgb, var(--fog) 45%, transparent), transparent 70%),
    linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--fog) 22%, transparent));
}
main p, main li { text-shadow: 0 1px 12px color-mix(in srgb, var(--sky) 80%, transparent); }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }

main, .hero, .footer { position: relative; z-index: 2; }
.weather { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* The highway on the left edge. Its stones thin out ring by ring; main.js scrolls it with the page. */
.road {
  position: fixed; top: 0; bottom: 0; left: 20px; width: 26px; z-index: 1; pointer-events: none;
  display: none;
  background-position: 0 var(--road-y, 0px);
  transition: opacity 1.6s ease;
  -webkit-mask: linear-gradient(transparent, #000 8%, #000 92%, transparent);
          mask: linear-gradient(transparent, #000 8%, #000 92%, transparent);
}
@media (min-width: 900px) { .road { display: block; } }
body[data-ring="hearth"] .road, body[data-ring="cage"] .road, body[data-ring="board"] .road {
  background-image:
    linear-gradient(90deg, transparent 12px, rgba(0, 0, 0, 0.45) 12px 14px, transparent 14px),
    repeating-linear-gradient(180deg, #776a52 0 15px, #2c251b 15px 17px, #6a5e48 17px 31px, #2c251b 31px 33px);
  background-size: 100% 66px, 100% 66px;
}
body[data-ring="weald"] .road {
  background-image:
    repeating-linear-gradient(180deg, #4f5040 0 14px, #1c1f17 14px 16px, #464838 16px 26px, transparent 26px 120px, #3e4032 120px 132px, transparent 132px 190px);
  background-size: 100% 190px;
}
body[data-ring="scars"] .road {
  background-image:
    repeating-linear-gradient(180deg, #3a3238 0 9px, transparent 9px 230px, #2d272c 230px 236px, transparent 236px 420px);
  background-size: 100% 420px;
}
body[data-ring="edge"] .road, body[data-ring="void"] .road { opacity: 0; }

/* The milestone: how far down the road the reader is. Written along the road on wide screens. */
.distance {
  position: fixed; z-index: 3; margin: 0;
  font: 500 1rem/1 var(--text); color: var(--accent); white-space: nowrap;
  top: 10px; right: 12px; padding: 0.35rem 0.7rem;
  background: color-mix(in srgb, var(--sky) 85%, transparent);
}
@media (min-width: 900px) {
  .distance {
    top: auto; right: auto; left: 54px; bottom: 28px; padding: 0; background: none;
    writing-mode: vertical-rl; transform: rotate(180deg);
  }
}

/* Hero: dusk over the Gilded Cage, the eclipse above it. */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) 12vh calc(var(--rail) + var(--gutter));
  background:
    radial-gradient(55% 45% at 78% 24%, rgba(255, 196, 110, 0.35), transparent 70%),
    linear-gradient(180deg, #140a26 0%, #3a1436 32%, #8c2f22 66%, transparent 100%);
}
/* Total eclipse (inline SVG). On load the moon slides over the sun; when it covers it the diamond ring flashes
   and the corona comes out. */
.eclipse {
  position: absolute; top: 2vh; right: 3vw;
  width: clamp(260px, 50vmin, 560px); height: auto; overflow: visible;
}
.ec-moon { animation: ec-moon 3.2s cubic-bezier(.25, .1, .2, 1) 0.3s both; }
.ec-halo { transform-box: fill-box; transform-origin: center; animation: ec-halo 3.4s ease 0.3s both, ec-breathe 8s ease-in-out 3.7s infinite; }
.ec-corona { transform-box: fill-box; transform-origin: center; animation: ec-corona 2.4s ease-out 3.1s both; }
.ec-diamond { animation: ec-diamond 2.2s ease-out 3.1s both, ec-glint 11s ease-in-out 5.3s infinite; }
/* After totality the eclipse keeps living: the corona turns and breathes, the chromosphere flickers, the
   diamond ring glints now and then. Paused while the hero is off screen (main.js). */
.ec-rays { transform-box: view-box; transform-origin: 0 0; animation: ec-spin 240s linear 3.1s infinite; }
.ec-chromo { animation: ec-flicker 3.7s ease-in-out 3.5s infinite; }
.ec-proms { animation: ec-flicker 5.3s ease-in-out 4.2s infinite reverse; }
.hero.is-away .eclipse * { animation-play-state: paused; }
/* Walking away from the hearth (scrolling down) the moon slides off the sun: totality ends, the corona and the
   diamond ring go out. --ec runs from 0 to 1 over the hero (main.js). */
.ec-drift { transform: translate(calc(var(--ec, 0) * -100px), calc(var(--ec, 0) * 58px)); }
.ec-total { opacity: calc(1 - var(--ec, 0) * 4); }
@keyframes ec-moon { from { transform: translate(105px, -62px); } }
@keyframes ec-halo { from { opacity: 1; } to { opacity: 0.55; } }
@keyframes ec-corona { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes ec-diamond { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0.2; } }
@keyframes ec-glint { 0%, 70%, 100% { opacity: 0.2; } 80% { opacity: 0.55; } }
@keyframes ec-breathe { 0%, 100% { opacity: 0.55; transform: none; } 50% { opacity: 0.7; transform: scale(1.04); } }
@keyframes ec-spin { to { transform: rotate(360deg); } }
@keyframes ec-flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.hero-text { max-width: 62rem; }
.hero h1 {
  font: 600 clamp(5.2rem, 22vw, 18rem)/0.78 var(--black);
  color: var(--ink);
  margin-left: -0.04em; padding-bottom: 0.14em;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.6), 0 12px 50px rgba(0, 0, 0, 0.55);
}
.hero-line { max-width: 34rem; margin-top: 2rem; font-size: 1.45rem; line-height: 1.55; font-weight: 500; }
.hero-links { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.2rem; }
.walk {
  font: 700 1.3rem/1 var(--text); color: #1c0f05; text-decoration: none;
  background: var(--accent); padding: 0.75rem 1.3rem;
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 45%, transparent);
}
.walk:hover { background: var(--ink); }
.quiet { color: var(--dim); }

/* Rings */
.ring {
  min-height: 130vh;
  padding: 26vh var(--gutter) 18vh calc(var(--rail) + var(--gutter));
  max-width: 76rem;
}
.ring-head { margin-bottom: 3.5rem; }
.ring h2 { font: 600 clamp(3.4rem, 10vw, 8rem)/0.85 var(--black); color: var(--ink); }
.motto { font-style: italic; color: var(--accent); font-size: 1.45rem; margin-top: 0.9rem; max-width: 30rem; }

.ring-body { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 19rem); gap: 3rem 6rem; align-items: start; }
@media (max-width: 899px) { .ring-body { grid-template-columns: 1fr; } }
.prose .lead { font-size: 1.45rem; line-height: 1.55; font-weight: 500; margin-bottom: 2.6rem; }
.prose h3 { font: 700 1.5rem/1.3 var(--text); color: var(--accent); margin: 2.4rem 0 0.4rem; }
.prose p { hyphens: auto; }

.fall {
  position: sticky; top: 30vh; padding: 1.4rem 1.5rem;
  background: color-mix(in srgb, var(--fog) 22%, transparent);
  border-top: 3px solid var(--accent);
}
.fall-head { font: 700 1.5rem/1.2 var(--text); color: var(--accent); margin-bottom: 0.6rem; }
.fall p:last-child { font-size: 1.3rem; line-height: 1.5; color: var(--ink); }

.edge { min-height: 90vh; }

.void {
  min-height: 150vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 var(--gutter);
  font-size: 1.8rem; color: var(--ink);
}
.void-small { font-size: 1.3rem; color: var(--dim); margin-top: 1rem; }

/* The notice board in Last Hearth: who we are looking for and what stands, in the panels of the rings. */
.board {
  padding: 26vh var(--gutter) 22vh calc(var(--rail) + var(--gutter));
  max-width: 76rem;
}
.board h2 { font: 600 clamp(3.4rem, 10vw, 8rem)/0.85 var(--black); color: var(--ink); }
.board-lead { max-width: 34rem; font-size: 1.45rem; line-height: 1.55; font-weight: 500; }
.board-sub {
  font: 700 1.5rem/1 var(--caps); letter-spacing: 0.04em; color: var(--accent);
  margin: 5rem 0 1.6rem;
}

/* Five posts: three across, then two wider ones; two across on tablets, one on phones. */
.wanted { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.5rem; }
.post { grid-column: span 2; }
.post:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 1099px) {
  .wanted { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post, .post:nth-child(n+4) { grid-column: auto; }
  .post:last-child { grid-column: 1 / -1; }
}
@media (max-width: 639px) { .wanted { grid-template-columns: 1fr; } }
.post, .stands > div {
  padding: 1.4rem 1.5rem 1.6rem;
  background: color-mix(in srgb, var(--fog) 22%, transparent);
  border-top: 3px solid var(--accent);
}
.post-role { font-size: 1rem; color: var(--dim); }
.post h4 { font: 700 1.5rem/1.2 var(--text); color: var(--accent); margin: 0.2rem 0 0.7rem; }
.post p:last-child { font-size: 1.15rem; line-height: 1.55; }

.stands-note { max-width: 34rem; color: var(--dim); margin: -0.6rem 0 1.6rem; }
.stands { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; }
@media (max-width: 899px) { .stands { grid-template-columns: 1fr; } }
.stands > div:last-child { border-top-color: var(--dim); }
.stands-head { font: 700 1.3rem/1.2 var(--text); margin-bottom: 0.8rem; }
.stands > div:first-child .stands-head { color: var(--accent); }
.stands > div:last-child .stands-head { color: var(--dim); }
.stands ul { list-style: none; margin: 0; padding: 0; font-size: 1.15rem; line-height: 1.5; }
.stands li { position: relative; padding-left: 1.7rem; margin-bottom: 0.55rem; }
.stands li::before { position: absolute; left: 0; top: 0; }
.done li::before { content: "\2713"; color: var(--accent); }
.open li { color: var(--dim); }
.open li::before { content: "\25CB"; }

/* The letter with the contact links. Its seal is already broken: whoever pinned it here wants it read. */
/* The glow behind body text is for the night sky, not for ink on paper. */
.letter-paper p { text-shadow: none; }
.letter { position: relative; max-width: 34rem; margin: 9rem 0 0 auto; }
@media (max-width: 899px) { .letter { margin-top: 6rem; } }
.letter-paper {
  background:
    linear-gradient(180deg, transparent calc(50% - 1px), rgba(0, 0, 0, 0.12) 50%, transparent calc(50% + 2px)),
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, 0.25), transparent 60%),
    var(--paper);
  color: var(--paper-ink);
  padding: 2.4rem 2.2rem 4.4rem;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.5);
  transform: rotate(-0.8deg);
  font-size: 1.2rem; line-height: 1.6;
}
.letter-to { font-style: italic; margin-bottom: 0.6rem; }
.letter-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin-top: 1.2rem; }
.letter-links a { color: var(--wax); font-size: 1.3rem; font-weight: 700; }

.seal { position: absolute; left: 50%; bottom: -34px; width: 84px; height: 84px; margin-left: -42px; }
.seal-half {
  position: absolute; inset: 0; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 38% 32%, #b23a32, var(--wax) 55%, #4a0c0c);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 6px rgba(0, 0, 0, 0.12);
}
.seal-half::after {
  content: "E"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 3rem/1 var(--black); color: #5b0f0f;
  text-shadow: 1px 1px 0 rgba(255, 140, 120, 0.3), -1px -1px 0 rgba(0, 0, 0, 0.35);
}
.seal-half.left { clip-path: polygon(0 0, 54% 0, 46% 30%, 56% 52%, 44% 76%, 50% 100%, 0 100%); transform: translate(-7px, 3px) rotate(-9deg); }
.seal-half.right { clip-path: polygon(54% 0, 100% 0, 100% 100%, 50% 100%, 44% 76%, 56% 52%, 46% 30%); transform: translate(6px, -2px) rotate(7deg); }

.footer {
  padding: 2.5rem var(--gutter) 3.5rem calc(var(--rail) + var(--gutter));
  color: var(--dim); font-size: 1rem;
  background: rgba(30, 14, 6, 0.85);
}
.footer a { color: var(--dim); }

/* legal.html: one readable column, nothing else. */
.legal { max-width: 44rem; padding: 3rem var(--gutter) 5rem calc(var(--rail) + var(--gutter)); }
.legal h1 { font: 600 clamp(2.8rem, 8vw, 4.5rem)/1 var(--black); margin: 3.5rem 0 1.2rem; }
.legal h2 { font: 700 1.4rem/1.3 var(--text); color: var(--accent); margin: 2.2rem 0 0.4rem; }
.legal p + p { margin-top: 1rem; }
.legal-date { color: var(--dim); margin-top: 3rem !important; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { transition: none; }
  .ec-moon, .ec-halo, .ec-corona, .ec-diamond, .ec-rays, .ec-chromo, .ec-proms { animation: none; }
  .ec-halo { opacity: 0.55; }
  .ec-diamond { opacity: 0.2; }
}
