/* ============================================================
   Deadlock Patch Tracker — design system
   ============================================================ */
:root {
    --bg: #0a0c0b;
    --surface: rgba(16, 21, 19, 0.78);
    --surface-hover: rgba(127, 255, 212, 0.04);
    --border: rgba(127, 255, 212, 0.14);
    --border-strong: rgba(127, 255, 212, 0.35);
    --accent: #7fffd4;
    --accent-dim: rgba(127, 255, 212, 0.65);
    --accent-glow: rgba(127, 255, 212, 0.25);
    --text: #e8f0ec;
    --text-dim: #93a89e;
    --buff: #4ade80;
    --nerf: #f87171;
    --change: #fbbf24;
    --fix: #60a5fa;
    --new: #ff4d4d;
    --font-display: 'ValvePulp', 'Segoe UI', sans-serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    --nav-h: 68px;
}

@font-face {
    font-family: 'ValvePulp';
    src: url('../fonts/valvepulp-bold.ttf') format('truetype');
    font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    padding-top: var(--nav-h);
}

a { color: inherit; text-decoration: none; }

/* ---------- scrollbars (site-wide, slim + smooth) ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(127, 255, 212, 0.28) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(127, 255, 212, 0.22);
    border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(127, 255, 212, 0.45); }

/* ---------- fixed background layer (scales with any window) ---------- */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}
.page-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(10, 12, 11, 0.62) 0%,
        rgba(10, 12, 11, 0.82) 55%,
        rgba(10, 12, 11, 0.97) 100%);
}

/* ---------- nav ---------- */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 40px;
    background: rgba(10, 12, 11, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    /* safety net: if content still doesn't fit at some width, let it scroll instead
       of silently cutting off the right side (the info button) with no way to reach it */
    overflow-x: auto;
    overflow-y: hidden;
}
nav .logo { height: 2.6em; width: auto; display: block; }
nav .logo:hover { filter: drop-shadow(0 0 8px var(--accent-glow)); }
nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 0 24px;
    padding: 0;
    list-style: none;
}
nav ul a {
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.04em;
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-dim);
    transition: color 0.15s ease, background 0.15s ease;
}
nav ul a:hover { color: var(--accent); background: var(--surface-hover); }
nav ul a.active {
    color: var(--accent);
    text-shadow: 0 0 14px var(--accent-glow);
}

/* ---------- layout ---------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 36px 0 20px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 44px);
    margin: 0;
    letter-spacing: 0.03em;
}
.page-header .spacer { flex: 1; }

/* ---------- panels / cards ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ---------- badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-strong);
    color: var(--accent);
}
.badge.latest {
    background: rgba(127, 255, 212, 0.12);
    box-shadow: 0 0 12px var(--accent-glow);
}
.badge.type-hero_release {
    color: #ffd166;
    border-color: rgba(255, 209, 102, 0.5);
}
.badge.type-balance, .badge.type-update {
    color: var(--text-dim);
    border-color: rgba(255, 255, 255, 0.16);
}

/* ---------- tag chips ---------- */
.chip {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-radius: 5px;
    font-weight: 700;
}
.chip-buff   { color: var(--buff);   background: rgba(74, 222, 128, 0.12); }
.chip-nerf   { color: var(--nerf);   background: rgba(248, 113, 113, 0.12); }
.chip-change { color: var(--change); background: rgba(251, 191, 36, 0.12); }
.chip-rework { color: var(--change); background: rgba(251, 191, 36, 0.12); }
.chip-fix    { color: var(--fix);    background: rgba(96, 165, 250, 0.12); }
.chip-neutral { color: var(--text-dim); background: rgba(255, 255, 255, 0.06); }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- change rows ---------- */
ul.change-list {
    list-style: none;
    margin: 2px 0 12px;
    padding: 0;
}
.change {
    display: flex;
    gap: 9px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}
.change:hover { background: var(--surface-hover); }
.change .text { flex: 1; }

/* ---------- patch card internals ---------- */
.patch-card { padding: 22px 26px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.patch-card + .patch-card { margin-top: 18px; }

.card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.card-head .head-main { flex: 1; min-width: 0; }
.card-head .badges { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head h2.headline {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.4vw, 28px);
    margin: 0 0 4px;
    letter-spacing: 0.02em;
}
.card-head .meta {
    font-size: 13px;
    color: var(--text-dim);
}

/* collapsible body */
.card-body {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.35s ease;
}
.card-body > .card-body-inner { overflow: hidden; min-height: 0; }
.collapsed .card-body { grid-template-rows: 0fr; }
.toggle-btn {
    flex: 0 0 auto;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent-dim);
    width: 34px; height: 34px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.15s ease;
}
.toggle-btn:hover { border-color: var(--border-strong); }
.collapsed .toggle-btn { transform: rotate(-90deg); }

/* sections inside a patch body */
.sect { margin-top: 18px; }
.sect-title {
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-dim);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
/* hero changes: boxed cards flowing masonry-style into two columns */
.hero-cols {
    columns: 2 340px;
    column-gap: 14px;
}
.hero-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px 8px;
    margin-bottom: 14px;
    break-inside: avoid;
}
.hero-block .hero-line {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--border-strong);
    border-radius: 0;
    padding: 0 0 8px 0;
    margin: 0 0 8px;
}
.hero-block .hero-line:hover { background: none; }
.hero-block .hero-line:hover .name { color: var(--accent); }
.hero-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 6px;
    padding: 3px 10px 3px 3px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.hero-line:hover { background: var(--surface-hover); }
.hero-line img {
    width: 30px; height: 30px;
    border-radius: 6px;
    object-fit: cover;
}
.hero-line .name {
    font-family: var(--font-display);
    font-size: 17px;
    letter-spacing: 0.03em;
}
.ability-name, .item-name {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 8px 0 2px;
}
.item-name { color: var(--text); font-size: 13px; }

/* changed-heroes icon strip (home) */
.changed-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.changed-strip a img {
    width: 42px; height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.changed-strip a:hover img {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* ---------- dropdown ---------- */
.dd { position: relative; flex: 0 0 auto; }
.dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(10, 12, 11, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease;
    max-width: 260px;
    white-space: nowrap;
}
.dd-btn:hover { border-color: var(--border-strong); }
.dd-btn .dd-label { overflow: hidden; text-overflow: ellipsis; }
.dd-btn .dd-caret { color: var(--accent-dim); font-size: 10px; transition: transform 0.2s ease; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 280px;
    max-height: 340px;
    overflow-y: auto;
    background: #0e1211;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
    z-index: 60;
    display: none;
    padding: 6px;
}
.dd.open .dd-list { display: block; }
.dd-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
}
.dd-item:hover { background: var(--surface-hover); }
.dd-item.active { color: var(--accent); background: rgba(127, 255, 212, 0.07); }
.dd-item .sub { font-size: 11px; color: var(--text-dim); flex: 0 0 auto; }

/* ---------- home ---------- */
.home-banner {
    position: relative;
    height: clamp(260px, 44vh, 460px);
    margin-top: calc(-1 * var(--nav-h));
    background-image: url('../Title_screen.webp');
    background-size: cover;
    background-position: center 25%;
    display: flex;
    align-items: flex-end;
}
.home-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(10, 12, 11, 0.35) 0%,
        rgba(10, 12, 11, 0.1) 45%,
        var(--bg) 100%);
}
.home-banner .banner-text {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 26px;
}
.home-banner h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 58px);
    margin: 0;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}
.home-banner p {
    margin: 6px 0 0;
    color: var(--text-dim);
    font-size: clamp(13px, 1.4vw, 16px);
    letter-spacing: 0.05em;
}
.wip-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 99px;
    color: #fbbf24;
    font-size: 12px;
    letter-spacing: 0.02em;
    max-width: 480px;
}
.wip-badge b { font-style: normal; }
.home-main {
    max-width: 1150px;
    margin: 28px auto 60px;
    padding: 0 40px;
}

/* ---------- patches page ---------- */
.patches-main { max-width: 1200px; margin: 0 auto 60px; padding: 0 40px; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 6px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--border);
}
.timeline .patch-card { position: relative; }
.timeline .patch-card::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 30px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent-dim);
}
.timeline .patch-card.flash {
    border-color: var(--border-strong);
    box-shadow: 0 0 24px var(--accent-glow);
}

/* ---------- heroes page ---------- */
.heroes-main { margin: 0 auto 60px; }
.search-box {
    background: rgba(10, 12, 11, 0.6);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 9px 14px;
    width: 220px;
    outline: none;
    transition: border-color 0.15s ease;
}
.search-box:focus { border-color: var(--border-strong); }
.search-box::placeholder { color: var(--text-dim); }

.heroes-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px 14px;
    padding: 10px 0 40px;
}
.hero-tile {
    width: 104px;
    position: relative;
    cursor: pointer;
    text-align: center;
    transition: transform 0.18s ease;
}
.hero-tile:hover { transform: translateY(-5px) scale(1.06); z-index: 2; }
.hero-tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    display: block;
}
.hero-tile:hover img {
    border-color: var(--border-strong);
    box-shadow: 0 6px 20px var(--accent-glow);
}
.hero-tile p {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.05em;
    margin: 6px 0 0;
    color: var(--text-dim);
    transition: color 0.18s ease;
}
.hero-tile:hover p { color: var(--accent); }
.new-pill {
    position: absolute;
    top: -7px; right: -7px;
    background: var(--new);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 99px;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.55);
    pointer-events: none;
}

/* ---------- hero detail page ---------- */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr auto;
    gap: 24px;
    height: calc(100vh - var(--nav-h));
    padding: 16px 0 16px 40px;
    overflow: hidden;
}
.hero-history {
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    padding-bottom: 8px;
}
.hero-history .patch-card { padding: 18px 20px; }
.hero-history h2.headline { font-size: 19px; }

/* center column: near-fullscreen render with the hero's wordmark overlaid at the bottom */
.hero-feature {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 0;
}
.render-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-feature img.render {
    /* explicit viewport-based height: always fits top-to-bottom on any monitor */
    height: calc(100vh - var(--nav-h) - 40px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.7));
}
.name-plate {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: min(64%, 440px);
    pointer-events: none;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 24px var(--accent-glow));
}

/* right rail: flush against the right wall, two icons per row, ~75% height centered */
.hero-rail {
    height: 75%;
    align-self: center;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 64px);
    gap: 10px;
    align-content: start;
    padding: 4px 10px 8px 4px;
}

/* home page variant: fixed to the right edge, vertically centered */
.home-rail {
    position: fixed;
    right: 0;
    top: calc(var(--nav-h) + (100vh - var(--nav-h)) / 2);
    transform: translateY(-50%);
    height: calc((100vh - var(--nav-h)) * 0.75);
    align-self: auto;
    z-index: 5;
}
@media (max-width: 1500px) {
    .home-rail { grid-template-columns: 64px; }
}
.hero-rail a {
    position: relative;
    display: block;
}
.hero-rail img {
    width: 64px; height: 64px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    opacity: 0.75;
    transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.hero-rail a:hover img { opacity: 1; transform: scale(1.1); border-color: var(--border-strong); }
.hero-rail a.active img {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.hero-rail .rail-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--new);
    box-shadow: 0 0 6px rgba(255, 77, 77, 0.8);
}

.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 15px;
}

/* ---------- items (coming soon) ---------- */
.coming-soon {
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 24px;
}
.coming-soon h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 72px);
    letter-spacing: 0.08em;
    margin: 0;
}
.coming-soon .accent-bar {
    width: 90px; height: 3px;
    margin: 18px auto;
    background: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
    border-radius: 2px;
}
.coming-soon p {
    color: var(--text-dim);
    font-size: 16px;
    letter-spacing: 0.06em;
    margin: 0;
}

/* ---------- info button + about modal ---------- */
.info-btn {
    margin-left: auto;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(10, 12, 11, 0.6);
    color: var(--accent-dim);
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.info-btn:hover {
    color: var(--accent);
    border-color: var(--border-strong);
    box-shadow: 0 0 12px var(--accent-glow);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 7, 6, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: modal-fade 0.18s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    position: relative;
    max-width: 460px;
    width: 100%;
    background: #0e1211;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    padding: 30px 32px 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    animation: modal-rise 0.22s ease;
}
@keyframes modal-rise {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 0.03em;
    margin: 0 0 14px;
    color: var(--accent);
}
.modal-card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    margin: 0 0 14px;
}
.modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}
.modal-close:hover { color: var(--accent); }
.modal-links {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.modal-links a {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.03em;
    color: var(--accent-dim);
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.modal-links a:hover {
    color: var(--accent);
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

/* ---------- footer disclaimer ---------- */
.site-footer {
    max-width: 900px;
    margin: 48px auto 28px;
    padding: 20px 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.7;
}

/* ---------- items grid (no icon art yet, so tiles are text pills) ---------- */
.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0 40px;
}
.item-tile {
    position: relative;
    cursor: pointer;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0.03em;
    color: var(--text);
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.item-tile:hover {
    border-color: var(--border-strong);
    color: var(--accent);
    transform: translateY(-2px);
}
.item-tile .new-pill {
    top: -9px; right: -9px;
}

/* ---------- item detail page ---------- */
.item-detail-main { max-width: 900px; margin: 0 auto 60px; padding: 0 40px; }
.item-detail-main .page-header h1 { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
    .container, .home-main, .patches-main { padding-left: 20px; padding-right: 20px; }
    nav { padding: 0 16px; }
    nav ul a { font-size: 18px; padding: 6px 10px; }
    .hero-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        padding: 16px 20px;
    }
    /* stack: render on top, hero rail strip second, patches below */
    .hero-feature { order: -2; height: auto; }
    .hero-feature img.render { height: auto; max-width: 80vw; max-height: 40vh; }
    .hero-history { height: auto; overflow: visible; }
    .hero-rail {
        height: auto;
        align-self: stretch;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: 64px;
        overflow-x: auto;
        overflow-y: hidden;
        order: -1;
    }
    .hero-cols { grid-template-columns: 1fr; }
    .hero-tile { width: 84px; }

    /* home page's hero rail was a fixed right-edge sidebar that just got hidden
       below 1250px - give it the same horizontal-scroll strip treatment .hero-rail
       already gets above, instead of disappearing entirely. */
    .home-rail {
        position: static;
        right: auto; top: auto; transform: none;
        gap: 8px;
        padding: 10px 20px;
        margin: 0;
    }
}

/* phones (portrait AND landscape) plus any narrower resized window: the 1000px
   breakpoint above isn't tight enough on its own - logo + 3 links + info button
   don't reliably fit on one line under ~700px, so content got clipped on the right
   with no way to reach it. Shrink everything enough to stay on one line instead;
   nav's own overflow-x: auto (see base rule) is the fallback if it's still tight. */
@media (max-width: 700px) {
    nav { padding: 0 10px; gap: 4px; }
    nav .logo { height: 1.9em; flex-shrink: 0; }
    nav ul { margin-left: 6px; gap: 0; flex-shrink: 0; }
    nav ul a {
        font-size: 12px;
        padding: 5px 6px;
        letter-spacing: 0.01em;
        white-space: nowrap;
    }
    .info-btn { width: 28px; height: 28px; font-size: 15px; flex-shrink: 0; }

    /* home page only: its patch card puts the "jump to patch" dropdown directly
       beside the headline in .card-head, and .dd never shrinks (flex: 0 0 auto), so
       on a narrow phone it eats most of the row and squeezes the headline/meta text
       down to almost nothing, wrapping word-by-word. Stack them instead so the
       headline always gets the card's full width. Scoped to #patch-panel only -
       patches.html/hero.html/item.html's .card-head has a toggle button here
       instead of a dropdown and already works fine, so leave those alone. */
    #patch-panel .card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #patch-panel #dd-slot { align-self: flex-start; }
}
