/* The public site: the home page, the World, the FAQ and Support (client/*.html). Its letters,
   colours and vellum are the Chronicles' (lore/lore.css), so the site and the Lore read as one book. */

@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/lore/fonts/eb-garamond.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(assets/lore/fonts/eb-garamond-italic.woff2) format('woff2'); }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/lore/fonts/cinzel.woff2) format('woff2'); }

:root {
  --bar: 60px;
  --night: #14110e;
  --night-2: #1d1814;
  --night-3: #0c0a08;
  --gold: #c9a35f;
  --gold-hi: #e3c387;
  --gold-dim: rgba(201, 163, 95, .55);
  --line: rgba(201, 163, 95, .28);
  --bone: #e9dcc2;
  --bone-dim: #bfb197;
  --ink: #2a1c10;
  --ink-soft: #5d4129;
  --rubric: #7c2617;
  --paper: #eadbbd;
  --text: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --caps: 'Cinzel', 'Trajan Pro', 'Palatino Linotype', Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
  --fade: radial-gradient(130% 90% at 50% 40%, transparent 55%, rgba(122, 78, 32, .2) 100%);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .33 0 0 0 0 .21 0 0 0 0 .1 0 0 0 1.1 -.48'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0045' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .36 0 0 0 0 .16 0 0 0 1.05 -.46'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--night); color: var(--bone);
  font-family: var(--text); font-size: 20px; line-height: 1.6;
  font-kerning: normal; font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 .9em; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 40; padding: 8px 14px; background: var(--gold); color: var(--night); font: 600 15px var(--text); }
.skip:focus { top: 10px; }
.caps, .label, .bar, .btn, .foot, dt, .tag, summary {
  font-family: var(--caps); font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
}

/* ---- the bar across the top ---- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar);
  display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); padding: 0 var(--gutter);
  background: linear-gradient(rgba(27, 22, 18, .96), rgba(18, 15, 12, .96)); border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35); font-size: 12.5px;
}
.bar a { text-decoration: none; }
.brand { flex: none; color: var(--gold); font-size: 17px; letter-spacing: .3em; }
.brand:hover { color: var(--gold-hi); }
.links { flex: 1; display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.links a { position: relative; padding: 6px 0; opacity: .82; transition: opacity .2s; white-space: nowrap; }
.links a:hover, .links a[aria-current] { opacity: 1; }
.links a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--gold); }
.links .login { margin-left: auto; }
.menu { display: none; margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 44px; padding: 0 22px;
  border: 1px solid var(--gold); border-radius: 2px; background: var(--gold); color: var(--night);
  font-size: 13px; font-weight: 600; letter-spacing: .18em; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--gold-hi); border-color: var(--gold-hi); }
.btn.ghost { background: transparent; color: var(--gold); }
.btn.ghost:hover { background: rgba(201, 163, 95, .14); color: var(--gold-hi); }
.bar .btn { min-height: 38px; padding: 0 16px; font-size: 12px; opacity: 1; }
.bar .btn::after { display: none; }

@media (max-width: 760px) {
  .links { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; padding: 10px 4px; font-size: 12px; color: var(--bone); }
  .menu summary::-webkit-details-marker { display: none; }
  .menu summary::after { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 9px;
    border: solid var(--gold); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
  .menu[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
  .menu nav { position: fixed; left: 12px; right: 12px; top: calc(var(--bar) + 8px); display: grid; padding: 8px;
    background: var(--night-2); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
  .menu nav a { padding: 13px 12px; font-size: 13px; text-decoration: none; }
  .menu nav a:hover, .menu nav a[aria-current] { background: rgba(201, 163, 95, .12); }
  .menu nav .btn { margin-top: 6px; }
}

/* ---- the opening: a painting, the words on its dark side ---- */
.hero { position: relative; min-height: min(calc(100svh - var(--bar)), 900px); display: flex; align-items: center; overflow: hidden; background: var(--night-3); }
.hero > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(12, 9, 6, .9) 0%, rgba(12, 9, 6, .72) 34%, rgba(12, 9, 6, .1) 64%, transparent),
              linear-gradient(transparent 70%, var(--night)); }
@media (max-width: 760px) {
  .hero::before { background: linear-gradient(rgba(12, 9, 6, .55), rgba(12, 9, 6, .78) 45%, rgba(12, 9, 6, .9) 80%, var(--night)); }
}
.hero .words { position: relative; z-index: 2; width: min(100%, 38rem); padding: 64px var(--gutter) 96px; }
.hero .label { margin: 0 0 18px; color: var(--gold); font-size: 13px; letter-spacing: .32em; }
.hero h1 { margin: 0 0 22px; font: 500 clamp(38px, 3.4vw + 16px, 68px)/1.06 var(--caps); letter-spacing: .02em; text-wrap: balance; color: #f3e6cc;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.hero .lede { font-size: clamp(20px, .5vw + 17px, 23px); color: var(--bone); text-shadow: 0 1px 10px rgba(0, 0, 0, .7); }
.hero .lede em { color: var(--bone-dim); }
.when { margin: 28px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.when b { display: block; font: 600 15px var(--caps); letter-spacing: .22em; color: var(--gold-hi); }
.when > span { display: block; margin-top: 4px; font: 500 12.5px var(--caps); letter-spacing: .16em; color: var(--bone-dim); }
.when > span em { font-style: normal; color: var(--gold-hi); }
.acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.note { margin-top: 14px; font-size: 16px; font-style: italic; color: var(--bone-dim); }

/* ---- a page's own head, on the pages under the home page ---- */
.head { position: relative; padding: clamp(56px, 8vw, 110px) var(--gutter) clamp(40px, 6vw, 72px); text-align: center; overflow: hidden; }
.head > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.head::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(20, 17, 14, .2), var(--night)); }
.head > * { position: relative; z-index: 1; }
.head h1 { margin: 0 auto 16px; max-width: 18em; font: 500 clamp(36px, 2.6vw + 18px, 60px)/1.1 var(--caps); letter-spacing: .03em; text-wrap: balance; }
.head p { max-width: 34em; margin: 0 auto; color: var(--bone-dim); font-size: 21px; }

/* ---- sections ---- */
.band { padding: clamp(64px, 9vw, 120px) var(--gutter); }
.wrap { width: min(100%, 72rem); margin: 0 auto; }
.narrow { width: min(100%, 40rem); margin: 0 auto; }
.label { margin: 0 0 14px; font-size: 12.5px; letter-spacing: .3em; color: var(--gold); }
h2 { margin: 0 0 22px; font: 500 clamp(30px, 1.8vw + 18px, 46px)/1.14 var(--caps); letter-spacing: .03em; text-wrap: balance; }
h3 { margin: 0 0 8px; font: 500 21px/1.25 var(--caps); letter-spacing: .05em; }
.stand { font-family: var(--caps); font-size: clamp(17px, .4vw + 15px, 20px); letter-spacing: .08em; color: var(--gold-hi); }
.center { text-align: center; }
.rule { display: flex; justify-content: center; margin: 26px auto; color: var(--gold-dim); }

/* vellum: a sheet of the Chronicles' paper, ink on it */
.vellum {
  color: var(--ink); background-color: var(--paper);
  background-image: var(--fade), var(--grain), var(--cloud);
  background-size: 100% 100%, 260px 260px, 900px 900px;
}
.vellum .label, .vellum .stand { color: var(--rubric); }
.vellum .rule { color: #8a6532; }
.vellum a { color: var(--rubric); }
.vellum .btn.ghost { color: var(--rubric); border-color: rgba(124, 38, 23, .55); }
.vellum .btn.ghost:hover { background: var(--rubric); color: var(--paper); }
/* the drawings: ink on the vellum, so only the lines show */
.drawing { margin: 0; }
.drawing img { width: 100%; mix-blend-mode: multiply; filter: sepia(.3) contrast(1.08); opacity: .9; }

/* two columns, words beside a picture; one on a phone */
.pair { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.pair.flip > :first-child { order: 2; }
@media (max-width: 860px) { .pair { grid-template-columns: 1fr; } .pair.flip > :first-child { order: 0; } }

/* what there is to do: a ledger of short entries under a rule, not a grid of cards */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 6px clamp(28px, 4vw, 56px); margin: 40px 0 0; }
.ledger div { padding: 20px 0 6px; border-top: 1px solid rgba(138, 101, 50, .45); }
.ledger dt { margin-bottom: 6px; font-size: 14px; letter-spacing: .14em; color: var(--rubric); }
.ledger dd { margin: 0; font-size: 18.5px; line-height: 1.55; }

/* the paths: the five professions over a dark painting, numbered as the Chronicles' chapters */
.over { position: relative; overflow: hidden; background: var(--night-3); }
.over > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.over::before { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--night), rgba(20, 17, 14, .55) 18%, rgba(20, 17, 14, .55) 82%, var(--night)); }
.over > .wrap, .over > .narrow { position: relative; z-index: 1; }
.paths { list-style: none; margin: 44px 0 0; padding: 0; display: grid; gap: 0; }
.paths li { display: grid; grid-template-columns: 4.2rem 18rem 1fr; gap: 8px 28px; align-items: baseline; padding: 26px 0; border-top: 1px solid var(--line); }
.paths li:last-child { border-bottom: 1px solid var(--line); }
.paths .num { font: 500 26px var(--caps); color: var(--gold); }
.paths h3 { margin: 0; font-size: 24px; }
.paths h3 small { display: block; margin-top: 6px; font-size: 11.5px; letter-spacing: .2em; color: var(--gold); }
.paths p { margin: 0; color: var(--bone); }
@media (max-width: 860px) { .paths li { grid-template-columns: 3rem 1fr; } .paths p { grid-column: 2; } }
.together { max-width: 44em; margin: 56px auto 0; text-align: center; }
.together h3 { margin: 0 0 14px; font-size: clamp(22px, 1vw + 18px, 28px); }
.together p { color: var(--bone); }

/* who needs whom: a chain round the trades */
.chain { list-style: none; margin: 36px 0 0; padding: 0; counter-reset: link; }
.chain li { position: relative; padding: 0 0 22px 42px; }
.chain li::before { content: ''; position: absolute; left: 11px; top: 12px; width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid #8a6532; background: var(--paper); }
.chain li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 26px; bottom: 2px; width: 1px; background: rgba(138, 101, 50, .55); }
.chain b { font-weight: 600; }

/* the map in a frame */
.map { margin: 0; padding: 10px; background: #2b2118; border: 1px solid #7d5c2c; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.map img { width: 100%; }
.map figcaption { padding: 10px 4px 2px; font-size: 15px; font-style: italic; color: var(--bone-dim); }
.map a { display: block; }

/* what changed lately, from the game's own notes (src/patchnotes.js) */
.updates { display: grid; gap: 0; margin: 36px 0 0; }
.update { display: grid; grid-template-columns: 11rem 1fr; gap: 10px 32px; padding: 26px 0; border-top: 1px solid rgba(138, 101, 50, .45); }
.update time { font: 500 13.5px var(--caps); letter-spacing: .16em; color: var(--rubric); padding-top: 4px; }
.update ul { margin: 0; padding: 0 0 0 1.1em; }
.update li { margin-bottom: 8px; font-size: 18.5px; line-height: 1.5; }
.update li.more a { font-style: italic; }
/* the Updates page: a day a fold, the newest open */
.days { margin: 8px 0 0; }
.day { border-top: 1px solid var(--line); }
.day:last-child { border-bottom: 1px solid var(--line); }
.day summary { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 0; cursor: pointer; list-style: none; }
.day summary::-webkit-details-marker { display: none; }
.day summary time { font: 500 18px var(--caps); letter-spacing: .12em; color: var(--gold-hi); }
.day summary span { font-style: italic; color: var(--bone-dim); }
.day ul { margin: 0 0 24px; padding: 0 0 0 1.1em; }
.day li { margin-bottom: 14px; line-height: 1.55; }
.day li small { display: block; margin-top: 4px; font-size: .88em; font-style: italic; color: var(--bone-dim); }
.update li::marker { color: #8a6532; }
.update .more { list-style: none; margin-left: -1.1em; font-style: italic; color: var(--ink-soft); }
@media (max-width: 700px) { .update { grid-template-columns: 1fr; } }

/* the last call, over the homestead at dusk */
.call { text-align: center; }
.call h2 { color: #f3e6cc; }
.call .acts { justify-content: center; }
.call small { display: block; margin-top: 14px; font: 500 12.5px var(--caps); letter-spacing: .18em; color: var(--bone-dim); }

/* the World page: the lands, and each part of a life there */
.lands { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 0 clamp(28px, 4vw, 56px); }
.lands li { padding: 22px 0; border-top: 1px solid var(--line); }
.lands h3 { color: var(--gold-hi); }
.lands h3 small { margin-left: .6em; font-size: 11.5px; letter-spacing: .18em; color: var(--bone-dim); }
.lands p { margin: 0; font-size: 18.5px; color: var(--bone); }
.part + .part { margin-top: clamp(56px, 7vw, 96px); }
.part ul { margin: 0 0 .9em; padding-left: 1.1em; }
.part li { margin-bottom: 6px; }
.part li::marker { color: var(--gold-dim); }
.vellum .part li::marker { color: #8a6532; }
.tag { display: inline-block; margin: 0 0 12px; padding: 3px 10px; border: 1px solid currentColor; border-radius: 2px; font-size: 11px; letter-spacing: .18em; }
.tag.now { color: #8fb07a; }
.tag.soon { color: var(--gold); }
.vellum .tag.now { color: #3f6a2c; }
.vellum .tag.soon { color: var(--rubric); }
.later { margin-top: .4em; font-style: italic; color: var(--bone-dim); font-size: 18px; }
.vellum .later { color: var(--ink-soft); }

/* the FAQ: questions that open */
.faq h2 { margin-top: 56px; font-size: 26px; color: var(--gold); }
.faq h2:first-child { margin-top: 0; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; position: relative; padding: 18px 40px 18px 0; cursor: pointer;
  font: 500 17px/1.4 var(--caps); letter-spacing: .04em; text-transform: none; color: var(--bone); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 8px; top: 24px; width: 8px; height: 8px;
  border: solid var(--gold); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--gold-hi); }
.faq .answer { padding: 0 0 18px; color: var(--bone); font-size: 19px; }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---- the trailer, played in a window over the page ---- */
dialog.trailer { width: min(96vw, 1100px); padding: 0; border: 1px solid var(--gold-dim); background: #000; color: var(--bone); }
dialog.trailer::backdrop { background: rgba(6, 5, 4, .86); }
dialog.trailer .frame { position: relative; aspect-ratio: 16 / 9; }
dialog.trailer iframe, dialog.trailer video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
dialog.trailer .close { position: absolute; right: 0; top: -46px; min-height: 40px; }

/* ---- the foot ---- */
.foot { padding: 40px var(--gutter) 48px; border-top: 1px solid var(--line); background: var(--night-3); font-size: 12px; color: var(--bone-dim); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; }
.foot .brand { margin-right: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 14px 24px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--gold-hi); }
.foot .small { flex-basis: 100%; margin: 6px 0 0; font: italic 15px var(--text); letter-spacing: 0; text-transform: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
