/* ===== Angel Rocket — fonts & base styles ===== */

@font-face {
  font-family: 'Eurostile Ext';
  src: url('fonts/EurostileBoldExtended.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Microgramma Ext';
  src: url('fonts/MicrogrammaDExtendedBold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas';
  src: url('fonts/NeueHaasDisplayRoman.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas';
  src: url('fonts/NeueHaasDisplayRomanItalic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas';
  src: url('fonts/NeueHaasDisplayMedium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Neue Haas';
  src: url('fonts/NeueHaasDisplayLight.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/Manrope.ttf') format('truetype-variations');
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font-display: 'Eurostile Ext', 'Microgramma Ext', 'Neue Haas', system-ui, sans-serif;
  --font-body: 'Neue Haas', 'Inter', system-ui, sans-serif;

  /* Provinces */
  --teal:   #178995; /* north panel */
  --green:  #11F28A; /* west panel */
  --brown:  #311A0B; /* east panel */
  --yellow: #FDE526; /* south panel */

  --logo-red:    #F00000;  /* on teal */
  --logo-mint:   #C7F5C7;  /* on green (lightened) */
  --logo-orange: #FD5A02;  /* on brown */
  --logo-navy:   #0B1A4A;  /* on yellow */

  /* Mint on the west green is 1.23:1; body text there uses a deep shade of the same green
     (6.4:1, above WCAG's 4.5:1 for body text). The crown keeps the mint. */
  --west-text:   #04512D;

  --glow-strength: 0.55;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #000; color: #fff; font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
a { color: inherit; }

/* Holding a panel is a gesture, not a text selection: without this iOS shows the
   magnifier and selects the nearest text (the hint banner) on long-press. */
.splash, .splash *, .mobile-hint, .nudge, .brand {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ===== Intro gate ===== */
.intro {
  position: fixed; inset: 0; z-index: 60;
  width: 100%; border: 0; margin: 0; padding: 0;
  background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  font-family: var(--font-display);
  text-transform: uppercase;
  cursor: pointer;
  opacity: 1;
  transition: opacity 500ms ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.intro.out { opacity: 0; pointer-events: none; }
.intro:focus-visible { outline: none; }
.intro:focus-visible .intro__cta { outline: 2px dashed rgba(255,255,255,0.6); outline-offset: 4px; }
.intro__title { font-size: clamp(26px, 5vw, 44px); letter-spacing: 0.12em; font-weight: 700; }
.intro__cta {
  font-size: clamp(11px, 1.1vw, 13px);
  letter-spacing: 0.32em;
  opacity: 0.85;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 12px 22px;
}

/* ===== Splash 4-panel grid ===== */
.splash {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  background: #000;
}
.panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: filter 220ms ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.panel:focus-visible { outline: 2px dashed rgba(255,255,255,0.6); outline-offset: -8px; }
.panel--north { background: var(--teal); }
.panel--west  { background: var(--green); }
.panel--east  { background: var(--brown); }
.panel--south { background: var(--yellow); }

.panel__logo {
  display: flex; align-items: center; justify-content: center;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), filter 320ms ease;
  will-change: transform, filter;
  /* scale to fit BOTH dimensions inside a target square ~30% of panel */
  width: auto;
  height: auto;
  max-width: 42%;
  max-height: 42%;
}
/* Use SVG-native aspect ratios. Cap each by a target area (sqrt(area) ≈ 30% of min panel dim).
   Each logo gets max-width AND max-height; native aspect-ratio determines which one binds. */
.panel--north .panel__logo { aspect-ratio: 1142 / 998;  max-width: 31.8%; max-height: 38%; }
.panel--west  .panel__logo { aspect-ratio: 1618 / 1185; max-width: 39.1%; max-height: 35.3%; }
.panel--east  .panel__logo { aspect-ratio: 2454 / 1619; max-width: 43.6%; max-height: 30.6%; }
.panel--south .panel__logo { aspect-ratio: 1004 / 2050; max-width: 21.9%; max-height: 43.9%; }
.panel__logo svg { width: 100%; height: 100%; display: block; }
/* Also force SVG to scale uniformly (no padding) */
.panel__logo svg { object-fit: contain; }

/* Layout: centered (default) vs inner-corner (logos cluster toward the splash centre) */
.splash--centered .panel { align-items: center; justify-content: center; }
.splash--inner .panel { display: block; position: relative; }
.splash--inner .panel__logo {
  position: absolute;
}
/* Inner mode keeps the same per-province caps so visual mass stays balanced */
/* TL: drop logo sits in the bottom-right corner of its panel */
.splash--inner .panel--north .panel__logo { right: 6%; bottom: 6%; }
/* TR: crown sits in the bottom-left of its panel */
.splash--inner .panel--west  .panel__logo { left: 6%;  bottom: 6%; }
/* BL: pyramid sits in the top-right of its panel */
.splash--inner .panel--east  .panel__logo { right: 6%; top: 6%; }
/* BR: flower sits in the top-left of its panel, nudged down a bit so it doesn't crowd the seam */
.splash--inner .panel--south .panel__logo { left: 6%;  top: 14%; }
/* Hide individual logo bounds when SVG would be cropped */
.panel__logo svg { width: 100%; height: 100%; display: block; }

/* hover lift + glow */
.panel:hover .panel__logo,
.panel.is-held .panel__logo {
  transform: scale(1.10);
}
/* Per-province glow tint — picks a color that contrasts the bg+logo combo so the halo
   reads as light without washing the logo out. */
.panel--north { --glow-tint: 255,80,80; }      /* warm red halo on teal */
.panel--west  { --glow-tint: 5,140,80; }       /* darker green halo on bright green so the mint pops */
.panel--east  { --glow-tint: 255,120,40; }     /* warm orange halo on brown */
.panel--south { --glow-tint: 30,40,90; }       /* deep navy halo on yellow */
.panel.glow:hover .panel__logo,
.panel.glow.is-held .panel__logo {
  filter:
    drop-shadow(0 0 calc(10px * var(--glow-strength)) rgba(var(--glow-tint), calc(0.55 * var(--glow-strength))))
    drop-shadow(0 0 calc(22px * var(--glow-strength)) rgba(var(--glow-tint), calc(0.32 * var(--glow-strength))));
}
/* Hide the source panel that's transitioning, so the clone glides over a clean stage */
.panel.is-leaving { opacity: 0; transition: opacity 120ms ease 80ms; }

/* logo-color tinting via SVG fill */
.panel--north { --logo: var(--logo-red); }
.panel--west  { --logo: var(--logo-mint); }
.panel--east  { --logo: var(--logo-orange); }
.panel--south { --logo: var(--logo-navy); }
.panel__logo svg path,
.expander__logo svg path { fill: var(--logo); }

/* small province label */
.panel__label {
  position: absolute;
  bottom: clamp(14px, 2.4vw, 28px);
  left: clamp(14px, 2.4vw, 28px);
  font-family: var(--font-display);
  font-size: clamp(10px, 1.05vw, 14px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
  pointer-events: none;
}
.panel--north .panel__label { color: var(--logo-red); }
.panel--west  .panel__label { color: var(--logo-mint); }
.panel--east  .panel__label { color: var(--logo-orange); }
.panel--south .panel__label { color: var(--logo-navy); }

/* expanding panel transition (FLIP-style — animates a single transform for smoothness) */
.expander {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-origin: 0 0;
  transition: transform 1100ms cubic-bezier(.7,0,.15,1);
  will-change: transform;
}
.expander__logo {
  position: absolute;
  transition: opacity 320ms ease 380ms;
}
.expander__logo svg { width: 100%; height: 100%; display: block; }
.expander.expanded .expander__logo { opacity: 0; }

/* corner brand */
.brand {
  position: fixed; top: 14px; left: 16px; z-index: 5;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  background: #111;
  padding: 7px 12px 6px;
  border-radius: 4px;
  pointer-events: none;
  border: 1.5px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

/* mobile hint banner */
.mobile-hint {
  position: fixed; left: 50%; top: 12px;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(0,0,0,0.78);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-hint.show { opacity: 1; }
@media (max-width: 380px) {
  .mobile-hint { font-size: 9px; letter-spacing: 0.14em; padding: 6px 10px; }
}

/* clippy nudge */
.nudge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
  font-family: var(--font-body);
}
.nudge--mini .nudge__avatar {
  width: 32px; height: 32px;
  font-size: 14px;
  opacity: 0.78;
}
.nudge__bubble {
  background: #fff;
  color: #111;
  border: 1.5px solid #111;
  border-radius: 14px;
  padding: 10px 26px 10px 12px;
  max-width: 220px;
  font-size: 12.5px;
  line-height: 1.32;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  position: relative;
}
.nudge__bubble::after {
  content: '';
  position: absolute;
  right: 18px; bottom: -10px;
  width: 12px; height: 12px;
  background: #fff;
  border-right: 1.5px solid #111;
  border-bottom: 1.5px solid #111;
  transform: rotate(45deg);
}
.nudge__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1.5px solid #111;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: #111;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.nudge__close {
  position: absolute; top: 4px; right: 6px;
  background: transparent; border: 0;
  font-size: 14px; cursor: pointer; color: #555;
  line-height: 1;
}

/* ===== Section page (after entering a quadrant) ===== */
.section {
  position: fixed; inset: 0;
  z-index: 40;
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 480ms ease 100ms;
}
.section.in { opacity: 1; }
.section--north { background: var(--teal);  color: var(--logo-red); }
.section--west  { background: var(--green); color: var(--west-text); }
.section--west .section__heroLogo { color: var(--logo-mint); }
.section--east  { background: var(--brown); color: var(--logo-orange); }
.section--south { background: var(--yellow); color: var(--logo-navy); }

.section__nav {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(20px, 3vw, 36px);
  z-index: 2;
  pointer-events: none;
}
.section__nav > * { pointer-events: auto; }
.iconbtn {
  background: transparent;
  border: 1.5px solid currentColor;
  color: inherit;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.iconbtn:hover { background: currentColor; }
.iconbtn:hover svg { color: var(--bg-current); }
.iconbtn svg { width: 18px; height: 18px; pointer-events: none; }
.section--north .iconbtn:hover { color: var(--teal); }
.section--west  .iconbtn:hover { color: var(--green); }
.section--east  .iconbtn:hover { color: var(--brown); }
.section--south .iconbtn:hover { color: var(--yellow); }
.iconbtn--text { width: auto; padding: 0 16px; height: 42px; gap: 8px; }

.section__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  padding: clamp(40px, 6vw, 100px) clamp(24px, 5vw, 80px) clamp(40px, 6vw, 80px);
  align-items: center;
}
@media (min-width: 900px) {
  .section__hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.section__heroLogo {
  width: min(46vmin, 460px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}
.section__heroLogo > div { width: 100%; height: 100%; }
.section__heroLogo svg { width: 100%; height: 100%; display: block; }
.section__heroLogo svg path { fill: currentColor; }

.section__heroText { container-type: inline-size; }
.section__title {
  font-family: var(--font-display);
  font-weight: 700;
  /* Extended display faces run ~1.07em per capital; --chars is the longest unbreakable run */
  font-size: min(clamp(40px, 7vw, 110px), calc(100cqi / (var(--chars, 9) * 1.1)));
  hyphens: manual;
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
  text-transform: uppercase;
}
.section__province {
  font-family: var(--font-display);
  font-size: clamp(11px, 1.1vw, 14px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0.7;
  margin: 0 0 24px;
}
.section__lede {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.55;
  max-width: 56ch;
  margin: 0 0 28px;
  opacity: 0.88;
}

.section__body {
  padding: 0 clamp(24px, 5vw, 80px) clamp(80px, 10vw, 140px);
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 5vw, 72px);
}
@media (min-width: 900px) {
  .section__body { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.lore {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}
.lore h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 26px);
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  text-transform: uppercase;
}
.lore p {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.6;
  margin: 0 0 12px;
  opacity: 0.92;
  text-wrap: pretty;
}
.lore article {
  border-top: 1.5px solid currentColor;
  padding-top: clamp(20px, 2.4vw, 32px);
  opacity: 0.95;
}

/* Sidebar player */
.sidebar { display: grid; gap: 24px; align-content: start; position: sticky; top: 80px; }
.player {
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 20px;
  background: rgba(0,0,0,0.04);
}
.section--east .player { background: rgba(255,255,255,0.04); }
.section--south .player { background: rgba(0,0,0,0.05); }
.player__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.7;
}
.player__title {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.5vw, 22px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.tracklist { display: grid; gap: 2px; margin: 0 0 16px; }
.track {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  color: inherit;
  text-align: left;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  transition: padding 160ms ease;
}
.track:hover { padding-left: 6px; }
.track:last-child { border-bottom: 0; }
.track__idx { font-family: var(--font-display); opacity: 0.55; font-size: 11px; white-space: nowrap; }
.track__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__time { font-family: 'Inter', monospace; font-variant-numeric: tabular-nums; opacity: 0.6; font-size: 12px; }
.track.is-active { padding-left: 6px; font-weight: 500; }
.track.is-active .track__idx::before { content: '▶ '; }

.player__embed {
  display: block;
  width: 100%;
  height: 120px;
  border: 0;
  margin-top: 4px;
}
.player__link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.75;
}
.player__link:hover { opacity: 1; text-decoration: underline; }

.section__footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px clamp(24px, 5vw, 80px);
  border-top: 1.5px solid currentColor;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* sound toggle visual */
.soundbtn {
  position: relative;
}
.soundbtn[data-on="false"]::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  top: 50%;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
}
