/* THE NIGHT LOCK — Glamsterdam unofficial site */

:root {
  --canal: #070705;
  --water: #0b1214;
  --gold: #d4a017;
  --gold-bright: #e8c547;
  --gold-dim: #8a6a10;
  --ivory: #f4ede0;
  --ivory-dim: rgba(244, 237, 224, 0.72);
  --ivory-mute: rgba(244, 237, 224, 0.48);
  --line: rgba(212, 160, 23, 0.38);
  --line-strong: rgba(232, 197, 71, 0.7);
  --panel: rgba(7, 7, 5, 0.72);
  --panel-solid: rgba(11, 12, 10, 0.92);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --display: "Bodoni Moda", "Didot", "Bodoni MT", serif;
  --ui: "Figtree", "Segoe UI", sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  --radius: 2px;
  --sheet-top: 46vh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--canal);
  color: var(--ivory);
  font-family: var(--ui);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  position: relative;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
a {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

h1, h2, h3, p, ol, ul, figure {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  padding: 8px 12px;
  background: var(--gold);
  color: #140f05;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

/* ——— 3D stage ——— */
#scene-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--canal);
  pointer-events: none;
}
#canal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.scene-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 7, 5, 0.28) 0%, transparent 22%, transparent 58%, rgba(7, 7, 5, 0.5) 100%),
    radial-gradient(120% 80% at 70% 40%, transparent 40%, rgba(7, 7, 5, 0.35) 100%);
  pointer-events: none;
}

/* ——— Loader: lock filling, gates easing open ——— */
.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px calc(24px + var(--safe-b));
  background: var(--canal);
  text-align: center;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-lock {
  width: min(280px, 72vw);
  aspect-ratio: 4 / 5;
  margin-bottom: 28px;
}
.loader-chamber {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0c0b;
  border: 1px solid var(--line);
  clip-path: polygon(10% 0, 90% 0, 100% 8%, 100% 100%, 0 100%, 0 8%);
}
.loader-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background:
    linear-gradient(180deg, rgba(232, 197, 71, 0.95) 0%, rgba(212, 160, 23, 0.7) 18%, rgba(11, 18, 20, 0.2) 55%, rgba(11, 18, 20, 0.85) 100%);
  box-shadow: 0 -20px 50px rgba(212, 160, 23, 0.35);
  transition: height 2.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.loader.is-filling .loader-water {
  height: 100%;
}
.loader-gate {
  position: absolute;
  top: 0;
  width: 48%;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, #1a140c 0 10px, #120e09 10px 12px),
    linear-gradient(180deg, #2a2116, #0c0a07);
  border: 1px solid rgba(212, 160, 23, 0.22);
  transform-origin: top center;
  transition: transform 1.6s cubic-bezier(0.4, 0.05, 0.2, 1) 1.1s;
  z-index: 2;
}
.loader-gate::after {
  content: "";
  position: absolute;
  inset: 12% 18%;
  border: 1px solid rgba(212, 160, 23, 0.28);
  background:
    linear-gradient(135deg, transparent 46%, rgba(212, 160, 23, 0.35) 50%, transparent 54%),
    linear-gradient(45deg, transparent 46%, rgba(212, 160, 23, 0.35) 50%, transparent 54%);
}
.loader-gate-left {
  left: 0;
  transform-origin: left center;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}
.loader-gate-right {
  right: 0;
  transform-origin: right center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12% 100%);
}
.loader.is-open .loader-gate-left {
  transform: perspective(600px) rotateY(62deg);
}
.loader.is-open .loader-gate-right {
  transform: perspective(600px) rotateY(-62deg);
}
.loader-mark {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 38%;
  height: auto;
  transform: translate(-50%, -50%) scale(0.84);
  opacity: 0;
  z-index: 3;
  filter: drop-shadow(0 0 18px rgba(232, 197, 71, 0.55));
  transition: opacity 0.8s ease 1.6s, transform 0.8s ease 1.6s;
}
.loader.is-open .loader-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.loader-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.loader-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}
.loader-tick {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ivory-dim);
  margin-bottom: 14px;
}
.loader-status {
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 18px;
}
.loader-disclaimer {
  max-width: 36rem;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ivory-mute);
}
.loader-skip {
  margin-top: 18px;
  padding: 10px 22px;
  border: 1px solid var(--line);
  color: var(--ivory);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  background: rgba(212, 160, 23, 0.08);
}
.loader-skip:hover,
.loader-skip:focus-visible {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

/* ——— App chrome ——— */
.app {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  pointer-events: none;
}
.app.is-booting {
  visibility: hidden;
}
.app.is-live {
  visibility: visible;
}

.top-rail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + var(--safe-t)) 18px 8px 16px;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(7, 7, 5, 0.7), transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 16px rgba(212, 160, 23, 0.35);
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.brand-note {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ivory-mute);
  white-space: nowrap;
}

/* ——— Lock navigation (chamber nodes, not a wheel/dock/table) ——— */
.lock-nav {
  position: fixed;
  left: 50%;
  bottom: calc(14px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: calc(100% - 20px);
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  pointer-events: auto;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.lock-track {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0;
  min-width: 0;
}
.lock-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 6px;
  color: var(--ivory-mute);
}
.lock-node-gate {
  width: 28px;
  height: 18px;
  border: 1px solid var(--line);
  background: rgba(11, 18, 20, 0.8);
  position: relative;
  clip-path: polygon(6% 0, 94% 0, 100% 20%, 100% 100%, 0 100%, 0 20%);
}
.lock-node-gate::before,
.lock-node-gate::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 42%;
  background: #16110b;
  border: 1px solid rgba(212, 160, 23, 0.2);
  transition: transform 0.5s ease, background 0.4s ease;
}
.lock-node-gate::before { left: 2px; transform-origin: left center; }
.lock-node-gate::after { right: 2px; transform-origin: right center; }
.lock-node.is-active .lock-node-gate,
.lock-node[aria-current="true"] .lock-node-gate {
  border-color: var(--gold-bright);
  box-shadow: inset 0 -8px 10px rgba(212, 160, 23, 0.35);
}
.lock-node.is-active .lock-node-gate::before {
  transform: perspective(40px) rotateY(50deg);
  background: rgba(212, 160, 23, 0.35);
}
.lock-node.is-active .lock-node-gate::after {
  transform: perspective(40px) rotateY(-50deg);
  background: rgba(212, 160, 23, 0.35);
}
.lock-node-label {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lock-node-label em {
  font-style: normal;
  color: var(--gold);
  margin-right: 3px;
}
.lock-node:hover,
.lock-node:focus-visible {
  color: var(--ivory);
}
.lock-sill {
  width: 10px;
  height: 2px;
  background: var(--line);
  flex: 0 0 auto;
  margin: 0 1px 14px;
}
.btn-auto {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.btn-auto-lever {
  width: 16px;
  height: 16px;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  position: relative;
}
.btn-auto-lever::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 7px;
  background: var(--gold);
  transform: translate(-50%, -80%) rotate(-35deg);
  transform-origin: bottom center;
  transition: transform 0.3s ease;
}
.btn-auto.is-on,
.btn-auto[aria-pressed="true"] {
  color: var(--gold-bright);
}
.btn-auto.is-on .btn-auto-lever::after,
.btn-auto[aria-pressed="true"] .btn-auto-lever::after {
  transform: translate(-50%, -80%) rotate(35deg);
  background: var(--gold-bright);
}

/* ——— Chambers / panels ——— */
.sheet {
  pointer-events: none;
}
.chamber {
  position: fixed;
  z-index: 4;
  width: min(560px, calc(100% - 36px));
  max-height: calc(100dvh - 160px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 26px 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: translate3d(0, 18px, -80px) rotateX(6deg) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  filter: blur(8px);
  pointer-events: none;
  transition:
    opacity 0.9s ease,
    transform 1.1s cubic-bezier(0.22, 0.7, 0.2, 1),
    filter 0.9s ease,
    visibility 0.9s ease;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}
.chamber.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  filter: blur(0);
  pointer-events: auto;
}
.chamber[hidden] {
  display: block; /* keep layout for transitions; visibility handles hide */
}
#chamber-arrival {
  top: calc(78px + var(--safe-t));
  left: max(20px, var(--safe-l));
}
#chamber-locks {
  top: calc(78px + var(--safe-t));
  right: max(20px, var(--safe-r));
  left: auto;
}
#chamber-tide {
  left: 0;
  right: 0;
  margin-inline: auto;
  bottom: calc(92px + var(--safe-b));
  top: auto;
  width: min(680px, calc(100% - 36px));
}
#chamber-high {
  top: calc(78px + var(--safe-t));
  left: max(20px, var(--safe-l));
}
#chamber-quay {
  top: calc(78px + var(--safe-t));
  right: max(20px, var(--safe-r));
  left: auto;
  width: min(600px, calc(100% - 36px));
}

.chamber-index {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.chamber-index span {
  color: var(--gold-bright);
  margin-right: 8px;
}
.tagline {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--gold-bright);
  margin-bottom: 10px;
}
.headline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5.4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.headline .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  margin-right: 0.28em;
}
.headline .word > span {
  display: inline-block;
  transform: translateY(110%) rotateX(-40deg);
  transform-origin: bottom;
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.16, 0.8, 0.2, 1), opacity 0.6s ease;
}
.chamber.is-active .headline.is-revealed .word > span {
  transform: translateY(0) rotateX(0);
  opacity: 1;
}
.subhead,
.lead {
  font-size: 15px;
  color: var(--ivory-dim);
  max-width: 42em;
  margin-bottom: 18px;
}
.disclaimer,
.official-sources,
.quiet-note {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ivory-mute);
}
.arrival-disclaimer {
  margin-top: 16px;
}
.official-sources a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ——— Buttons (gate / lock-plate / quay-ring) ——— */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 6px 0 18px;
}
.btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ivory);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.18s ease, filter 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.btn-kicker {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 2px;
}
.btn-label {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 236, 180, 0.28) 48%, transparent 62%);
  transform: translateX(-120%);
  pointer-events: none;
  z-index: 1;
}
.btn:hover::after,
.btn:focus-visible::after {
  animation: shine 0.7s ease;
}
@keyframes shine {
  to { transform: translateX(120%); }
}
.btn:hover,
.btn:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 0 22px rgba(212, 160, 23, 0.28);
}
.btn:active {
  transform: scale(0.97);
}

.btn-gate {
  min-width: 116px;
  padding: 12px 26px 14px;
  background:
    linear-gradient(180deg, rgba(212, 160, 23, 0.28), rgba(138, 106, 16, 0.18)),
    #16110a;
  border: 1px solid var(--line-strong);
  clip-path: polygon(10% 0, 90% 0, 100% 16%, 94% 100%, 6% 100%, 0 16%);
}
.btn-gate .btn-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.btn-plate {
  min-width: 132px;
  padding: 10px 18px 12px;
  background: #14110c;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 3px rgba(20, 16, 10, 0.9);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
}
.btn-plate::before,
.btn-plate::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3a2e16;
  box-shadow: 0 0 0 1px var(--gold-dim);
  z-index: 2;
  top: 5px;
}
.btn-plate::before { left: 6px; }
.btn-plate::after { right: 6px; }
.ca-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.btn-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background:
    radial-gradient(circle at 50% 45%, rgba(212, 160, 23, 0.2), transparent 62%),
    #0c0b08;
  box-shadow: inset 0 0 0 5px #070705, 0 0 16px rgba(212, 160, 23, 0.25);
  flex: 0 0 auto;
}
.btn-ring .btn-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.btn-plaque {
  margin-top: 10px;
  min-width: 0;
  width: auto;
  padding: 8px 14px;
}

/* Chart plaque */
.chart-plaque {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(212, 160, 23, 0.07), transparent 40%),
    rgba(10, 12, 11, 0.7);
  padding: 14px 16px 16px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px);
}
.plaque-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.plaque-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  margin: 4px 0 8px;
}
.plaque-body {
  font-size: 13px;
  color: var(--ivory-dim);
}
.chart-embed {
  margin-top: 12px;
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.chart-embed iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
  background: #0b1214;
}
.chart-embed.is-hidden,
.chart-embed[hidden] {
  display: none;
}

/* Locks / why / about */
.lock-cards,
.why-grid {
  display: grid;
  gap: 10px;
  margin: 4px 0 18px;
}
.lock-card,
.why-card {
  padding: 14px 14px 16px;
  border: 1px solid rgba(212, 160, 23, 0.22);
  background: rgba(11, 12, 10, 0.45);
}
.lock-card h3,
.why-card h3,
.about-block h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 8px;
}
.lock-card p,
.why-card p,
.about-block p {
  font-size: 13.5px;
  color: var(--ivory-dim);
}
.about-block p + p {
  margin-top: 10px;
}
.card-eip {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.about-block {
  margin-top: 8px;
}
.still-frame {
  margin: 16px 0;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #000;
}
.still-frame img {
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  transform: scale(1.02);
  animation: ken 28s ease-in-out infinite alternate;
}
@keyframes ken {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.06) translate3d(-0.6%, -0.4%, 0); }
}
.still-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0;
  background: none;
  overflow: hidden;
}
.still-pair img {
  border: 1px solid var(--line);
}

/* Tide staff */
.tide-staff {
  list-style: none;
  padding: 4px 0 8px 0;
  margin: 0 0 12px;
  border-left: 2px solid var(--line);
}
.tide-mark {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 0 0 18px 16px;
  position: relative;
}
.tide-mark::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--canal);
  border: 2px solid var(--gold-dim);
  transform: rotate(45deg);
}
.tide-mark.is-past::before { border-color: var(--ivory-mute); background: #2a2a24; }
.tide-mark.is-now::before { border-color: var(--gold-bright); background: var(--gold); box-shadow: 0 0 10px rgba(232, 197, 71, 0.7); }
.tide-mark.is-held::before { border-color: var(--gold-dim); background: #3a2a0c; }
.tide-level {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding-top: 4px;
}
.tide-mark h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}
.tide-when {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  margin: 2px 0 6px;
}
.tide-mark p:last-child {
  font-size: 13.5px;
  color: var(--ivory-dim);
}

.quay-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}
.games-heading {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 6px;
}
.games-lead {
  font-size: 13.5px;
  color: var(--ivory-dim);
  margin-bottom: 12px;
}
.game-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  background: rgba(11, 18, 20, 0.5);
  color: var(--ivory);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  pointer-events: auto;
}
.game-card:hover,
.game-card:focus-visible {
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(212, 160, 23, 0.2);
}
.game-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}
.game-blurb {
  font-size: 12.5px;
  color: var(--ivory-dim);
}
.game-best {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-top: auto;
}

.site-footer {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.footer-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 10px;
}
.footer-brand {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.site-footer .disclaimer {
  margin-bottom: 10px;
}

/* Toasts */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  color: var(--ivory);
  font-size: 13px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Game stage */
.game-stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: rgba(7, 7, 5, 0.72);
  backdrop-filter: blur(8px);
  padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b));
  pointer-events: auto;
}
.game-stage[hidden] {
  display: none;
}
.game-stage-frame {
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px);
}
.game-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.game-stage-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
}
.game-stage-body {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 12px;
}
.game-hud {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.game-canvas,
.game-board {
  width: 100%;
  height: min(420px, calc(100dvh - 220px));
  background: #0b1214;
  border: 1px solid var(--line);
  display: block;
  touch-action: none;
}
.game-help {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ivory-dim);
}
.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.lane-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.lane-btn {
  padding: 12px 8px;
  border: 1px solid var(--line);
  background: #14110c;
  color: var(--ivory);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lane-btn:hover,
.lane-btn:focus-visible {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.touch-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 10px;
  margin-top: 12px;
  width: 100%;
  border: 1px solid var(--gold);
  background: rgba(212, 160, 23, 0.08);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ivory);
}
.game-over-card {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(7, 7, 5, 0.86);
  text-align: center;
  padding: 20px;
}
.game-over-card h3 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
}
.wick-wrap {
  height: 14px;
  border: 1px solid var(--line);
  margin: 8px 0 12px;
  background: #0a0c0b;
}
.wick-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #8a6a10, #e8c547);
  transform-origin: left center;
}

/* Phone: 3D above, sheet below */
@media (max-width: 820px) {
  #scene-root {
    height: var(--sheet-top);
    bottom: auto;
  }
  .scene-veil {
    background:
      linear-gradient(180deg, rgba(7, 7, 5, 0.15) 0%, transparent 30%, rgba(7, 7, 5, 0.55) 100%);
  }
  .top-rail {
    background: linear-gradient(180deg, rgba(7, 7, 5, 0.5), transparent);
  }
  .lock-nav {
    top: calc(var(--sheet-top) - 6px);
    bottom: auto;
    width: calc(100% - 16px);
    max-width: none;
    transform: translateX(-50%) translateY(-50%);
    padding: 6px 8px;
  }
  .lock-node-label em {
    display: none;
  }
  .lock-node-label {
    font-size: 7px;
    letter-spacing: 0.04em;
  }
  .lock-sill {
    width: 6px;
    margin-bottom: 12px;
  }
  .sheet {
    position: fixed;
    top: var(--sheet-top);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    pointer-events: auto;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(7, 7, 5, 0.2) 0%, var(--canal) 28px);
    padding-top: 28px;
  }
  .chamber,
  #chamber-arrival,
  #chamber-locks,
  #chamber-tide,
  #chamber-high,
  #chamber-quay {
    position: absolute;
    inset: 28px 0 0;
    width: 100%;
    max-height: none;
    transform: translate3d(0, 24px, 0);
    filter: none;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    clip-path: none;
    background: var(--panel-solid);
    padding: 20px 16px calc(20px + var(--safe-b));
    box-shadow: none;
    backdrop-filter: none;
  }
  .chamber.is-active,
  #chamber-tide.is-active {
    transform: translate3d(0, 0, 0);
    --tilt-x: 0deg;
    --tilt-y: 0deg;
  }
  .headline {
    font-size: clamp(1.7rem, 8.4vw, 2.3rem);
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  .still-pair {
    grid-template-columns: 1fr;
  }
  .tide-mark {
    grid-template-columns: 56px 1fr;
    gap: 8px;
    padding-left: 14px;
  }
  .toasts {
    bottom: calc(12px + var(--safe-b));
  }
  .actions {
    gap: 8px;
  }
  .btn-gate,
  .btn-plate {
    min-width: 0;
    flex: 1 1 auto;
  }
}

@media (max-width: 400px) {
  .lock-node {
    padding: 4px 3px;
  }
  .lock-node-gate {
    width: 22px;
    height: 16px;
  }
  .brand-note {
    font-size: 8px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .loader-water {
    height: 100%;
  }
  .loader-gate-left {
    transform: perspective(600px) rotateY(62deg);
  }
  .loader-gate-right {
    transform: perspective(600px) rotateY(-62deg);
  }
  .loader-mark {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  .chamber,
  #chamber-tide {
    filter: none;
    transform: none;
  }
  .headline .word > span {
    transform: none;
    opacity: 1;
  }
  .still-frame img {
    animation: none;
    transform: none;
  }
}

/* Wide desktop typography breathing room */
@media (min-width: 1440px) {
  #chamber-arrival,
  #chamber-high {
    width: min(600px, 38vw);
  }
  #chamber-locks,
  #chamber-quay {
    width: min(640px, 40vw);
  }
}
