/* SUBMARINU tokens (sampled from banner.png)
   hull #0a1216 · steel #1b1e1d · rust #5b362e · rust-deep #3a130c · fur #e8762b
   brass #c9a24b · led #43e08d · alarm #d8372b · paper #e3d5b5 · ink #14202b
   type: Roboto Slab 900/700/400 (headings, body) + Overpass Mono (readouts, CA)
   scale: 4 8 12 16 24 40 64 · radius 0 everywhere · motion: red lamp pulse, parallax drift */

@font-face { font-family: 'Roboto Slab'; font-weight: 400; font-display: swap; src: url(assets/fonts/roboto-slab-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Roboto Slab'; font-weight: 700; font-display: swap; src: url(assets/fonts/roboto-slab-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Roboto Slab'; font-weight: 900; font-display: swap; src: url(assets/fonts/roboto-slab-latin-900-normal.woff2) format('woff2'); }
@font-face { font-family: 'Overpass Mono'; font-weight: 400; font-display: swap; src: url(assets/fonts/overpass-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Overpass Mono'; font-weight: 700; font-display: swap; src: url(assets/fonts/overpass-mono-latin-700-normal.woff2) format('woff2'); }

:root {
  --hull: #0a1216; --steel: #1b1e1d; --steel-hi: #2a2e2c; --rust: #5b362e; --rust-deep: #3a130c;
  --fur: #e8762b; --brass: #c9a24b; --led: #43e08d; --alarm: #d8372b; --paper: #e3d5b5; --ink: #14202b;
  --slab: 'Roboto Slab', Rockwell, 'Courier New', serif;
  --mono: 'Overpass Mono', ui-monospace, Menlo, monospace;
  --deck-h: 188px;
}
* { box-sizing: border-box; }
html { background: var(--hull); }
body { margin: 0; color: #e8dccb; font-family: var(--slab); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ---------- bridge ---------- */
.bridge { display: grid; grid-template-rows: auto auto; background: var(--hull); }
.stage { position: relative; overflow: hidden; background: #0b2430 url(assets/banner-web.jpg) center / cover; height: clamp(420px, calc(100svh - 190px), 700px); user-select: none; -webkit-user-select: none; }
.stage::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16,70,92,.82) 0%, rgba(8,34,46,.9) 55%, rgba(4,12,18,.97) 100%); }
#dive-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; touch-action: none; }
@keyframes lamp { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.plate { position: absolute; left: 40px; top: 40px; width: fit-content; max-width: calc(100% - 80px); padding: 24px 40px 24px 28px; background: linear-gradient(180deg, #2a2e2c, #1b1e1d); border: 2px solid #0a1216; box-shadow: inset 0 0 0 2px var(--brass), inset 0 0 0 4px #0a1216; pointer-events: none; transition: opacity .5s ease, transform .5s ease; }
.stage.playing .plate { opacity: 0; transform: translateY(-14px); }
.plate h1 { margin: 0; font-weight: 900; font-size: clamp(34px, 5vw, 64px); line-height: .95; letter-spacing: .02em; color: var(--fur); text-shadow: 2px 2px 0 var(--rust-deep); }
.plate p { margin: 12px 0 0; font-size: 18px; line-height: 1.35; color: #eadcc2; max-width: 30ch; }
.rivet { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e6d6a0, #6d5a2a 70%); }
.r1 { left: 8px; top: 8px; } .r2 { right: 8px; top: 8px; } .r3 { left: 8px; bottom: 8px; } .r4 { right: 8px; bottom: 8px; }

/* ---------- deck (instruments) ---------- */
.deck { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 16px 40px; background: linear-gradient(180deg, var(--steel-hi), var(--steel) 24%); border-top: 3px solid var(--brass); box-shadow: inset 0 3px 0 #0a1216; }
.inst { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.inst canvas { width: 120px; height: 120px; background: #050a0c; border: 3px solid #0a1216; border-radius: 50%; box-shadow: 0 0 0 3px var(--steel-hi), 0 0 0 5px #0a1216; }
.inst-label { font: 700 11px/1 var(--mono); letter-spacing: .18em; color: var(--brass); }

.manifest { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.status { font: 700 12px/1.4 var(--mono); letter-spacing: .08em; color: #cdbfa6; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.status .watch { color: var(--brass); }
.lamp { width: 10px; height: 10px; background: var(--alarm); box-shadow: 0 0 8px var(--alarm); animation: lamp 2.6s ease-in-out infinite; }
.ca { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; background: #050a0c; border: 2px solid var(--brass); color: var(--led); }
.ca:hover, .ca:focus-visible { background: #0b1a14; }
.ca:focus-visible { outline: 2px dashed var(--fur); outline-offset: 3px; }
.ca-tag { font: 700 12px/1 var(--mono); color: #050a0c; background: var(--brass); padding: 4px 6px; letter-spacing: .1em; }
.ca-val { font: 700 clamp(13px, 1.5vw, 18px)/1.3 var(--mono); letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; user-select: all; }
.ca-hint { font: 700 11px/1 var(--mono); letter-spacing: .14em; color: var(--brass); white-space: nowrap; }
.ca.copied { border-color: var(--led); }
.ca.copied .ca-hint { color: var(--led); }

.links { display: flex; gap: 12px; align-items: stretch; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; font: 900 14px/1 var(--slab); letter-spacing: .1em; text-decoration: none; color: var(--brass); background: var(--hull); border: 2px solid var(--brass); box-shadow: 0 4px 0 #050a0c; transition: transform .12s, box-shadow .12s; }
.btn:hover, .btn:focus-visible { transform: translateY(2px); box-shadow: 0 2px 0 #050a0c; }
.btn:focus-visible { outline: 2px dashed var(--fur); outline-offset: 3px; }
.btn-buy { background: var(--fur); color: #1a0a04; border-color: #1a0a04; box-shadow: 0 4px 0 var(--rust-deep); }
.btn-buy:hover, .btn-buy:focus-visible { box-shadow: 0 2px 0 var(--rust-deep); }
.btn-x { padding: 0 10px; }
.btn-x img { width: 28px; height: 28px; }

/* ---------- Dive Run overlay + HUD ---------- */
.dr-hud { position: absolute; top: 14px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font: 700 15px/1 var(--mono); color: var(--led); letter-spacing: .06em; text-shadow: 0 0 8px rgba(67,224,141,.6); pointer-events: none; }
.dr-hud .dr-best { color: var(--brass); text-shadow: 0 0 6px rgba(201,162,74,.5); font-size: 12px; }
.dr-overlay { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 28px; background: rgba(5,10,12,.72); border: 2px solid var(--brass); text-align: center; transition: opacity 180ms ease; max-width: calc(100% - 24px); }
.dr-overlay.hidden { opacity: 0; pointer-events: none; }
.dr-title { margin: 0; font: 900 clamp(26px,4vw,40px)/1 var(--slab); color: var(--fur); text-transform: uppercase; letter-spacing: .02em; }
.dr-sub { margin: 0; color: var(--paper); font: 500 14px var(--mono); }
.dr-btn { margin-top: 6px; min-height: 44px; padding: 12px 28px; border: 0; background: var(--brass); color: var(--ink); font: 700 14px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; box-shadow: 0 3px 0 #8a6e2f; }
.dr-btn:hover, .dr-btn:focus-visible { background: #d9b863; }
.dr-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6e2f; }

/* ---------- captain's log (paper, ruled, 36px lines) ---------- */
.log { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; padding: 64px 40px 64px; background-color: var(--paper); color: var(--ink);
  background-image: linear-gradient(90deg, transparent 0 calc(40px + 70px), rgba(181,54,43,.55) calc(40px + 70px) calc(40px + 71px), transparent calc(40px + 71px)),
                    repeating-linear-gradient(180deg, transparent 0 35px, rgba(20,32,43,.22) 35px 36px);
  border-top: 6px solid var(--rust); }
.log-head { position: sticky; top: 24px; align-self: start; padding-left: 86px; }
.vol { font: 700 12px/1 var(--mono); letter-spacing: .16em; color: var(--rust); margin: 0 0 12px; }
.log h2 { margin: 0; font-weight: 900; font-size: clamp(40px, 6vw, 80px); line-height: .95; color: var(--rust-deep); text-transform: uppercase; letter-spacing: -.01em; }
.log-note { margin: 24px 0 0; max-width: 28ch; font-size: 16px; line-height: 36px; font-style: italic; }
.entries { list-style: none; margin: 0; padding: 0; counter-reset: e; }
.entries li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 0; position: relative; }
.entries time { font: 700 15px/36px var(--mono); color: var(--rust); }
.entries p { margin: 0 0 36px; font-size: 18px; line-height: 36px; max-width: 46ch; }
.entries b { font-weight: 700; background: linear-gradient(0deg, rgba(232,118,43,.45) 0 40%, transparent 40%); }
.stamp { display: inline-block; margin-left: 16px; padding: 0 8px; font: 900 13px/22px var(--mono); letter-spacing: .14em; color: var(--alarm); border: 3px double var(--alarm); transform: rotate(-4deg); vertical-align: 2px; }

/* ---------- faq ---------- */
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 64px; padding: 64px 40px; background: var(--hull); border-top: 3px solid var(--brass); }
.faq-head h2 { margin: 0; font-weight: 900; font-size: clamp(32px, 4.4vw, 56px); line-height: 1; color: var(--fur); text-shadow: 2px 2px 0 var(--rust-deep); }
.faq-head p { margin: 16px 0 0; color: #b9ab93; max-width: 30ch; }
.faq-list { max-width: 640px; justify-self: end; width: 100%; }
details { border-top: 2px solid var(--steel-hi); }
details:last-child { border-bottom: 2px solid var(--steel-hi); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 19px; line-height: 1.3; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font: 700 22px/1 var(--mono); color: var(--brass); }
details[open] summary::after { content: '-'; }
summary:focus-visible { outline: 2px dashed var(--fur); outline-offset: 2px; }
details p { margin: 0 0 16px; color: #cdbfa6; max-width: 46ch; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 40px; background: var(--hull); border-top: 3px solid var(--brass); font: 700 13px/1 var(--mono); letter-spacing: .12em; color: #b9ab93; }
.foot-x { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brass); }
.foot-x img { width: 28px; height: 28px; }
.ns { padding: 16px 40px; margin: 0; background: var(--alarm); color: #fff; font: 700 13px var(--mono); }

/* ---------- narrow ---------- */
@media (max-width: 920px) {
  .deck { grid-template-columns: auto auto minmax(0, 1fr); padding: 16px 24px; }
  .links { grid-column: 1 / -1; }
  .links .btn { flex: 1 1 auto; }
  .manifest { grid-column: 1 / -1; order: 3; }
  .links { order: 4; }
  .plate { left: 24px; top: 24px; }
  .log, .faq { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 40px 24px; }
  .log { background-image: repeating-linear-gradient(180deg, transparent 0 35px, rgba(20,32,43,.22) 35px 36px); }
  .log-head { position: static; padding-left: 0; }
  .faq-list { justify-self: stretch; }
    .foot { padding: 24px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .stage { height: clamp(420px, 66svh, 620px); }
  .dr-hud { top: auto; bottom: 10px; right: 12px; }
  .dr-overlay { bottom: 44px; padding: 12px 16px; gap: 6px; }
  .dr-sub { font-size: 12px; }
  .dr-title { font-size: 24px; }
  .plate { left: 12px; top: 12px; max-width: calc(100% - 24px); padding: 12px 20px 12px 14px; }
  .plate h1 { font-size: 30px; }
  .plate p { font-size: 12.5px; margin-top: 6px; max-width: 34ch; }
  .deck { padding: 12px; gap: 12px; }
  .inst canvas { width: 96px; height: 96px; }
  .ca { grid-template-columns: auto minmax(0, 1fr); }
  .ca-hint { grid-column: 1 / -1; }
  .entries li { grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
  .entries p { font-size: 17px; }
  .btn { padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .lamp { animation: none; opacity: .7; }
  .btn { transition: none; }
}
