:root {
  /* palette of the original ost.monster */
  --night: #00011f;
  --night-2: #060a33;
  --night-3: #141b55;
  --mist: #e4e6f2;
  --bone: #ffffff;
  --brass: #f78917;
  --brass-hi: #ff9800;
  --parchment: #e9dcbc;
  --parchment-edge: #c9b48a;
  --ink: #2e2316;
  --ink-soft: #5b4a33;
  --seal: #8e2f24;

  --display: "Lobster", Georgia, serif;
  --nav: "Lobster Two", "Lobster", Georgia, serif;
  --hero: "Creepster", "Lobster", fantasy;
  --text: "Shantell Sans", "Segoe UI", system-ui, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 6px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--bone); font-family: var(--display); font-weight: 400; line-height: 1.15; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section__title { font-size: clamp(1.75rem, 4vw, 2.6rem); margin-bottom: 2.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.5rem; min-width: min(13.75rem, 100%); max-width: 100%; padding: .9rem 2.25rem;
  text-align: center; overflow-wrap: anywhere; hyphens: auto;
  border: 2px solid #fff; border-radius: 36px;
  background: #fff;
  color: var(--night); font: 600 1.125rem/1.2 var(--text); text-transform: uppercase; text-decoration: none;
  transition: background-color .3s, color .3s, border-color .3s, transform .12s;
}
.btn:hover { background: var(--brass); border-color: var(--brass); color: #fff; }
.btn--ghost { background: transparent; color: #fff; }
.btn--ghost:hover { background: #fff; border-color: #fff; color: var(--night); }
.btn--small { min-height: 2.5rem; min-width: 0; padding: .45rem 1.25rem; font-size: .9rem; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 1, 31, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(247, 137, 23, .25);
}
.topbar__inner {
  max-width: var(--wrap); margin: 0 auto; padding: .6rem var(--gutter);
  display: flex; align-items: center; gap: 1.5rem;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font: 400 1.75rem/1 var(--hero); color: var(--brass-hi); letter-spacing: .03em; }
.nav { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.nav__links { gap: 1.25rem; }
.nav__links a { text-decoration: none; color: #f5f5f5; font: 400 1.15rem/1.2 var(--nav); }
.nav__links a:hover { color: var(--brass-hi); }
.lang { gap: .15rem; border-left: 1px solid rgba(247, 137, 23, .3); padding-left: 1rem !important; }
.lang a { display: block; padding: .25rem .45rem; border-radius: 4px; text-decoration: none; font-size: .9rem; font-weight: 700; color: var(--mist); }
.lang a[aria-current] { color: #fff; background: var(--brass); }
.lang a:not([aria-current]):hover { color: var(--brass-hi); }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle {
    display: block; margin-left: auto;
    background: none; border: 1px solid rgba(247, 137, 23, .5); border-radius: var(--radius);
    color: var(--bone); font: 700 .95rem var(--text); padding: .5rem .9rem; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--night); border-bottom: 1px solid rgba(247, 137, 23, .25);
  }
  .nav.is-open { display: flex; }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a { display: block; padding: .7rem 0; border-bottom: 1px solid rgba(195, 202, 219, .1); font-size: 1.1rem; }
  .lang { border-left: 0; padding-left: 0 !important; gap: .5rem; }
  .lang a { padding: .45rem .8rem; border: 1px solid rgba(247, 137, 23, .3); }
}

/* Hero */
.hero {
  position: relative; isolation: isolate;
  /* the hero fills the whole first screen; requirements start below the fold */
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
/* the photo is bright, so it is dimmed everywhere and more under the text, like the original */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 1, 31, .7) 0%, rgba(0, 1, 31, 0) 25%),
    linear-gradient(90deg, rgba(0, 1, 31, .85) 0%, rgba(0, 1, 31, .55) 45%, rgba(0, 1, 31, .15) 80%),
    linear-gradient(rgba(0, 1, 31, .35), rgba(0, 1, 31, .35)),
    linear-gradient(0deg, var(--night) 0%, rgba(0, 1, 31, .6) 22%, rgba(0, 1, 31, 0) 45%);
}
.hero__content {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  /* bottom room for the requirements block that overlaps the hero */
  padding: 6rem var(--gutter) calc(4rem + 5rem);
}
.hero__title {
  font: 400 clamp(3.75rem, 10vw, 8.5rem)/1 var(--hero);
  text-transform: uppercase; color: var(--brass-hi);
  text-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}
.hero__lead { max-width: 30rem; margin-top: 1.75rem; font-size: 1.15rem; line-height: 1.65; color: var(--bone); text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.5rem; }

@media (max-width: 700px) {
  .hero { min-height: 0; align-items: flex-end; }
  .hero__bg img { object-position: 50% top; }
  .hero::after { background: linear-gradient(0deg, var(--night) 8%, rgba(0, 1, 31, .8) 45%, rgba(0, 1, 31, .3) 100%); }
  .hero__content { padding-top: 14rem; padding-bottom: 2.5rem; }
  .hero__actions .btn { flex: 1 1 100%; }
}

/* Document links */
.docs { border-top: 1px solid rgba(247, 137, 23, .2); border-bottom: 1px solid rgba(247, 137, 23, .2); background: var(--night-2); }
/* columns follow the number of links (4 now, 5 when the Season page returns) */
.docs__inner { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.docs a {
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.25rem 1rem; text-decoration: none;
  border-left: 1px solid rgba(247, 137, 23, .15);
}
.docs a:first-child { border-left: 0; padding-left: 0; }
.docs strong { color: var(--bone); font-family: var(--display); font-size: 1.2rem; font-weight: 400; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.docs span { font-size: .875rem; line-height: 1.35; color: var(--mist); opacity: .8; overflow-wrap: break-word; hyphens: auto; }
.docs a:hover strong { color: var(--brass-hi); }
@media (max-width: 1000px) {
  .docs__inner { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0; }
  .docs a { padding: 1rem; border-left: 0; }
  .docs a:first-child { padding-left: 1rem; }
  .docs a:nth-child(n+3) { border-top: 1px solid rgba(247, 137, 23, .15); }
  .docs a:nth-child(odd) { border-right: 1px solid rgba(247, 137, 23, .15); }
  .docs a:last-child:nth-child(odd) { grid-column: span 2; border-right: 0; }
}

/* Requirements: Skadi on the left, parchment on the right; the section rides up into the fading hero */
.section--req { position: relative; z-index: 1; margin-top: -5rem; padding-top: 0; }
.req { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: stretch; }
.req__portrait { position: relative; min-height: 22rem; }
.req__portrait img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 15%;
  box-shadow: 0 24px 60px rgba(0, 0, 12, .62);
}
@media (max-width: 860px) {
  .section--req { margin-top: 0; padding-top: 1.5rem; }
  .req { grid-template-columns: minmax(0, 1fr); }
  .req__portrait { min-height: 0; aspect-ratio: 4 / 3; }
}

/* Decree — requirements as an in-game parchment */
.decree {
  position: relative;
  font-size: .95rem;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.1rem, 3vw, 2rem);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 235, .55), transparent 60%),
    radial-gradient(ellipse at 0% 100%, rgba(150, 115, 60, .22), transparent 55%),
    radial-gradient(ellipse at 100% 80%, rgba(150, 115, 60, .18), transparent 50%),
    var(--parchment);
  border: 1px solid var(--parchment-edge);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 6px var(--parchment),
    inset 0 0 0 7px rgba(120, 90, 45, .45),
    inset 0 0 60px rgba(120, 90, 45, .25),
    0 24px 60px rgba(0, 0, 12, .58);
}
.decree__title {
  display: flex; align-items: center; gap: 1rem;
  color: #6b4c1f; font-size: clamp(1.4rem, 3vw, 1.85rem); text-align: center;
}
.decree__title::before,
.decree__title::after {
  content: ""; flex: 1; height: 9px;
  background:
    linear-gradient(45deg, transparent 35%, #8a6526 35% 65%, transparent 65%) center / 9px 9px no-repeat,
    linear-gradient(#8a6526, #8a6526) center / 100% 1px no-repeat;
}
.decree__title::before { background-position: right center, center; }
.decree__title::after { background-position: left center, center; }
.decree__intro { text-align: center; margin: .5rem auto 1.25rem; color: var(--ink-soft); max-width: 36rem; }

.decree__list { margin: 0; }
.decree__row {
  display: grid; grid-template-columns: 2.75rem 7.5rem minmax(0, 1fr); gap: 0 1rem; align-items: center;
  padding: .7rem 0;
  border-top: 1px solid rgba(120, 90, 45, .3);
}
.decree__row:first-child { border-top: 0; }
.decree__row img {
  width: 2.75rem; height: 2.75rem; padding: .55rem; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f3e8cc, #d8c497);
  border: 1.5px solid #9b7836;
  box-shadow: 0 0 0 3px var(--parchment), 0 0 0 4px rgba(155, 120, 54, .5);
}
.decree dt { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: #4a3517; }
.decree dd { margin: 0; line-height: 1.5; overflow-wrap: break-word; }
.decree dd b { color: var(--seal); font-weight: 700; }
.titles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 100%), 1fr)); gap: .15rem 1.25rem; }
.titles b { white-space: nowrap; }
.decree__note { margin-top: 1.1rem; text-align: center; font-style: italic; font-weight: 500; color: var(--seal); }

@media (max-width: 640px) {
  .decree__row { grid-template-columns: 3rem minmax(0, 1fr); gap: .35rem 1rem; align-items: start; }
  .decree__row img { width: 3rem; height: 3rem; padding: .6rem; grid-row: span 2; }
  .decree dt { align-self: end; }
}

/* Roles */
.section--rules { background: var(--night-2); }
.rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2.5rem 4rem; align-items: start; }
.rules__head h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
.rules__head p { margin: 1rem 0 1.5rem; max-width: 26rem; }
.rules__head .rules__leader { margin-bottom: 0; font-size: 1.15rem; color: var(--bone); }
.rules__leader b { color: var(--brass-hi); font-weight: 700; }
.roles { margin: 0; }
.roles div { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid rgba(247, 137, 23, .2); }
.roles div:first-child { border-top: 1px solid rgba(247, 137, 23, .2); }
.roles dt { color: var(--mist); }
.roles dd { margin: 0; color: var(--bone); font-weight: 700; text-align: right; }
@media (max-width: 800px) { .rules { grid-template-columns: 1fr; } }

/* Captains: 4 x 4 grid, name above the portrait */
.captains { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; }
.captain h3 { font-size: 1.5rem; margin-bottom: .6rem; }
.captain__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); }
.captain img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 1px solid rgba(247, 137, 23, .45); border-radius: var(--radius);
  transition: border-color .2s, filter .2s;
}
.captain__zoom:hover img { border-color: var(--brass-hi); filter: brightness(1.08); }

/* Lightbox for captain photos */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--bone);
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 1, 20, .92); }
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.lightbox__img {
  width: min(86vw, 78vh, 1200px); aspect-ratio: 1; object-fit: cover;
  border: 1px solid rgba(247, 137, 23, .6); border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 12, .7);
}
.lightbox__name { font: 400 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--display); }
.lightbox__btn {
  position: fixed; z-index: 1;
  width: 3rem; height: 3rem; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 1, 31, .6); color: #fff;
  font: 400 2rem/1 var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .2s, border-color .2s;
}
.lightbox__btn:hover { background: var(--brass); border-color: var(--brass); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .lightbox__prev, .lightbox__next { top: auto; bottom: 1.25rem; transform: none; }
  .lightbox__prev { left: calc(50% - 3.75rem); }
  .lightbox__next { right: calc(50% - 3.75rem); }
}
@media (max-width: 900px) { .captains { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; } }
@media (max-width: 420px) { .captain h3 { font-size: 1.25rem; } }
/* Join */
#kapitany { padding-bottom: 1.5rem; }

/* Main events: square art cut into an isometric cube, like the original site */
.events { padding-top: 1rem; text-align: center; }
.events__title { font-size: clamp(1.9rem, 4.4vw, 3.2rem); }
.events__title .accent { padding-right: .12em; }
.events__list {
  list-style: none; margin: 2.5rem auto 0; padding: 0; max-width: 64rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem);
}
.events__list img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  -webkit-mask: url("../img/cube-mask.svg") center / contain no-repeat;
  mask: url("../img/cube-mask.svg") center / contain no-repeat;
}
@media (max-width: 700px) {
  .events__list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 26rem; }
}
.accent { color: var(--brass); }
.join__video {
  width: 100%; max-width: 56rem; margin-top: 2rem;
  aspect-ratio: 16 / 9; background: #000;
  border: 1px solid rgba(247, 137, 23, .45); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 12, .62);
}
.join__video iframe { display: block; width: 100%; height: 100%; border: 0; }
.join { padding: clamp(2rem, 4vw, 3rem) 0 clamp(4rem, 9vw, 7rem); text-align: center; background: radial-gradient(ellipse at 50% 100%, var(--night-3), var(--night) 70%); }
.join__inner { display: flex; flex-direction: column; align-items: center; }
.join h2 { font-size: clamp(1.9rem, 4.4vw, 3.2rem); text-wrap: balance; }
/* Lobster's slanted T leans into the next glyph, so the question mark needs some room */
.join h2 .accent { padding-right: .22em; }
.join p { margin-top: 1rem; max-width: 34rem; }
.join .hero__actions { justify-content: center; }

/* Footer */
.footer { border-top: 1px solid rgba(247, 137, 23, .2); padding: 2rem 0; font-size: .95rem; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer__brand { display: flex; align-items: center; gap: .6rem; color: var(--bone); }
.footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--brass-hi); }

/* ===== Document pages (Устав, Закон 207 ...) ===== */
.nav__links a[aria-current="page"] { color: var(--brass-hi); }

.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.page-hero__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0, 1, 31, .92), rgba(0, 1, 31, .6)), linear-gradient(0deg, var(--night), rgba(0, 1, 31, 0) 60%);
}
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin-top: .75rem; }
.page-hero h1 .accent { padding-right: .12em; }
.page-hero p { margin-top: 1rem; max-width: 34rem; color: var(--bone); }
.page-hero__back { color: var(--mist); text-decoration: none; font-size: .95rem; }
.page-hero__back::before { content: "‹ "; }
.page-hero__back:hover { color: var(--brass-hi); }

.doc {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem);
  align-items: start; padding-top: 2.5rem; padding-bottom: 4rem;
}
.toc {
  position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto;
  border-left: 2px solid rgba(247, 137, 23, .35); padding-left: 1rem;
}
.toc summary { font: 400 1.35rem/1.2 var(--display); color: var(--bone); cursor: pointer; list-style: none; margin-bottom: .75rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: .3rem 0; color: var(--mist); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.toc a:hover, .toc a.is-active { color: var(--brass-hi); }

.doc__body { max-width: 46rem; overflow-wrap: break-word; }
.doc__body > section > p, .doc__body > section > ul, .doc__body > section > ol, .doc__body .note, .doc__body .terms, .doc__body blockquote { max-width: 40rem; }
.doc__body section { padding-bottom: 2.75rem; margin-bottom: 2.75rem; border-bottom: 1px solid rgba(247, 137, 23, .15); scroll-margin-top: 5.5rem; }
.doc__body h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin-bottom: 1.1rem; }
.doc__body h3 { font-size: 1.35rem; margin: 1.5rem 0 .6rem; }
.doc__body p { margin: 0 0 .9rem; }
.doc__body ul, .doc__body ol { margin: 0 0 1rem; padding-left: 1.4rem; }
.doc__body li { margin-bottom: .45rem; }
.doc__body li::marker { color: var(--brass); }
.doc__body a { color: var(--brass-hi); }
.doc__body strong, .doc__body b { color: var(--bone); }
.doc__body .btn { color: #fff; }
.num { color: var(--brass-hi) !important; margin-right: .25rem; }

.clauses li { padding-left: .3rem; }

.note { margin: 1.25rem 0; padding: 1rem 1.25rem; background: var(--night-2); border-left: 3px solid var(--brass); border-radius: 0 var(--radius) var(--radius) 0; }
.note h3:first-child { margin-top: 0; }
.note p:last-child { margin-bottom: 0; }
.note--strong { color: var(--bone); font-weight: 600; }

.terms { margin: 0; }
.terms div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .25rem 1.25rem; padding: .8rem 0; border-bottom: 1px solid rgba(247, 137, 23, .15); }
.terms dt { color: var(--bone); font-weight: 700; }
.terms dd { margin: 0; }
.roles--doc { margin-bottom: 1.25rem; }
.roles--doc dt { max-width: 30rem; }

.appendix__label { margin: 0 0 .25rem !important; color: var(--brass); font-size: .95rem; }

.portals { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.portals > div { background: var(--night-2); border: 1px solid rgba(247, 137, 23, .2); border-radius: var(--radius); padding: 1rem 1.1rem; }
.portals h3 { margin: 0 0 .6rem !important; font-size: 1.15rem !important; }
.portals ul { list-style: none; padding: 0 !important; margin: 0 !important; }
.portals li { display: flex; justify-content: space-between; gap: .75rem; margin: 0 0 .3rem !important; font-size: .92rem; }
.portals li span { color: var(--bone); font-variant-numeric: tabular-nums; white-space: nowrap; }

.doc__body blockquote { margin: 1.5rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--brass); font-style: italic; color: var(--bone); }
.doc__body blockquote p { margin: 0 0 .4rem; }
.doc__body blockquote footer { font-style: normal; color: var(--mist); font-size: .95rem; }
.doc__body blockquote footer::before { content: "— "; }
.doc__top a { color: var(--mist); }

.docs a[aria-current="page"] strong { color: var(--brass-hi); }

@media (max-width: 900px) {
  .doc { grid-template-columns: minmax(0, 1fr); padding-top: 1.5rem; }
  .toc { position: static; max-height: none; border-left: 0; padding: 1rem 1.25rem; background: var(--night-2); border-radius: var(--radius); }
  .toc summary { margin-bottom: 0; }
  .toc summary::after { content: " ▾"; color: var(--brass); }
  .toc[open] summary { margin-bottom: .75rem; }
  .terms div { grid-template-columns: minmax(0, 1fr); }
}

/* Law page extras */
.doc__body code {
  font: 600 .88em/1 "Shantell Sans", system-ui, sans-serif; color: var(--brass-hi);
  background: rgba(247, 137, 23, .1); border: 1px solid rgba(247, 137, 23, .3);
  padding: .15em .45em; border-radius: 4px; white-space: nowrap;
}
.chips { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { margin: 0 !important; }
.chips code { font-size: 1rem; padding: .4em .8em; }
.steps { counter-reset: step; list-style: none; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding: .55rem 0 .55rem 2.75rem; margin: 0 !important; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: .45rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brass); color: #fff; font-weight: 700; font-size: .95rem;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: .93rem; top: 2.4rem; bottom: -.45rem; width: 2px; background: rgba(247, 137, 23, .35); }
.tg-card {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; align-items: center;
  margin: 1rem 0 2.5rem; padding: 1.5rem; background: var(--night-2);
  border: 1px solid rgba(247, 137, 23, .3); border-radius: var(--radius);
}
.tg-card img { width: 100%; height: auto; border-radius: 10px; }
.tg-card h2 { margin-bottom: .5rem !important; }
@media (max-width: 560px) { .tg-card { grid-template-columns: minmax(0, 1fr); text-align: center; } .tg-card img { max-width: 12rem; margin: 0 auto; } }

/* French puts a narrow no-break space before "?", so the accent needs less extra room */
html[lang="fr"] .join h2 .accent { padding-right: .14em; }

/* German compounds are long: let the browser hyphenate running text and headings */
html[lang="de"] .doc__body, html[lang="de"] h1, html[lang="de"] h2, html[lang="de"] .decree dd, html[lang="de"] .docs span { hyphens: auto; }

/* Skip link: hidden until a keyboard user presses Tab */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .7rem 1.2rem; border-radius: var(--radius);
  background: #fff; color: var(--night); font-weight: 700; text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }
main:focus { outline: none; }

/* 4. Pressed state: a small physical "click" on buttons */
.btn:active, .lightbox__btn:active { transform: translateY(1px) scale(.98); }
.lightbox__prev:active, .lightbox__next:active { transform: translateY(calc(-50% + 1px)) scale(.96); }
.captain__zoom:active img { transform: scale(.985); }
.captain__zoom img { transition: border-color .2s, filter .2s, transform .12s; }
@media (max-width: 700px) {
  .lightbox__prev:active, .lightbox__next:active { transform: translateY(1px) scale(.96); }
}

/* 5. Even line lengths in headings, no lone word on the last line of paragraphs */
h1, h2, h3, .docs strong { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }

/* 9. Flat dark blocks get a soft ambient light and a faint grain, in the site's own colours */
.section--rules,
.section:has(> .wrap > .captains),
.events { position: relative; isolation: isolate; }
.section--rules::before,
.section:has(> .wrap > .captains)::before,
.events::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 70% at 12% 0%, rgba(247, 137, 23, .07), transparent 70%),
    radial-gradient(ellipse 70% 80% at 92% 100%, rgba(60, 80, 190, .16), transparent 70%);
}
.section--rules::after,
.section:has(> .wrap > .captains)::after,
.events::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .04;
  background: 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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
}