/* Dunmaris's website is drawn on the chart of the Studio's mark: a parchment ground ruled with a
   drafting grid, ink text, gold for the instruments (the pills, the rules, the rose), panels with a
   double gold rule, Grenze Gotisch for names and Alegreya Sans for reading. Real footage from the game
   carries every section; vocations bring their colours (knight red, ranger green, mage blue), lands
   their palette's cloth (assets/palettes.json). One light look, like a chart on a table.

   The tokens keep the names of the game's interface (--ink is the ground, --parch the text), so a rule
   written for the dark look still says what it means; only the values turned over. --ground-rgb and
   --shade-rgb are the ground and the shadow as channels, for the rgba() fades and shadows.

   The home page is made like an illuminated chart: every section is a layered scene (ground texture,
   drifting fog, embers, a drawn ornament, then the footage and the words), the sections are torn from
   one another along a cut edge, and the sample images sit over a sea chart.

   Mobile first: the base rules are the phone; wider screens are added at 640px and 960px. */
:root {
  color-scheme: light;
  --ink: #e9dcbf;
  --ink-2: #e1d2b0;
  --stone: #d8c8a2;
  --panel: #f3ead6;
  --panel-2: #f9f3e3;
  --ground-rgb: 233, 220, 191;
  --shade-rgb: 62, 44, 18;
  --line: rgba(62, 44, 18, .18);
  --line-gold: rgba(184, 134, 44, .55);
  --parch: #1f1b14;
  --parch-2: #4b4234;
  --dim: #7b7060;
  --gold: #d9a63f;
  --gold-hi: #f1cd78;
  --gold-deep: #a7781f;
  /* Gold as text on the parchment: deep enough to read, as the rose's shaded half is. */
  --gold-ink: #85601a;
  --hp: #d5503f;
  --mp: #4c84dc;
  --ok: #74c95c;
  --bad: #b8321f;
  /* The drafting grid ruled over the ground, as on the Studio's mark. */
  --grid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M0 .5h48M.5 0v48' fill='none' stroke='%231f1b14' stroke-opacity='.09'/%3E%3C/svg%3E");
  --display: "Grenze Gotisch", "Alegreya Sans", Georgia, serif;
  --body: "Alegreya Sans", "Trebuchet MS", system-ui, sans-serif;
  --gutter: 16px;
  --measure: 1120px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  /* The gold of the metalwork: lit at the top, deep in the middle, catching light again below. */
  --foil: linear-gradient(180deg, #f6d88a 0%, #e3b34c 42%, #b8862c 56%, #f1cf7a 100%);
  /* The knot rule under every headline: a line, a loop each side, a ring with a diamond in it. */
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='24'%3E%3Cg fill='none' stroke='%23e3b34c' stroke-linecap='round'%3E%3Cpath stroke-width='1.2' stroke-opacity='.7' d='M0 12h86M154 12h86'/%3E%3Cpath stroke-width='1.2' d='M58 12c0-5 8-5 8 0s-8 5-8 0M174 12c0-5 8-5 8 0s-8 5-8 0'/%3E%3Ccircle cx='120' cy='12' r='9.5' stroke-width='1.2'/%3E%3Cpath d='M92 12h12M136 12h12'/%3E%3C/g%3E%3Cpath fill='%23e3b34c' d='M120 6l6 6-6 6-6-6zM100 12l3-3 3 3-3 3zM134 12l3-3 3 3-3 3z'/%3E%3C/svg%3E");
  /* Grain: fine noise over everything. Mottle: slow noise that makes a ground read as worn stone. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --mottle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .82 0 0 0 0 .55 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E");
  /* The torn edge between sections, repeated along it. */
  --torn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='24' preserveAspectRatio='none'%3E%3Cpath d='M0 0h240v9l-9 5-12-7-10 10-13-6-9 8-14-9-11 7-13-4-9 9-12-10-10 6-12-7-13 9-11-6-12 8-10-9-13 5-9-7-11 9-12-5-13 7-2-7z' fill='%23000'/%3E%3C/svg%3E");
  /* The sea, in the small wave marks of a chart. */
  --waves: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='40'%3E%3Cpath d='M0 12c8-10 16-10 24 0s16 10 24 0s16-10 24 0s16 10 24 0' fill='none' stroke='%23e3b34c' stroke-width='.9'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-color: #b9a883 var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--parch);
  font: 500 17px/1.5 var(--body);
  background:
    radial-gradient(110% 55% at 50% -8%, rgba(217, 166, 63, .12), transparent 62%),
    var(--grid) center / 48px 48px,
    var(--ink);
}
/* Grain over everything, so the ground reads as paper and not as a flat fill. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .09;
  background-image: var(--grain);
}
/* A vignette: the edges of the sheet browned, as an old chart's are. */
body.home::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(110, 76, 28, .22) 100%);
}

::selection { background: var(--gold); color: var(--ink); }
input, textarea { caret-color: var(--gold); }
a { color: var(--gold-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img, video, svg { display: block; max-width: 100%; }
time, .num { font-variant-numeric: tabular-nums; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; line-height: 1.02; margin: 0; text-wrap: balance; }
/* Names are pressed into the paper: a thread of light below each letter. */
.home h2, .home h3 { text-shadow: 0 1px 0 rgba(255, 250, 235, .55); }
p { margin: 0; text-wrap: pretty; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.ornament { display: block; pointer-events: none; }

/* Footage from the game sits in a frame with the interface's double gold rule. */
.frame { position: relative; margin: 0; overflow: hidden; background: var(--panel); }
.frame img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line-gold), inset 0 0 0 5px rgba(var(--ground-rgb), .55), inset 0 0 0 6px rgba(227, 179, 76, .22);
}
/* An ornate frame has knotwork in its four corners, over the double rule. */
.corner { position: absolute; width: 46px; height: 46px; color: var(--gold); opacity: .85; filter: drop-shadow(0 1px 1px rgba(var(--shade-rgb), .8)); z-index: 2; }
.corner-tl { top: 6px; left: 6px; }
.corner-tr { top: 6px; right: 6px; transform: scaleX(-1); }
.corner-bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.corner-br { bottom: 6px; right: 6px; transform: scale(-1); }

/* ---------- header and footer ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
}
.home .top {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  max-width: none;
  padding-inline: max(var(--gutter), calc((100% - var(--measure)) / 2));
  background: linear-gradient(180deg, rgba(var(--ground-rgb), .9), rgba(var(--ground-rgb), 0));
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 900 30px/1 var(--display);
  color: var(--parch);
  text-decoration: none;
  letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(255, 250, 235, .6);
}
.wordmark:hover { color: var(--gold-ink); }
/* The mark beside the name: the chart's rose (shared/_mark), all in ink at this size (gold is lost in a
   36px ring on parchment); the shaded halves of the rose keep its relief. Gold on hover, with the name. */
.mark { width: 1.3em; height: 1.3em; flex: none; color: var(--parch); fill: currentColor; --rose: var(--parch); filter: drop-shadow(0 1px 0 rgba(255, 250, 235, .6)); }
.wordmark:hover .mark { --rose: var(--gold-ink); }
.top-nav { display: flex; align-items: center; gap: 14px; }
.top-nav a { white-space: nowrap; }
.top-link {
  color: var(--parch);
  font-weight: 700;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.top-link:hover { color: var(--gold-ink); }
/* On the narrowest phones (375px and under) the name, "Log in" and the pill are a few pixels too many. */
@media (max-width: 400px) {
  .top { gap: 8px; }
  .top .wordmark { font-size: 26px; gap: 7px; }
  .top-nav { gap: 10px; }
}

.bottom {
  position: relative;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding: 44px var(--gutter) calc(28px + env(safe-area-inset-bottom));
}
.bottom::before { content: ""; position: absolute; top: -1px; left: 50%; width: 240px; height: 24px; transform: translate(-50%, -50%); background: var(--ink) var(--ornament) center / 240px 24px no-repeat; }
.bottom-inner { max-width: var(--measure); margin: 0 auto; display: grid; gap: 18px; }
.bottom .wordmark { font-size: 26px; }
.bottom-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.bottom-nav a { color: var(--parch-2); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.bottom-nav a:hover { color: var(--gold-ink); }
.bottom-note { color: var(--dim); font-size: 14px; }
/* Dunmaris's accounts elsewhere (config/socials.yml), each its network's mark and handle. */
.bottom-social { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.bottom-social a { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; color: var(--parch-2); text-decoration: none; font-weight: 700; }
.bottom-social a:hover { color: var(--gold-ink); }
.bottom-social .icon { width: 18px; height: 18px; }

/* ---------- buttons: the game's own gold pill (.pill) and its ghost ---------- */

.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  font: 800 17px/1 var(--body);
  color: #241a05;
  text-decoration: none;
  background: linear-gradient(180deg, #f0cd78, var(--gold) 55%, #d6a63f) var(--gold);
  border: 1px solid var(--gold);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 10px rgba(var(--shade-rgb), .25);
  cursor: pointer;
  transition: background-color .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out), filter .2s var(--ease-out);
}
.button:hover, button:hover, input[type="submit"]:hover { color: #241a05; filter: brightness(1.06); border-color: var(--gold-deep); }
.button:active, button:active, input[type="submit"]:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 4px rgba(var(--shade-rgb), .3); }
.button.quiet, button.quiet {
  color: var(--parch);
  font-weight: 700;
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 3px 10px rgba(var(--shade-rgb), .2);
}
.button.quiet:hover, button.quiet:hover { color: var(--gold-ink); background: var(--panel-2); border-color: var(--line-gold); filter: none; }
.button.small, button.small { min-height: 38px; padding: 0 16px; font-size: 15px; }
button.link {
  min-height: 44px;
  padding: 0;
  color: var(--parch-2);
  font: 700 16px var(--body);
  background: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
button.link:hover { color: var(--gold-ink); background: none; filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .button { flex: 1 1 auto; }

/* ---------- flash ---------- */

.flash {
  max-width: 560px;
  margin: 4px var(--gutter) 12px;
  padding: 12px 16px;
  border: 1px solid var(--line-gold);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px -16px rgba(var(--shade-rgb), .9);
}
.flash-alert { border-color: var(--bad); color: var(--bad); }
.flash-notice { border-color: var(--ok); }
.home .flash { position: absolute; z-index: 11; top: 64px; left: 0; right: 0; margin-inline: auto; width: calc(100% - 2 * var(--gutter)); }
@media (min-width: 640px) { .flash { margin-inline: auto; } }

/* ---------- section scaffolding ---------- */

main { flex: 1; width: 100%; min-width: 0; }
.page main { padding: 4px var(--gutter) 56px; }
.home main > section { position: relative; padding: 64px max(var(--gutter), calc((100% - var(--measure)) / 2)); }

.section-head { display: grid; gap: 10px; margin-bottom: 28px; max-width: 46ch; }
.section-head h2 { font-size: 40px; font-weight: 900; color: var(--parch); }
.section-head h2::after {
  content: "";
  display: block;
  width: 240px;
  max-width: 100%;
  height: 24px;
  margin-top: 10px;
  background: var(--ornament) left / 240px 24px no-repeat;
}
.section-head p { color: var(--parch-2); font-size: 18px; }

/* Things settle into place as they scroll into view (reveal_controller.js adds .reveals and .in). */
.reveals [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); }
.reveals [data-reveal].in { opacity: 1; transform: none; }
.reveals .feature:nth-child(2) { transition-delay: .12s; }
.reveals .feature:nth-child(3) { transition-delay: .24s; }

/* The torn edge: each section's ground hangs a little over the next one's, cut like paper, with its
   shadow falling on what is below. The section sets --tear to the colour of its own foot. */
.tear { position: absolute; left: 0; right: 0; bottom: -23px; height: 24px; z-index: 3; pointer-events: none; filter: drop-shadow(0 5px 5px rgba(var(--shade-rgb), .55)); }
.tear::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tear, var(--ink));
  -webkit-mask: var(--torn) 0 0 / 240px 24px repeat-x;
  mask: var(--torn) 0 0 / 240px 24px repeat-x;
}

/* Weather: fog that drifts across a scene, and embers that rise through it (embers_controller.js). */
.fog, .embers, .shaft { position: absolute; pointer-events: none; }
/* On paper the weather is a wash: sepia clouds that darken a little where they drift. */
.fog {
  inset: -30% -20%;
  z-index: 0;
  mix-blend-mode: multiply;
  opacity: .6;
  filter: blur(2px);
}
.fog-a { background: radial-gradient(40% 50% at 30% 60%, rgba(150, 110, 50, .12), transparent 70%), radial-gradient(35% 45% at 75% 35%, rgba(217, 166, 63, .14), transparent 70%); }
.fog-b { background: radial-gradient(45% 40% at 60% 70%, rgba(150, 110, 50, .1), transparent 70%), radial-gradient(30% 40% at 15% 25%, rgba(217, 166, 63, .12), transparent 70%); }
.embers { inset: 0; z-index: 0; width: 100%; height: 100%; }
.shaft { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .fog-a { animation: drift-a 46s ease-in-out infinite alternate; }
  .fog-b { animation: drift-b 58s ease-in-out infinite alternate; }
}
@keyframes drift-a { from { transform: translate3d(-4%, 2%, 0) scale(1); } to { transform: translate3d(5%, -3%, 0) scale(1.08); } }
@keyframes drift-b { from { transform: translate3d(5%, -2%, 0) scale(1.05); } to { transform: translate3d(-5%, 3%, 0) scale(1); } }

/* ---------- hero ---------- */

.home main > .hero {
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-content: start;
  /* The headline steps up into the fading bottom of the footage. */
  padding-top: calc(100vw * 546 / 720 * .8);
  padding-bottom: 48px;
  --tear: var(--ink);
}
.hero-light { display: none; }
.hero-corners { display: none; }
/* On a phone the footage plays across the top at the size it has in the game (no zoom, so it stays
   sharp), and fades into the ink the headline stands on; the phone it is shown in on a desk is put
   away until 960px. */
@media (max-width: 959px) {
  .hero .hero-film { position: absolute; inset: 0 0 auto; z-index: -2; isolation: auto; aspect-ratio: 720 / 546; border-radius: 0; background: none; box-shadow: none; }
  .hero .hero-film .phone-screen::after { display: none; }
  .hero .hero-film :is(.phone-screen, .phone-view) { position: static; inset: auto; height: 100%; border-radius: 0; clip-path: none; background: none; box-shadow: none; overflow: visible; }
  .hero .hero-film video { width: 100%; height: 100%; object-fit: cover; background: none; }
  .hero .hero-film::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 0;
    opacity: 1;
    background: linear-gradient(180deg, rgba(var(--ground-rgb), .75) 0%, rgba(var(--ground-rgb), 0) 20%, rgba(var(--ground-rgb), 0) 58%, rgba(var(--ground-rgb), .85) 86%, var(--ink) 100%);
  }
}
.hero-copy { position: relative; z-index: 1; display: grid; gap: 16px; max-width: 34rem; }
.hero h1 {
  font-size: clamp(48px, 13.5vw, 96px);
  font-weight: 900;
  line-height: .92;
  color: var(--parch);
  text-shadow: 0 1px 0 rgba(255, 250, 235, .6);
}
/* The illuminated capital: the first letter in black, in a ruled box with a diamond at each corner. */
.cap {
  position: relative;
  display: inline-block;
  padding: 0 .06em;
  margin-right: .02em;
  color: #000;
  text-shadow: none;
}
.cap::before {
  content: "";
  position: absolute;
  inset: .08em -.02em -.02em;
  z-index: -1;
  border: 1px solid rgba(227, 179, 76, .55);
  box-shadow: inset 0 0 0 3px rgba(var(--ground-rgb), .6), inset 0 0 0 4px rgba(227, 179, 76, .25);
  background: repeating-linear-gradient(135deg, rgba(227, 179, 76, .08) 0 2px, transparent 2px 7px), rgba(var(--ground-rgb), .55);
}
.cap::after {
  content: "";
  position: absolute;
  inset: .08em -.02em -.02em;
  z-index: -1;
  background:
    radial-gradient(circle at 0 0, var(--gold) 2.5px, transparent 3px),
    radial-gradient(circle at 100% 0, var(--gold) 2.5px, transparent 3px),
    radial-gradient(circle at 0 100%, var(--gold) 2.5px, transparent 3px),
    radial-gradient(circle at 100% 100%, var(--gold) 2.5px, transparent 3px);
}
.hero-lede { font-size: 19px; line-height: 1.45; color: var(--parch-2); max-width: 32ch; }
.hero .actions { margin-top: 6px; }
/* Over footage the ghost pill frosts what is behind it, so it stays legible on any frame. */
.hero .button.quiet { background: rgba(var(--ground-rgb), .7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.hero-note { color: var(--dim); font-size: 14px; }

/* The one authored moment: the raid lights up as the words settle into place. */
@media (prefers-reduced-motion: no-preference) {
  .hero-film video { animation: kindle 1.6s var(--ease-out) both; }
  .hero-copy > * { animation: settle .9s var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: .07s; }
  .hero-copy > :nth-child(3) { animation-delay: .14s; }
  .hero-copy > :nth-child(4) { animation-delay: .21s; }
}
@keyframes kindle { from { filter: brightness(.2) saturate(.5); } to { filter: none; } }
@keyframes settle { from { opacity: .4; transform: translateY(10px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

/* Reels: a row of footage that a thumb swipes through on a phone, one item snapping in at a time. */
.thumb-reel, .vocation-reel {
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.thumb-reel::-webkit-scrollbar, .vocation-reel::-webkit-scrollbar { display: none; }
.thumb-reel > li, .vocation-reel > li { scroll-snap-align: start; }

/* ---------- one thumb: the game's whole screen, in a phone ---------- */

.thumb {
  --tear: var(--stone);
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(217, 166, 63, .1), transparent 70%),
    var(--grid) center / 48px 48px,
    var(--mottle) center / 1000px 1000px,
    linear-gradient(180deg, var(--ink-2) 0%, var(--stone) 100%);
}
/* Not a swipe: the three features stack and the page scrolls down through them. */
.thumb-reel {
  margin: 0;
  padding: 56px 0 12px;
  grid-auto-flow: row;
  grid-auto-columns: auto;
  overflow: visible;
  scroll-snap-type: none;
  gap: 72px;
}
.feature { position: relative; display: grid; align-content: start; gap: 8px; width: min(100%, 300px); margin-inline: auto; }
/* The number of each, drawn in outline behind its phone, big as a poster. */
.numeral {
  position: absolute;
  top: -50px;
  left: -12px;
  z-index: 0;
  font: 900 150px/1 var(--display);
  color: rgba(227, 179, 76, .1);
  -webkit-text-stroke: 1px rgba(227, 179, 76, .3);
  letter-spacing: -.02em;
  pointer-events: none;
  user-select: none;
}
.feature h3 { font-size: 32px; color: var(--parch); margin-top: 12px; }
.feature p { color: var(--parch-2); }
/* The shadow each phone throws on the table. */
.feature .phone::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -26px;
  height: 40px;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(var(--shade-rgb), .3), transparent 70%);
  filter: blur(6px);
}

/* ---------- the phone: footage recorded on a phone is shown on one ---------- */

/* The footage shows the game's own interface, so no body, buttons, island or status bar are drawn
   round it; the phone is a plain screen with a gold rule. */
.phone {
  position: relative;
  z-index: 1;
  isolation: isolate;
  container-type: inline-size;
  margin: 0;
  aspect-ratio: 9 / 16;
  background: #060607;
  box-shadow:
    0 40px 70px -28px rgba(var(--shade-rgb), .6),
    0 14px 24px -16px rgba(var(--shade-rgb), .5);
}
/* The footage runs edge to edge and the interface's double gold rule is laid over it, as on a
   .frame (WebKit does not clip a video to rounded corners once the phone is transformed, so there
   are none). */
.phone-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #0d1513; /* the game's own ink: the screen is dark until the footage plays */
}
.phone-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--line-gold), inset 0 0 0 5px rgba(var(--ground-rgb), .55), inset 0 0 0 6px rgba(227, 179, 76, .22);
}
.phone-view { position: absolute; inset: 0; z-index: 1; overflow: hidden; border-radius: inherit; }
.phone-view video { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #15211e; }

/* ---------- hunts: a field of colour per vocation, the game itself on top ---------- */

.hunts {
  --tear: var(--ink-2);
  background:
    repeating-linear-gradient(135deg, rgba(62, 44, 18, .035) 0 1px, transparent 1px 14px),
    var(--grid) center / 48px 48px,
    var(--mottle) center / 1000px 1000px,
    var(--ink-2);
}
.vocation {
  --voc: var(--gold);
  --voc-hi: var(--gold-hi);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-inline: calc(-1 * var(--gutter));
  display: grid;
  /* A reel inside scrolls; it never widens the page. */
  grid-template-columns: minmax(0, 1fr);
  background:
    radial-gradient(120% 60% at 100% 100%, color-mix(in srgb, var(--voc) 30%, transparent), transparent 70%),
    var(--mottle) center / 1000px 1000px,
    linear-gradient(180deg, color-mix(in srgb, var(--voc) 24%, var(--ink-2)), color-mix(in srgb, var(--voc) 8%, var(--ink-2)));
  /* Cut on the slant, each field hanging a little over the next. */
  clip-path: polygon(0 0, 100% 14px, 100% 100%, 0 calc(100% - 14px));
  padding-bottom: 14px;
}
.vocation + .vocation { margin-top: -16px; }
/* --voc-hi is the vocation's colour as ink: deep enough to read on its own pale field. */
.vocation.knight { --voc: var(--hp); --voc-hi: #a52f1f; z-index: 3; }
.vocation.ranger { --voc: var(--ok); --voc-hi: #2f7a22; z-index: 2; clip-path: polygon(0 14px, 100% 0, 100% calc(100% - 14px), 0 100%); }
.vocation.mage { --voc: var(--mp); --voc-hi: #2a56a8; z-index: 1; }
.vocation .embers { opacity: .8; }
/* The vocation's crest, drawn in one fine line, big behind its words. */
.crest {
  position: absolute;
  right: -40px;
  bottom: -30px;
  z-index: 0;
  width: 300px;
  height: 300px;
  color: var(--voc-hi);
  opacity: .14;
  stroke-width: .3;
  pointer-events: none;
}
/* Each vocation's footage: a reel on a phone, a big shot over two small ones on a wide screen. */
.vocation-reel {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 30px var(--gutter) 2px;
  grid-auto-columns: 84%;
  gap: 10px;
}
.vocation-reel > li { border-radius: 10px; box-shadow: 0 20px 40px -20px rgba(var(--shade-rgb), .5); }
.vocation-reel video, .vocation-reel img, .clip-placeholder { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
/* A clip not filmed yet: the vocation's colour, hatched, saying what will play there. */
.clip-placeholder {
  display: grid;
  align-content: end;
  gap: 4px;
  padding: 18px;
  color: var(--parch-2);
  font-size: 15px;
  background:
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--voc) 14%, transparent) 0 12px, transparent 12px 24px),
    color-mix(in srgb, var(--voc) 10%, var(--ink-2));
}
.clip-placeholder-tag { font-weight: 800; color: var(--voc-hi); }
.vocation-text { position: relative; z-index: 1; display: grid; gap: 10px; padding: 18px var(--gutter) 30px; }
.vocation h3 { display: flex; align-items: center; gap: 12px; font-size: 46px; font-weight: 900; color: var(--parch); }
.vocation-mark { width: 34px; height: 34px; color: var(--voc-hi); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--voc) 60%, transparent)); }
.vocation-role { font-size: 19px; color: var(--parch); }
.vocation-text ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; color: var(--parch-2); }
.vocation-text li { display: flex; gap: 10px; align-items: baseline; }
.vocation-text li::before { content: ""; flex: none; width: 6px; height: 6px; transform: translateY(-2px) rotate(45deg); background: var(--voc-hi); }
.vocation-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-top: 2px;
  font-weight: 800;
  font-size: 17px;
  color: var(--voc-hi);
  text-decoration: none;
}
.vocation-go .icon { transition: transform .25s var(--ease-out); }
.vocation-go:hover { color: var(--parch); }
.vocation-go:hover .icon { transform: translateX(4px); }
.hunts-note { margin-top: 22px; max-width: 62ch; color: var(--dim); font-size: 15px; }

/* ---------- gear: what you wear shows on you ---------- */

.gear {
  --tear: var(--ink);
  background:
    var(--grid) center / 48px 48px,
    var(--mottle) center / 1000px 1000px,
    linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 100%);
}
.gear-media { display: grid; gap: 22px; }
.gear-film, .gear-lineup { border-radius: 12px; box-shadow: 0 30px 60px -30px rgba(var(--shade-rgb), .5); }
.gear-film video, .gear-lineup img, .spoils-film video { width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; }
/* Spoils: the rarest gear, one close-up hung under a lamp beside what it is. */
.spoils { display: grid; gap: 28px; margin-top: 72px; }
.spoils-hang { position: relative; }
.beam {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 40px);
  width: 86%;
  height: 160px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(246, 216, 138, 0) 0%, rgba(246, 216, 138, .18) 100%);
  clip-path: polygon(47% 0, 53% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.beam::after { content: ""; position: absolute; top: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--gold-hi); box-shadow: 0 0 12px 4px rgba(246, 216, 138, .6); }
.spoils-film { border-radius: 12px; box-shadow: 0 40px 70px -30px rgba(var(--shade-rgb), .55); }
.spoils-film::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(246, 216, 138, .12), transparent 35%); mix-blend-mode: screen; }
.spoils-text { display: grid; gap: 12px; }
.spoils h3 { font-size: 40px; font-weight: 900; color: var(--parch); }
.spoils p { color: var(--parch-2); font-size: 18px; max-width: 46ch; }
.spoils ul { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; color: var(--parch-2); }
.spoils li { display: flex; gap: 10px; align-items: baseline; }
.spoils li::before { content: ""; flex: none; width: 6px; height: 6px; transform: translateY(-2px) rotate(45deg); background: var(--gold); }

/* ---------- sights: sample images over a chart of the sea ---------- */

.sights { --tear: var(--ink); background: var(--grid) center / 48px 48px, var(--ink); }
.chart { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.chart::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background: var(--waves) 0 0 / 96px 40px, var(--waves) 48px 20px / 96px 40px;
}
@media (prefers-reduced-motion: no-preference) { .chart::before { animation: swell 14s linear infinite; } }
@keyframes swell { to { background-position: 96px 0, 144px 20px; } }
/* Rhumb lines in pencil, the rose in gold: the instruments of the Studio's mark. */
.rhumb { position: absolute; left: 50%; top: 42%; width: 150vmax; height: 150vmax; transform: translate(-50%, -50%); color: var(--parch); opacity: .07; }
.compass { position: absolute; right: -50px; top: 70px; width: 220px; height: 220px; color: var(--gold); opacity: .55; filter: drop-shadow(0 0 1px rgba(var(--shade-rgb), .5)); }
.sights .section-head, .sight-grid { position: relative; z-index: 1; }
/* A gallery that scrolls down: every fifth picture runs the full width, the four between pair up as squares. */
.sight-grid { list-style: none; margin: 0; padding: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sight { grid-column: span 1; border-radius: 10px; box-shadow: 0 24px 40px -24px rgba(var(--shade-rgb), .5); }
.sight:nth-child(5n + 1) { grid-column: 1 / -1; }
.sight:not(:nth-child(5n + 1)) img { aspect-ratio: 1; }
.sight img { border-radius: inherit; }

/* ---------- closing: the gate on the Isle of Choosing ---------- */

.home main > .closing {
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding-top: 96px;
  padding-bottom: 150px;
  background:
    radial-gradient(70% 60% at 50% 100%, rgba(217, 166, 63, .3), transparent 70%),
    var(--grid) center / 48px 48px,
    var(--mottle) center / 1000px 1000px,
    var(--ink);
  display: grid;
  justify-items: center;
}
.closing .fog { opacity: .35; }
.gate {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 0;
  width: min(104%, 680px);
  transform: translateX(-50%);
  color: var(--gold-deep);
  opacity: .5;
  filter: drop-shadow(0 0 12px rgba(217, 166, 63, .25));
}
.closing-copy { position: relative; z-index: 1; display: grid; justify-items: center; gap: 16px; }
/* The mark hangs at the crown of the gate, over the words. */
.closing-mark { width: 120px; height: 120px; margin-bottom: 4px; filter: drop-shadow(0 16px 30px rgba(var(--shade-rgb), .35)) drop-shadow(0 0 28px rgba(217, 166, 63, .3)); }
@media (min-width: 640px) { .closing-mark { width: 150px; height: 150px; } }
.closing h2 { font-size: clamp(40px, 11vw, 72px); font-weight: 900; max-width: 14ch; }
.closing h2::after { content: ""; display: block; width: 240px; max-width: 100%; height: 24px; margin: 14px auto 0; background: var(--ornament) center / 240px 24px no-repeat; }
.closing p { color: var(--parch-2); font-size: 18px; max-width: 40ch; }
.closing .actions { justify-content: center; width: 100%; max-width: 440px; margin-top: 8px; }

/* ---------- before you join: the questions a visitor brings, answered ---------- */

.faq {
  background:
    var(--grid) center / 48px 48px,
    var(--mottle) center / 1000px 1000px,
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.faq-list { margin: 0; max-width: 64ch; }
.faq-item { padding: 20px 0 22px; border-top: 1px solid var(--line-gold); }
.faq-item:last-child { border-bottom: 1px solid var(--line-gold); }
.faq-item dt { font: 700 26px/1.15 var(--display); color: var(--parch); margin-bottom: 8px; }
.faq-item dd { margin: 0; color: var(--parch-2); font-size: 17px; max-width: 58ch; }
@media (min-width: 960px) {
  .faq-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; max-width: none; }
  .faq-item:last-child { border-bottom: 0; }
}

/* ---------- panels: forms and the account ---------- */

.card {
  width: 100%;
  max-width: 460px;
  margin: 12px auto;
  padding: 26px 20px 22px;
  border-radius: 12px;
  border: 1px solid var(--line-gold);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 5px rgba(227, 179, 76, .2), 0 24px 60px -30px rgba(var(--shade-rgb), .95);
}
.card.wide { max-width: 680px; }
.card h2 { font-size: 36px; font-weight: 900; margin-bottom: 18px; }
.card h2::after { content: ""; display: block; width: 240px; max-width: 100%; height: 24px; margin-top: 8px; background: var(--ornament) left / 240px 24px no-repeat; }
.card h3 { font-size: 28px; margin-bottom: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 800; }
.field .hint { color: var(--dim); font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  min-height: 50px;
  font: 500 17px var(--body);
  color: var(--parch);
  background: #fdf9ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: inset 0 2px 6px rgba(var(--shade-rgb), .12);
  transition: border-color .2s var(--ease-out);
}
input:hover { border-color: rgba(62, 44, 18, .35); }
input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
input::placeholder { color: #8e8370; }
.card input[type="submit"] { width: 100%; }
.errors { border: 1px solid var(--bad); border-radius: 8px; padding: 12px 16px; margin-bottom: 18px; color: var(--bad); background: rgba(184, 50, 31, .06); }
.errors ul { margin: 0; padding-left: 18px; }
.below { margin-top: 18px; color: var(--dim); font-size: 15px; }
.consent { margin: 2px 0 14px; color: var(--dim); font-size: 14px; }

/* The terms and the privacy policy: a long read in the card, with the headings as running heads. */
.legal { line-height: 1.55; }
.legal-date { margin-bottom: 20px; color: var(--dim); font-size: 14px; }
.legal h3 { margin-top: 28px; font-size: 24px; }
.legal p, .legal ul { margin-bottom: 12px; color: var(--parch-2); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal strong { color: var(--parch); }
.legal code { font-size: 14px; }
.account-meta { color: var(--dim); }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }
.account-actions form { margin: 0; }

.characters { width: 100%; border-collapse: collapse; margin: 4px 0 20px; }
.characters th, .characters td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.characters th { color: var(--dim); font-weight: 700; font-size: 14px; }
.characters td:first-child, .characters th:first-child { padding-left: 0; }
.characters .name { font: 700 22px/1.1 var(--display); color: var(--gold-ink); }
.characters .created { display: none; }
.empty { color: var(--dim); margin-bottom: 18px; }

/* ---------- wider screens ---------- */

@media (min-width: 640px) {
  :root { --gutter: 28px; }
  .home main > section { padding-block: 88px; }
  .section-head h2 { font-size: 52px; }
  .actions .button { flex: 0 0 auto; }
  .card { padding: 34px 32px 28px; margin-top: 28px; }
  .characters .created { display: table-cell; }
  .corner { width: 56px; height: 56px; }
  .compass { width: 300px; height: 300px; right: -40px; top: 60px; }
  .vocation { clip-path: polygon(0 0, 100% 22px, 100% 100%, 0 calc(100% - 22px)); padding-bottom: 22px; }
  .vocation.ranger { clip-path: polygon(0 22px, 100% 0, 100% calc(100% - 22px), 0 100%); }
  .vocation + .vocation { margin-top: -26px; }
  .numeral { font-size: 190px; top: -60px; left: -22px; }
}

@media (min-width: 960px) {
  .home main > .hero {
    min-height: min(100svh, 920px);
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    align-content: center;
    gap: 72px;
    padding-top: 128px;
    padding-bottom: 96px;
  }
  .hero-light {
    display: block;
    position: absolute;
    inset: -8%;
    z-index: -3;
    background: url("/assets/dragon-raid-58064122.jpg") center / cover;
    filter: blur(56px) saturate(1.1) brightness(1.1);
    opacity: .45;
  }
  @media (prefers-reduced-motion: no-preference) { .hero-light { animation: breathe 14s ease-in-out infinite alternate; } }
  .hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(70% 90% at 30% 50%, rgba(var(--ground-rgb), .82), rgba(var(--ground-rgb), .35) 70%), linear-gradient(180deg, transparent 70%, var(--ink));
  }
  /* A shaft of light falls across the sheet from the top left: the paper lit paler there. */
  .shaft {
    display: block;
    inset: 0;
    z-index: 0;
    background: linear-gradient(104deg, rgba(255, 250, 235, .5), rgba(255, 250, 235, .18) 30%, transparent 55%);
    clip-path: polygon(0 0, 46% 0, 78% 100%, 0 100%);
  }
  /* The knotwork at the four corners of the scene. */
  .hero-corners { display: block; position: absolute; inset: 22px; z-index: 1; pointer-events: none; will-change: transform; }
  .hero-corners .corner { width: 150px; height: 150px; opacity: .6; filter: drop-shadow(0 1px 1px rgba(var(--shade-rgb), .9)); }
  .hero-corners .corner-tl { top: 0; left: 0; }
  .hero-corners .corner-tr { top: 0; right: 0; }
  .hero-corners .corner-bl { bottom: 0; left: 0; }
  .hero-corners .corner-br { bottom: 0; right: 0; }
  .fog { will-change: transform; }
  .hero-film {
    grid-column: 2;
    grid-row: 1;
    width: 360px;
    box-shadow:
      0 0 0 1px rgba(var(--shade-rgb), .9),
      0 0 0 2px rgba(255, 255, 255, .12),
      0 60px 100px -40px rgba(var(--shade-rgb), .65),
      0 0 90px -10px rgba(217, 166, 63, .35);
    will-change: transform;
  }
  .hero-copy { grid-column: 1; grid-row: 1; gap: 22px; }
  .hero-lede { font-size: 22px; }

  .thumb-reel {
    padding: 64px 0 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 44px;
  }
  /* The phones, titles and first lines of text line up across the three, whatever a title's length. */
  .feature { width: auto; margin-inline: 0; grid-row: span 3; grid-template-rows: subgrid; }
  .numeral { font-size: 220px; top: -74px; left: -34px; }

  .vocation {
    margin-inline: 0;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    clip-path: polygon(0 0, 100% 36px, 100% 100%, 0 calc(100% - 36px));
    padding-bottom: 36px;
    background:
      radial-gradient(90% 120% at 100% 50%, color-mix(in srgb, var(--voc) 30%, transparent), transparent 70%),
      var(--mottle) center / 1000px 1000px,
      linear-gradient(90deg, color-mix(in srgb, var(--voc) 10%, var(--ink-2)), color-mix(in srgb, var(--voc) 22%, var(--ink-2)));
  }
  .vocation + .vocation { margin-top: -40px; }
  .vocation.ranger { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); clip-path: polygon(0 36px, 100% 0, 100% calc(100% - 36px), 0 100%); }
  .vocation.ranger .vocation-reel { order: 2; }
  .vocation.ranger .crest { right: auto; left: -40px; transform: scaleX(-1); }
  .crest { width: 420px; height: 420px; bottom: -60px; }
  .vocation-reel {
    padding: 40px 28px 28px;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .vocation.knight .vocation-reel, .vocation.mage .vocation-reel { padding-bottom: 56px; }
  .vocation.ranger .vocation-reel { padding-top: 24px; padding-bottom: 60px; }
  .vocation-reel > li:first-child { grid-column: 1 / -1; }
  .vocation-reel > li:first-child :is(video, img, .clip-placeholder) { aspect-ratio: 4 / 3; }
  .vocation-text { padding: 56px 44px 60px; }
  .vocation h3 { font-size: 56px; }

  .gear-media { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .spoils { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 56px; margin-top: 96px; }
  .spoils-hang { transform: rotate(-.8deg); }
  .beam { height: 200px; }
  .spoils h3 { font-size: 52px; }

  /* Twice the pictures across, so none is stretched past its size: four columns, the wide ones take two
     and fill the height of the squares beside them (the row is as tall as a square). */
  .sight-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
  .sight:nth-child(5n + 1) { grid-column: span 2; }
  .sight:nth-child(5n + 1) img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }
  .compass { width: 380px; height: 380px; right: 2%; top: 30px; }

  .closing .actions { max-width: none; }
  .home main > .closing { padding-bottom: 180px; }
  /* The arch is wide enough to stand over the whole of the words, so its apex rises above the mark
     instead of crossing the heading. */
  .gate { width: 1080px; max-width: none; }
}
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.07); } }
