/* ==========================================================================
   skydanner
   A private flight obsession dashboard. UK and Europe to Sydney.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Ink base, pulled deep so the photo reads as dusk water rather than noon */
  --ink:          #04101f;
  --ink-2:        #071a2e;
  --navy:         #0d2340;
  --navy-soft:    #16324f;

  /* Accents lifted straight out of the photograph */
  --aqua:         #3fe0c8;
  --aqua-dim:     #1ea998;
  --sky:          #7fc8f5;
  --sand:         #f2cfa0;
  --sand-deep:    #d9a066;
  --coral:        #ff8f6b;

  /* Text */
  --text:         #eef5fa;
  --text-soft:    rgba(238, 245, 250, 0.72);
  --text-mute:    rgba(238, 245, 250, 0.46);
  --text-faint:   rgba(238, 245, 250, 0.26);

  /* Glass */
  --glass:        rgba(8, 24, 42, 0.66);
  --glass-hi:     rgba(14, 36, 60, 0.80);
  --glass-lo:     rgba(6, 18, 34, 0.42);
  --edge:         rgba(255, 255, 255, 0.09);
  --edge-hi:      rgba(255, 255, 255, 0.18);
  --blur:         blur(26px) saturate(150%);

  /* Shape and rhythm */
  --r-lg:         22px;
  --r-md:         16px;
  --r-sm:         10px;
  --r-pill:       999px;
  --shadow:       0 18px 50px rgba(0, 0, 0, 0.42);
  --shadow-sm:    0 6px 20px rgba(0, 0, 0, 0.28);
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --gutter:       clamp(18px, 4vw, 48px);
  --maxw:         1320px;

  /* Status colours */
  --st-new:         var(--aqua);
  --st-shortlisted: var(--sand);
  --st-investigated:var(--sky);
  --st-snoozed:     #a99fd6;
  --st-dismissed:   rgba(238, 245, 250, 0.34);
  --st-booked:      #6ee7a8;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { flex: 1 0 auto; position: relative; }
.foot { flex-shrink: 0; }

/* The feed and rules views have no hero, so the whole of main is veiled.
   The dashboard veils per section instead, leaving its hero clear. */
body[data-view='feed'] main::before,
body[data-view='prefs'] main::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(4, 16, 31, 0.52) 0%,
    rgba(4, 16, 31, 0.74) 6%,
    rgba(4, 16, 31, 0.76) 100%);
}

/* --------------------------------------------------------------------------
   2. The background stack
   Four layers so the photograph feels like the room the UI is standing in,
   not wallpaper behind it:
     a. the photograph itself, fixed, anchored low
     b. a vertical ink scrim that deepens towards the bottom
     c. a horizontal scrim darkening the left where the copy lives
     d. an aqua glow over the water, plus fine grain
   -------------------------------------------------------------------------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('../img/beach-background.png');
  background-size: cover;
  background-position: 56% 58%;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: saturate(1.18) contrast(1.06);
  will-change: transform;
}

/* Scrim tuned so the photograph stays a photograph. Deep enough on the left
   for the display type to hold, near clear over the water on the right, and
   only fully ink at the very bottom of the viewport. */
.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(4, 16, 31, 0.62) 0%,
      rgba(4, 16, 31, 0.20) 26%,
      rgba(5, 20, 36, 0.30) 58%,
      rgba(4, 16, 31, 0.66) 84%,
      rgba(3, 12, 24, 0.88) 100%),
    linear-gradient(90deg,
      rgba(4, 16, 31, 0.86) 0%,
      rgba(4, 16, 31, 0.70) 30%,
      rgba(4, 16, 31, 0.42) 52%,
      rgba(4, 16, 31, 0.10) 70%,
      rgba(4, 16, 31, 0.00) 85%,
      rgba(4, 16, 31, 0.20) 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 76% 40%, rgba(63, 224, 200, 0.16) 0%, transparent 68%),
    radial-gradient(ellipse 50% 35% at 18% 88%, rgba(242, 207, 160, 0.10) 0%, transparent 70%);
}

.bg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.055'/></svg>");
}

/* --------------------------------------------------------------------------
   3. Shared primitives
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.glass {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0;
}

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* A hairline with aviation ruler ticks, used to separate sections */
.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background:
    repeating-linear-gradient(90deg,
      var(--edge) 0 6px, transparent 6px 12px);
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a { color: var(--aqua); text-decoration: none; }

/* Buttons do not inherit colour from the page by default, and several cards
   are buttons, so their unstyled text falls back to the UA default. */
button { font-family: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   4. Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: linear-gradient(180deg, rgba(4, 16, 31, 0.86), rgba(4, 16, 31, 0.52));
  border-bottom: 1px solid var(--edge);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-right: auto;
  min-width: 0;
}

.brand-mark {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-mark b { color: var(--aqua); font-weight: 700; }

.brand-tag {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
}

.nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: var(--r-pill);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav button[aria-current='true'] {
  color: var(--ink);
  background: linear-gradient(135deg, var(--aqua), var(--aqua-dim));
  font-weight: 600;
}

.topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
}
.topbar-clock .t { font-size: 14px; font-weight: 500; }
.topbar-clock .l {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   5. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 118px) var(--gutter) clamp(40px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.8fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--r-pill);
  background: rgba(63, 224, 200, 0.10);
  border: 1px solid rgba(63, 224, 200, 0.26);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aqua);
  margin-bottom: 22px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 0 rgba(63, 224, 200, 0.6);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(63, 224, 200, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(63, 224, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 224, 200, 0); }
}

.hero h1 {
  font-size: clamp(38px, 5.2vw, 63px);
  letter-spacing: -0.035em;
  line-height: 1.02;
  margin-bottom: 20px;
  text-shadow: 0 2px 30px rgba(2, 10, 20, 0.55);
}
.hero h1 .glint {
  background: linear-gradient(100deg, var(--sand) 0%, #a6f0e0 46%, var(--aqua) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lede {
  font-size: clamp(15px, 1.35vw, 17.5px);
  color: var(--text-soft);
  max-width: 54ch;
  margin: 0 0 30px;
  text-shadow: 0 1px 18px rgba(2, 10, 20, 0.6);
}

/* Route strip: the aviation motif, LON to SYD with a great circle arc */
.routestrip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
  max-width: 540px;
  padding: 12px 24px;
  border-radius: var(--r-md);
  background: rgba(4, 16, 31, 0.46);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-sm);
}
.routestrip .code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.routestrip .arcwrap {
  position: relative;
  flex: 1;
  min-width: 90px;
  height: 62px;
  display: block;
}
.routestrip .arc { display: block; width: 100%; height: 62px; overflow: visible; }
/* Apex of the quadratic sits at 41% of the viewBox height */
.routestrip .plane {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
}
.routestrip .arc .track {
  fill: none;
  stroke: rgba(63, 224, 200, 0.75);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 6 6;
  animation: dash 26s linear infinite;
  filter: drop-shadow(0 0 5px rgba(63, 224, 200, 0.45));
}
@keyframes dash { to { stroke-dashoffset: -240; } }
.routestrip .plane {
  fill: var(--sand);
  filter: drop-shadow(0 0 6px rgba(242, 207, 160, 0.5));
}
.routestrip .dot {
  fill: var(--aqua);
  vector-effect: non-scaling-stroke;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  appearance: none;
  border: 1px solid var(--edge-hi);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--edge-hi);
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-dim));
  border-color: transparent;
  color: #032018;
  font-weight: 600;
}
.btn-primary:hover {
  box-shadow: 0 10px 30px rgba(63, 224, 200, 0.28);
  background: linear-gradient(135deg, #55ecd6, var(--aqua-dim));
}
.btn-ghost { background: transparent; border-color: var(--edge); color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* Countdown panel, right of hero */
.countdown { padding: 26px 28px; }
.countdown-num {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: clamp(52px, 7vw, 82px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, var(--sand) 0%, var(--sand-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.countdown-sub { font-size: 14px; color: var(--text-soft); margin-top: 6px; }
.countdown-meta {
  display: flex;
  gap: 22px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--edge);
}
.countdown-meta div { min-width: 0; }
.countdown-meta .v { font-size: 19px; font-weight: 600; }
.countdown-meta .k {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   6. Sections and summary cards
   -------------------------------------------------------------------------- */

/* Each section carries its own ink veil, so the hero can stay a clear
   photograph while everything below it stays readable. The veil sits in the
   root negative layer, above the background stack and below all content. */
.section, .foot { position: relative; }
.section::before, .foot::before {
  content: '';
  position: absolute;
  /* .section also carries .wrap, so stretch the veil out to the viewport */
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(4, 16, 31, 0.00) 0%,
    rgba(4, 16, 31, 0.58) 9%,
    rgba(4, 16, 31, 0.72) 24%,
    rgba(4, 16, 31, 0.74) 100%);
}
/* Adjacent sections need no top fade, or the overlap reads as a seam */
.section + .section::before {
  background: linear-gradient(180deg,
    rgba(4, 16, 31, 0.74) 0%,
    rgba(4, 16, 31, 0.76) 100%);
}

/* main carries the veil on those views, so suppress the per-section one */
.view[data-view='feed'] .section::before,
.view[data-view='prefs'] .section::before { display: none; }
.foot::before {
  background: linear-gradient(180deg, rgba(4, 16, 31, 0.74), rgba(3, 12, 24, 0.9));
}

.section { padding: clamp(40px, 6vw, 74px) var(--gutter); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(22px, 2.6vw, 31px); }
.section-head p { margin: 7px 0 0; color: var(--text-mute); font-size: 14px; max-width: 62ch; }

.cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 16px;
}

/* Summary card, styled as a boarding pass stub */
.scard {
  position: relative;
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-align: left;
  width: 100%;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease), background 0.35s var(--ease);
}
.scard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent, var(--aqua)), transparent 82%);
  opacity: 0.85;
}
/* Perforation notch, the boarding pass tell */
.scard::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 1px solid var(--edge);
  transform: translateY(-50%);
}
.scard:hover {
  transform: translateY(-3px);
  border-color: var(--edge-hi);
  background: var(--glass-hi);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.44);
}
.scard-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, var(--aqua));
  margin-bottom: 14px;
}
.scard-price {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 33px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.scard-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-soft);
}
.scard-route .seg {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--text-faint) 0 3px, transparent 3px 7px);
}
.scard-note {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--edge);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   7. Mood panel
   -------------------------------------------------------------------------- */

.mood {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: 0;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--edge);
  background: var(--glass-lo);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.mood-copy { padding: clamp(26px, 4vw, 44px); }
.mood-copy h3 {
  font-size: clamp(21px, 2.4vw, 29px);
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}
.mood-copy p { color: var(--text-soft); font-size: 15px; margin: 0 0 14px; }
.mood-copy p:last-of-type { margin-bottom: 0; }
.mood-copy .sig {
  margin-top: 24px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mood-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-left: 1px solid var(--edge);
}
.mood-stat {
  padding: clamp(20px, 3vw, 30px);
  border-bottom: 1px solid var(--edge);
}
.mood-stat:nth-child(odd) { border-right: 1px solid var(--edge); }
.mood-stat:nth-last-child(-n+2) { border-bottom: 0; }
.mood-stat .v {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--sand);
}
.mood-stat .k {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 9px;
}

/* --------------------------------------------------------------------------
   8. Filters
   -------------------------------------------------------------------------- */

.filters { padding: 20px 22px; margin-bottom: 22px; }

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px 26px;
  align-items: flex-end;
}

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* Wide fields share a row on desktop and take a full row on small screens.
   Kept in CSS rather than inline so the breakpoint below can win. */
.field-wide { flex: 1 1 260px; }
.field > label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.field input[type='date'],
.field select,
.field input[type='number'] {
  appearance: none;
  background: rgba(4, 16, 31, 0.6);
  border: 1px solid var(--edge);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.field select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23eef5fa' stroke-opacity='0.5' stroke-width='1.4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.field input:hover, .field select:hover { border-color: var(--edge-hi); }
.field input:focus, .field select:focus {
  border-color: var(--aqua);
  background: rgba(4, 16, 31, 0.85);
  outline: none;
}
.field input[type='date'] { color-scheme: dark; }

.dual { display: flex; align-items: center; gap: 8px; }
.dual span { color: var(--text-faint); font-size: 12px; }

/* Range slider */
.field input[type='range'] {
  appearance: none;
  width: 172px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--aqua) var(--fill, 50%), rgba(255,255,255,0.14) var(--fill, 50%));
}
.field input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.2s var(--ease);
}
.field input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.18); }
.field input[type='range']::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--sand); border: 2px solid var(--ink); cursor: grab;
}
.range-val {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--sand);
  min-width: 62px;
}

/* Toggle chips for the boolean filters */
.chipset { display: flex; flex-wrap: wrap; gap: 7px; }
.chiptoggle {
  appearance: none;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-mute);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.chiptoggle:hover { color: var(--text); border-color: var(--edge-hi); }
.chiptoggle[aria-pressed='true'] {
  background: rgba(63, 224, 200, 0.14);
  border-color: rgba(63, 224, 200, 0.42);
  color: var(--aqua);
}
.chiptoggle[data-state='exclude'][aria-pressed='true'] {
  background: rgba(255, 143, 107, 0.13);
  border-color: rgba(255, 143, 107, 0.4);
  color: var(--coral);
}

.filters-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--edge);
  flex-wrap: wrap;
}
.result-count { font-size: 13px; color: var(--text-mute); }
.result-count b { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------------------
   9. Opportunity feed
   -------------------------------------------------------------------------- */

.feed { display: flex; flex-direction: column; gap: 14px; }

.opp {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: clamp(16px, 2.4vw, 32px);
  align-items: center;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
              background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  animation: rise 0.5s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.opp:hover {
  transform: translateY(-2px);
  border-color: var(--edge-hi);
  background: var(--glass-hi);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
}
.opp[data-status='dismissed'] { opacity: 0.42; }
.opp[data-status='dismissed']:hover { opacity: 0.72; }
.opp[data-status='booked'] {
  border-color: rgba(110, 231, 168, 0.4);
  background: linear-gradient(100deg, rgba(110, 231, 168, 0.09), var(--glass) 42%);
}

/* Price block, left */
.opp-price { border-right: 1px solid var(--edge); padding-right: 18px; }
.opp-price .p {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.opp-price .s {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 8px;
}
.opp-price .s .bar {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.opp-price .s .bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--aqua-dim), var(--aqua));
}

/* Middle: route and meta */
.opp-main { min-width: 0; }
.opp-route {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.opp-route .ap {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.opp-route .via {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}
.opp-route .hop {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
  font-size: 12px;
}
.opp-route .hop::before {
  content: '';
  width: 20px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--text-faint) 0 3px, transparent 3px 6px);
}
.opp-route .repo {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(242, 207, 160, 0.13);
  border: 1px solid rgba(242, 207, 160, 0.3);
  color: var(--sand);
  letter-spacing: 0.05em;
}

.opp-dates {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 11px;
}
.opp-dates .sep { color: var(--text-faint); margin: 0 7px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3.5px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-mute);
  white-space: nowrap;
}
.tag[data-k='self']   { color: var(--coral); border-color: rgba(255,143,107,0.3);  background: rgba(255,143,107,0.10); }
.tag[data-k='repo']   { color: var(--sand);  border-color: rgba(242,207,160,0.3);  background: rgba(242,207,160,0.10); }
.tag[data-k='stop']   { color: var(--sky);   border-color: rgba(127,200,245,0.3);  background: rgba(127,200,245,0.10); }
.tag[data-k='fit']    { color: var(--aqua);  border-color: rgba(63,224,200,0.32);  background: rgba(63,224,200,0.11); }

.tag-status {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3.5px 10px 3.5px 8px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.tag-status::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
[data-s='new']          { color: var(--st-new); }
[data-s='shortlisted']  { color: var(--st-shortlisted); }
[data-s='investigated'] { color: var(--st-investigated); }
[data-s='snoozed']      { color: var(--st-snoozed); }
[data-s='dismissed']    { color: var(--st-dismissed); }
[data-s='booked']       { color: var(--st-booked); }

/* Right: score dial */
.opp-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.dial { position: relative; width: 58px; height: 58px; }
.dial svg { transform: rotate(-90deg); }
.dial .track { fill: none; stroke: rgba(255, 255, 255, 0.11); stroke-width: 4; }
.dial .prog {
  fill: none;
  stroke: url(#dialgrad);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s var(--ease);
}
.dial .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 16px;
  font-weight: 500;
}
.opp-score .k {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-mute);
}
.empty h3 { font-size: 19px; color: var(--text); margin-bottom: 8px; }

/* --------------------------------------------------------------------------
   10. Detail drawer
   -------------------------------------------------------------------------- */

.drawer-veil {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(2, 9, 18, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.drawer-veil[data-open='true'] { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(660px, 100vw);
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(9, 26, 45, 0.95), rgba(4, 14, 26, 0.97));
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-left: 1px solid var(--edge-hi);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.55);
  transform: translateX(100%);
  transition: transform 0.46s var(--ease);
}
.drawer[data-open='true'] { transform: translateX(0); }

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(20px, 3vw, 32px);
  background: linear-gradient(180deg, rgba(9, 26, 45, 0.97), rgba(9, 26, 45, 0.8));
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.drawer-head .id {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12.5px;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}
.drawer-close {
  margin-left: auto;
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1;
  transition: all 0.25s var(--ease);
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.13); color: var(--text); }

.drawer-body { padding: clamp(22px, 3vw, 34px); }

.drawer-price {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.drawer-price .p {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}
.drawer-price .sub { font-size: 13px; color: var(--text-mute); margin-top: 8px; }

.dblock { margin-bottom: 28px; }
.dblock > h4 {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--edge);
}

/* Itinerary as a vertical flight strip */
.itin { position: relative; padding-left: 26px; }
.itin::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--edge-hi) 0 4px, transparent 4px 9px);
}
.leg { position: relative; padding-bottom: 20px; }
.leg:last-child { padding-bottom: 0; }
.leg::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--aqua);
}
.leg[data-kind='stopover']::before { border-color: var(--sky); }
.leg[data-kind='final']::before { border-color: var(--sand); background: var(--sand); }
.leg-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.leg-ap {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
}
.leg-city { font-size: 14px; color: var(--text-soft); }
.leg-nights {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2.5px 8px;
  border-radius: var(--r-pill);
  background: rgba(127, 200, 245, 0.12);
  border: 1px solid rgba(127, 200, 245, 0.3);
  color: var(--sky);
}
.leg-note { font-size: 13px; color: var(--text-mute); margin-top: 5px; }

.kvgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  overflow: hidden;
}
.kv { background: rgba(4, 16, 31, 0.5); padding: 15px 17px; }
.kv .k {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.kv .v { font-size: 15px; font-weight: 500; }
.kv .v.mono { font-size: 14.5px; }

.why {
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(63, 224, 200, 0.10), rgba(63, 224, 200, 0.02));
  border: 1px solid rgba(63, 224, 200, 0.24);
  border-left: 2px solid var(--aqua);
}
.why p { margin: 0; font-size: 14.5px; color: var(--text); }
.why .src {
  margin-top: 11px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.prose { font-size: 14.5px; color: var(--text-soft); margin: 0; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 22px;
  margin-top: 4px;
  border-top: 1px solid var(--edge);
}

/* --------------------------------------------------------------------------
   11. Preferences
   -------------------------------------------------------------------------- */

.prefs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.prefcard { padding: 26px 28px; }
.prefcard > h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
.prefcard > .hint { font-size: 13px; color: var(--text-mute); margin: 0 0 20px; }

.switchrow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--edge);
}
.switchrow:first-of-type { border-top: 0; }
.switchrow .txt { flex: 1; min-width: 0; }
.switchrow .txt .t { font-size: 14.5px; font-weight: 500; }
.switchrow .txt .d { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }

.switch {
  appearance: none;
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: var(--r-pill);
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.switch[aria-checked='true'] {
  background: linear-gradient(135deg, var(--aqua), var(--aqua-dim));
  border-color: transparent;
}
.switch[aria-checked='true']::after {
  transform: translateX(19px);
  background: #04121d;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 4px;
  border-top: 1px solid var(--edge);
  margin-top: 6px;
}
.stepper .lbl { flex: 1; }
.stepper .lbl .t { font-size: 14.5px; font-weight: 500; }
.stepper .lbl .d { font-size: 12.5px; color: var(--text-mute); }
.stepper .ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid var(--edge);
  background: rgba(4, 16, 31, 0.55);
}
.stepper button {
  appearance: none;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s var(--ease);
}
.stepper button:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.stepper .n {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 14px;
  min-width: 58px;
  text-align: center;
}

.airportchips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; }
.airportchip {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(63, 224, 200, 0.3);
  background: rgba(63, 224, 200, 0.09);
  color: var(--aqua);
}

.saved-flash {
  font-size: 12px;
  color: var(--aqua);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.saved-flash[data-on='true'] { opacity: 1; }

/* --------------------------------------------------------------------------
   12. Footer, views, toast
   -------------------------------------------------------------------------- */

.view { display: none; }
.view[data-active='true'] { display: block; animation: fade 0.45s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.foot {
  padding: 40px var(--gutter) 54px;
  margin-top: 20px;
  border-top: 1px solid var(--edge);
  color: var(--text-faint);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 120;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: rgba(9, 26, 45, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--edge-hi);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  transform: translate(-50%, 80px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
}
.toast[data-on='true'] { transform: translate(-50%, 0); opacity: 1; }
.toast b { color: var(--aqua); font-weight: 600; }

.skeleton {
  height: 92px;
  border-radius: var(--r-md);
  border: 1px solid var(--edge);
  background: linear-gradient(100deg, var(--glass-lo) 30%, rgba(255,255,255,0.05) 50%, var(--glass-lo) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }

.sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   13. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .countdown { max-width: 460px; }
  .mood { grid-template-columns: 1fr; }
  .mood-stats { border-left: 0; border-top: 1px solid var(--edge); }
}

@media (max-width: 860px) {
  .topbar-in { height: auto; padding: 12px var(--gutter); flex-wrap: wrap; gap: 12px; }
  .brand { margin-right: auto; }
  .topbar-clock { display: none; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .nav button { flex: 1; }

  .opp { grid-template-columns: 1fr auto; gap: 14px 18px; padding: 18px; }
  .opp-price {
    grid-column: 1 / -1;
    border-right: 0;
    padding-right: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--edge);
    display: flex;
    align-items: baseline;
    gap: 14px;
  }
  .opp-price .s { margin-top: 0; flex: 1; }
  .bg { background-position: 68% 40%; }
}

@media (max-width: 560px) {
  .opp { grid-template-columns: 1fr; }
  .opp-score { flex-direction: row; align-self: flex-start; gap: 12px; }
  .filters-row { gap: 18px; }
  .field input[type='range'] { width: 100%; }
  .field, .dual { width: 100%; }
  .field-wide { flex-basis: 100%; }
  .dual input { flex: 1; min-width: 0; }
  .mood-stats { grid-template-columns: 1fr; }
  .mood-stat:nth-child(odd) { border-right: 0; }
  .mood-stat:nth-last-child(2) { border-bottom: 1px solid var(--edge); }
  .drawer { width: 100vw; }
}

/* --------------------------------------------------------------------------
   14. Accessibility and print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
