/* =========================================================================
   ARMA4.RU — visual system in the spirit of Arma Reforger:
   tactical-map darkness, olive & sand, amber HUD accents, condensed type.
   ========================================================================= */
:root {
    --bg-0: #090b08;
    --bg-1: #10130d;
    --bg-2: #171b12;
    --bg-3: #21261a;
    --fg: #e9e6da;
    --fg-2: #c8c6b8;
    --muted: #8f987e;
    --olive: #7c8a4d;
    --sand: #c9b98a;
    --accent: #f2a03d;
    --accent-2: #ff7a2f;
    --danger: #d9483b;
    --line: rgba(233, 230, 218, .09);
    --line-strong: rgba(233, 230, 218, .18);
    --radius: 4px;
    --container: 1180px;
    --font-display: "Oswald", "Arial Narrow", sans-serif;
    --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
    --cut: 10px; /* corner cut for buttons and cards */
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg-0);
    color: var(--fg);
    font: 17px/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
/* Fine noise grain over everything: kills the flat-digital look. */
body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000; opacity: .045; mix-blend-mode: overlay;
    background-image: 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='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .01em; text-transform: uppercase; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
::selection { background: var(--accent); color: #1b1408; }

/* ---------- Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto; z-index: 50;
    transition: background .35s, border-color .35s, backdrop-filter .35s;
    border-bottom: 1px solid transparent;
    /* Before scrolling the header sits on hero images: keep a soft shade under it. */
    background: linear-gradient(180deg, rgba(9, 11, 8, .78) 0%, rgba(9, 11, 8, .4) 70%, rgba(9, 11, 8, 0) 100%);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.site-header.is-scrolled { background: rgba(9, 11, 8, .82); backdrop-filter: blur(12px); border-color: var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: .06em; color: var(--fg); text-transform: uppercase; }
.brand::before { content: ""; width: 10px; height: 10px; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.brand b { font-weight: inherit; }
.brand span { color: var(--accent); }
.brand:hover { color: var(--fg); }
.nav { display: flex; gap: 26px; margin-left: 12px; overflow-x: auto; scrollbar-width: none; }
.nav a { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--accent); transition: right .3s var(--ease); }
.nav a:hover { color: var(--fg); }
.nav a:hover::after { right: 0; }
.nav__short { display: none; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.user-menu__link { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.user-menu__link:hover { color: var(--fg); }
.user-menu__me { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; }
.avatar { border-radius: 2px; object-fit: cover; background: var(--bg-3); display: inline-grid; place-content: center; font-family: var(--font-display); font-weight: 700; color: var(--accent); }
.avatar--sm { width: 28px; height: 28px; font-size: .9rem; }
.avatar--lg { width: 96px; height: 96px; font-size: 2.6rem; }

main.container { padding-top: 110px; padding-bottom: 72px; min-height: 70vh; }
main.container.has-hero { padding-top: 0; }
/* The hero slides under the fixed header, but a flash above it (e.g. "e-mail not confirmed") must stay below. */
main.container:is(.has-hero, .has-post-hero) > .flash:first-child { margin-top: 84px; }

/* ---------- Buttons ---------- */
.btn {
    position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px;
    font-family: var(--font-display); font-weight: 600; font-size: .95rem; letter-spacing: .1em; text-transform: uppercase;
    color: #1b1408; background: var(--accent); border: 0; cursor: pointer; isolation: isolate;
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transition: transform .2s var(--ease), color .2s;
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--accent-2); transform: translateX(-101%); transition: transform .35s var(--ease); z-index: -1; }
.btn:hover { color: #1b1408; transform: translateY(-1px); }
.btn:hover::before { transform: translateX(0); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost::before { background: rgba(233, 230, 218, .08); }
.btn--ghost:hover { color: var(--fg); }
.btn--sm { padding: 8px 14px; font-size: .9rem; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger::before { background: #b8352a; }
.btn--danger:hover { color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- Hero ---------- */
.hero {
    position: relative; display: grid; align-items: end; overflow: hidden;
    /* Height follows the content (not the viewport), so the gap under the header labels stays the same on tall screens. */
    padding: 190px 0 0; margin: 0 calc(50% - 50vw); /* full-bleed inside the container */
    background: radial-gradient(120% 80% at 70% 20%, #1c2416 0%, var(--bg-0) 60%);
}
.hero__layer { position: absolute; inset: 0; }
.hero__topo { width: 100%; height: 100%; display: block; opacity: .9; }
.hero__field { width: 100%; height: 100%; display: block; opacity: .7; filter: saturate(.7) contrast(1.05); }
.hero__field[hidden] { display: none; }
.hero__grid {
    background-image:
        linear-gradient(rgba(201, 185, 138, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 185, 138, .06) 1px, transparent 1px);
    background-size: 84px 84px; mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 100%);
}
.hero__vignette { background: linear-gradient(180deg, rgba(9, 11, 8, .55) 0%, rgba(9, 11, 8, 0) 30%, rgba(9, 11, 8, .35) 70%, var(--bg-0) 100%); }
.hero__scan { height: 2px; inset: auto 0; top: 0; background: linear-gradient(90deg, transparent, rgba(242, 160, 61, .5), transparent); animation: scan 9s linear infinite; opacity: .6; }
@keyframes scan { from { transform: translateY(0); } to { transform: translateY(100svh); } }
.hero__hud { position: absolute; inset: 92px 24px 24px; pointer-events: none; }
.hero__hud::before, .hero__hud::after, .hero__hud i::before, .hero__hud i::after {
    content: ""; position: absolute; width: 26px; height: 26px; border: 1px solid rgba(201, 185, 138, .45);
}
.hero__hud::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hero__hud::after { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hero__hud i::before { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hero__hud i::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.hero__label { position: absolute; top: 100px; left: 32px; right: 32px; display: flex; justify-content: space-between; gap: 16px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); opacity: .8; }
.hero__label .dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-right: 8px; animation: blink 1.6s steps(2) infinite; vertical-align: 1px; }
@keyframes blink { 50% { opacity: .15; } }
.hero__content { position: relative; z-index: 2; width: min(var(--container), 100%); margin: 0 auto; padding: 0 20px 76px; }
.hero__kicker { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .24em; color: var(--accent); text-transform: uppercase; margin-bottom: 18px; }
.hero__title { font-size: clamp(3.2rem, 9.5vw, 8rem); line-height: .95; margin: 0 0 18px; letter-spacing: -.005em; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub { max-width: 620px; color: var(--fg-2); font-size: 1.15rem; margin-bottom: 30px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line-strong); }
.hero__stat { padding: 16px 28px 0 0; margin-right: 28px; border-right: 1px solid var(--line); }
.hero__stat:last-child { border-right: 0; }
.hero__stat b { display: block; font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1; color: var(--sand); }
.hero__stat small { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* Cursor-following grid readout, bottom right of the hero */
.hero__coords { position: absolute; right: 32px; bottom: 28px; z-index: 3; color: var(--sand); opacity: .75; }
.hero__coords b { font-weight: 500; color: var(--accent); display: inline-block; min-width: 3ch; }

/* "Fold" button, bottom left: folds the hero to a strip so the news start higher (hero-fold.js) */
.hero__fold { position: absolute; left: 32px; bottom: 28px; z-index: 3; background: none; border: 0; padding: 0; cursor: pointer; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sand); opacity: .75; }
.hero__fold:hover { opacity: 1; color: var(--accent); }
.hero__fold[hidden] { display: none; }
/* Folded: a strip under the header with only the button to unfold; the title, the buttons and the ticker repeat the header anyway. */
.hero--folded { padding: 68px 0 0; border-bottom: 1px solid var(--line); }
.hero--folded :is(.hero__layer, .hero__hud, .hero__label, .hero__coords, .hero__tip, .hero__content) { display: none; }
.hero--folded .hero__fold { position: static; justify-self: center; width: min(var(--container), 100%); padding: 14px 20px; text-align: left; }
.hero--folded + .ticker { display: none; }
/* Balloon under the strip, pointing at the unfold button when the hero folded by itself (hero-fold.js); it hangs below
   the strip, so the folded hero lets it overflow (all the layers that need clipping are hidden then). */
.hero--folded { overflow: visible; }
.hero__balloon {
    position: absolute; z-index: 4; top: calc(100% + 12px); left: max(20px, (100% - var(--container)) / 2 + 20px); max-width: calc(100% - 40px);
    display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; background: var(--bg-2); border: 1px solid rgba(201, 185, 138, .4);
    border-left: 2px solid var(--accent); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: balloon-in .5s var(--ease) .2s both;
}
.hero__balloon::before {
    content: ""; position: absolute; top: -6px; left: 18px; width: 10px; height: 10px; background: var(--bg-2);
    border: 1px solid rgba(201, 185, 138, .4); border-right: 0; border-bottom: 0; transform: rotate(45deg);
}
.hero__balloon[hidden] { display: none; }
.hero__balloon button { background: none; border: 0; padding: 0 4px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--muted); }
.hero__balloon button:hover { color: var(--accent); }
@keyframes balloon-in { from { opacity: 0; transform: translateY(6px); } }

/* Card over a unit of the hero battlefield (battlefield.js) */
.hero__tip {
    position: absolute; z-index: 3; pointer-events: none; display: grid; grid-template-columns: auto auto; gap: 2px 14px;
    padding: 8px 10px; min-width: 170px; background: rgba(9, 11, 8, .82); border: 1px solid rgba(201, 185, 138, .4);
    border-left: 2px solid var(--accent); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.hero__tip[hidden] { display: none; }
.hero__tip b { font-weight: 600; font-size: .8rem; color: var(--sand); }
.hero__tip b + span { justify-self: end; }
.hero__tip i { grid-column: 1 / -1; font-style: normal; color: var(--fg-2); margin-bottom: 4px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.hero__tip span:nth-of-type(2n + 1):not(:first-of-type) { color: var(--sand); text-align: right; }
.hero__tip em { grid-column: 1 / -1; font-style: normal; margin-top: 4px; padding-top: 5px; border-top: 1px solid var(--line); }
.hero__tip em.is-alert { color: var(--accent); }
.hero__tip em.is-dead { color: #d9534f; }

/* Ticker of the latest headlines under the hero */
.ticker { margin: 0 calc(50% - 50vw); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-1); overflow: hidden; }
.ticker__track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { padding: 12px 34px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.ticker__item::before { content: "▮ "; color: var(--accent); }
.ticker__item:hover { color: var(--accent); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { margin-top: 84px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); position: relative; }
.section__head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 72px; height: 2px; background: var(--accent); }
.section__index { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .22em; color: var(--accent); text-transform: uppercase; margin-bottom: 8px; }
.section__title { margin: 0; }
.section__title a { color: var(--fg); }
.section__more { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }

.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Cards ---------- */
.card {
    position: relative; display: flex; flex-direction: column; background: var(--bg-2);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    transition: transform .35s var(--ease), background .35s;
}
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .35s; }
.card:hover { transform: translateY(-4px); background: var(--bg-3); }
.card:hover::after { box-shadow: inset 0 0 0 1px rgba(242, 160, 61, .5); }
.card--announcement .card__body::before { content: "Событие"; position: absolute; top: 12px; left: 12px; z-index: 3; padding: 4px 10px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; background: var(--accent); color: #1b1408; }
.card__cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-3); }
.card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; filter: saturate(.85); }
.card:hover .card__cover img { transform: scale(1.06); filter: saturate(1); }
.card__cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 55%, rgba(9, 11, 8, .55) 100%); pointer-events: none; }
/* Amber corner brackets slide in on hover */
.card__cover::after { content: ""; position: absolute; z-index: 2; inset: 10px; pointer-events: none; opacity: 0; transition: opacity .3s;
    background:
        linear-gradient(var(--accent), var(--accent)) top left / 18px 1px no-repeat,
        linear-gradient(var(--accent), var(--accent)) top left / 1px 18px no-repeat,
        linear-gradient(var(--accent), var(--accent)) bottom right / 18px 1px no-repeat,
        linear-gradient(var(--accent), var(--accent)) bottom right / 1px 18px no-repeat; }
.card:hover .card__cover::after { opacity: 1; }

.card__placeholder { display: grid; place-content: center; height: 100%; font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: .12em; color: rgba(233, 230, 218, .08);
    background-image: linear-gradient(rgba(201, 185, 138, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(201, 185, 138, .07) 1px, transparent 1px); background-size: 28px 28px; }
.card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card__meta time { color: var(--sand); }
.post-stats { margin-left: auto; display: inline-flex; gap: 12px; }
.post-stats__item { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.post-stats__item svg { width: 13px; height: 13px; }
.card__title { font-size: 1.3rem; margin: 0; line-height: 1.15; font-weight: 600; }
.card__title a { color: var(--fg); }
.card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.card__lead { margin: 0; color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__countdown { margin-top: auto; padding-top: 10px; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.card__countdown.is-live::before { content: "● "; animation: blink 1.2s steps(2) infinite; }
.tag { position: relative; z-index: 2; color: var(--olive); }
.tag:hover { color: var(--sand); }
.badge { display: inline-block; padding: 3px 9px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; background: var(--bg-3); color: var(--sand); }

.pagination { display: flex; gap: 22px; justify-content: center; align-items: center; margin-top: 40px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Post page ---------- */
.post { max-width: 780px; margin: 0 auto; }
.post__header { margin-bottom: 28px; }
.post__header h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.post__lead { font-size: 1.25rem; color: var(--fg-2); font-weight: 300; }
.post__event { display: inline-block; padding: 10px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; }
.post__cover { margin: 10px 0 30px; clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px)); }
.post__body { font-size: 1.08rem; }
.post__body h2, .post__body h3 { margin-top: 1.6em; }
.post__body img { margin: 18px 0; }
.post__body .video { margin: 22px 0; }
.post__body .video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.post__body figure { margin: 24px 0; }
.post__body figure img { display: block; margin: 0 auto; max-height: 80vh; width: auto; }
.post__body figcaption { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.post__body blockquote { border-left: 3px solid var(--accent); margin: 20px 0; padding: 6px 20px; color: var(--fg-2); font-style: italic; }
.post__body a { text-decoration: underline; text-underline-offset: 3px; }
.post__source { color: var(--muted); font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 36px; }
.post__edits { list-style: none; color: var(--muted); font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; border-top: 1px solid var(--line); padding: 14px 0 0; margin: 36px 0 0; }
.post__source + .post__edits { border-top: 0; padding-top: 0; margin-top: 8px; }
.post__edits li + li { margin-top: 4px; }
.post__footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }
.like { font: 700 1rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; background: transparent; color: var(--fg); border: 1px solid var(--line-strong); padding: 12px 18px; cursor: pointer; transition: border-color .2s, color .2s; }
.like:hover { border-color: var(--accent); }
.like--on { color: var(--accent-2); border-color: var(--accent-2); }
.like__icon { display: inline-block; transition: transform .3s var(--ease); }
.like--on .like__icon { transform: scale(1.25); }
.like:disabled { opacity: .6; }

/* ---------- Forum replies ---------- */
.discussion { max-width: 780px; margin: 56px auto 0; }
.replies { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 12px; }
.reply { background: var(--bg-2); border-left: 2px solid var(--olive); padding: 14px 18px; }
.reply__meta { display: flex; align-items: center; gap: 10px; font-size: .9rem; margin-bottom: 6px; }
.reply__meta a { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; }
.reply__body { font-size: .98rem; }
.reply__body p:last-child { margin-bottom: 0; }
.reply__body img { max-height: 320px; width: auto; }

/* ---------- Flashes, forms ---------- */
.flash { padding: 12px 16px; margin: 0 0 18px; border-left: 3px solid var(--line-strong); background: var(--bg-2); font-size: .95rem; }
.flash--success { border-color: var(--olive); }
.flash--danger { border-color: var(--danger); }
.flash--warning { border-color: var(--accent); }
.form-page { max-width: 460px; margin: 0 auto; }
.form-page--wide { max-width: 680px; }
.form-page h1 { font-size: 2.4rem; }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.form input, .form select, .form textarea { font: 1rem var(--font-body); padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--bg-1); color: var(--fg); border-radius: 0; transition: border-color .2s, box-shadow .2s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(242, 160, 61, .18); }
.form input:disabled { opacity: .6; }
.form fieldset { border: 1px solid var(--line); padding: 14px 18px; display: grid; gap: 12px; }
.form legend { padding: 0 8px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sand); }
.form .check { display: flex; align-items: center; gap: 12px; font: 1rem var(--font-body); text-transform: none; letter-spacing: 0; color: var(--fg); }
.form .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-form { display: inline; margin: 8px 0; }
.social-login { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.social-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.social-list li { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--bg-2); border-left: 2px solid var(--line-strong); }
.social-list li > span:first-child { min-width: 90px; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.subnav { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.subnav a { padding: 10px 0; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid transparent; }
.subnav a.active { color: var(--fg); border-color: var(--accent); }
.profile { display: flex; gap: 28px; align-items: center; }

/* ---------- Empty states ---------- */
.empty { padding: 34px 28px; border: 1px dashed var(--line-strong); color: var(--muted); position: relative; }
.empty::before, .empty::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--sand); }
.empty::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.empty::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.empty__code { color: var(--sand); margin-bottom: 8px; }
.empty__code .dot { display: inline-block; width: 7px; height: 7px; background: var(--accent); margin-right: 8px; animation: blink 1.6s steps(2) infinite; vertical-align: 1px; }
.empty p { margin: 0; }

/* ---------- Error pages ---------- */
.error { text-align: center; padding: 100px 0 60px; }
.error__code { font-family: var(--font-display); font-size: clamp(5rem, 22vw, 12rem); font-weight: 800; line-height: .9; color: transparent; -webkit-text-stroke: 2px var(--accent); letter-spacing: .04em; }
.error__text { color: var(--muted); font-size: 1.2rem; margin: 14px 0 28px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-1); color: var(--muted); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; padding: 26px 20px; }
.site-footer a { color: var(--fg-2); }

/* ---------- Reveal ---------- */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    [data-reveal] { opacity: 1; transform: none; }
    .ticker__track { animation: none; }
}
@media (max-width: 640px) {
    /* No room for the menu next to the logo: it moves to a second row under it. */
    .site-header__inner { flex-wrap: wrap; column-gap: 14px; row-gap: 2px; height: auto; padding-top: 10px; padding-bottom: 6px; }
    /* Six items fit a 360px phone with these and "TS" below; space-between spreads them wider when there is room. */
    .nav { order: 1; flex-basis: 100%; margin-left: 0; gap: 8px; justify-content: space-between; }
    .nav a { letter-spacing: .1em; }
    .user-menu { gap: 12px; }
    .user-menu .btn, .user-menu__me span:not(.avatar) { display: none; }
    .hero { padding-top: 124px; }
    .hero--folded { padding-top: 100px; }
    .hero__fold { left: 20px; }
    main.container:is(.has-hero, .has-post-hero) > .flash:first-child { margin-top: 102px; }
    .hero__label { display: none; }
    .hero__stat { padding-right: 16px; margin-right: 16px; }
}
@media (max-width: 420px) {
    .nav__long { display: none; }
    .nav__short { display: inline; }
}

/* ---------- Featured (first) news on the home page ---------- */
.featured {
    position: relative; display: grid; min-height: 460px; align-items: end; margin-bottom: 22px; overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
    background: var(--bg-2);
}
.featured__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.85); transition: transform 1.2s var(--ease), filter .6s; }
.featured:hover .featured__img { transform: scale(1.04); filter: saturate(1) brightness(.95); }
/* The text sits on the photo: darken the text column on the left and the bottom so any cover stays readable. */
.featured::before { content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, rgba(9, 11, 8, .9) 0%, rgba(9, 11, 8, .78) 45%, rgba(9, 11, 8, .2) 80%, rgba(9, 11, 8, 0) 100%),
                linear-gradient(180deg, rgba(9, 11, 8, 0) 40%, rgba(9, 11, 8, .85) 100%); }
@media (max-width: 640px) { .featured::before { background: linear-gradient(180deg, rgba(9, 11, 8, .45) 0%, rgba(9, 11, 8, .92) 55%); } }
.featured::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px var(--line); }
.featured__body { position: relative; z-index: 2; padding: 32px 36px; max-width: 760px; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.featured__label { display: inline-block; margin-bottom: 14px; padding: 5px 10px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; background: var(--accent); color: #1b1408; }
.featured__title { font-size: clamp(1.7rem, 3.2vw, 2.7rem); margin: 0 0 10px; line-height: 1.05; }
.featured__title a { color: var(--fg); }
.featured__title a::after { content: ""; position: absolute; inset: 0; }
.featured__lead { color: var(--fg-2); max-width: 620px; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured .card__meta { position: relative; z-index: 3; }
.featured .post-stats { margin-left: 0; }
.featured .post-stats__item { color: var(--fg-2); }

/* ---------- Post page: cinematic header ---------- */
.post-hero {
    position: relative; margin: 0 calc(50% - 50vw) 40px; min-height: 68svh; display: grid; align-items: end; overflow: hidden;
    background: var(--bg-1);
}
.post-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); transform: scale(1.02); }
.post-hero::before { content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(9, 11, 8, .8) 0%, rgba(9, 11, 8, .45) 22%, rgba(9, 11, 8, .6) 50%, rgba(9, 11, 8, .88) 75%, var(--bg-0) 95%),
                linear-gradient(90deg, rgba(9, 11, 8, .65) 0%, rgba(9, 11, 8, .35) 55%, rgba(9, 11, 8, 0) 85%); }
.post-hero--plain { min-height: 0; padding-top: 110px; background: radial-gradient(90% 70% at 30% 0%, #1a2015 0%, var(--bg-0) 70%); }
.post-hero--plain::before { display: none; }
.post-hero__inner { position: relative; z-index: 2; width: min(var(--container), 100%); margin: 0 auto; padding: 120px 20px 36px; }
.post-hero__inner .card__meta { margin-bottom: 14px; }
.post-hero__inner h1 { max-width: 900px; font-size: clamp(2rem, 4.6vw, 3.8rem); margin-bottom: 14px; text-shadow: 0 2px 24px rgba(0, 0, 0, .5); }
.post-hero__lead { max-width: 720px; color: var(--fg-2); font-size: 1.2rem; font-weight: 300; margin: 0; }
.post-hero__corner { position: absolute; inset: 96px 24px 24px; pointer-events: none; }
.post-hero__corner::before, .post-hero__corner::after { content: ""; position: absolute; width: 22px; height: 22px; border: 1px solid rgba(201, 185, 138, .4); }
.post-hero__corner::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.post-hero__corner::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.post { padding-top: 0; }
main.container.has-post-hero { padding-top: 0; }

/* ---------- TeamSpeak ---------- */
a.hero__stat { color: inherit; }
a.hero__stat:hover b { color: var(--accent); }
.ts-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin-bottom: 36px; background: var(--line); border: 1px solid var(--line); }
.ts-stat { padding: 18px 20px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; }
.ts-stat b { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; line-height: 1; color: var(--sand); overflow-wrap: anywhere; }
.ts-stat b.mono { font-size: 1rem; color: var(--fg); }
.ts-stat b small { font-size: .55em; color: var(--muted); }
.ts-stat > span { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ts-layout { display: grid; gap: 40px; margin-top: 36px; }
@media (min-width: 1000px) { .ts-layout--split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.ts-tree { list-style: none; margin: 0; padding: 0; }
.ts-tree__item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0 7px calc(var(--depth) * 18px); border-bottom: 1px solid var(--line); color: var(--muted); }
.ts-tree__item.is-active { color: var(--fg); }
.ts-tree__item b { font-family: var(--font-mono); font-size: .8rem; color: var(--accent); }
.ts-tree__item--spacer { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--sand); padding-top: 14px; }
.ts-ranges { display: flex; gap: 14px; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; }
.ts-ranges a { color: var(--muted); }
.ts-ranges a.is-active { color: var(--accent); }
.chart { margin: 0; }
.chart svg { display: block; width: 100%; height: 240px; background: var(--bg-2); }
.chart__grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart__axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted); font-size: .68rem; }

/* ---------- Forum topics on the home page ---------- */
.topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.topics__item { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.topics__title { color: var(--fg); font-size: 1.05rem; }
.topics__title:hover { color: var(--accent); }
.topics__meta { display: flex; gap: 14px; color: var(--muted); font-size: .68rem; }
.topics__meta time { color: var(--sand); }

/* ---------- Squad finder, "Иду" under announcements ---------- */
.squads { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .squads { grid-template-columns: repeat(2, 1fr); } }
.squad { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: 90px; }
.squad:target { box-shadow: inset 0 0 0 1px rgba(242, 160, 61, .5); }
.squad--started { opacity: .7; }
.squad__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.squad__meta time { color: var(--sand); }
.squad__meta [data-countdown] { color: var(--accent); }
.squad__text { margin: 0; overflow-wrap: anywhere; }
.squad__facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .95rem; }
.squad__facts dt { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.squad__facts dd { margin: 0; overflow-wrap: anywhere; }
.squad__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.squad__author { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--fg-2); }
.squad__footer .inline-form { margin: 0; }
.post__attendees { margin-top: 24px; }
.attendees { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.attendees li { display: flex; align-items: center; gap: 8px; color: var(--fg-2); }
