/* Colours come from skinlocker-theme tokens. The four accent values are added by build.js from config.js. */
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/space-grotesk-latin.woff2') format('woff2'); }

:root {
  --accent: #e83e8c;
  --accent-ink: #0b1120;
  --link: #f082b4;
  --link-hover: #f7bad6;
  --bg: #0b1120;
  --surface: #151e32;
  --surface-2: #1c2742;
  --border: #26324d;
  --border-strong: #3a4868;
  --text: #e5e9f2;
  --text-muted: #9aa7bf;
  --heading: 'Space Grotesk', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.5 Inter, system-ui, sans-serif; }
img { display: block; max-width: 100%; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3 { margin: 0; color: #fff; font-family: var(--heading); font-weight: 700; line-height: 1.15; }
h1 { font-size: 44px; }
h2 { font-size: 28px; margin-bottom: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
small, .fine { color: var(--text-muted); font-size: 13px; }
.muted { color: var(--text-muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; padding: 8px 12px; background: var(--surface); }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding: 16px 32px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 700 24px var(--heading); letter-spacing: .04em; }
.brand:hover { color: #fff; }
.brand svg { color: var(--accent); }
.mainnav { display: flex; flex-wrap: wrap; gap: 8px 24px; flex: 1 1 320px; }
.mainnav a { color: var(--text); font-weight: 500; text-decoration: none; }
.mainnav a:hover, .mainnav a[aria-current] { color: var(--link); }
.to-deadlocker { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; text-decoration: none; }
.to-deadlocker:hover { border-color: var(--link); }
.to-deadlocker img { width: auto; height: 28px; }
.to-deadlocker img + img { height: 18px; }
.dl-mark { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.dl-mark img { width: auto; height: 28px; }
.dl-mark img + img { height: 18px; }
.mods-link { gap: 7px; }
.hc-count .dl-mark { gap: 5px; margin-left: 3px; }
.hc-count .dl-mark img { height: 20px; }
.hc-count .dl-mark img + img { height: 13px; }
.model-list.after-grid { margin-top: 16px; }
.search { position: relative; flex: 0 1 280px; }
input[type=search], input[type=email] { width: 100%; min-height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: inherit; font-size: 15px; }
.search-results { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; max-height: 360px; overflow: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; }
.search-results a, .search-results p { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; color: var(--text); text-decoration: none; font-size: 14px; }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); color: #fff; }
.search-results small { flex: none; }

.wrap { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 56px; }
.notice { padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); }
.notice strong { color: var(--text); }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-copy h1 { font-size: 60px; line-height: 1.05; }
.hero-copy > p { max-width: 520px; color: var(--text-muted); font-size: 18px; }
.hero-copy > .lead { color: var(--text); font-weight: 600; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border: 1px solid transparent; border-radius: 8px; background: none; font: 600 16px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn-primary, .btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--link); color: #fff; }

.viewer { position: relative; flex: 1 1 440px; min-width: 0; height: 460px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 35%, var(--border-strong), var(--surface) 68%); border: 1px solid var(--border); border-radius: 12px; }
.viewer img { position: absolute; inset: 16px 0 0; width: 100%; height: calc(100% - 16px); object-fit: contain; object-position: center top; }
.viewer::after { content: ''; position: absolute; inset: 62% 0 0; background: linear-gradient(transparent, rgba(11, 17, 32, .8)); pointer-events: none; }
.viewer .btn { position: relative; z-index: 1; }
.viewer iframe { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.viewer.is-live iframe { opacity: 1; pointer-events: auto; }
.viewer-status { display: none; position: absolute; z-index: 3; left: 50%; bottom: 20px; align-items: center; gap: 8px; color: #fff; font-size: 14px; white-space: nowrap; text-shadow: 0 1px 4px #000; transform: translateX(-50%); }
.viewer-status::before { content: ''; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--accent); border-radius: 50%; animation: viewer-spin .8s linear infinite; }
.viewer.is-loading .viewer-status { display: inline-flex; }
@keyframes viewer-spin { to { transform: rotate(360deg); } }
.viewer.is-auto .btn { position: absolute; inset: 0; z-index: 3; align-items: flex-end; padding: 0 0 16px; border-radius: 0; background: none; color: #fff; font-size: 13px; font-weight: 500; text-shadow: 0 1px 4px #000; opacity: 0; transition: opacity .15s ease; }
.viewer.is-auto.is-live:hover .btn, .viewer.is-auto.is-live .btn:focus-visible { opacity: 1; filter: none; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile, .card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
a.tile:hover, a.card:hover { border-color: var(--border-strong); color: var(--text); }
.tile { overflow: hidden; }
.tile-art { position: relative; height: 150px; background: radial-gradient(circle at 50% 30%, var(--border-strong), var(--surface-2) 72%); }
.tile-art img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.badge { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; }
.tile-art .badge { position: absolute; top: 10px; right: 10px; }
.tile-body { display: flex; flex-direction: column; padding: 12px 14px; }
.tile-body strong { color: #fff; font-weight: 600; }
.card { gap: 8px; padding: 20px; }
.card strong { color: #fff; font-weight: 600; }
.card span, .card p { color: var(--text-muted); font-size: 15px; }
.pill { padding: 1px 8px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text-muted); font-size: 12px; }

.panel { padding: 40px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.notify { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; scroll-margin-top: 24px; }
.notify h2 { margin: 0; }
.notify .btn-row { justify-content: center; }
.signup { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 8px; }
.signup label { color: var(--text-muted); font-size: 15px; }
.signup-row { display: flex; gap: 8px; }
.signup-row input[type=email] { flex: 1; min-width: 0; background: var(--bg); }
.signup-row .btn { flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: -32px; color: var(--text-muted); font-size: 14px; }
.crumbs a { color: var(--text-muted); }
.page-head { display: flex; flex-direction: column; gap: 12px; }
.page-head > p { max-width: 720px; color: var(--text-muted); font-size: 18px; }
.page-head > .byline { font-size: 14px; }
.hero-detail .hero-copy h1 { font-size: 52px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li { padding: 2px 10px; background: var(--surface-2); border-radius: 999px; color: var(--text-muted); font-size: 13px; }
.muted + .facts { margin-top: 16px; }
.prose { max-width: 760px; display: flex; flex-direction: column; gap: 14px; color: var(--text-muted); }
.prose h2 { margin: 14px 0 0; font-size: 22px; }
.abilities, .facts, .forecasts, .two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two-col { gap: 40px; }
.ability { flex-direction: row; gap: 14px; }
.ability img { flex: none; width: 48px; height: 48px; }
.ability h3 { margin-bottom: 4px; }
.stats { margin: 0; }
.stats > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.stats dt { color: var(--text-muted); }
.stats dd { margin: 0; color: #fff; font-weight: 600; }
.stats-inline { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.stats-inline > div { flex-direction: column; gap: 0; padding: 0; border: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.weapon { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; }
.weapon > div { flex: 1 1 480px; min-width: 0; }
.weapon-art { position: relative; flex: 1 1 320px; display: block; height: 280px; background: radial-gradient(circle at 50% 45%, var(--border-strong), var(--surface) 70%); border: 1px solid var(--border); border-radius: 12px; }
.weapon-art:hover { border-color: var(--link); }
.weapon-art img { width: 100%; height: 100%; padding: 20px; object-fit: contain; }
.weapon-art .badge { position: absolute; top: 10px; right: 10px; }
.top-mods { padding: 24px; }
.see-mods { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.see-mods:hover { color: #fff; }
.top-mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.top-mod { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--text); text-decoration: none; }
.top-mod img { width: 100%; height: auto; aspect-ratio: 16 / 9; margin-bottom: 6px; object-fit: cover; background: var(--surface-2); border-radius: 8px; }
.top-mod strong { overflow: hidden; color: #fff; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; gap: 16px; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.faq summary { color: #fff; font-weight: 600; cursor: pointer; }
.faq p { margin-top: 8px; color: var(--text-muted); }
.model-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.model-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.model-list strong { color: #fff; font-weight: 600; }
.model-list small { flex-basis: 100%; }
.forecast-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.confidence { color: var(--link); font-size: 14px; font-weight: 600; }

.footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding: 28px 32px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px; }
.footer > div:first-child { flex: 1 1 320px; }
.footer-brand { color: #fff; font: 700 16px var(--heading); letter-spacing: .04em; }
.footer-links { display: flex; gap: 16px; margin-top: 6px; }
.footer-links a { color: var(--text-muted); }
.sister { display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .1em; }

/* Heroes page: Portraits and Icons follow Deadlocker's hero views. */
.heroes-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: -24px; }
.view-picker { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.view-picker button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text-muted); font: 500 14px Inter, system-ui, sans-serif; cursor: pointer; }
.view-picker button:hover { color: #fff; }
.view-picker button[aria-pressed=true] { background: var(--surface-2); color: #fff; }
.hero-grid { display: grid; overflow-x: clip; overflow-y: visible; }
.hc { position: relative; display: block; min-width: 0; color: var(--text); text-decoration: none; }
.hc:hover { color: var(--text); }
.hc-frame { position: relative; display: block; }
.hc-frame > *, .hc-icon, .hc-count span { display: none; }
.hc-name { display: block; color: #fff; font-weight: 600; }
.hc-count { display: flex; align-items: baseline; justify-content: center; gap: .3em; width: max-content; margin: 0 auto; border-left: 2px solid var(--accent); background: var(--surface-2); color: var(--text-muted); font-weight: 700; letter-spacing: .07em; line-height: 1.3; text-transform: uppercase; }
.hc-count b { color: var(--link); font-weight: 900; letter-spacing: 0; }

[data-hero-grid=portrait] { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px 12px; }
[data-hero-grid=portrait] .hc { display: flex; flex-direction: column; padding-top: 14%; }
[data-hero-grid=portrait] .hc-count.is-empty, [data-hero-grid=icon] .hc-count.is-empty { display: none; }
[data-hero-grid=portrait] .hc-frame { aspect-ratio: 3 / 5; transform: rotate(-1.5deg); transition: transform .2s ease; }
[data-hero-grid=portrait] .hc:hover .hc-frame { transform: rotate(-1.5deg) translateY(-4px) scale(1.03); }
[data-hero-grid=portrait] .hc-bg { display: block; position: absolute; inset: 0; background: linear-gradient(180deg, var(--border-strong), var(--surface) 60%, var(--bg)); clip-path: polygon(4% 2%, 100% 0, 96% 100%, 0 98%); }
[data-hero-grid=portrait] .hc-portrait { display: block; position: absolute; inset: 0; clip-path: polygon(4% -30%, 100% -30%, 96% 100%, 0 98%); }
[data-hero-grid=portrait] .hc-portrait img { position: absolute; left: 50%; bottom: 0; width: auto; max-width: none; height: 112%; transform: translateX(-50%); transition: filter .2s ease; }
[data-hero-grid=portrait] .hc:hover .hc-portrait img { filter: brightness(1.12); }
[data-hero-grid=portrait] .hc-portrait::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); }
[data-hero-grid=portrait] .hc-wordmark { display: block; position: absolute; z-index: 1; left: 50%; bottom: 5%; width: auto; height: auto; max-width: 82%; max-height: 16%; transform: translateX(-50%); filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 6px rgba(0, 0, 0, .9)); }
[data-hero-grid=portrait] .hc-name { position: absolute; z-index: 1; left: 5%; right: 5%; top: 78%; font-size: 13px; font-weight: 800; line-height: 1.1; text-align: center; text-transform: uppercase; text-shadow: 0 1px 4px #000; }
[data-hero-grid=portrait] .has-wordmark .hc-name { position: absolute; width: 1px; height: 1px; left: 50%; overflow: hidden; clip-path: inset(50%); }
[data-hero-grid=portrait] .hc-count { margin-top: 10px; padding: 2px 8px; font-size: 10px; transform: rotate(-1.5deg); }
[data-hero-grid=portrait] .hc-count b { font-size: 13px; }

[data-hero-grid=card] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
[data-hero-grid=card] .hc { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; transition: border-color .15s ease, transform .15s ease; }
[data-hero-grid=card] .hc:hover { border-color: var(--link); transform: translateY(-2px); }
[data-hero-grid=card] .hc-name { display: flex; align-items: center; min-height: 54px; padding: 0 58px 0 14px; font-size: 16px; }
[data-hero-grid=card] .hc-frame { aspect-ratio: 4 / 5; background: radial-gradient(circle at 50% 38%, var(--border-strong), var(--surface-2) 58%, var(--surface)); }
[data-hero-grid=card] .hc-card { display: block; position: absolute; inset: 0; width: 100%; height: 100%; padding: 14px 12px 10px; object-fit: contain; object-position: center bottom; transition: transform .2s ease; }
[data-hero-grid=card] .hc:hover .hc-card { transform: scale(1.03); }
[data-hero-grid=card] .hc-model .hc-card { padding: 18px; object-position: center; }
[data-hero-grid=card] .hc-weapon .hc-frame { aspect-ratio: 4 / 3; }
[data-hero-grid=card] .hc-weapon .hc-card { padding: 16px 20px; }
[data-hero-grid=card] .hc-icon { display: block; position: absolute; top: 8px; right: 10px; width: 38px; height: 38px; padding: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 50%; object-fit: cover; }
[data-hero-grid=card] .badge { display: block; position: absolute; top: 10px; right: 10px; }
[data-hero-grid=card] .hc-count { width: auto; margin: 0; padding: 10px 14px; border: 0; border-top: 1px solid var(--border-strong); background: none; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; justify-content: flex-start; }
[data-hero-grid=card] .hc-count b { color: inherit; font-weight: 400; }
[data-hero-grid=card] .hc-count span { display: inline-flex; align-items: center; gap: 3px; }
[data-hero-grid=card] .hc-count.is-empty { line-height: 1.35; }

[data-hero-grid=icon] { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; }
[data-hero-grid=icon] .hc { display: flex; flex-direction: column; align-items: center; padding: 4px; }
[data-hero-grid=icon] .hc-frame { display: none; }
[data-hero-grid=icon] .hc-icon { display: block; order: -1; width: 100%; aspect-ratio: 1; height: auto; object-fit: contain; transition: transform .2s ease; }
[data-hero-grid=icon] .hc:hover .hc-icon { transform: translateY(-3px) scale(1.06); }
[data-hero-grid=icon] .hc-name { margin-top: 4px; font-size: 11px; font-weight: 400; line-height: 1.2; text-align: center; }
[data-hero-grid=icon] .hc-count { margin-top: 3px; padding: 1px 6px; font-size: 9px; transform: rotate(-1.5deg); }
[data-hero-grid=icon] .hc-count b { font-size: 11px; }

@media (max-width: 1100px) {
  [data-hero-grid=portrait] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  [data-hero-grid=icon] { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  [data-hero-grid=portrait] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  [data-hero-grid=card] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-hero-grid=icon] { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  [data-hero-grid=portrait] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-hero-grid=card] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-hero-grid=icon] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .heroes-head { margin-bottom: -16px; }
}

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .model-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar, .footer { padding-left: 16px; padding-right: 16px; }
  .wrap { padding: 24px 16px 48px; gap: 44px; }
  .search { flex: 1 1 100%; }
  .brand { font-size: 21px; }
  .topbar { gap: 12px 16px; }
  .mainnav { flex-basis: 100%; order: 2; }
  .search { order: 3; }
  .topbar > .to-deadlocker { margin-left: auto; }
  h1, .hero-copy h1, .hero-detail .hero-copy h1 { font-size: 40px; }
  .hero-copy, .viewer { flex-basis: 100%; }
  .viewer { height: 380px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .abilities, .facts, .forecasts, .two-col, .model-list, .top-mod-grid { grid-template-columns: minmax(0, 1fr); }
  .weapon > div { flex-basis: 100%; }
  .crumbs { margin-bottom: -24px; }
  .signup-row { flex-direction: column; }
}
