/* The main website's components and pages, made only from the names in tokens.css. Shown together on /styleguide.
   The gateway writes the first view of the home page, the blog and the wiki into #pre with these same classes, so
   a reader sees the page before the application has loaded; see index.html. */

/* ---- Base ------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--c-night); color: var(--c-text); font: var(--weight-body) var(--text-base) / var(--leading) var(--font-sans); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100svh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--c-tide); text-underline-offset: 3px; }
a:hover { color: var(--c-text); }
::selection { background: var(--c-tide); color: var(--c-ink); }
:focus-visible { outline: 2px solid var(--c-tide); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-weight: var(--weight-title); letter-spacing: var(--tracking-title); line-height: var(--leading-tight); margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-md); letter-spacing: -0.01em; }
/* A page's heading is given the focus when the page is reached, for screen readers; it needs no box. */
h1:focus { outline: none; }
p { margin: 0 0 var(--space-4); }
.muted { color: var(--c-text-dim); }
.faint { color: var(--c-text-faint); }
.small { font-size: var(--text-xs); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
.eyebrow { margin: 0 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-title); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--c-tide); }
.lede { font-size: var(--text-md); color: var(--c-text-dim); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Until the application has drawn its first page, the gateway's first view (#pre) is what is seen; then #pre goes
   and #app shows. Without scripts, or if the application cannot start, #pre simply stays. */
html:not(.live) #app { display: none; }

/* ---- The world behind the page ----------------------------------------------------------------------------- */
/* A tiny, already-blurred copy of a piece of key art, stretched over the screen: it costs nothing to draw, so the
   panes over it can be plain tints and still read as frosted glass. Each part of the site has its own scene. */
.backdrop { position: fixed; inset: 0; z-index: -2; background: var(--c-night) url('../img/veil/harbour.webp') center / cover no-repeat; }
.backdrop::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% -10%, transparent, rgb(11 17 24 / 0.5) 70%), linear-gradient(rgb(11 17 24 / 0.25), rgb(11 17 24 / 0.62)); }
.backdrop[data-scene='palace'] { background-image: url('../img/veil/palace.webp'); }
.backdrop[data-scene='rift'] { background-image: url('../img/veil/rift.webp'); }
.backdrop[data-scene='meadow'] { background-image: url('../img/veil/meadow.webp'); }
.backdrop[data-scene='tidebell'] { background-image: url('../img/veil/tidebell.webp'); }
.backdrop[data-scene='portal'] { background-image: url('../img/veil/portal.webp'); }

/* ---- Glass ------------------------------------------------------------------------------------------------- */
.glass { background: var(--glass); box-shadow: var(--glass-edge); border-radius: var(--r-lg); }
.glass-blur { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.sheet { background: var(--glass-strong); box-shadow: var(--glass-edge); border-radius: var(--r-lg); padding: clamp(20px, 3.6vw, 40px); }
.sheet-read { background: var(--glass-read); box-shadow: var(--glass-edge), var(--glass-lift); border-radius: var(--r-lg); }
.well { background: var(--glass-fill); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06); border-radius: var(--r); padding: var(--space-4); }

/* ---- The top bar ------------------------------------------------------------------------------------------- */
.top { position: fixed; z-index: 20; top: 10px; left: var(--gutter); right: var(--gutter); max-width: var(--page-max); margin: 0 auto; }
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); height: 52px; padding: 0 6px 0 16px; border-radius: var(--r-pill);
  background: var(--glass); box-shadow: var(--glass-edge), 0 10px 30px rgb(0 0 0 / 0.25); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--c-text); font-weight: var(--weight-title); letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; font-size: 16px; }
.mark:hover { color: var(--c-text); }
.mark-glyph { flex: none; width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(from 200deg, var(--c-tide), var(--c-gold), rgb(255 150 176), var(--c-tide)); box-shadow: 0 0 14px rgb(120 224 242 / 0.45), inset 0 0 0 4px rgb(11 17 24 / 0.35); }
.top nav { display: flex; align-items: center; gap: 2px; font-size: var(--text-sm); font-weight: var(--weight-bold); }
.top nav .links { display: flex; align-items: center; gap: 2px; }
.top nav a { color: var(--c-text-dim); text-decoration: none; padding: 8px 13px; border-radius: var(--r-pill); white-space: nowrap; transition: background var(--dur), color var(--dur); }
.top nav a:hover { color: var(--c-text); background: var(--glass-fill); }
.top nav a.active { color: var(--c-text); box-shadow: inset 0 0 0 1px var(--glass-line); }
.top nav a.who { color: var(--c-gold); }
.top nav a.play { margin-left: 4px; }
.menu-toggle { display: none; }
.menu-button { display: none; }
/* The page starts below the bar. */
main { padding-top: calc(var(--top-h) + var(--space-5)); min-height: 70vh; }
main.flush { padding-top: 0; }

@media (max-width: 720px) {
  .top { top: 8px; }
  .top-bar { padding-left: 14px; height: 50px; }
  .menu-toggle { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .menu-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--c-text); background: var(--glass-fill-hi); }
  .menu-button svg { width: 20px; height: 20px; }
  .top nav .links { position: absolute; top: calc(100% + 8px); left: 0; right: 0; display: none; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px;
    border-radius: var(--r-lg); background: var(--glass-solid); box-shadow: var(--glass-edge), 0 18px 40px rgb(0 0 0 / 0.45); }
  .top nav .links a { padding: 13px 16px; font-size: var(--text-base); border-radius: var(--r); }
  .menu-toggle:checked ~ .links { display: flex; }
  .menu-toggle:focus-visible ~ .menu-button { outline: 2px solid var(--c-tide); outline-offset: 2px; }
  .top nav { gap: 6px; }
}

/* ---- Buttons ----------------------------------------------------------------------------------------------- */
/* The main action is a white pill, the brightest thing on any screen; the accent marks what is chosen, not action. */
.pill, .soft, .quiet { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-pill); font: var(--weight-title) var(--text-sm) / 1 var(--font-sans);
  text-decoration: none; cursor: pointer; padding: 11px 20px; white-space: nowrap; transition: transform var(--dur) var(--ease), background var(--dur), box-shadow var(--dur), color var(--dur); }
.pill { background: var(--c-text); color: var(--c-ink); box-shadow: 0 4px 14px rgb(0 0 0 / 0.25); }
.pill:hover { color: var(--c-ink); background: #fff; transform: translateY(-1px); box-shadow: 0 8px 22px rgb(0 0 0 / 0.3), 0 0 0 4px rgb(255 255 255 / 0.12); }
.soft { background: var(--glass-fill-hi); color: var(--c-text); }
.soft:hover { color: var(--c-text); background: rgb(255 255 255 / 0.22); }
.quiet { background: none; color: var(--c-tide); box-shadow: inset 0 0 0 1px currentColor; }
.quiet:hover { color: var(--c-text); }
.danger { color: var(--c-danger); }
.top nav a.play, .top nav a.play:hover { color: var(--c-ink); background: var(--c-text); padding: 10px 18px; }
.big { font-size: var(--text-base); padding: 15px 28px; }
:is(.pill, .soft, .quiet):disabled { opacity: 0.45; cursor: default; transform: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.have { margin: var(--space-3) 0 0; }

/* ---- Chips, states and notices ----------------------------------------------------------------------------- */
.chip, .tags a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: var(--r-pill); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--c-text-dim); text-decoration: none; background: var(--glass-fill-hi); transition: background var(--dur), color var(--dur); }
.tags a:hover { color: var(--c-text); background: rgb(255 255 255 / 0.2); }
.tags a.on { background: var(--c-text); color: var(--c-ink); }
.tags small, .chip small { opacity: 0.62; font-weight: var(--weight-body); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: var(--weight-title); text-transform: uppercase; letter-spacing: 0.08em; }
.state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.state.up { color: var(--c-life); }
.state.updating { color: var(--c-ember); }
.state.down { color: var(--c-danger); }
.notice { padding: 12px 16px; border-radius: var(--r); background: rgb(244 210 132 / 0.12); box-shadow: inset 0 0 0 1px rgb(244 210 132 / 0.4); color: var(--c-text); }
.error { color: var(--c-danger); font-weight: var(--weight-bold); }
.good { color: var(--c-life); font-weight: var(--weight-bold); }
.nothing { padding: 28px 22px; border-radius: var(--r-lg); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); color: var(--c-text-dim); text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgb(255 255 255 / 0.18); border-top-color: var(--c-tide); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ---- Forms ------------------------------------------------------------------------------------------------- */
.field, .form label { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--c-text); }
.field small, .form label small { color: var(--c-text-faint); font-size: var(--text-xs); font-weight: var(--weight-body); line-height: 1.45; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  font: var(--weight-body) var(--text-base) / 1.3 var(--font-sans); color: var(--c-text); padding: 12px 14px; border: 0; border-radius: var(--r);
  background: rgb(255 255 255 / 0.08); box-shadow: inset 0 0 0 1px var(--glass-line); transition: box-shadow var(--dur), background var(--dur); width: 100%; min-width: 0; }
input::placeholder { color: var(--c-text-faint); }
input:hover { background: rgb(255 255 255 / 0.11); }
input:focus { outline: none; background: rgb(255 255 255 / 0.12); box-shadow: inset 0 0 0 1.5px var(--c-tide), 0 0 0 4px var(--c-tide-soft); }
input:-webkit-autofill { -webkit-text-fill-color: var(--c-text); -webkit-box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 0 0 100px rgb(30 40 52); caret-color: var(--c-text); }

/* ---- Page frame -------------------------------------------------------------------------------------------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) var(--space-section); }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin: var(--space-4) 0 var(--space-5); }
.page-head h1 { margin: 0; text-shadow: var(--glass-text-shadow); }
.page-head .lede { margin: var(--space-2) 0 0; max-width: 620px; text-shadow: var(--glass-text-shadow); }
.page-head .eyebrow { text-shadow: var(--glass-text-shadow); }
.back { font-size: var(--text-sm); font-weight: var(--weight-bold); margin: 0 0 var(--space-4); }
.back a { text-decoration: none; color: var(--c-text-dim); }
.back a:hover { color: var(--c-text); }
.byline { color: var(--c-text-faint); font-size: var(--text-sm); font-weight: var(--weight-bold); margin: 0 0 var(--space-3); }
.byline time { color: var(--c-gold); }
.feed { display: inline-flex; align-items: center; gap: 8px; }
.feed svg { width: 15px; height: 15px; }
.loading { display: grid; place-items: center; gap: var(--space-4); min-height: 50vh; color: var(--c-text-faint); font-weight: var(--weight-bold); }
.loading.full { min-height: 100vh; min-height: 100svh; }
.loading .mark { font-size: 22px; }

/* ---- Footer ------------------------------------------------------------------------------------------------ */
.foot { border-top: 1px solid var(--glass-line); background: linear-gradient(rgb(11 17 24 / 0.2), rgb(11 17 24 / 0.75)); }
.foot-in { max-width: var(--page-max); margin: 0 auto; padding: var(--space-6) var(--gutter) var(--space-7); display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; justify-content: space-between; color: var(--c-text-faint); font-size: var(--text-sm); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); }
.foot nav a { color: var(--c-text-dim); text-decoration: none; font-weight: var(--weight-bold); }
.foot nav a:hover { color: var(--c-text); }
.foot p { margin: 0; flex-basis: 100%; }

/* ---- Cards and tiles --------------------------------------------------------------------------------------- */
.tile { padding: var(--space-5); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); }
.tile h3 { margin-bottom: var(--space-2); }
.tile p { margin: 0; color: var(--c-text-dim); font-size: 15px; }
.ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; margin-bottom: var(--space-4); color: var(--c-tide);
  background: radial-gradient(circle at 50% 0%, rgb(120 224 242 / 0.35), rgb(14 20 28 / 0.6) 75%); box-shadow: inset 0 0 0 1px var(--glass-line); }
.ico svg { width: 20px; height: 20px; }
.card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); text-decoration: none; color: var(--c-text);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
a.card:hover, .card:has(h2 a:hover) { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--glass-line-strong), 0 18px 40px rgb(0 0 0 / 0.3); color: var(--c-text); }
.card .pic { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: rgb(255 255 255 / 0.04); }
.card .pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .txt { padding: var(--space-4) 18px var(--space-5); display: flex; flex-direction: column; flex: 1; }
.card h2, .card h3 { font-size: 19px; letter-spacing: -0.015em; margin: 0 0 var(--space-2); }
.card h2 a, .card h3 a { color: var(--c-text); text-decoration: none; }
.card p { margin: 0; color: var(--c-text-dim); font-size: 15px; }
.card .byline { margin-bottom: var(--space-2); font-size: var(--text-xs); }

/* ---- Home: the landing page -------------------------------------------------------------------------------- */
.landing { position: relative; }
.hero-art { position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--c-night) 0%, rgb(11 17 24 / 0.55) 22%, rgb(11 17 24 / 0.05) 55%, rgb(11 17 24 / 0.25) 100%), linear-gradient(to right, rgb(11 17 24 / 0.45), transparent 62%); }
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; padding: 96px var(--gutter) clamp(24px, 7vh, 72px); }
.hero-card { width: 100%; max-width: 580px; margin-left: max(0px, calc((100% - var(--page-max) + 2 * var(--gutter)) / 2)); padding: clamp(22px, 3vw, 34px); border-radius: var(--r-lg);
  background: var(--glass); box-shadow: var(--glass-edge), var(--glass-lift); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.hero h1 { font-size: var(--text-hero); letter-spacing: -0.035em; margin-bottom: var(--space-4); }
.hero .lede { margin-bottom: var(--space-5); }
.worlds { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: 6px; }
.worlds li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--text-sm); color: var(--c-text-dim); }
.worlds b { color: var(--c-text); text-transform: capitalize; }
.worlds .checking { color: var(--c-text-faint); }
.section { max-width: var(--page-max); margin: var(--space-section) auto 0; padding: 0 var(--gutter); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-4); margin-bottom: var(--space-5); }
.section-head h2 { margin: 0; text-shadow: var(--glass-text-shadow); }
.section-head p { margin: 0; max-width: 400px; color: var(--c-text-faint); font-size: var(--text-sm); }
.intro { margin-top: var(--space-6); }
.intro .sheet p:last-child { margin: 0; font-size: var(--text-md); color: var(--c-text-dim); max-width: 780px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 14px; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 40%); gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 0 0 var(--space-3); scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 0.25) transparent; }
.gallery figure { position: relative; margin: 0; scroll-snap-align: start; border-radius: var(--r-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--glass-line), 0 12px 30px rgb(0 0 0 / 0.3); }
.gallery img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery figcaption { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: var(--weight-bold);
  background: var(--glass); box-shadow: var(--glass-edge); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.news-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.news-cards li { display: flex; }
.news-cards .card { flex: 1; }
.news-empty { padding: var(--space-5); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); color: var(--c-text-dim); }
.coming ul { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.coming li { padding: 14px 16px; border-radius: var(--r); background: var(--glass-fill); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06); color: var(--c-text-dim); font-size: 15px; }
.coming li b { color: var(--c-text); }
.coming .sheet > p:last-child { margin: var(--space-4) 0 0; font-size: var(--text-sm); color: var(--c-text-faint); }
.final { position: relative; isolation: isolate; overflow: hidden; margin-top: var(--space-section); padding: clamp(84px, 16vh, 160px) var(--gutter); display: grid; place-items: center; text-align: center; }
.final picture { position: absolute; inset: 0; z-index: -1; }
.final picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.final::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--c-night), rgb(11 17 24 / 0.2) 35%, rgb(11 17 24 / 0.3) 65%, rgb(11 17 24 / 0.9)); }
.final-card { max-width: 520px; padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge), var(--glass-lift); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.final-card p { color: var(--c-text-dim); }
.final .actions { justify-content: center; }
@media (max-width: 720px) {
  .hero { min-height: 94svh; }
  .hero-art { height: 94svh; }
  .hero-art img { object-position: 32% 40%; }
  .gallery { grid-auto-columns: 84%; }
}

/* A short picture band at the top of the blog, a post and the wiki. */
.band { position: relative; isolation: isolate; overflow: hidden; height: clamp(220px, 34vh, 340px); margin-bottom: calc(-1 * clamp(120px, 18vh, 190px)); }
.band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(rgb(11 17 24 / 0.2), rgb(11 17 24 / 0.1) 30%, rgb(11 17 24 / 0.95)); }
/* What follows a band is drawn over its lower part. */
.band + * { position: relative; }

/* ---- The blog ---------------------------------------------------------------------------------------------- */
.posts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.posts li { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); transition: transform var(--dur) var(--ease), box-shadow var(--dur); }
.posts li:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--glass-line-strong), 0 18px 40px rgb(0 0 0 / 0.3); }
.posts .cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.posts .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.posts li > div { padding: var(--space-4) 18px var(--space-5); min-width: 0; }
.posts h2 { font-size: 20px; letter-spacing: -0.015em; margin: 0 0 var(--space-2); }
.posts h2 a { color: var(--c-text); text-decoration: none; }
.posts h2 a::after { content: ''; position: absolute; inset: 0; }
.posts li { position: relative; }
.posts li p { margin: 0 0 var(--space-2); color: var(--c-text-dim); font-size: 15px; }
.posts li p.byline { color: var(--c-text-faint); font-size: var(--text-xs); }
@media (min-width: 900px) {
  /* The newest post on the first page is shown large. */
  .posts.first li:first-child { grid-column: 1 / -1; flex-direction: row; }
  .posts.first li:first-child .cover { flex: 0 0 58%; aspect-ratio: auto; min-height: 320px; }
  .posts.first li:first-child > div { padding: var(--space-6); align-self: center; }
  .posts.first li:first-child h2 { font-size: var(--text-xl); }
  .posts.first li:first-child p { font-size: var(--text-md); }
}
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-top: var(--space-6); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.pager a { text-decoration: none; padding: 10px 18px; border-radius: var(--r-pill); background: var(--glass-fill-hi); color: var(--c-text); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a:hover { background: rgb(255 255 255 / 0.22); }
.pager span { color: var(--c-text-faint); }

/* A post. */
.post-wrap { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter) var(--space-section); }
.post { padding: clamp(22px, 5vw, 56px); }
.post h1 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
.post > .lede { font-family: var(--font-serif); font-size: var(--text-lg); margin: 0 0 var(--space-4); }
.post img.cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); margin: var(--space-2) 0 var(--space-6); box-shadow: var(--glass-edge); }
.post .tags { margin: var(--space-6) 0 0; }
.post .pager { border-top: 1px solid var(--glass-line); padding-top: var(--space-5); }

/* ---- Long reading: what the gateway makes of Markdown ------------------------------------------------------- */
.prose { font-family: var(--font-serif); font-size: var(--text-read); line-height: var(--leading-read); font-weight: 400; color: rgb(244 247 250 / 0.9); overflow-wrap: anywhere; max-width: var(--read-max); }
.prose > :first-child { margin-top: 0; }
.prose :is(h1, h2, h3, h4) { font-family: var(--font-sans); color: var(--c-text); scroll-margin-top: calc(var(--top-h) + 24px); }
.prose h1 { font-size: 30px; margin: 1.6em 0 0.5em; }
.prose h2 { font-size: 26px; margin: 1.6em 0 0.45em; }
.prose h3 { font-size: 20px; margin: 1.4em 0 0.4em; }
.prose h4 { font-size: 17px; margin: 1.3em 0 0.3em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 1.05em; }
.prose li { margin: 0.3em 0; }
.prose li::marker { color: var(--c-tide); }
.prose strong { color: var(--c-text); font-weight: 700; }
.prose a { color: var(--c-tide); text-decoration-thickness: 1px; }
.prose img { display: block; height: auto; border-radius: var(--r); margin: 1.4em 0; box-shadow: var(--glass-edge); }
.prose hr { border: 0; height: 1px; background: linear-gradient(to right, transparent, var(--glass-line-strong), transparent); margin: 2.2em 0; }
.prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--c-gold); color: var(--c-text-dim); font-style: italic; }
.prose code { font: 0.84em var(--font-mono); background: rgb(255 255 255 / 0.09); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: rgb(0 0 0 / 0.3); box-shadow: var(--glass-edge); padding: 14px 16px; border-radius: var(--r); overflow: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: 0.82em; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; font: var(--text-sm) / 1.5 var(--font-sans); }
.prose th, .prose td { border-bottom: 1px solid var(--glass-line); padding: 8px 14px 8px 0; text-align: left; }
.prose th { color: var(--c-text); }
.prose a.wikilink.missing { color: var(--c-danger); text-decoration-style: dashed; }

/* ---- The wiki ---------------------------------------------------------------------------------------------- */
.search { display: flex; gap: var(--space-2); max-width: 640px; padding: 6px; border-radius: var(--r-pill); background: var(--glass); box-shadow: var(--glass-edge), var(--glass-lift); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.search input { flex: 1; border-radius: var(--r-pill) !important; background: transparent !important; box-shadow: none !important; padding-left: 16px; }
.search input:focus { box-shadow: none !important; }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--c-tide), 0 0 0 4px var(--c-tide-soft), var(--glass-lift); }
.search button { flex: none; }
.wiki-home .search { margin: 0 0 var(--space-6); }
.wiki-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.wiki-tree section { padding: var(--space-5); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); }
.wiki-tree h2 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--c-tide); margin: 0 0 var(--space-3); }
.wiki-tree ul { list-style: none; padding: 0; margin: 0; }
.wiki-tree li a { display: block; padding: 7px 10px; margin: 0 -10px; border-radius: var(--r-sm); text-decoration: none; color: var(--c-text-dim); font-weight: var(--weight-bold); font-size: 15px; }
.wiki-tree li a:hover { color: var(--c-text); background: var(--glass-fill); }
.wiki-tree li a.on { color: var(--c-text); background: var(--glass-fill-hi); box-shadow: inset 3px 0 0 var(--c-tide); }
.wiki { display: grid; grid-template-columns: 240px minmax(0, 1fr) 210px; gap: var(--space-5); align-items: start; }
.wiki > aside { position: sticky; top: calc(var(--top-h) + 20px); max-height: calc(100vh - var(--top-h) - 40px); overflow-y: auto; scrollbar-width: thin; }
.wiki .side .wiki-tree { grid-template-columns: 1fr; gap: 0; }
.wiki .side .wiki-tree section { padding: 0 0 var(--space-4); background: none; box-shadow: none; }
.wiki .side { padding: var(--space-5) var(--space-4); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); }
.wiki .side .search { margin: 0 0 var(--space-5); box-shadow: inset 0 0 0 1px var(--glass-line); padding: 3px; background: rgb(0 0 0 / 0.15); }
.wiki .side .search input { padding: 8px 12px; font-size: var(--text-sm); }
.wiki .side .search button { padding: 8px 12px; }
.wiki article { min-width: 0; padding: clamp(22px, 4vw, 48px); }
.wiki article h1 { margin-bottom: var(--space-2); }
.wiki .crumbs { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--c-text-faint); margin: 0 0 var(--space-4); }
.wiki .crumbs a { color: var(--c-text-dim); text-decoration: none; }
.wiki .crumbs a:hover { color: var(--c-text); }
.wiki article .byline { margin: var(--space-6) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--glass-line); }
.toc { padding: var(--space-5) var(--space-4); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); font-size: var(--text-sm); }
.toc h2 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-eyebrow); color: var(--c-tide); margin: 0 0 var(--space-3); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--glass-line); }
.toc li a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--c-text-dim); text-decoration: none; font-weight: var(--weight-bold); line-height: 1.35; }
.toc li.l3 a { padding-left: 24px; font-weight: var(--weight-body); }
.toc li a:hover { color: var(--c-text); border-left-color: var(--c-tide); }
.toc-inline { display: none; margin: 0 0 var(--space-5); }
@media (max-width: 1100px) {
  .wiki { grid-template-columns: 230px minmax(0, 1fr); }
  .wiki .toc-side { display: none; }
  .wiki .toc-inline { display: block; }
}
.toc-inline summary { cursor: pointer; font-weight: var(--weight-bold); color: var(--c-text); }
.toc-inline .toc { margin-top: var(--space-3); background: var(--glass-fill); box-shadow: none; padding: var(--space-3) var(--space-4); }
@media (max-width: 820px) {
  .wiki { grid-template-columns: minmax(0, 1fr); }
  .wiki > aside { position: static; max-height: none; order: 2; }
}
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 820px; }
.results li { padding: var(--space-4) var(--space-5); border-radius: var(--r-lg); background: var(--glass); box-shadow: var(--glass-edge); }
.results a { font-size: var(--text-md); font-weight: var(--weight-title); text-decoration: none; color: var(--c-text); }
.results a:hover { color: var(--c-tide); }
.results small { margin-left: 8px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--glass-fill-hi); color: var(--c-text-dim); font-size: var(--text-xs); font-weight: var(--weight-bold); }
.results p { margin: 6px 0 0; color: var(--c-text-dim); font-size: 15px; }
#found-count { margin: 0 0 var(--space-4); }

/* ---- Sign-up, sign-in and the account page ----------------------------------------------------------------- */
.door { min-height: calc(100vh - var(--top-h)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: var(--space-7); align-items: center; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) var(--space-7); }
.door-words { order: -1; }
.door-words h2 { font-size: var(--text-2xl); text-shadow: var(--glass-text-shadow); }
.door-words p { font-size: var(--text-md); color: var(--c-text-dim); max-width: 460px; }
.door-words ul { list-style: none; padding: 0; margin: var(--space-5) 0 0; display: grid; gap: 10px; }
.door-words li { display: flex; gap: 12px; align-items: center; color: var(--c-text-dim); }
.door-words li::before { content: ''; flex: none; width: 8px; height: 8px; transform: rotate(45deg); background: var(--c-tide); box-shadow: 0 0 10px var(--c-tide); }
.form { padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); background: var(--glass-strong); box-shadow: var(--glass-edge), var(--glass-lift); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.form h1 { font-size: clamp(28px, 3.4vw, 36px); margin-bottom: var(--space-2); }
.form h1 + p { color: var(--c-text-dim); margin-bottom: var(--space-5); }
.form h2 { font-size: var(--text-md); margin: var(--space-6) 0 var(--space-3); padding-top: var(--space-5); border-top: 1px solid var(--glass-line); }
.form form { display: flex; flex-direction: column; gap: var(--space-4); align-items: stretch; }
.form form button[type=submit] { align-self: flex-start; margin-top: var(--space-1); }
.form .error, .form .good { margin: var(--space-4) 0 0; }
.form .notice { margin: 0 0 var(--space-4); }
.form dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 var(--space-5); padding: var(--space-4); border-radius: var(--r); background: var(--glass-fill); }
.form dt { color: var(--c-text-faint); font-size: var(--text-sm); font-weight: var(--weight-bold); }
.form dd { margin: 0; overflow-wrap: anywhere; font-weight: var(--weight-bold); }
.form dd#player-name { color: var(--c-gold); }
.form .row { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-6) 0 0; padding-top: var(--space-5); border-top: 1px solid var(--glass-line); }
.form .alt { margin: var(--space-5) 0 0; color: var(--c-text-dim); font-size: 15px; }
.form .alt + .small { margin-top: var(--space-2); color: var(--c-text-faint); }
.sessions { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sessions li { padding: 10px 14px; border-radius: var(--r); background: var(--glass-fill); font-size: var(--text-sm); overflow-wrap: anywhere; }
.account { max-width: 620px; margin: 0 auto; padding: 0 var(--gutter) var(--space-section); }
@media (max-width: 880px) {
  .door { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); min-height: 0; padding-top: var(--space-3); }
  .door-words { order: 2; }
  .door-words h2 { font-size: var(--text-xl); }
}

/* ---- The style guide --------------------------------------------------------------------------------------- */
.sg h2 { margin-top: var(--space-7); }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.sg-swatch { border-radius: var(--r); overflow: hidden; background: var(--glass); box-shadow: var(--glass-edge); font-size: var(--text-xs); }
.sg-swatch i { display: block; height: 64px; }
.sg-swatch div { padding: 10px 12px; }
.sg-swatch code { display: block; color: var(--c-text-faint); font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.sg-panes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; padding: 18px; border-radius: var(--r-lg); background: url('../img/art/harbour-720.webp') center / cover; }
.sg-panes > div { min-height: 120px; padding: 14px; border-radius: var(--r); box-shadow: var(--glass-edge); font-size: var(--text-sm); font-weight: var(--weight-bold); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.sg-panes code { display: block; font: 11px var(--font-mono); color: var(--c-text-dim); margin-top: 4px; }
.sg-type > * { margin: 0 0 var(--space-4); }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 var(--space-4); }
.sg-space { display: grid; gap: 8px; }
.sg-space div { display: flex; align-items: center; gap: 12px; font: 12px var(--font-mono); color: var(--c-text-dim); }
.sg-space i { display: block; height: 14px; border-radius: 4px; background: var(--c-tide); }

/* ---- The error strip Blazor shows when something breaks ----------------------------------------------------- */
#blazor-error-ui { display: none; position: fixed; z-index: 50; left: var(--gutter); right: var(--gutter); bottom: 16px; padding: 12px 18px; border-radius: var(--r); background: rgb(120 28 22 / 0.94); box-shadow: var(--glass-edge); color: #fff; font-weight: var(--weight-bold); }
#blazor-error-ui a { color: #fff; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
