@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin-800-normal.woff2") format("woff2");
  font-weight: 800; font-display: swap;
}

:root {
  --ink: #0a0a0f;
  --paper: #f4efe2;
  --amber: #ffb300;
  --amber-dim: #6b4c00;
  --panel: #121218;
  --panel-2: #1b1b24;
  --accent: #ff2e6e;
  --font-board: "IBM Plex Mono", "Courier New", monospace;
  --font-body: "Archivo", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink); color: var(--paper);
  font-family: var(--font-body);
  min-height: 100vh;
}
body.is-shaking { animation: shake 0.5s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-10px, 4px) rotate(-0.6deg); }
  30% { transform: translate(9px, -5px) rotate(0.5deg); }
  45% { transform: translate(-7px, 5px) rotate(-0.4deg); }
  60% { transform: translate(6px, -3px) rotate(0.3deg); }
  75% { transform: translate(-4px, 2px) rotate(-0.2deg); }
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { margin: 0; }
button, input { font-family: inherit; }

/* ---------- persistent page backdrop + flying horse ---------- */
#pageBg {
  position: fixed; inset: 0; z-index: 0;
  background: url("assets/window-bg.webp") center 35% / cover no-repeat;
  filter: saturate(1.05);
}
#pageBg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,5,12,0.72) 0%, rgba(5,5,12,0.88) 40%, rgba(5,5,12,0.96) 100%);
}
#bgHorse {
  position: fixed; z-index: 1; pointer-events: none;
  width: min(30vw, 320px);
  top: 20%; left: 8%;
  opacity: 0.8;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
  animation: horseDrift 28s ease-in-out infinite;
}
@keyframes horseDrift {
  0%   { top: 18%; left: 6%;  transform: rotate(-4deg) scale(1); }
  20%  { top: 10%; left: 62%; transform: rotate(3deg) scale(1.05); }
  40%  { top: 40%; left: 78%; transform: rotate(-2deg) scale(0.95); }
  55%  { top: 60%; left: 45%; transform: rotate(4deg) scale(1); }
  75%  { top: 68%; left: 10%; transform: rotate(-3deg) scale(1.05); }
  100% { top: 18%; left: 6%;  transform: rotate(-4deg) scale(1); }
}
@media (max-width: 720px) {
  #bgHorse { width: min(46vw, 220px); opacity: 0.6; }
}

/* ---------- shatter overlay for turbulence ---------- */
#shatterLayer { position: fixed; inset: 0; z-index: 700; pointer-events: none; }
.shard {
  position: fixed; will-change: transform, opacity;
}

/* ---------- topline / rail ---------- */
.topline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 34px);
  background: linear-gradient(rgba(10,10,15,0.8), transparent);
}
.brand { font-family: var(--font-board); font-weight: 700; font-size: 15px; letter-spacing: 0.04em; color: var(--amber); }
.brand-sub { color: var(--paper); opacity: 0.6; font-weight: 500; }
.ca-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--amber-dim);
  border-radius: 3px; padding: 7px 14px; font-family: var(--font-board); font-size: 12px;
  color: var(--amber); cursor: pointer; transition: border-color 0.2s;
}
.ca-pill span:first-child { opacity: 0.6; }
.ca-pill:hover { border-color: var(--amber); }
.ca-pill.is-copied { border-color: var(--accent); color: var(--accent); }

.rail {
  position: fixed; left: clamp(14px, 3vw, 30px); top: 50%; transform: translateY(-50%); z-index: 400;
  display: flex; flex-direction: column; gap: 16px;
}
.rail a {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--font-board); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  opacity: 0.5; transition: opacity 0.2s;
}
.rail a span { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--paper); transition: background 0.2s; }
.rail a:hover, .rail a.is-active { opacity: 1; }
.rail a.is-active span { background: var(--amber); border-color: var(--amber); }
@media (max-width: 900px) { .rail a span + * { display: none; } }
@media (max-width: 600px) { .rail { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-board); font-weight: 700; font-size: 13px; letter-spacing: 0.03em;
  padding: 12px 24px; border-radius: 3px; text-decoration: none; border: 1px solid var(--amber-dim);
  cursor: pointer; transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-primary { background: var(--amber); color: #1a0f00; border-color: var(--amber); box-shadow: 0 8px 20px -8px rgba(255,179,0,0.6); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--paper); }
.btn-ghost:hover { border-color: var(--amber); }
.btn-text { background: none; border-color: transparent; color: var(--paper); opacity: 0.7; text-decoration: underline; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- hero / window / board ---------- */
main { position: relative; z-index: 5; }
.board-section {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 110px 20px 50px; position: relative; overflow: hidden;
}
.window {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
}
.window-bg { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(1.15); }
.window-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,5,12,0.35) 0%, rgba(5,5,12,0.75) 55%, rgba(5,5,12,0.96) 100%);
}
.ticker { font-family: var(--font-board); font-size: clamp(38px, 7vw, 62px); color: var(--paper); letter-spacing: 0.02em; text-shadow: 0 2px 20px rgba(0,0,0,0.6); }
.sub { opacity: 0.8; margin: 6px 0 26px; }

.board {
  width: min(94vw, 640px); background: var(--panel); border: 2px solid #2a2a34;
  border-radius: 4px; padding: 6px; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.8);
}
.board-head, .board-row {
  display: grid; grid-template-columns: 90px 1fr 130px; gap: 8px;
  padding: 10px 12px; text-align: left; align-items: center;
}
.board-head {
  font-family: var(--font-board); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper); opacity: 0.5;
}
.board-row {
  width: 100%; background: none; border: none; border-top: 1px solid #262630; cursor: pointer;
  font-family: var(--font-board); color: var(--amber); font-size: 14px;
  transition: background 0.15s;
}
.board-row:hover { background: rgba(255,179,0,0.06); }
.flip-cell {
  display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  transform-origin: 50% 50%; transition: transform 0.14s linear;
}
.flip-cell.is-flipping { transform: scaleY(0.05); }
.status { color: var(--paper); }
.is-locked-status { color: #4ee08a; }
@media (max-width: 560px) {
  .board-head, .board-row { grid-template-columns: 66px 1fr 84px; font-size: 11px; }
}

.search-rig { display: flex; gap: 8px; margin-top: 22px; }
.search-input {
  background: var(--panel); border: 1px solid #2a2a34; color: var(--paper);
  font-family: var(--font-board); font-size: 13px; padding: 11px 14px; border-radius: 3px;
  min-width: 200px;
}
.search-input:focus { outline: none; border-color: var(--amber); }
.hero-actions { margin-top: 24px; }

/* ---------- search takeover easter egg ---------- */
.search-takeover {
  position: fixed; inset: 0; z-index: 9000; background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; overflow: hidden;
}
.search-takeover[hidden] { display: none; }
.takeover-rows { display: flex; flex-direction: column; gap: 4px; }
.takeover-rows div {
  font-family: var(--font-board); font-weight: 700; color: var(--amber);
  font-size: clamp(30px, 9vw, 90px); letter-spacing: 0.1em; text-align: center; white-space: nowrap;
}
.takeover-horse {
  position: fixed; top: 50%; left: -300px; width: 220px; z-index: 9001;
  transform: translateY(-50%); filter: drop-shadow(0 10px 30px rgba(0,0,0,0.6));
}

/* ---------- shared ledge chrome ---------- */
.ledge { max-width: 900px; margin: 0 auto; padding: 120px 24px 60px; text-align: center; }
.ledge-kicker { font-family: var(--font-board); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.ledge-title { font-family: var(--font-board); font-size: clamp(26px, 4.4vw, 42px); margin-bottom: 10px; }
.ledge-sub { opacity: 0.75; margin: 0 0 34px; }
.myth-text { max-width: 62ch; margin: 0 auto; text-align: left; font-size: 17px; line-height: 1.7; }
.myth-text p { margin: 0 0 16px; }

.stone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .stone-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-plaque {
  background: var(--panel); border: 1px solid #26262f; border-radius: 4px;
  padding: 20px 12px; display: flex; flex-direction: column; gap: 6px;
}
.stat-value { font-family: var(--font-board); font-weight: 700; font-size: 19px; color: var(--amber); }
.stat-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.6; }

.buy-steps { list-style: none; margin: 0 0 36px; padding: 0; text-align: left; max-width: 46ch; margin-left: auto; margin-right: auto; }
.buy-steps li { display: flex; gap: 12px; padding: 8px 0; font-size: 15px; }
.buy-steps b { font-family: var(--font-board); color: var(--amber); }
.buy-ca-row {
  display: inline-flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid #26262f; border-radius: 999px; padding: 10px 10px 10px 20px;
  font-family: var(--font-board); font-size: 13px;
}
.buy-ca-value { font-family: var(--font-board); background: var(--panel-2); color: var(--paper); border: 1px solid var(--amber-dim); padding: 8px 14px; border-radius: 999px; cursor: pointer; }

/* ---------- boarding pass ---------- */
.boarding-rig { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.pass-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.pass-preview { width: min(94vw, 640px); }
#passCanvas { width: 100%; border: 1px solid #26262f; border-radius: 4px; }
.pass-btns { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

/* ---------- in flight entertainment ---------- */
.ife-rig { max-width: 560px; margin: 0 auto; }
.ife-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.ife-tab {
  flex: 1; background: var(--panel); border: 1px solid #26262f; border-bottom: none;
  color: var(--paper); opacity: 0.6; font-family: var(--font-board); font-size: 11px;
  padding: 10px 6px; cursor: pointer; border-radius: 4px 4px 0 0;
}
.ife-tab.is-active { opacity: 1; color: var(--amber); background: var(--panel-2); }
.ife-screen {
  background: var(--panel-2); border: 1px solid #26262f; border-radius: 0 0 6px 6px;
  aspect-ratio: 4/3; position: relative; overflow: hidden;
}
.ife-channel { position: absolute; inset: 0; display: none; padding: 16px; }
.ife-channel.is-active { display: block; }
.safety-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: 100%; }
.safety-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 10px; opacity: 0.85; }
.safety-item svg { width: 36px; height: 36px; }
.sky-map { position: relative; width: 100%; height: 100%; background: radial-gradient(circle at 50% 50%, #1c2440, #0a0a12); border-radius: 4px; overflow: hidden; }
.sky-map::before { content: ""; position: absolute; inset: 0; background-image: repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 24px, rgba(255,255,255,0.06) 25px); }
.sky-dot { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); transition: left 1.6s ease-in-out, top 1.6s ease-in-out; top: 50%; left: 50%; }
.turb-copy { opacity: 0.7; margin: 30% 0 16px; }
#turbBtn { display: block; margin: 0 auto; }

/* ---------- baggage carousel ---------- */
.carousel-wrap { width: 100%; max-width: 700px; margin: 0 auto 22px; overflow: hidden; border: 1px solid #26262f; border-radius: 6px; background: var(--panel); }
.carousel-track { display: flex; gap: 14px; padding: 18px; animation: carousel 22s linear infinite; width: max-content; }
@keyframes carousel { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.bag-tag {
  flex: none; background: var(--panel-2); border: 1px solid var(--amber-dim); border-radius: 4px;
  padding: 10px 16px; font-family: var(--font-board); font-size: 12px; color: var(--amber);
}
.bag-form { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- attendant call ---------- */
#attendantBtn {
  position: fixed; right: 16px; bottom: 16px; z-index: 500;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--amber); color: #1a0f00; border: none; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0,0,0,0.5);
  transition: transform 0.15s var(--ease);
}
#attendantBtn:hover { transform: scale(1.06); }
#attendantBtn:active { transform: scale(0.92); }
#attendantFlyLayer { position: fixed; inset: 0; z-index: 9500; pointer-events: none; overflow: hidden; }
.fly-horse {
  position: fixed; top: 40%; left: -300px; width: 200px;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.5));
}
.attendant-msg {
  position: fixed; right: 84px; bottom: 30px; z-index: 501;
  background: var(--panel); border: 1px solid var(--amber-dim); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; font-size: 13px; max-width: 260px;
  opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.attendant-msg.is-on { opacity: 1; transform: translateY(0); }

/* ---------- footer ---------- */
.site-footer { position: relative; z-index: 5; text-align: center; padding: 70px 20px 90px; }
.footer-line { font-family: var(--font-board); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin: 0 0 18px; }
.footer-socials { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.footer-socials a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); border: 1px solid #26262f; transition: border-color 0.2s, transform 0.2s var(--ease);
}
.footer-socials a:hover { border-color: var(--amber); transform: translateY(-3px); }
.footer-ca { font-size: 11px; opacity: 0.5; word-break: break-all; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  body.is-shaking { animation: none; }
  .carousel-track { animation: none; }
  .sky-dot { transition: none; }
  #bgHorse { animation: none; top: 20%; left: 8%; transform: none; }
}
