/* Wake Diver: one stylesheet for the landing page and the manual. The page
   gets darker the further down you read, as the water does. Colours come
   from the game: its sea blues, the air bar's green, the chest's gold and
   the red of danger. */
:root {
  --surface: #0d4658;
  --abyss: #03101a;
  --panel: rgba(8, 30, 42, .78);
  --panel-solid: #0a2130;
  --line: #1b4254;
  --ink: #e6f0f1;
  --dim: #92b2bc;
  --sea: #4aa8e0;
  --air: #5cc85c;
  --brass: #e8b84a;
  --danger: #e25a4a;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font: 17px/1.65 var(--sans);
  background: var(--abyss) linear-gradient(180deg, var(--surface) 0, #082a3a 900px, #05182a 2600px, var(--abyss) 5200px) no-repeat;
}
a { color: var(--brass); }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
img.pix { image-rendering: pixelated; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
p { max-width: 44rem; }

/* ---- top bar ---- */
.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; }
.manual-page .bar, .bar.solid { position: static; border-bottom: 1px solid var(--line); background: var(--abyss); }
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1.25rem;
             min-height: 3.5rem; flex-wrap: wrap; }
.bar a { color: var(--ink); text-decoration: none; }
.brand { font: 800 1.15rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; }
.bar nav { display: flex; gap: .4rem 1.1rem; font-size: .9rem; flex-wrap: wrap; }
.bar nav a { color: var(--dim); }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }

/* ---- type ---- */
h1, h2, h3 { line-height: 1.05; }
h2 { font: 800 clamp(2.2rem, 6vw, 3.4rem)/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
     margin: 0 0 1rem; }
h3 { font: 800 1.6rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .4rem; }
.over { font: 600 .74rem/1.3 var(--mono); letter-spacing: .28em; text-transform: uppercase; color: var(--brass);
        margin: 0 0 1rem; }
.lede { font-size: 1.25rem; color: var(--dim); }
section { padding: 5rem 0 0; scroll-margin-top: 1rem; }

/* ---- the painted poster ---- */
.poster { position: relative; min-height: min(100vh, 58rem); display: grid; align-items: end; overflow: hidden; }
.poster > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.poster::before { content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(3,16,26,.85) 0, rgba(3,16,26,.35) 45%, rgba(3,16,26,0) 70%),
    linear-gradient(180deg, rgba(3,16,26,.55) 0, rgba(3,16,26,0) 22%, rgba(3,16,26,0) 60%, #082a3a 100%); }
.rays { position: absolute; inset: -20% -10% 30%; z-index: 1; pointer-events: none; mix-blend-mode: screen;
        background: repeating-linear-gradient(105deg, rgba(160,230,240,0) 0 60px, rgba(160,230,240,.07) 60px 90px, rgba(160,230,240,0) 90px 170px);
        filter: blur(6px); animation: sway 14s ease-in-out infinite alternate; transform-origin: 50% 0; }
@keyframes sway { from { transform: skewX(-4deg) translateX(-2%); opacity: .7; } to { transform: skewX(5deg) translateX(3%); opacity: 1; } }
.bubbles { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bubbles i { position: absolute; bottom: -20px; width: 10px; height: 10px; border-radius: 50%;
             border: 1.5px solid rgba(220,245,250,.65); background: rgba(220,245,250,.08);
             animation: rise linear infinite; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(10px, -45vh); }
  100% { transform: translate(-6px, -95vh); opacity: 0; }
}
.poster .wrap { position: relative; z-index: 3; width: 100%; padding-top: 7rem; padding-bottom: 4rem; }
.poster h1 { font: 900 clamp(4.2rem, 16vw, 11.5rem)/.82 var(--display); text-transform: uppercase; letter-spacing: -.01em;
             margin: 0; text-shadow: 0 6px 40px rgba(0,0,0,.55); }
.poster h1 span { display: block; color: var(--sea); }
.poster .lede { color: var(--ink); font-size: clamp(1.2rem, 3vw, 1.7rem); max-width: 34rem; margin: 1.25rem 0 0;
                text-shadow: 0 2px 16px rgba(0,0,0,.8); }
@media (prefers-reduced-motion: reduce) { .rays, .bubbles i { animation: none; } .bubbles { display: none; } }

/* ---- the depth gauge in the margin ---- */
.gauge { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 6; width: 64px;
         display: grid; justify-items: center; gap: .5rem; font: 600 .7rem/1 var(--mono); color: var(--dim);
         letter-spacing: .12em; text-transform: uppercase; pointer-events: none; }
.gauge .tube { width: 10px; height: 38vh; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.35);
               position: relative; overflow: hidden; }
.gauge .fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: linear-gradient(var(--sea), #1c5a8a); }
.gauge b { font: 800 1.35rem/1 var(--display); color: var(--ink); letter-spacing: .02em; }
@media (max-width: 1100px) { .gauge { display: none; } }

/* ---- buttons ---- */
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.15rem; border-radius: 3px;
       border: 1px solid var(--line); background: var(--panel-solid); color: var(--ink);
       font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--dim); color: #fff; }
.btn.primary { background: var(--brass); color: #141008; border-color: var(--brass); }
.btn.primary:hover { background: #fff; border-color: #fff; color: #111; }
.btn small { font-weight: 400; color: var(--dim); }
.btn.primary small { color: #4a3a14; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---- the story ---- */
.story { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
@media (max-width: 860px) { .story { grid-template-columns: 1fr; } }
.story p { font-size: 1.1rem; }
.story .first::first-letter { font: 900 4.2rem/.8 var(--display); float: left; margin: .35rem .55rem 0 0; color: var(--brass); }
img.box { border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.65); transform: rotate(1.5deg);
          max-width: min(100%, 25rem); justify-self: center; }
.note { font: 500 1.65rem/1.3 var(--hand); color: #d9e6d0; margin: 1.5rem 0 0; padding-left: 1rem;
        border-left: 2px solid var(--brass); max-width: 34rem; }

/* ---- the player ---- */
.player { border: 1px solid var(--line); background: var(--panel); padding: 1rem; margin-top: 1.25rem;
          display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.25rem; backdrop-filter: blur(4px); }
@media (max-width: 860px) { .player { grid-template-columns: 1fr; } }
.screen { position: relative; background: #000; aspect-ratio: 4 / 3; outline: none; border-radius: 6px; overflow: hidden;
          box-shadow: inset 0 0 60px rgba(0,0,0,.9), 0 0 0 6px #0b1a22, 0 0 0 7px var(--line); }
.screen:focus-visible { box-shadow: 0 0 0 6px #0b1a22, 0 0 0 8px var(--brass); }
.screen canvas { width: 100%; height: 100%; display: block; }
.screen .cover { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 1rem;
                 text-align: center; padding: 1rem; background: rgba(0,0,0,.35); }
.screen .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: -1;
                     image-rendering: pixelated; opacity: .55; }
.screen .cover[hidden] { display: none; }
.screen .cover .keys { color: var(--ink); text-shadow: 0 1px 6px #000; }
.switches { display: flex; flex-wrap: wrap; gap: .5rem; }
.switches .btn { font: 600 .78rem/1 var(--mono); letter-spacing: .1em; padding: .65rem .9rem; }
.switches .sound { margin-left: auto; }
.switches .sound.off { color: var(--danger); border-color: var(--danger); }
.side h3 { font-size: 1.15rem; margin-top: 1.25rem; }
.side h3:first-child { margin-top: 0; }
.keys { color: var(--dim); font-size: .9rem; margin: .5rem 0 0; }
.controls { width: 100%; border-collapse: collapse; font-size: .88rem; }
.controls td { padding: .3rem 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--dim); }
.controls td:first-child { color: var(--ink); white-space: nowrap; padding-right: .75rem; }
kbd { font: .78rem var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; padding: .05rem .35rem;
      border-radius: 3px; background: var(--abyss); color: var(--ink); }

/* ---- the chart ---- */
.chart-box { border: 1px solid var(--line); background: #061a26; padding: 1rem; margin-top: 1.5rem; position: relative; }
.chart-box svg { display: block; width: 100%; height: auto; }
.chart-box .land { fill: #2f6f52; }
.chart-box .sea { fill: #0a2a40; }
.chart-box .grid { stroke: #123a52; stroke-width: .08; }
.wreck-dot { cursor: pointer; }
.wreck-dot .pip { fill: var(--brass); animation: blink 1.1s steps(1) infinite; }
.wreck-dot.live .pip { fill: #fff; }
.wreck-dot .halo { fill: none; stroke: var(--brass); stroke-width: .18; opacity: 0; }
.wreck-dot:hover .halo, .wreck-dot:focus .halo, .wreck-dot.on .halo { opacity: 1; }
.wreck-dot text { font: 600 1.5px var(--mono); fill: var(--ink); letter-spacing: .1px; paint-order: stroke;
                  stroke: #061a26; stroke-width: .5px; }
.wreck-dot:focus { outline: none; }
@keyframes blink { 50% { opacity: .15; } }
@media (max-width: 640px) { .wreck-dot text { font-size: 3.4px; } .wreck-dot .name { display: none; } }
@media (prefers-reduced-motion: reduce) { .wreck-dot .pip { animation: none; } }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font: .78rem var(--mono); color: var(--dim); margin-top: .75rem;
                letter-spacing: .06em; text-transform: uppercase; }
.chart-legend span::before { content: ""; display: inline-block; width: .6rem; height: .6rem; margin-right: .45rem; background: var(--brass); }
.chart-legend .live::before { background: #fff; }

/* ---- the wrecks ---- */
.wrecks { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 2.5rem 2rem;
          grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); counter-reset: wreck; }
.wrecks li { background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr;
             transition: border-color .2s, transform .2s; scroll-margin-top: 1.5rem; }
.wrecks li.on { border-color: var(--brass); transform: translateY(-4px); }
.wrecks figure { margin: 0; position: relative; aspect-ratio: 9 / 7; overflow: hidden; }
.wrecks figure img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.wrecks li:hover figure img { transform: scale(1.04); }
.wrecks .tag { position: absolute; left: .75rem; top: .75rem; font: 600 .7rem/1 var(--mono); letter-spacing: .15em;
               text-transform: uppercase; padding: .45rem .6rem; background: rgba(3,16,26,.8); color: var(--dim);
               border: 1px solid var(--line); }
.wrecks .live .tag { background: var(--brass); color: #141008; border-color: var(--brass); }
.wrecks .body { padding: 1.25rem 1.25rem 1.5rem; display: grid; align-content: start; }
.wrecks .no { font: 600 .72rem/1 var(--mono); letter-spacing: .2em; color: var(--brass); }
.wrecks h3 { font-size: 2rem; margin: .5rem 0 .25rem; }
.wrecks .where { font: .78rem/1.5 var(--mono); color: var(--sea); text-transform: uppercase; letter-spacing: .08em; }
.wrecks p { color: var(--dim); margin: .75rem 0 0; font-size: .97rem; }
.wrecks .note { font-size: 1.45rem; margin-top: 1rem; }
.wrecks .buttons { margin-top: 1.25rem; }
.wrecks .unknown figure img { filter: saturate(.7); }

/* ---- what is aboard ---- */
.aboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (max-width: 860px) { .aboard { grid-template-columns: 1fr; } }
.aboard .crt { background: #000; border: 1px solid var(--line); padding: .75rem; border-radius: 6px; }
.aboard .crt img { display: block; width: 100%; image-rendering: pixelated; }
.shots { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); margin-top: 2.5rem; }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--line); background: #000; display: block; width: 100%; image-rendering: pixelated; }
.shots figcaption { color: var(--dim); font-size: .88rem; margin-top: .5rem; }
.shots figcaption b { color: var(--ink); display: block; font: 800 1.1rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .05em; }

/* ---- facts and tables ---- */
.facts { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
         padding: 0; list-style: none; margin: 2rem 0 0; }
.facts li { border-top: 2px solid var(--line); padding-top: .85rem; color: var(--dim); font-size: .95rem; }
.facts b { color: var(--ink); display: block; font: 800 1.25rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table.levels { border-collapse: collapse; min-width: 34rem; width: 100%; font-size: .95rem; }
.levels th, .levels td { padding: .65rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.levels thead th { font: 800 1.2rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em; }
.levels thead th:nth-child(2) { color: var(--air); }
.levels thead th:nth-child(3) { color: var(--brass); }
.levels thead th:nth-child(4) { color: var(--danger); }
.levels tbody th { color: var(--dim); font-weight: 400; }

/* ---- the log ---- */
.log { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .1rem; max-width: 46rem; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); color: var(--dim); }
.log li b { font: 600 .74rem/1.9 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.log li.done b { color: var(--air); }
.log li.next b { color: var(--brass); }
@media (max-width: 520px) { .log li { grid-template-columns: 1fr; gap: .1rem; } }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line); margin-top: 6rem; padding: 2rem 0 3rem; color: var(--dim); font-size: .88rem; }
footer p { max-width: 50rem; }

/* ---- the manual ---- */
.manual { max-width: 46rem; margin: 0 auto; padding: 2rem 16px 2rem; }
.manual h1 { font: 900 clamp(3.4rem, 13vw, 6rem)/.9 var(--display); text-transform: uppercase; margin: 1.5rem 0 .5rem; }
.manual h1 + h3 { font: 600 .78rem/1.5 var(--mono); letter-spacing: .14em; color: var(--dim); text-transform: uppercase; margin-top: 0; }
.manual h2 { font-size: 1.9rem; border-bottom: 3px solid var(--sea); padding-bottom: .4rem; margin-top: 3rem; }
.manual h3 { font-size: 1.4rem; margin-top: 2rem; color: var(--brass); }
.manual hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.manual table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1rem 0; display: block; overflow-x: auto; }
.manual th, .manual td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.manual th { color: var(--dim); font-weight: 600; }
.manual img { display: block; margin: 1.25rem 0 .25rem; border: 1px solid var(--line); background: #000; image-rendering: pixelated; }
.manual img[src$=".jpg"] { image-rendering: auto; box-shadow: 0 18px 50px rgba(0,0,0,.6); }
.manual em { color: var(--dim); }
.manual blockquote { margin: 1rem 0; padding: 0 0 0 1rem; border-left: 2px solid var(--brass); }
.manual blockquote p, .manual blockquote em { font: 500 1.55rem/1.3 var(--hand); color: #d9e6d0; font-style: normal; }
.manual ol li, .manual ul li { margin: .3rem 0; }
