/* plane-transit.com: always dark. Tokens first; everything else uses them. */
:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-raise: #0d0f14;
  --panel: #111319;
  --line: rgba(236, 232, 222, 0.09);
  --line-strong: rgba(236, 232, 222, 0.18);
  --text: #ece8de;
  --muted: #a3a29c;
  --dim: #6f7077;
  --accent: #f0c878;
  --accent-soft: rgba(240, 200, 120, 0.14);
  --radius: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1360px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(240, 200, 120, 0.07), transparent 70%),
    radial-gradient(900px 400px at 85% 0%, rgba(120, 150, 220, 0.05), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: var(--gutter); top: -60px; z-index: 20;
  padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #111; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- header */
.site-header {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; filter: drop-shadow(0 0 14px rgba(240, 200, 120, 0.25)); }
.brand-name { font-weight: 650; font-size: 1.05rem; letter-spacing: 0.01em; white-space: nowrap; }
.button { white-space: nowrap; }
@media (max-width: 520px) { .wide-only { display: none; } }
.button {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.03);
  color: var(--text); text-decoration: none; font-size: 0.92rem; font-weight: 550;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.button:hover { border-color: var(--accent); background: var(--accent-soft); }
.button svg { width: 18px; height: 18px; fill: currentColor; }

/* ----------------------------------------------------------------- intro */
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.intro { padding: clamp(24px, 6vw, 72px) 0 clamp(24px, 4vw, 44px); max-width: 760px; }
.intro h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5.2vw, 3.6rem); line-height: 1.04; letter-spacing: -0.025em; font-weight: 700;
}
.intro p { margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 60ch; }
.intro p a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.intro p a:hover { text-decoration-color: var(--accent); }
.intro .count { color: var(--dim); font-size: 0.9rem; margin-top: 14px; }

/* --------------------------------------------------------------- gallery */
.gallery {
  list-style: none; margin: 0; padding: 0 0 64px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 26px 20px;
}
.tile { margin: 0; }
.tile-link { display: block; text-decoration: none; border-radius: var(--radius); }
.frame {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: #000;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(0, 0, 0, 0.9);
  transition: box-shadow .3s var(--ease), transform .3s var(--ease);
}
.frame { aspect-ratio: 4 / 3; }
.frame img, .frame video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), opacity .25s linear;
}
.frame video { position: absolute; inset: 0; opacity: 0; }
.tile.is-playing .frame video { opacity: 1; }
@media (hover: hover) {
  .tile-link:hover .frame { box-shadow: 0 0 0 1px rgba(240, 200, 120, 0.45), 0 22px 50px -24px rgba(0, 0, 0, 0.95); }
  .tile-link:hover .frame img, .tile-link:hover .frame video { transform: scale(1.015); }
}
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(8, 9, 12, 0.55); border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.badge svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
@media (hover: hover) { .tile-link:hover .badge { opacity: 0; transform: scale(.85); } }
.tile.is-playing .badge { opacity: 0; }
.caption { display: block; padding: 9px 4px 0; color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- viewer */
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--text); overflow: hidden;
}
.viewer::backdrop { background: rgba(4, 5, 7, 0.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.viewer[open] { display: grid; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.viewer-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  width: 100%; height: 100%;
}
.viewer-stage { position: relative; display: grid; place-items: center; padding: 64px 72px; min-height: 0; }
.viewer-stage img, .viewer-stage video {
  max-width: 100%; width: auto; height: auto;
  max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px);
  border-radius: 10px; box-shadow: 0 30px 80px -30px #000; background: #000;
}
.viewer-stage video { cursor: pointer; }
.viewer-state {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(8, 9, 12, 0.6); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.viewer-state svg { width: 22px; height: 22px; fill: #fff; }
.viewer-stage.is-paused .viewer-state { opacity: 1; }
.viewer-info {
  overflow-y: auto; padding: 72px 28px 32px; border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 19, 25, 0.92), rgba(12, 13, 18, 0.96));
}
.viewer-info h2 { margin: 0 0 6px; font-size: 1.35rem; line-height: 1.2; letter-spacing: -0.01em; }
.viewer-info .when { margin: 0 0 22px; color: var(--muted); }
.viewer-info .dim { color: var(--dim); }
.viewer-info dl { margin: 0; display: grid; gap: 14px; }
.viewer-info dt { color: var(--dim); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; }
.viewer-info dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.viewer-info .safety { margin: 22px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 0.88rem; }
.viewer-info .legal { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 0.84rem; }
.viewer-info .legal a { color: var(--muted); }
.viewer-btn {
  position: absolute; z-index: 3; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: rgba(12, 13, 18, 0.7); color: var(--text);
  transition: border-color .2s, background .2s;
}
.viewer-btn:hover { border-color: var(--accent); background: rgba(40, 34, 20, 0.8); }
.viewer-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-close { top: 16px; right: 16px; }
.viewer-prev, .viewer-next { top: 50%; translate: 0 -50%; }
.viewer-prev { left: 14px; }
.viewer-next { right: calc(340px + 14px); }

@media (max-width: 900px) {
  .viewer-inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer-stage { padding: 60px 12px 12px; }
  .viewer-stage img, .viewer-stage video { max-height: calc(58vh - 72px); max-height: calc(58dvh - 72px); }
  .viewer-info { border-left: 0; border-top: 1px solid var(--line); padding: 18px 20px 28px; max-height: 42vh; }
  .viewer-info dl { grid-template-columns: 1fr 1fr; gap: 12px 18px; }
  .viewer-next { right: 8px; }
  .viewer-prev { left: 8px; }
  .viewer-prev, .viewer-next { top: calc(29vh + 30px); width: 36px; height: 36px; background: rgba(12, 13, 18, 0.55); }
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line);
  display: grid; gap: 10px; color: var(--muted); font-size: 0.92rem;
}
.site-footer p { margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-links a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.footer-links a:hover { border-color: var(--accent); }
.footer-legal { color: var(--dim); font-size: 0.84rem; }

/* ------------------------------------------------------------ text pages */
.page { max-width: 760px; padding: clamp(24px, 5vw, 56px) 0 64px; }
.page h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; margin: 0 0 18px; }
.page h2 { font-size: 1.2rem; margin: 34px 0 10px; }
.page p, .page li { color: var(--muted); }
.page a { color: var(--text); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.page a:hover { text-decoration-color: var(--accent); }
.page .small { font-size: 0.86rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
