/* PINCERLOCK postcard in the game's Field Ink look (styles.json visual_presets.field_ink):
   hazy field paper, near-black brown pen ink, fine hatching and hairline frames, colour held back (saturation .7). */
@font-face { font-family: "Russo One"; src: url("fonts/RussoOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("fonts/BarlowSemiCondensed-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Golos Text"; src: url("fonts/GolosText-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }

:root {
  /* from the preset: haze #d9cfb3, fog #c7bfa6, lit cloud #faefd4, ink #13100b, sky top #7a8c91, ground #9c9170 */
  --paper: #ddd4bb;
  --paper-2: #cfc6ad;
  --paper-3: #ebe3cc;
  --ink: #13100b;
  --ink-2: #2d2820;
  --text: #2f2a22;
  --muted: #645d4c;
  --slate: #56676c;
  --rust: #8a3a2e;
  --rust-2: #a2483a;
  --good: #44613a;
  --night: #1b1813;
  --night-text: #cfc6ad;
  --night-muted: #9b927d;
  --gap: var(--paper);
  --max: 1180px;
  --hatch: repeating-linear-gradient(135deg, rgba(19,16,11,.045) 0 1px, transparent 1px 7px);
  --hatch-light: repeating-linear-gradient(135deg, rgba(235,227,204,.035) 0 1px, transparent 1px 7px);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .06 0 0 0 0 .04 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0; color: var(--text);
  background: var(--grain), var(--hatch), var(--paper);
  font: 500 18px/1.6 "Barlow SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Barlow has no Cyrillic: the Russian page reads in Golos Text (the game's UI font), a touch smaller. */
html[lang=ru] body { font-family: "Golos Text", "Segoe UI", system-ui, sans-serif; font-size: 17px; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--rust); }
h1, h2, h3, .kicker, .button, .tally b, .navlink, .brand span { font-family: "Russo One", Impact, sans-serif; font-weight: 400; }
h1 { font-size: clamp(30px, 4.3vw, 54px); line-height: 1.06; margin: 8px 0 16px; color: var(--ink); letter-spacing: .3px; }
h2 { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.12; margin: 6px 0 18px; color: var(--ink); }
h3 { font-size: 20px; margin: 0 0 10px; color: var(--ink); }
.kicker { color: var(--rust); text-transform: uppercase; letter-spacing: 3px; font-size: 13px; margin: 0; }
.kicker::before { content: ""; display: inline-block; width: 28px; height: 1px; background: currentColor; vertical-align: middle; margin-right: 10px; }
.center { text-align: center; }
.center.kicker::after { content: ""; display: inline-block; width: 28px; height: 1px; background: currentColor; vertical-align: middle; margin-left: 10px; }
b { font-weight: 600; color: var(--ink); }

/* A pen-drawn frame: a hairline, a paper gap, a second hairline. */
.framed, figure img, figure video, .gallery img, .card, .hero-card {
  border: 1px solid var(--ink);
  box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink);
}

.button {
  display: inline-block; background: var(--ink-2); color: var(--paper-3); text-decoration: none;
  border: 1px solid var(--ink); padding: 12px 22px; font-size: 15px; letter-spacing: 1.5px;
  cursor: pointer; text-transform: uppercase; transition: background .15s, color .15s;
  box-shadow: 0 0 0 3px var(--gap), 0 0 0 4px var(--ink);
}
.button:hover { background: var(--ink); }
.button.primary { background: var(--rust); }
.button.primary:hover { background: var(--rust-2); }
.button.ghost { background: var(--hatch), var(--paper-3); color: var(--ink); }
.button.ghost:hover { background: var(--paper); }
.button.small { padding: 7px 14px; font-size: 13px; box-shadow: none; }
.button:disabled { opacity: .6; cursor: wait; }

/* ---------------- top bar: always dark, always readable */
.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--hatch-light), rgba(19,16,11,.94);
  border-bottom: 1px solid #4a4235;
  backdrop-filter: blur(4px);
}
.top-inner { max-width: var(--max); margin: 0 auto; padding: 9px 24px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; }
.brand span { color: var(--paper-3); font-size: 17px; letter-spacing: 2px; }
.navlink { color: var(--night-text); text-decoration: none; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; padding: 4px 0; border-bottom: 1px solid transparent; }
.navlink:hover { color: #fff; border-bottom-color: var(--rust-2); }
.top .button.small { background: var(--rust); border-color: #000; }
.top .button.small:hover { background: var(--rust-2); }

/* language menu with flags (a <details>, so it works without script) */
.langs { position: relative; }
.langs summary {
  list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  color: var(--paper-3); font: 600 14px "Barlow SC", "Golos Text", sans-serif; letter-spacing: 1px;
  padding: 6px 10px; border: 1px solid #5a5142; background: rgba(235,227,204,.06);
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { border-color: var(--paper-2); }
.langs summary img, .langs li img { border: 1px solid rgba(0,0,0,.4); box-shadow: none; }
.langs summary i { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.langs[open] summary i { transform: rotate(-135deg) translate(-2px, -2px); }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 4px; list-style: none; min-width: 168px;
  background: var(--hatch), var(--paper-3); border: 1px solid var(--ink); box-shadow: 0 0 0 3px var(--paper-3), 0 0 0 4px var(--ink), 0 10px 24px rgba(0,0,0,.35);
}
.langs li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--ink); text-decoration: none; font: 600 15px "Golos Text", "Barlow SC", sans-serif; }
.langs li a:hover { background: var(--paper); }
.langs li a.current { color: var(--rust); }
.langs li a.current::after { content: "✓"; margin-left: auto; }

/* ---------------- hero */
.hero {
  position: relative; min-height: clamp(560px, calc(100vh - 58px), 900px); display: flex; flex-direction: column;
  background: linear-gradient(90deg, rgba(27,24,19,.55), rgba(27,24,19,.08) 60%), url("img/hero.webp") center 42% / cover no-repeat;
  border-bottom: 1px solid var(--ink);
}
.hero-body { position: relative; max-width: var(--max); width: 100%; margin: auto; padding: 40px 24px 70px; }
.hero-card {
  --gap: rgba(221,212,187,.92);
  max-width: 580px; background: var(--grain), var(--hatch), rgba(221,212,187,.92); padding: 24px 28px 28px;
}
.wordmark { width: min(460px, 100%); margin: -2px 0 8px -6px; }
.lead { font-size: 18px; color: var(--text); margin: 0; }
.actions { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 26px; }
.credit { position: absolute; right: 16px; bottom: 10px; margin: 0; font-size: 11px; color: var(--paper-3);
  letter-spacing: 1.5px; text-transform: uppercase; background: rgba(19,16,11,.6); padding: 2px 8px; }
.credit.inline { position: static; margin: 18px auto 0; max-width: var(--max); padding: 0 24px; background: none; color: var(--muted); }
.dark .credit.inline { color: var(--night-muted); }

/* ---------------- range tally */
.tally { background: var(--hatch-light), var(--night); color: var(--night-text); padding: 34px 24px 30px; text-align: center; }
.tally-title { margin: 0 auto 22px; max-width: 760px; color: var(--night-muted); letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; }
.tests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: var(--max); margin: 0 auto; }
.test { display: block; text-decoration: none; color: inherit; border: 1px solid #5a5142; box-shadow: 0 0 0 3px var(--night), 0 0 0 4px #3b3429; padding: 16px 10px 12px; transition: border-color .15s, background .15s; }
.test:hover, .test:focus-visible { border-color: var(--paper-2); background: rgba(235,227,204,.05); outline: none; }
.test .see { display: block; margin-top: 10px; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: #c9685a; }
.test:hover .see { color: #e08374; }
/* the picture or section a range-test box points to lights up on arrival */
figure:target img { animation: arrive 1.6s ease-out 1; }
@keyframes arrive { 0%, 35% { box-shadow: 0 0 0 4px var(--gap), 0 0 0 7px var(--rust-2); } 100% { box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink); } }
section:target h2 { animation: arrive-h 1.6s ease-out 1; }
@keyframes arrive-h { 0%, 35% { color: #e08374; } 100% { color: var(--paper-3); } }
.test h3 { color: var(--paper-3); font-size: 17px; letter-spacing: .5px; }
.tally ul { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; gap: 12px; margin: 0; padding: 0 6px; }
.tally li { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tally b { font-size: 28px; color: var(--paper-3); line-height: 1.1; }
.tally li.red b { color: #c9685a; }
.tally span { color: var(--night-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; line-height: 1.3; }
.tally-note { margin: 20px 0 0; color: var(--night-muted); font-size: 14px; }

/* ---------------- bands */
.band { padding: 86px 0; position: relative; }
.band.paper-2 { --gap: var(--paper-2); background: var(--grain), var(--hatch), var(--paper-2); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.band.dark { --gap: var(--night); background: var(--grain), var(--hatch-light), var(--night); color: var(--night-text); }
.band.dark h2, .band.dark b { color: var(--paper-3); }
.band.dark .kicker { color: #c9685a; }
.band.dark .copy p, .band.dark .points li { color: var(--night-text); }
.band.dark figure img, .band.dark figure video { border-color: #8d846f; box-shadow: 0 0 0 4px var(--night), 0 0 0 5px #8d846f; }
.band.dark figcaption { color: var(--night-muted); }
.split {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: center;
}
.split.reverse { grid-template-columns: 1fr 1.2fr; }
.points { list-style: none; padding: 0; margin: 22px 0 0; }
.points li { position: relative; padding-left: 24px; margin: 0 0 14px; }
.points li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 8px; height: 8px; border: 1px solid currentColor; transform: rotate(45deg); }
.points li b { color: inherit; }
.band:not(.dark) .points li b { color: var(--ink); }
figure { margin: 0; position: relative; }
figcaption { font-size: 15px; color: var(--muted); margin-top: 14px; line-height: 1.45; }
.cutaway figcaption, .compare figcaption {
  position: absolute; right: 10px; bottom: 10px; margin: 0; background: var(--paper-3); color: var(--ink);
  padding: 1px 8px; border: 1px solid var(--ink); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
}
.video video { width: min(100%, 440px); margin: 0 auto; aspect-ratio: 4 / 5; object-fit: cover; }
.video figcaption { text-align: center; }

.frames {
  max-width: var(--max); margin: 64px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.frames.three { grid-template-columns: repeat(3, 1fr); }
.frames figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------------- before / after */
.compare { user-select: none; --pos: 55%; border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink); overflow: hidden; }
.compare img { border: 0; box-shadow: none; }
.compare .after { width: 100%; }
.before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.before-wrap img { width: 100%; height: 100%; }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 1px; margin-left: -.5px; background: var(--ink); pointer-events: none; }
.compare .handle span {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: var(--paper-3); border: 1px solid var(--ink); box-shadow: 0 0 0 3px rgba(235,227,204,.7), 0 0 0 4px var(--ink);
}
.compare .handle span::before, .compare .handle span::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border: 5px solid transparent; }
.compare .handle span::before { left: 4px; border-right-color: var(--ink); }
.compare .handle span::after { right: 4px; border-left-color: var(--ink); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare .tag { position: absolute; top: 10px; background: var(--paper-3); color: var(--ink); border: 1px solid var(--ink); padding: 1px 9px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; pointer-events: none; }
.compare .tag.left { left: 10px; }
.compare .tag.right { right: 10px; color: var(--rust); }

/* ---------------- world */
.gallery { max-width: var(--max); margin: 30px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; }
.features { max-width: var(--max); margin: 54px auto 0; padding: 0 24px; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 34px; }
.features li { padding: 14px 0 14px 18px; border-left: 2px solid var(--rust); border-bottom: 1px solid rgba(19,16,11,.25); }

/* ---------------- updates block */
.updates { border-top: 1px solid var(--ink); }
.update-list { list-style: none; margin: 0; padding: 0; counter-reset: upd; }
.update-list li {
  counter-increment: upd; position: relative; padding: 16px 0 16px 58px;
  border-bottom: 1px solid rgba(19,16,11,.28); color: var(--text);
}
.update-list li:first-child { border-top: 1px solid rgba(19,16,11,.28); }
.update-list li::before {
  content: counter(upd, decimal-leading-zero); position: absolute; left: 0; top: 14px;
  font: 22px "Russo One", sans-serif; color: var(--rust); letter-spacing: 1px;
}
.update-list b { color: var(--ink); }

/* ---------------- subscribe dialog */
body.modal-open { overflow: hidden; }
.modal { padding: 0; border: 0; background: transparent; width: min(600px, calc(100% - 28px)); max-height: calc(100vh - 32px); overflow: visible; }
.modal::backdrop { background: rgba(19,16,11,.74); backdrop-filter: blur(2px); }
.modal .card { --gap: var(--paper-3); position: relative; margin: 6px; max-height: calc(100vh - 44px); overflow: auto; }
.modal h2 { padding-right: 34px; }
.close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%;
  background: var(--paper-3); color: var(--ink); font-size: 15px; line-height: 1; cursor: pointer;
}
.close:hover { color: var(--rust); border-color: var(--rust); }
.card { max-width: 580px; margin: 0 auto; padding: 30px 32px 24px; background: var(--grain), var(--hatch), var(--paper-3); }
form { display: grid; gap: 8px; margin-top: 22px; }
label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 10px; }
input[type=email], input[name=captcha_answer] {
  width: 100%; font: inherit; font-size: 18px; color: var(--ink); background: #f3eddc; border: 1px solid var(--ink);
  border-radius: 0; padding: 11px 14px; outline: none;
}
input:focus { box-shadow: 0 0 0 3px var(--paper-3), 0 0 0 4px var(--rust); }
input.bad { border-color: var(--rust); background: #f0dfd6; }
.captcha { display: grid; grid-template-columns: 210px 44px 1fr; gap: 12px; align-items: center; }
.captcha-img { width: 210px; height: 70px; border: 1px solid var(--ink); background: var(--night); }
.captcha-img svg { display: block; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--ink); background: var(--paper-3); color: var(--ink); font-size: 20px; cursor: pointer; }
.icon:hover { color: var(--rust); }
input[name=captcha_answer] { text-align: center; font-family: "Russo One", sans-serif; letter-spacing: 2px; }
form .button { margin-top: 18px; justify-self: start; }
.status { min-height: 26px; margin: 6px 0 0; font-weight: 600; }
.status.ok { color: var(--good); }
.status.err { color: var(--rust); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fine { font-size: 13px; color: var(--muted); }

footer { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 28px 24px; color: var(--night-muted); background: var(--hatch-light), var(--night); font-size: 14px; }
footer p { margin: 0; max-width: 640px; }

/* ---------------- plain pages (unsubscribe, not found) */
body.plain { min-height: 100vh; display: grid; place-items: center; }
.note { text-align: center; padding: 24px; }
.note img { margin: 0 auto 20px; width: min(420px, 90vw); }

/* ---------------- tablets and phones */
@media (max-width: 1000px) {
  .navlink { display: none; }
}
@media (max-width: 900px) {
  .split, .split.reverse { grid-template-columns: 1fr; gap: 36px; }
  .frames { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .frames.three { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .gallery, .features, .tests { grid-template-columns: 1fr; }
  .band { padding: 60px 0; }
  .hero { background-position: 70% 40%; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  html[lang=ru] body { font-size: 16px; }
  .top-inner { padding: 8px 14px; gap: 10px; }
  .brand span { display: none; }
  .hero { min-height: auto; background: linear-gradient(0deg, rgba(27,24,19,.25), rgba(27,24,19,0)), url("img/hero.webp") 72% 40% / cover no-repeat; }
  .hero-body { padding: 150px 14px 40px; }
  .hero-card { padding: 18px 16px 20px; }
  .actions { gap: 14px; }
  .actions .button { width: 100%; text-align: center; }
  .split, .frames, .gallery, .features { padding: 0 16px; }
  .frames.three { grid-template-columns: 1fr; gap: 26px; }
  .frames { gap: 18px; }
  .frames figcaption { font-size: 14px; }
  .card { padding: 22px 16px 18px; }
  .modal .card { margin: 4px; }
  .update-list li { padding-left: 48px; }
  .captcha { grid-template-columns: 1fr 44px; }
  .captcha-img { width: 100%; max-width: 210px; }
  .captcha input { grid-column: 1 / -1; }
  .tally { padding: 28px 14px 24px; }
  .tally ul { gap: 4px; }
  .tally span { font-size: 11px; letter-spacing: .6px; }
  .tally b { font-size: 24px; }
  .credit.inline { padding: 0 16px; }
  footer { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

/* ---------------- direct contact */
.contact-card { max-width: 600px; }
.telegram-link, .footer-telegram { color: var(--rust); font-weight: 700; text-decoration: none; }
.telegram-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid rgba(19,16,11,.35); }
.telegram-link:hover, .footer-telegram:hover { text-decoration: underline; }
.telegram-icon { display: block; width: 28px; height: 28px; fill: currentColor; }
.contact-email { display: block; width: min(100%, 444px); height: auto; margin-top: 10px; }
footer { flex-wrap: wrap; }
.footer-contact { display: inline-flex; align-items: center; }
.footer-telegram { display: inline-flex; align-items: center; gap: 8px; color: var(--paper-3); }
.footer-telegram .telegram-icon { width: 34px; height: 34px; }
@media (max-width: 560px) {
  .footer-contact { justify-content: center; }
}

/* ---------------- encyclopedia */
.navlink.current { color: #fff; border-bottom-color: var(--rust-2); }
.ency-head { padding: 64px 0 56px; border-bottom: 1px solid var(--ink); background: var(--grain), var(--hatch), var(--paper-3); }
.ency-head-inner { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.ency-head .lead { max-width: 760px; }
.ency-head.article .ency-head-inner { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.ency-head h1 { font-size: clamp(40px, 6vw, 76px); margin-bottom: 6px; }
.subtitle { margin: 0 0 18px; color: var(--slate); font-size: 17px; letter-spacing: .3px; }
.crumbs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--rust); }
.art figcaption, .versions figcaption.tagged {
  position: absolute; right: 10px; bottom: 10px; margin: 0; background: var(--paper-3); color: var(--ink);
  padding: 1px 8px; border: 1px solid var(--ink); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
}

.ency-list-band { padding-top: 56px; }
.ency-grid { max-width: var(--max); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.ency-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--text);
  background: var(--grain), var(--hatch), var(--paper-3);
  border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink); transition: background .15s;
}
.ency-card img { border: 0; border-bottom: 1px solid var(--ink); box-shadow: none; aspect-ratio: 3 / 2; object-fit: cover; }
.ency-card-media { position: relative; }
.ency-card-media img { width: 100%; }
.image-label {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px;
  background: var(--paper-3); border: 1px solid var(--ink); color: var(--ink);
  font-size: 10px; line-height: 1.5; letter-spacing: 1px; text-transform: uppercase;
}
.ency-card-body { display: block; padding: 18px 20px 20px; }
.ency-card h2 { font-size: 28px; margin: 4px 0 8px; }
.ency-card-nation { color: var(--rust); text-transform: uppercase; letter-spacing: 2px; font-size: 12px; }
.ency-card-text { display: block; color: var(--muted); font-size: 16px; line-height: 1.45; }
.ency-card .see { display: block; margin-top: 14px; font: 13px "Russo One", sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: var(--rust); }
a.ency-card:hover { background: var(--grain), var(--hatch), #f3eddc; }
a.ency-card:hover .see { color: var(--rust-2); }
.ency-card.soon { border-style: dashed; box-shadow: none; }
.ency-card.soon h2 { color: var(--muted); }

.facts { padding: 26px 24px; }
.facts ul { max-width: var(--max); margin: 0 auto; grid-template-columns: repeat(5, 1fr); }
.facts b { font-size: 24px; white-space: nowrap; }

.manual {
  margin: 0; padding: 22px 26px 18px 54px; background: var(--grain), var(--hatch), var(--paper-3);
  border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink); position: relative;
}
.manual::before { content: "\201C"; position: absolute; top: 12px; left: 16px; font: 56px/1 Georgia, serif; color: var(--rust); }
.manual p[lang=de] { margin: 0 0 4px; font: italic 500 19px/1.45 Georgia, "Times New Roman", serif; color: var(--ink); }
.manual .tr { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.manual cite { display: block; font-style: normal; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--slate); border-top: 1px solid rgba(19,16,11,.25); padding-top: 10px; }
.manual.narrow { max-width: 820px; margin: 56px auto 0; }
.paper-2 .manual { --gap: var(--paper-2); }

.intro { max-width: 820px; margin: 0 auto; padding: 0 24px; text-align: center; }
.versions { max-width: var(--max); margin: 40px auto 0; padding: 0 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.versions img { aspect-ratio: 3 / 2; object-fit: cover; }
.table-wrap { max-width: 980px; margin: 48px auto 0; padding: 0 24px; overflow-x: auto; }
.spec { width: 100%; border-collapse: collapse; background: var(--grain), var(--paper-3); border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink); }
.spec th, .spec td { padding: 10px 16px; text-align: left; border-bottom: 1px solid rgba(19,16,11,.2); vertical-align: top; }
.spec thead th { font: 15px "Russo One", sans-serif; letter-spacing: 1px; color: var(--paper-3); background: var(--ink-2); border-bottom: 1px solid var(--ink); }
.spec tbody th { width: 26%; font-weight: 600; color: var(--ink); font-size: 15px; }
.spec td { width: 37%; }
.spec tbody tr:nth-child(even) { background: rgba(19,16,11,.035); }
.spec tbody tr:last-child th, .spec tbody tr:last-child td { border-bottom: 0; }

.plans { display: grid; gap: 18px; }
.plans img { background: rgba(235,227,204,.03); padding: 10px; }
.band.dark .plans figcaption { color: var(--night-muted); }
.portrait { width: min(100%, 420px); margin: 0 auto; aspect-ratio: 4 / 5; object-fit: cover; }
#game .frames figure img { aspect-ratio: 4 / 5; }
.band.dark .button.ghost { background: transparent; color: var(--paper-3); border-color: #8d846f; box-shadow: 0 0 0 3px var(--night), 0 0 0 4px #8d846f; }
.band.dark .button.ghost:hover { background: rgba(235,227,204,.08); }

.sources { border-top: 1px solid var(--ink); }
.narrow-col { max-width: 820px; margin: 0 auto; padding: 0 24px; }
.source-list { list-style: none; padding: 0; margin: 20px 0; }
.source-list li { padding: 12px 0 12px 18px; border-left: 2px solid var(--rust); border-bottom: 1px solid rgba(19,16,11,.2); margin-bottom: 6px; }

@media (max-width: 1000px) {
  .navlink.keep { display: inline; }
}
@media (max-width: 900px) {
  .ency-head.article .ency-head-inner { grid-template-columns: 1fr; gap: 32px; }
  .ency-grid { grid-template-columns: 1fr 1fr; }
  .versions { grid-template-columns: 1fr; }
  .facts ul { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
}
@media (max-width: 560px) {
  .ency-head { padding: 40px 0 36px; }
  .ency-head-inner, .ency-grid, .versions, .table-wrap, .intro, .narrow-col { padding: 0 16px; }
  .ency-grid { grid-template-columns: 1fr; }
  .facts ul { grid-template-columns: repeat(2, 1fr); }
  .facts b { font-size: 20px; }
  .spec th, .spec td { padding: 8px 10px; font-size: 15px; }
  .manual { padding: 18px 16px 14px 42px; }
  .manual::before { left: 10px; font-size: 44px; }
  .navlink.keep { font-size: 12px; letter-spacing: 1px; }
  .top .nav-contact { display: none; }
}
/* the emblem keeps its size when the bar is full (an image in a flex item would shrink to nothing) */
.brand, .brand img { flex-shrink: 0; }
@media (max-width: 560px) {
  .brand img { width: 32px; height: 32px; }
}

/* ---------------- encyclopedia article: the menu on the right, the 3D model, the ballistics tables */
.ency-body { position: relative; }
.ency-toc {
  --gap: var(--paper-3);
  background: var(--grain), var(--hatch), var(--paper-3); border-bottom: 1px solid var(--ink);
  font: 600 14px "Barlow SC", "Golos Text", sans-serif;
}
.ency-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.ency-toc li { counter-increment: toc; }
.ency-toc a { color: var(--text); text-decoration: none; }
.ency-toc a:hover { color: var(--rust); }
.ency-toc a.active { color: var(--rust); }
.toc-title { margin: 0 0 12px; font: 12px "Russo One", sans-serif; letter-spacing: 2.5px; text-transform: uppercase; color: var(--rust); }
.toc-back { display: inline-block; margin-top: 18px; font-size: 13px; color: var(--muted) !important; }
.toc-back:hover { color: var(--rust) !important; }

@media (min-width: 1200px) {
  .ency-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; }
  .ency-main { grid-column: 1; grid-row: 1; min-width: 0; }
  .ency-toc {
    grid-column: 2; grid-row: 1; position: sticky; top: 59px; align-self: start;
    height: calc(100vh - 59px); overflow-y: auto; padding: 34px 22px 24px 24px;
    border-bottom: 0; border-left: 1px solid var(--ink); box-shadow: inset 4px 0 0 var(--gap), inset 5px 0 0 var(--ink);
  }
  .ency-toc li a { display: block; position: relative; padding: 7px 0 7px 34px; border-bottom: 1px solid rgba(19,16,11,.14); line-height: 1.3; }
  .ency-toc li a::before {
    content: counter(toc, decimal-leading-zero); position: absolute; left: 0; top: 8px;
    font: 12px "Russo One", sans-serif; letter-spacing: 1px; color: var(--muted);
  }
  .ency-toc li a.active::before, .ency-toc li a:hover::before { color: var(--rust); }
  .ency-toc li a.active { padding-left: 34px; box-shadow: inset 2px 0 0 transparent; }
  .ency-toc li a.active::after { content: ""; position: absolute; left: -24px; top: 6px; bottom: 6px; width: 3px; background: var(--rust); }
}
@media (max-width: 1199px) {
  .ency-toc { position: sticky; top: 57px; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 8px 24px; overflow-x: auto; scrollbar-width: none; }
  .ency-toc::-webkit-scrollbar { display: none; }
  .toc-title, .toc-back { display: none; }
  .ency-toc ol { display: flex; gap: 6px; white-space: nowrap; }
  .ency-toc li a { display: block; padding: 4px 10px; border: 1px solid transparent; font-size: 13px; }
  .ency-toc li a.active { border-color: var(--rust); background: rgba(138,58,46,.07); }
  html { scroll-padding-top: 110px; }
}
@media (min-width: 1200px) { html { scroll-padding-top: 76px; } }

.model-band { padding-top: 70px; }
.model-wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 1fr 1.7fr; gap: 44px; align-items: center; }
.model-pick { display: flex; gap: 12px; margin: 22px 0 6px; }
.model-pick .button { background: var(--hatch), var(--paper-3); color: var(--ink); box-shadow: 0 0 0 3px var(--gap), 0 0 0 4px var(--ink); }
.model-pick .button.current { background: var(--ink-2); color: var(--paper-3); }
.viewer { position: relative; }
model-viewer {
  display: block; width: 100%; height: clamp(320px, 36vw, 470px);
  background: radial-gradient(ellipse at 50% 62%, #f3eddc 0%, var(--paper-3) 45%, var(--paper-2) 100%);
  border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--gap), 0 0 0 5px var(--ink);
  --poster-color: transparent;
}
model-viewer:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }
model-viewer .model-poster { position: relative; width: 100%; height: 100%; }
.model-poster img { width: 100%; height: 100%; object-fit: contain; border: 0; box-shadow: none; }
model-viewer:not(:defined) .viewer-progress, .model-pick[hidden] { display: none; }
.viewer:not(.loaded) > figcaption { display: none; }
.viewer figcaption {
  position: absolute; right: 10px; bottom: 10px; margin: 0; background: var(--paper-3); color: var(--ink);
  padding: 1px 8px; border: 1px solid var(--ink); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; pointer-events: none;
}
.viewer-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(19,16,11,.12); }
.viewer-progress span { display: block; height: 100%; width: var(--progress, 0%); background: var(--rust); transition: width .2s; }
.viewer-progress.done { display: none; }

.narrow-col.wide { max-width: 980px; }
.table-wrap.flush { padding: 0; margin: 30px 0 0; max-width: none; }
.spec caption { caption-side: top; text-align: left; padding: 0 0 10px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.spec.ballistic th, .spec.ballistic td { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spec.ballistic thead tr:last-child th { font: 600 13px "Barlow SC", "Golos Text", sans-serif; letter-spacing: .5px; color: var(--paper-2); background: #3a342a; }
.spec.ballistic thead th[scope=colgroup] { border-left: 1px solid #5a5142; }
.spec.ballistic tbody th { width: auto; text-align: left; }
.spec.ballistic td:nth-child(5) { border-left: 1px solid rgba(19,16,11,.25); }
.spec.ballistic td:nth-child(4), .spec.ballistic td:nth-child(7) { font-weight: 600; color: var(--ink); }
.spec.rounds tbody th { width: 30%; }
#ballistics .points { margin-top: 28px; }

@media (max-width: 900px) {
  .model-wrap { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .model-wrap { padding: 0 16px; }
  .spec.ballistic th, .spec.ballistic td { padding: 7px 8px; font-size: 14px; }
  .ency-toc { padding: 6px 12px; }
}
.spec.ballistic { table-layout: fixed; }
.spec.ballistic thead tr:first-child th:first-child { width: 16%; }
.spec.ballistic { min-width: 560px; }
@media (max-width: 560px) {
  .top .button.small { padding: 6px 9px; font-size: 12px; letter-spacing: 1px; }
  .langs summary { padding: 5px 7px; gap: 6px; }
}
@media (max-width: 400px) {
  .langs summary span { display: none; }
  .top-inner { gap: 8px; }
}
.facts { padding: 24px 24px 22px; }
.facts .fact-icon { width: 52px; height: 52px; margin: 0 auto 8px; border: 0; box-shadow: none; }
.facts li { gap: 2px; }
@media (max-width: 560px) { .facts .fact-icon { width: 36px; height: 36px; margin-bottom: 4px; } }
/* a still of the 3D model: its own paper behind it, like the live viewer */
.art.still img { background: radial-gradient(ellipse at 50% 62%, #f3eddc 0%, var(--paper-3) 45%, var(--paper-2) 100%); }
.plans.single img { background: var(--ink-2); padding: 14px; }
.band:not(.dark) .plans.single figcaption { color: var(--muted); }
.spec.single-col tbody th { width: 34%; }
.spec.rounds.three tbody th { width: 22%; }
.spec.ballistic.he { min-width: 0; max-width: 520px; }
.armour-table .fine { color: var(--night-muted); }
.spec.dark-spec { background: rgba(235,227,204,.04); border-color: #8d846f; box-shadow: 0 0 0 4px var(--night), 0 0 0 5px #8d846f; color: var(--night-text); }
.spec.dark-spec tbody th { color: var(--paper-3); width: 40%; }
.spec.dark-spec th, .spec.dark-spec td { border-bottom-color: rgba(235,227,204,.12); }
.spec.dark-spec tbody tr:nth-child(even) { background: rgba(235,227,204,.03); }
.spec.dark-spec thead th { background: #3a342a; }
.paper-still, .ency-card img[src*="-card"] { background: radial-gradient(ellipse at 50% 62%, #f3eddc 0%, var(--paper-3) 45%, var(--paper-2) 100%); }
.plans img.paper-still { padding: 0; background: radial-gradient(ellipse at 50% 62%, #f3eddc 0%, var(--paper-3) 45%, var(--paper-2) 100%); }

/* ---------------- encyclopedia chapters: by nation, then by unit type */
.chapter { max-width: var(--max); margin: 0 auto 64px; padding: 0 24px; }
.chapter:last-child { margin-bottom: 0; }
.chapter-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
.chapter-head h2 { margin: 0; font-size: clamp(26px, 3vw, 36px); }
.chapter-head img { border: 0; box-shadow: none; }
.chapter-count { margin-left: auto; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.chapter-type { padding-top: 26px; }
.chapter-type h3 { font-size: 15px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--rust); margin: 0 0 18px; }
.chapter-type .ency-grid { padding: 0; }
.ency-card h4 { font: 26px "Russo One", sans-serif; color: var(--ink); margin: 2px 0 8px; }
.soon-title { display: block; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; }
.ency-card.soon { min-height: 0; }
.crumbs a { white-space: nowrap; }
@media (min-width: 1200px) {
  .chapters-toc li.toc-nation a { font: 14px "Russo One", sans-serif; letter-spacing: .5px; padding-left: 0; margin-top: 10px; border-bottom: 1px solid rgba(19,16,11,.3); }
  .chapters-toc li.toc-type a { padding: 5px 0 5px 16px; font-size: 13px; border-bottom: 0; }
  .chapters-toc li a::before { content: none !important; }
  .chapters-toc li.toc-nation a.active::after, .chapters-toc li.toc-type a.active::after { left: -24px; }
}
@media (max-width: 560px) {
  .chapter { padding: 0 16px; margin-bottom: 48px; }
}
.manual.after-plan { margin-top: 34px; }
.spec.rounds.three { table-layout: fixed; }
.spec.rounds.three thead th:first-child { width: 22%; }
.versions.three { grid-template-columns: repeat(3, 1fr); }
.spec.three-versions tbody th { width: 22%; }
.spec.three-versions { table-layout: fixed; }
.spec.dark-spec small { color: var(--night-muted); font-size: 12px; }
.frames.three figure img.paper-still { aspect-ratio: 4 / 5; object-fit: contain; }
@media (max-width: 900px) { .versions.three { grid-template-columns: 1fr; } }
.frames.two { grid-template-columns: repeat(2, minmax(0, 360px)); justify-content: center; }
@media (max-width: 560px) { .frames.two { grid-template-columns: 1fr; } }
.spec.ballistic.guns3 td:nth-child(4), .spec.ballistic.guns3 td:nth-child(7) { font-weight: inherit; color: inherit; }
.spec.ballistic.guns3 td:nth-child(5) { border-left: 0; }
.spec.ballistic.guns3 td:nth-child(2), .spec.ballistic.guns3 td:nth-child(4), .spec.ballistic.guns3 td:nth-child(6) { border-left: 1px solid rgba(19,16,11,.25); }
.spec.ballistic.guns3 td:nth-child(3), .spec.ballistic.guns3 td:nth-child(5), .spec.ballistic.guns3 td:nth-child(7) { font-weight: 600; color: var(--ink); }
@media (max-width: 700px) {
  .spec.three-versions, .spec.rounds.three { min-width: 600px; }
  .spec.three-versions tbody th, .spec.rounds.three tbody th { font-size: 14px; }
}
.spec.two-versions { table-layout: fixed; }
.spec.two-versions tbody th { width: 26%; }
@media (max-width: 700px) { .spec.two-versions { min-width: 520px; } }
