/* calderisles.com: one page at night on the sea. Deep water for the ground, the game's own type (Cinzel caps for
   names, EB Garamond for everything said), the menu's wax-seal red for Play and lantern gold for what you can reach.
   The chart of the realm is the one loud thing; everything around it stays quiet. The privacy notice and terms are
   plain light reading pages (.doc). */
:root {
  --sea-deep: #0e2229;
  --night: #0a1a1f;
  --sea: #173a45;
  --shallow: #3f7f86;
  --fog: #e6ebe7;
  --foam: #f4f6f2;
  --foam-dim: #d5e0de;
  --mist: #9fb2b2;
  --ink: #1b2629;
  --muted: #56676a;
  --rule: #c5cfcb;
  --sail: #a2412e;
  --sail-hi: #b9503a;
  --lantern: #e2c27c;
  --ok: #a6e6b8;
  --warn: #f0c07a;
  --serif: "EB Garamond", "Garamond", "Georgia", serif;
  --caps: "Cinzel", "Trajan Pro", "Georgia", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body { margin: 0; background: var(--night); color: var(--foam-dim); font: 400 20px/1.6 var(--serif); }
::selection { background: rgba(226, 194, 124, .35); color: var(--foam); }
a { color: var(--lantern); text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h2 { margin: 0 0 18px; font: 400 clamp(26px, 3vw, 38px)/1.2 var(--caps); letter-spacing: .06em; color: var(--foam); text-wrap: balance; }
p { margin: 0 0 1em; max-width: 64ch; }
section { padding-inline: 16px; }

/* ---- the play button: the menu's red wax */
.play { display: inline-block; padding: 16px 46px 15px calc(46px + .3em); font: 600 17px var(--caps); letter-spacing: .3em; text-transform: uppercase; text-decoration: none; color: var(--foam); background: var(--sail); border-radius: 3px; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 10px 28px rgba(4, 12, 15, .5); transition: background .15s ease, transform .15s ease; }
.play:hover { background: var(--sail-hi); transform: translateY(-1px); }
.play:focus-visible { outline-color: var(--foam); }

/* ---- hero: the in-game footage loop, the full first screen */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; overflow: hidden; padding: 64px 16px; color: var(--foam); background: linear-gradient(180deg, var(--sea) 0%, var(--sea-deep) 100%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse 55% 42% at 50% 50%, rgba(10, 26, 31, .5) 0%, rgba(10, 26, 31, 0) 100%), linear-gradient(180deg, rgba(10, 26, 31, 0) 60%, var(--night) 100%); }
/* the capture is hazy: one grade for the poster and the loop alike, so nothing shifts when it starts */
.hero .film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.18) saturate(1.15) brightness(.94); }
.film-toggle { position: absolute; right: 16px; bottom: 16px; z-index: 3; padding: 6px 12px; font: 15px var(--serif); color: var(--foam-dim); background: rgba(10, 26, 31, .55); border: 1px solid rgba(232, 238, 236, .18); border-radius: 3px; cursor: pointer; }
.film-toggle:hover, .film-toggle:focus-visible { color: var(--foam); border-color: rgba(232, 238, 236, .45); }
.hero-in { position: relative; z-index: 2; text-align: center; }
.mark { margin: 0; font: 400 clamp(44px, 9vw, 116px)/1 var(--caps); letter-spacing: .16em; padding-left: .16em; text-shadow: 0 2px 30px rgba(4, 12, 15, .75); }
.tag { margin: 18px auto 40px; font: italic 400 clamp(21px, 2.4vw, 28px) var(--serif); color: var(--foam); text-shadow: 0 1px 12px rgba(4, 12, 15, .95); }
.check { margin: 22px auto 0; max-width: 520px; font-size: 16px; color: var(--foam-dim); text-shadow: 0 1px 8px rgba(4, 12, 15, .95); }
.check[data-state="ok"] { color: var(--ok); }
.check[data-state="warn"] { width: fit-content; color: var(--warn); padding: 6px 14px; background: rgba(10, 26, 31, .88); border-radius: 3px; }

/* ---- the premise: the war in two sentences, set large */
.premise { padding-block: clamp(96px, 16vh, 168px) clamp(72px, 12vh, 128px); text-align: center; }
.premise p { margin: 0 auto; max-width: 30ch; font-size: clamp(25px, 2.9vw, 36px); line-height: 1.38; color: var(--foam); text-wrap: balance; }
.premise .premise-end { margin-top: 1.1em; font-style: italic; color: var(--lantern); }

/* ---- the realm: the chart drawn from the game's terrain, the lands named on it */
.realm { padding: 40px 0 0; }
.realm-head { max-width: 1120px; margin: 0 auto 36px; padding-inline: 16px; text-align: center; }
.realm-head p { margin-inline: auto; max-width: 52ch; color: var(--foam-dim); }
.chart-wrap { max-width: 1600px; margin: 0 auto; }
.chart { position: relative; margin: 0; container-type: inline-size; }
.lands { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.land { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); text-align: center; cursor: default; }
.land b { display: block; padding-left: .24em; white-space: nowrap; font: 600 clamp(10px, 1.02cqi, 16px) var(--caps); letter-spacing: .24em; text-transform: uppercase; color: var(--foam); text-shadow: 0 0 4px rgba(4, 12, 15, .95), 0 0 14px rgba(4, 12, 15, .8); }
.land span { position: absolute; left: 50%; top: calc(100% + 8px); z-index: 3; width: max-content; max-width: 24ch; padding: 10px 14px; font: italic 400 clamp(15px, 1.08cqi, 18px)/1.4 var(--serif); text-align: left; color: var(--foam); background: rgba(10, 26, 31, .94); border: 1px solid rgba(226, 194, 124, .3); border-radius: 3px; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); transform: translateX(-50%); opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s; pointer-events: none; }
.land.east span { left: auto; right: 0; transform: none; }
/* lands in the south open their line upwards, so it stays on the chart (and inside its scroll box on phones) */
.land.south span { top: auto; bottom: calc(100% + 8px); }
.land:hover span, .land:focus span, .land:focus-within span { opacity: 1; visibility: visible; }
.land:hover b, .land:focus b { color: var(--lantern); }
.land:focus { outline: none; }
.land:focus-visible b { outline: 1px solid var(--lantern); outline-offset: 4px; }
/* where each land's name sits: x% = (x_m + 30000) / 600, y% = (z_m + 20000) / 400 (tools/site/render_realm.py) */
.land-saltholm { --x: 50%; --y: 85%; }
.land-aldersey { --x: 29%; --y: 50%; }
.land-thornholt { --x: 20%; --y: 39%; }
.land-sallow-fens { --x: 15%; --y: 66%; }
.land-greyspine { --x: 21%; --y: 28%; }
.land-beacon-line { --x: 38%; --y: 13%; }
.land-rimeland { --x: 52%; --y: 5%; }
.land-middle-sound { --x: 51%; --y: 55%; }
.land-vesper-reach { --x: 75%; --y: 42%; }
.land-sarrakand { --x: 85%; --y: 64%; }
.land-brennholm { --x: 89%; --y: 17%; }
/* Saltholm, where everyone starts: lit, with a mark on the island */
.land.start b { color: var(--lantern); font-size: clamp(12px, 1.3cqi, 20px); }
.land.start::before { content: ""; display: block; width: 9px; height: 9px; margin: 0 auto 8px; transform: rotate(45deg); background: var(--lantern); box-shadow: 0 0 0 4px rgba(226, 194, 124, .22), 0 0 18px rgba(226, 194, 124, .7); }

/* ---- places: four stills from the game, two rows that trade sides */
.places { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; max-width: 1600px; margin: 0 auto; padding-block: 48px 0; }
.places figure { position: relative; margin: 0; min-width: 0; grid-column: span 5; overflow: hidden; border-radius: 3px; background: var(--sea-deep); }
.places figure.wide { grid-column: span 7; }
.places figure.wide img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.places figure:not(.wide) { aspect-ratio: 80 / 63; } /* the wide still's height at 5 of 12 columns, so it stands alone too */
.places figure:not(.wide) img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.places figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 20px 16px; font: italic 400 19px var(--serif); color: var(--foam); background: linear-gradient(180deg, rgba(10, 26, 31, 0) 0%, rgba(10, 26, 31, .82) 100%); }

/* ---- the Wyrd: what the isles will become, set like the premise but off the centre line */
.wyrd { max-width: 1120px; margin: 0 auto; padding-block: clamp(104px, 15vh, 168px); }
.wyrd p { max-width: 34ch; margin: 0; font-size: clamp(24px, 2.6vw, 33px); line-height: 1.38; color: var(--foam); text-wrap: pretty; }
.wyrd .wyrd-note { margin-top: .9em; font-size: clamp(19px, 1.7vw, 22px); font-style: italic; color: var(--lantern); }

/* ---- questions and news */
.faq, .news { max-width: 760px; margin: 0 auto; padding-block: 0 clamp(72px, 10vh, 112px); }
.faq details { border-bottom: 1px solid rgba(213, 224, 222, .14); }
.faq details:first-of-type { border-top: 1px solid rgba(213, 224, 222, .14); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 0; font: 500 21px var(--serif); color: var(--foam); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--caps); color: var(--lantern); }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--foam-dim); }
.news article { padding: 16px 0; border-top: 1px solid rgba(213, 224, 222, .14); }
.news time { font-size: 17px; font-style: italic; color: var(--mist); font-variant-numeric: tabular-nums; }
.news h3 { margin: 4px 0 6px; font: 500 21px var(--serif); color: var(--foam); }

.last { text-align: center; padding-block: clamp(24px, 4vh, 48px) clamp(88px, 13vh, 136px); }

footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; padding: 28px 16px 44px; background: var(--night); border-top: 1px solid rgba(244, 246, 242, .07); font: 600 14px var(--caps); letter-spacing: .2em; text-transform: uppercase; color: var(--mist); }
footer a { color: var(--foam-dim); text-decoration: underline; text-decoration-color: rgba(213, 224, 222, .3); }
footer a:hover { color: var(--foam); }

/* ---- privacy notice and terms: plain light reading pages */
body:has(.doc) { background: var(--fog); color: var(--ink); font-size: 19px; color-scheme: light; }
body:has(.doc) .doc a { color: var(--sea); }
body:has(.doc) .doc :focus-visible { outline-color: var(--sea); }
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.doc { max-width: 760px; padding-block: 56px 72px; }
.doc h1 { margin: 0 0 4px; font: 400 clamp(30px, 4.4vw, 44px)/1.15 var(--caps); letter-spacing: .06em; color: var(--sea-deep); }
.doc h2 { margin-top: 44px; font-size: clamp(22px, 2.6vw, 28px); color: var(--sea); }
.doc h3 { margin: 26px 0 6px; font: 600 15px var(--caps); letter-spacing: .14em; text-transform: uppercase; color: var(--sea); }
.doc .when { color: var(--muted); font-style: italic; }
.doc ul { max-width: 64ch; padding-left: 1.2em; margin: 0 0 1em; }
.doc li { margin-bottom: .45em; }
.doc .home { margin: 0 0 18px; font: 600 14px var(--caps); letter-spacing: .2em; text-transform: uppercase; }
.doc .home a { color: var(--shallow); text-decoration: none; }

@media (max-width: 860px) {
  body { font-size: 18px; }
  .mark { font-size: clamp(30px, 10vw, 60px); letter-spacing: .1em; padding-left: .1em; white-space: nowrap; }
  .places { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .places figure, .places figure.wide { grid-column: auto; }
  .places figure:not(.wide) { aspect-ratio: auto; }
  .places figure:not(.wide) img { position: static; aspect-ratio: 16 / 9; }
  .places figcaption { font-size: 17px; padding: 36px 16px 12px; }
  /* the whole chart on one screen: the names stay, their lines don't fit */
  .land b { font-size: 8px; letter-spacing: .14em; padding-left: .14em; }
  .land.start b { font-size: 10px; }
  .land.start::before { width: 6px; height: 6px; margin-bottom: 5px; }
  .land span { display: none; }
  .premise { padding-block: 88px 72px; }
  .places { padding-block: 32px 0; }
  .wyrd { padding-block: 80px; }
  footer { gap: 8px 20px; }
  footer span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .play, .land span { transition: none; }
}
