/* ============================================================================
   Catawba News — "Frequent Flyer"
   A satirical accountability feature. Dark editorial broadsheet meets flight HUD.
   ========================================================================== */

:root {
  /* Ink / surface */
  --ink-0: #070b14;
  --ink-1: #0a1020;
  --ink-2: #0b1322;
  --paper: #eef2f3;

  /* Accent (signal red) */
  --accent: #d6453a;
  --accent-soft: #f6a08f;
  --accent-hover: #e25347;

  /* Text greys */
  --muted: #9fb0b6;
  --muted-2: #7f9298;
  --muted-3: #69767c;
  --line: #aebcc1;

  /* Status */
  --gold: #f6c84a;
  --gold-cheat: #c9a85e;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --shell: 1180px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--paper);
  background:
    radial-gradient(1200px 680px at 72% 8%, rgba(214, 69, 58, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ink-0) 0%, var(--ink-1) 48%, var(--ink-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

/* Film-grain overlay — faint aged-broadsheet texture over everything */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Reveal-on-load -------------------------------------------------------- */
.rise { animation: riseIn 0.8s var(--ease) both; }
.rise[data-d="1"] { animation-delay: 0.05s; }
.rise[data-d="2"] { animation-delay: 0.12s; }
.rise[data-d="3"] { animation-delay: 0.20s; }
.rise[data-d="4"] { animation-delay: 0.50s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================================
   Header
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 20;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 22px 36px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__seal { width: 34px; height: 34px; display: block; }
.brand__name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }

.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-1);
  background: var(--accent);
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
}

.site-header__spacer { flex: 1; }

.backlink {
  font-size: 14px;
  font-weight: 600;
  color: var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.2s var(--ease), gap 0.2s var(--ease);
}
.backlink:hover { color: #fff; gap: 10px; }
.backlink .arrow { transition: transform 0.2s var(--ease); }
.backlink:hover .arrow { transform: translateX(-3px); }

/* ============================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  z-index: 20;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 30px 36px 0;
  text-align: center;
}

.eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(54px, 9vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  margin: 14px 0 0;
}
.hero__title em { font-style: italic; font-weight: 400; color: #fff; }

.hero__sub {
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 22px);
  font-style: italic;
  line-height: 1.45;
  color: #c4d0d4;
  max-width: 34ch;
  margin: 20px auto 0;
}

/* ============================================================================
   Flight stage
   ========================================================================== */
.stage {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--shell);
  margin: 14px auto 0;
  padding: 0 16px;
}

/* Atmosphere behind the map */
.stage__atmos {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 4%;
  right: 11%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%,
    rgba(214, 69, 58, 0.14),
    rgba(120, 150, 200, 0.05) 45%,
    transparent 70%);
  filter: blur(10px);
  animation: moonGlow 18s ease-in-out infinite alternate;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #dfe7ff;
  box-shadow: 0 0 6px rgba(200, 215, 255, 0.8);
  animation: twinkle var(--dur, 3s) ease-in-out var(--delay, 0s) infinite;
}

@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
@keyframes moonGlow {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.08); }
}

.map {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}

/* The real US coastline (Census/us-atlas via geoAlbersUsa) */
.map__land { fill: url(#land); }
.map__coast-soft { fill: none; stroke: rgba(110, 150, 210, 0.16); stroke-width: 5; }
.map__coast { fill: none; stroke: rgba(158, 192, 232, 0.62); stroke-width: 1.4; stroke-linejoin: round; }
.map__states { fill: none; stroke: rgba(126, 160, 210, 0.16); stroke-width: 0.7; }
.map__grat { fill: none; stroke: rgba(126, 160, 210, 0.10); stroke-width: 0.6; }

.route {
  fill: none;
  stroke: url(#route);
  stroke-width: 2.5;
  stroke-dasharray: 2 9;
  stroke-linecap: round;
  /* draw-on contrail */
  stroke-dashoffset: 0;
  animation: contrail 8s linear forwards;
}
@keyframes contrail {
  from { opacity: 0; }
  8%   { opacity: 1; }
  to   { opacity: 1; }
}

.node-label { font-family: var(--sans); }
.node-label--name { font-size: 14px; font-weight: 700; fill: var(--paper); letter-spacing: 0.5px; }
.node-label--sub  { font-size: 11px; fill: #8aa0a6; }

/* Gulfstream: one transcontinental run, then parks at San Diego */
.jet {
  offset-path: var(--route-path);
  offset-rotate: 0deg;
  offset-distance: 0%;
  animation: planeFly 8s cubic-bezier(0.4, 0.05, 0.3, 1) forwards;
}
@keyframes planeFly {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}

/* Miles HUD */
.hud {
  position: absolute;
  right: 24px;
  top: 18px;
  z-index: 5;
  padding: 15px 19px;
  background: rgba(8, 13, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.7);
}
.hud__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 22ch;
}
.hud__miles {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 42px;
  line-height: 1;
  color: #fff;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.hud__status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--gold);
}
.hud__status .dim { color: #6f7d83; }

/* ============================================================================
   Commentary
   ========================================================================== */
.commentary {
  position: relative;
  z-index: 20;
  max-width: 760px;
  margin: 30px auto 0;
  padding: 0 36px;
  text-align: center;
}
.commentary p {
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 300;
  line-height: 1.5;
  color: #dde6e8;
  margin: 0;
}
.commentary p + p { margin-top: 18px; }

/* ============================================================================
   Boarding pass — the itinerary, made literal
   ========================================================================== */
.bp-wrap {
  position: relative;
  z-index: 20;
  max-width: 880px;
  margin: 52px auto 0;
  padding: 0 36px;
  perspective: 1400px;
}

.bp {
  --paper-1: #f4efe4;
  --paper-2: #e9e2d2;
  --ticket-ink: #1b2330;
  --ticket-mut: #6c5f4c;
  display: grid;
  grid-template-columns: 1fr 248px;
  border-radius: 16px;
  overflow: hidden;
  color: var(--ticket-ink);
  box-shadow:
    0 40px 80px -34px rgba(0, 0, 0, 0.85),
    0 2px 0 rgba(255, 255, 255, 0.04);
  transform: rotateX(4deg);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  animation: boardingDrop 0.9s 0.15s var(--ease) both;
}
.bp:hover {
  transform: rotateX(0deg) translateY(-4px);
  box-shadow: 0 52px 100px -36px rgba(0, 0, 0, 0.9);
}

@keyframes boardingDrop {
  from { opacity: 0; transform: rotateX(16deg) translateY(34px); }
  to   { opacity: 1; transform: rotateX(4deg) translateY(0); }
}

/* Main panel */
.bp__main {
  position: relative;
  background:
    radial-gradient(900px 200px at 0% 0%, rgba(214, 69, 58, 0.08), transparent 60%),
    linear-gradient(135deg, var(--paper-1), var(--paper-2));
  padding: 24px 28px 26px;
}
.bp__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(27, 35, 48, 0.14);
}
.bp__airline {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* Redacted mystery operator — names no one, everyone knows */
.bp__op { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.bp__op-k {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ticket-mut);
}
.bp__redact {
  display: inline-block;
  width: 132px;
  height: 19px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 3px, transparent 3px 6px),
    linear-gradient(180deg, #20262e, #0d1116);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 2px rgba(0,0,0,0.3);
  transform: rotate(-0.6deg);
}
.bp__op-wink {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent);
}
.bp__doc {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 5px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

.bp__route {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 6px;
}
.bp__port { display: flex; flex-direction: column; gap: 3px; }
.bp__port--to { text-align: right; }
.bp__code { font-family: var(--serif); font-size: 44px; line-height: 0.9; font-weight: 500; letter-spacing: -0.02em; }
.bp__city { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ticket-mut); text-transform: uppercase; }

.bp__plane { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.bp__plane svg { transform: rotate(90deg); flex: none; }
.bp__dash { flex: 1; height: 0; border-top: 2px dashed rgba(214, 69, 58, 0.5); }

.bp__grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 18px;
}
.bp__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bp__k {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ticket-mut);
}
.bp__v {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ticket-ink);
  line-height: 1.2;
}
.bp__fare {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed rgba(27, 35, 48, 0.22);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.bp__fare-v { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--accent); }

/* Stub */
.bp__stub {
  position: relative;
  background:
    repeating-linear-gradient(45deg, rgba(27,35,48,0.025) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, var(--paper-2), #ded5c2);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
/* Perforation between main and stub */
.bp__stub::before {
  content: "";
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 2px;
  background-image: linear-gradient(rgba(27,35,48,0.4) 50%, transparent 50%);
  background-size: 2px 9px;
}
/* Punched circles top & bottom of the perforation */
.bp__stub::after {
  content: "";
  position: absolute;
  left: -9px; top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink-1);
  box-shadow: 0 calc(100% + 18px) 0 var(--ink-2);
}
.bp__stub-head {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ticket-mut);
  padding-bottom: 4px;
}
.bp__barcode {
  margin-top: auto;
  height: 46px;
  background-image: repeating-linear-gradient(90deg,
    var(--ticket-ink) 0 2px, transparent 2px 4px,
    var(--ticket-ink) 4px 5px, transparent 5px 9px,
    var(--ticket-ink) 9px 12px, transparent 12px 14px);
  border-radius: 2px;
  opacity: 0.86;
}
.bp__stub-no {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ticket-mut);
  text-align: center;
}

/* ============================================================================
   Flight stats
   ========================================================================== */
.stats {
  position: relative;
  z-index: 20;
  max-width: 1000px;
  margin: 44px auto 0;
  padding: 0 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stat {
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.stat:hover {
  transform: translateY(-3px);
  border-color: rgba(214, 69, 58, 0.35);
  background: rgba(255, 255, 255, 0.05);
}
.stat__k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.stat__v { font-family: var(--serif); font-size: 26px; color: #fff; margin-top: 8px; }
.stat__d { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* ============================================================================
   CTA
   ========================================================================== */
.cta {
  position: relative;
  z-index: 20;
  max-width: 1000px;
  margin: 50px auto 0;
  padding: 0 36px;
}
.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 30px 34px;
  background: linear-gradient(90deg, rgba(214, 69, 58, 0.14), rgba(214, 69, 58, 0.04));
  border: 1px solid rgba(214, 69, 58, 0.3);
  border-radius: 16px;
}
.cta__title { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); font-weight: 400; color: #fff; line-height: 1.1; }
.cta__sub { font-size: 15px; color: #c4d0d4; margin-top: 7px; max-width: 52ch; }

.btn {
  flex: none;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 16px 28px;
  border-radius: 11px;
  box-shadow: 0 12px 30px -10px rgba(214, 69, 58, 0.6);
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 18px 38px -12px rgba(214, 69, 58, 0.7); }

/* ============================================================================
   Disclaimer
   ========================================================================== */
.disclaimer {
  position: relative;
  z-index: 20;
  max-width: 1000px;
  margin: 40px auto 0;
  padding: 30px 36px 56px;
}
.disclaimer p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted-3);
  text-align: center;
  max-width: 90ch;
  margin: 0 auto;
}

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; padding: 18px 20px; }
  .site-header__spacer { display: none; }
  .backlink { width: 100%; order: 3; }
  .hero { padding: 22px 20px 0; }
  .stats { grid-template-columns: 1fr; }
  .hud { position: static; margin: 16px auto 0; max-width: 360px; right: auto; top: auto; }
  .cta__inner { flex-direction: column; align-items: flex-start; }
  .btn { width: 100%; text-align: center; }

  .bp-wrap { padding: 0 20px; }
  .bp { grid-template-columns: 1fr; }
  .bp__grid { grid-template-columns: repeat(2, 1fr); }
  .bp__code { font-size: 38px; }
  /* Perforation runs horizontally when stacked */
  .bp__stub::before { left: 0; right: 0; top: -1px; bottom: auto; width: auto; height: 2px;
    background-image: linear-gradient(90deg, rgba(27,35,48,0.4) 50%, transparent 50%); background-size: 9px 2px; }
  .bp__stub::after { left: -9px; top: -9px; box-shadow: calc(100% + 18px) 0 0 var(--ink-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  /* Park the jet at the destination, draw the route, and reveal content. */
  .jet { offset-distance: 100%; }
  .route { opacity: 1; }
  .bp { transform: none; }
}
