@font-face { font-family: 'Press Start 2P'; src: url('/fonts/press-start-2p.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('/fonts/pixelify-sans-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Pixelify Sans'; src: url('/fonts/pixelify-sans-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --night: #0a1730;   /* the harbour at night */
  --deep: #0e1f3d;    /* the boarding list */
  --ink: #13223f;     /* print on the pass */
  --cream: #f3ead2;   /* pass paper, main text */
  --brass: #e2b45a;   /* rules and frames */
  --gold: #ffd36b;    /* things to press */
  --lamp: #d23a2c;    /* the stamp, problems */
  --foam: #a9b6cf;    /* quieter text */
  --shadow: #040a17;
  --display: 'Press Start 2P', ui-monospace, monospace;
  --text: 'Pixelify Sans', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #050b19;
  color: var(--cream);
  font-family: var(--text);
  font-size: 19px;
  line-height: 1.5;
}
img, video { max-width: 100%; }

/* the harbour at night (drawn by bg.js) sits behind everything */
#scene { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: -2; display: block; image-rendering: pixelated; }
.scene-shade { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(130% 95% at 50% 32%, rgba(3, 7, 16, 0) 45%, rgba(3, 7, 16, 0.6) 100%); }
a { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- top: a quiet nav over the hero */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: flex-end; padding: 22px 28px; }
.top nav { display: flex; gap: 26px; }
.top a { font-family: var(--display); font-size: 11px; color: var(--cream); text-decoration: none; padding: 8px 0; text-shadow: 0 0 6px rgba(5, 11, 25, 0.95); }
.top a:hover { color: var(--gold); }

/* ---------- hero: the harbour, live from the game */
.hero { position: relative; min-height: max(600px, 100svh); display: grid; align-items: center; overflow: hidden; background: #050b19; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; image-rendering: pixelated; }
.hero-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 11, 25, 0) 34%, rgba(5, 11, 25, 0.5) 60%, rgba(5, 11, 25, 0.72) 100%),
    linear-gradient(180deg, rgba(5, 11, 25, 0.45) 0%, rgba(5, 11, 25, 0) 18%, rgba(5, 11, 25, 0) 72%, #050b19 100%); }
.hero-inner { position: relative; z-index: 1; width: min(100% - 56px, 1180px); margin: 0 auto; display: grid; justify-items: start; padding-left: 52%; }
.hero-logo { display: block; width: 100%; max-width: 560px; height: auto; image-rendering: pixelated; margin: 0 0 30px -6px; filter: drop-shadow(0 6px 0 rgba(4, 10, 23, 0.6)); }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(18px, 2.3vw, 30px); line-height: 1.45; margin: 0 0 14px; }
.hero-sub { margin: 0 0 32px; color: var(--foam); font-size: 20px; }
.hero h1, .hero-sub { text-shadow: 0 0 10px rgba(5, 11, 25, 0.9), 0 0 2px rgba(5, 11, 25, 0.9); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.btn.big { font-size: 12px; padding: 16px 20px; }
.hero .btn.line { background: rgba(5, 11, 25, 0.35); }

/* ---------- the check-in desk: pass on the left, boarding list on the right */
.desk { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 56px; align-items: start; max-width: 1180px; margin: 0 auto; padding: 72px 24px 96px; scroll-margin-top: 8px; }
.pass-col { position: sticky; top: 24px; }
/* text sitting on the night sky gets a soft dark halo so stars never touch the letters */
.count, .records-head, .foot p { text-shadow: 0 0 6px rgba(5, 11, 25, 0.95), 0 0 2px rgba(5, 11, 25, 0.95); }
.pass { position: relative; margin: 0; }
.pass > img:first-child { display: block; width: 100%; height: auto; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--shadow), 8px 8px 0 0 var(--shadow); }
.pass .stamp { position: absolute; left: 53%; top: 55.41%; width: 25%; height: auto; image-rendering: pixelated; pointer-events: none; }
.pass-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-top: 22px; }
.count:empty { display: none; }
.count { margin: 0; font-family: var(--display); font-size: 12px; line-height: 1.6; color: var(--gold); }
.dl { font-size: 17px; }

/* the stamp landing: the one moment of motion on the page */
@keyframes stamp-in { 0% { transform: scale(2.6) rotate(-4deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes thud { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -1px); } 75% { transform: translate(-1px, 1px); } }
.pass .stamp.landing { animation: stamp-in 260ms steps(6, end) both; transform-origin: 50% 50%; }
.pass.thud { animation: thud 160ms steps(4, end); }

/* ---------- boarding list */
.list-col { background: rgba(14, 31, 61, 0.94); border: 2px solid var(--brass); box-shadow: 8px 8px 0 0 var(--shadow); }
.list-title { font-family: var(--display); font-weight: 400; font-size: 13px; margin: 0; padding: 18px 22px 16px; color: var(--gold); border-bottom: 2px dotted var(--brass); }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 20px 22px; }
.row + .row { border-top: 2px dotted rgba(226, 180, 90, 0.45); }
.n { width: 32px; height: 32px; display: grid; place-items: center; font-family: var(--display); font-size: 12px; color: var(--brass); border: 2px solid var(--brass); }
.row h3 { font-family: var(--display); font-weight: 400; font-size: 12px; line-height: 1.6; margin: 6px 0 6px; }
.row .desc { margin: 0; font-size: 16px; color: var(--foam); }
.row .msg { margin: 8px 0 0; font-size: 16px; }
.row .msg:empty { display: none; }
.row .msg.bad { color: #ff9a8c; }
.row .msg.wait { color: var(--gold); }
.act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 2px; }

.row.locked { opacity: 0.45; }
.row.locked .act, .row.locked .wallet, .row.locked .share { display: none !important; }
.row[data-step="share"] .act { padding-top: 0; }
.row.done .n { background: var(--gold); color: var(--ink); border-color: var(--gold); font-size: 0; }
.row.done .n::before { content: ''; width: 14px; height: 10px; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 5' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h1v1H6zM5 1h1v1H5zM4 2h1v1H4zM0 2h1v1H0zM1 3h1v1H1zM3 3h1v1H3zM2 4h1v1H2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 5' shape-rendering='crispEdges'%3E%3Cpath d='M6 0h1v1H6zM5 1h1v1H5zM4 2h1v1H4zM0 2h1v1H0zM1 3h1v1H1zM3 3h1v1H3zM2 4h1v1H2z'/%3E%3C/svg%3E") center / contain no-repeat; }
.row.done .act .btn { display: none; }
.row.done .act .badge { display: inline-block; }

/* ---------- controls */
.btn { display: inline-block; font-family: var(--display); font-size: 11px; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer;
  padding: 12px 14px; border: 2px solid var(--ink); white-space: nowrap; }
.btn.gold { color: var(--ink); background: var(--gold); box-shadow: 3px 3px 0 0 var(--shadow); }
.btn.gold:hover { background: #ffe08f; }
.btn.gold:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--shadow); }
.btn.line { color: var(--cream); background: transparent; border-color: var(--cream); }
.btn.line:hover { background: var(--cream); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.who { margin: 0; font-size: 16px; color: var(--foam); }
.soon { display: none; font-family: var(--display); font-size: 10px; color: var(--foam); padding: 12px 0; }
.row.nopost { opacity: 0.6; }
.row.nopost .act .btn { display: none; }
.row.nopost .act .soon { display: inline-block; }
.row.done .act .soon { display: none !important; }
.badge { display: none; font-family: var(--display); font-size: 10px; color: var(--gold); padding: 12px 0; white-space: nowrap; }
.link { font: inherit; font-size: 15px; color: var(--foam); background: none; border: 0; padding: 4px 0; text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--cream); }

.wallet { margin-top: 12px; }
.wallet input, .postlink input { width: 100%; font-family: var(--text); font-size: 17px; color: var(--ink); background: var(--cream);
  border: 2px solid var(--brass); padding: 10px 12px; border-radius: 0; }
.wallet-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.saved { margin: 10px 0 0; font-size: 16px; color: var(--cream); }
.saved span { font-family: var(--display); font-size: 11px; color: var(--gold); margin-right: 10px; }
.share { margin-top: 12px; display: grid; gap: 12px; justify-items: start; }
.postlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; }

/* wallet and share rows put their controls under the text */
.row[data-step="wallet"] { grid-template-columns: 36px minmax(0, 1fr); }

/* ---------- Harbour Records: files on the harbour master's desk */
.records { max-width: 1180px; margin: 0 auto; padding: 8px 24px 104px; scroll-margin-top: 8px; }
.records-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: 30px; }
.records-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(16px, 2vw, 22px); margin: 0; }
.records-count { margin: 0; font-family: var(--display); font-size: 11px; color: var(--gold); }
.records-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 30px; }
.rec { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; background: var(--cream); color: var(--ink);
  border: 2px solid #b8781a; box-shadow: 6px 6px 0 0 var(--shadow); transform: rotate(var(--tilt, 0deg)); }
.rec::before { content: ''; position: absolute; top: -12px; left: 18px; width: 84px; height: 12px; background: #eadfc0; border: 2px solid #b8781a; border-bottom: 0; }
.rec header { display: flex; align-items: baseline; gap: 12px; padding: 14px 16px 12px; border-bottom: 2px dotted rgba(184, 120, 26, 0.55); }
.rec-no { font-family: var(--display); font-size: 9px; color: #857a62; white-space: nowrap; }
.rec h3 { font-family: var(--display); font-weight: 400; font-size: 12px; line-height: 1.5; margin: 0; }
.rec-img { position: relative; margin: 14px 14px 0; border: 2px solid var(--ink); background: #0a1730; aspect-ratio: 4 / 3; overflow: hidden; }
.rec-img img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.rec-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-9deg); font-family: var(--display); font-size: 13px;
  color: #ff6b5a; border: 4px double #ff6b5a; padding: 9px 12px; letter-spacing: 2px; white-space: nowrap; }
.rec-body { padding: 16px 16px 8px; font-size: 18px; line-height: 1.45; }
.rec-body p { margin: 0 0 6px; }
.rec-body.redacted { display: grid; gap: 10px; padding-top: 20px; }
.rec-body .bar { display: block; height: 15px; background: var(--ink); }
.rec footer { display: flex; align-items: center; gap: 12px; padding: 10px 16px 16px; font-family: var(--display); font-size: 9px; color: #857a62; }
.rec-progress { position: relative; flex: 1; height: 10px; border: 2px solid var(--ink); }
.rec-progress i { position: absolute; left: 0; top: 0; bottom: 0; background: #c27d12; }
.rec.open .rec-state { color: #2f7d4f; }
.rec.open.fresh .rec-img img { animation: declass 900ms steps(9, end) both; }
@keyframes declass { from { filter: brightness(0.15) saturate(0); } to { filter: none; } }

/* ---------- the teaser, with sound, in a dialog */
.film { width: min(96vw, 1280px); max-width: none; padding: 0; border: 2px solid var(--brass); background: #000; box-shadow: 10px 10px 0 0 var(--shadow); }
.film::backdrop { background: rgba(3, 7, 16, 0.86); }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.film .close { position: absolute; top: 12px; right: 12px; z-index: 1; background: rgba(5, 11, 25, 0.8); }

.foot { max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; border-top: 2px dotted rgba(226, 180, 90, 0.45); color: var(--foam); font-size: 16px; }
.foot p { margin: 0 0 6px; }
.foot p:first-child { font-family: var(--display); font-size: 11px; color: var(--cream); margin-bottom: 12px; }

/* ---------- narrow screens: pass first, then the list */
@media (max-width: 960px) {
  .desk { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; }
  .pass-col { position: static; }
  .records-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { padding-left: 42%; }
}
@media (max-width: 760px) {
  .hero { align-items: end; min-height: max(560px, 92svh); }
  .hero-video { object-position: 27% 50%; }
  .hero-shade { background: linear-gradient(180deg, rgba(5, 11, 25, 0.35) 0%, rgba(5, 11, 25, 0) 26%, rgba(5, 11, 25, 0.55) 56%, #050b19 100%); }
  .hero-inner { padding: 0 0 44px; width: calc(100% - 32px); }
  .hero-logo { max-width: 420px; margin-bottom: 22px; }
  .hero-sub { font-size: 18px; margin-bottom: 26px; }
  .top { padding: 16px; justify-content: center; }
  .top nav { gap: 22px; }
}
@media (max-width: 520px) {
  body { font-size: 18px; }
  .desk { padding: 40px 16px 64px; }
  .records { padding: 0 16px 72px; }
  .records-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .rec-img { aspect-ratio: 16 / 10; }
  .rec { --tilt: 0deg !important; }
  .hero-cta { display: grid; width: 100%; }
  .hero-cta .btn { width: 100%; }
  .top a { font-size: 10px; }
  .foot { padding: 24px 16px 40px; }
  .row { grid-template-columns: 34px minmax(0, 1fr); padding: 18px 16px; }
  .row .act { grid-column: 2; align-items: stretch; }
  .row .act .btn { width: 100%; }
  .row.done .act { align-items: flex-start; }
  .postlink { grid-template-columns: minmax(0, 1fr); }
  .list-title { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pass .stamp.landing, .pass.thud, .rec.open.fresh .rec-img img { animation: none; }
}
