/* Tonight — design system
   Ink night sky, parchment text, moonlight gold. Fraunces for voice, system sans for machinery. */

@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fraunces-roman-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fraunces-roman-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fraunces-italic-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fraunces-italic-ext.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #070a14;
  --ink-2: #0c1120;
  --paper: #ece7db;
  --paper-dim: #b9b3a4;
  --paper-faint: #837e71;
  --gold: #e3c383;
  --gold-dim: #a8905f;
  --line: rgba(236, 231, 219, 0.13);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --maxw: 44rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-weight: 340;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: rgba(227, 195, 131, 0.35); }
a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(227,195,131,.35); transition: border-color .2s; }
a:hover { border-color: var(--gold); }
button { font-family: var(--sans); cursor: pointer; color: inherit; background: none; border: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(0.9rem + env(safe-area-inset-top)) 1.1rem 2.2rem;
  background: linear-gradient(to bottom, rgba(4,6,12,.62), rgba(4,6,12,0));
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.wordmark {
  font-family: var(--serif); font-style: italic; font-weight: 380;
  font-size: 1.5rem; letter-spacing: 0.01em; color: var(--paper);
  border: none; text-shadow: 0 1px 12px rgba(0,0,0,.5);
}
.wordmark:hover { color: var(--gold); }
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .8rem; letter-spacing: .02em;
  color: var(--paper); background: rgba(10, 14, 26, 0.55);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .48em 1em; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, background .2s;
  max-width: 60vw; white-space: nowrap;
}
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover { border-color: rgba(227,195,131,.5); }
.chip .pin { color: var(--gold); flex: none; }

/* ---------- sky ---------- */
#skySection { position: relative; height: 62vh; min-height: 340px; max-height: 780px; }
#sky { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#sky.dragging { cursor: grabbing; }
.skyHint {
  position: absolute; bottom: .8rem; left: 50%; transform: translateX(-50%);
  font-family: var(--sans); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(236,231,219,.55); pointer-events: none;
  transition: opacity 1s; white-space: nowrap;
}
.hintArrows { letter-spacing: 0; opacity: .8; }
.skyHint.gone { opacity: 0; }
.objTip {
  position: absolute; z-index: 9; pointer-events: none;
  background: rgba(8, 11, 22, 0.88); border: 1px solid rgba(227,195,131,.4);
  border-radius: 10px; padding: .55em .8em;
  font-size: .86rem; line-height: 1.45; max-width: 240px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 24px rgba(0,0,0,.45);
}
.objTip strong { color: var(--gold); font-weight: 500; }
.objTip small { color: var(--paper-dim); font-family: var(--sans); font-size: .74rem; }
.soundBtn {
  position: absolute; right: .9rem; bottom: .8rem; z-index: 9;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  display: grid; place-items: center;
  color: rgba(236,231,219,.6); background: rgba(10,14,26,.5);
  border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .25s, border-color .25s;
}
.soundBtn .wave { opacity: 0; transition: opacity .25s; }
.soundBtn[aria-pressed="true"] { color: var(--gold); border-color: rgba(227,195,131,.45); }
.soundBtn[aria-pressed="true"] .wave { opacity: 1; }

/* ---------- time bar ---------- */
#timeBar {
  display: flex; align-items: center; gap: .9rem;
  max-width: var(--maxw); margin: 0 auto; padding: .9rem 1.2rem .4rem;
}
.nowBtn {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--gold); border: 1px solid rgba(227,195,131,.4); border-radius: 999px;
  padding: .4em 1em; transition: background .2s, opacity .2s;
  flex: none;
}
.nowBtn:hover { background: rgba(227,195,131,.12); }
.nowBtn.live { opacity: .35; pointer-events: none; }
.sliderWrap { position: relative; flex: 1; padding-bottom: 1.05rem; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; display: block;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(to right, rgba(227,195,131,.5), rgba(120,130,170,.35));
  border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold); margin-top: -7px;
  box-shadow: 0 0 12px rgba(227,195,131,.65);
  transition: transform .15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-track {
  height: 2px; background: linear-gradient(to right, rgba(227,195,131,.5), rgba(120,130,170,.35));
  border-radius: 2px;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 12px rgba(227,195,131,.65);
}
.timeTicks { position: absolute; left: 0; right: 0; top: 1.35rem; height: 1rem; pointer-events: none; }
.timeTicks span {
  position: absolute; transform: translateX(-50%);
  font-family: var(--sans); font-size: .62rem; letter-spacing: .05em;
  color: var(--paper-faint); white-space: nowrap;
}
.timeLabel {
  font-family: var(--sans); font-variant-numeric: tabular-nums;
  font-size: .95rem; color: var(--paper); min-width: 3.4em; text-align: right; flex: none;
}
.timeLabel small { display: block; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--paper-faint); text-align: right; }

/* ---------- programme ---------- */
#programme { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.2rem 2rem; }
.lede {
  font-size: clamp(1.45rem, 2.6vw + 1rem, 2.1rem);
  line-height: 1.35; font-weight: 340; letter-spacing: 0.002em;
  padding: .8rem 0 1.6rem;
}
.lede em { font-style: italic; color: var(--gold); }
.ledeGhost { color: var(--paper-faint); font-style: italic; }

.cards { display: grid; grid-template-columns: 1fr; gap: .9rem; }
.card {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 1.15rem 1.25rem 1.05rem;
  background: linear-gradient(160deg, rgba(20,26,44,.5), rgba(10,13,24,.35));
  transition: border-color .25s, transform .25s;
  position: relative;
}
.card.pointable:hover { border-color: rgba(227,195,131,.4); transform: translateY(-1px); }
.cardHead { display: flex; align-items: baseline; gap: .6em; margin-bottom: .3rem; }
.cardIcon { font-size: 1.05rem; line-height: 1; flex: none; transform: translateY(1px); }
.cardTitle { font-family: var(--serif); font-weight: 480; font-size: 1.12rem; letter-spacing: .005em; }
.cardWhen {
  margin-left: auto; font-family: var(--sans); font-size: .68rem; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gold-dim); white-space: nowrap; flex: none;
}
.cardBody { color: var(--paper-dim); font-size: .98rem; line-height: 1.55; }
.cardBody strong { color: var(--paper); font-weight: 480; }
.cardBody .fists { color: var(--gold); letter-spacing: .12em; font-size: .9em; }
.pointLink {
  display: inline-flex; align-items: center; gap: .35em;
  margin-top: .55rem; font-family: var(--sans); font-size: .74rem;
  letter-spacing: .06em; color: var(--gold); text-transform: uppercase;
  border: none; padding: 0;
}
.pointLink:hover { text-decoration: underline; text-underline-offset: 3px; }
.cloudBars { display: flex; gap: 3px; align-items: flex-end; height: 44px; margin: .7rem 0 .25rem; }
.cloudBars .cb { flex: 1; border-radius: 3px 3px 0 0; background: rgba(160,170,200,.7); min-height: 3px; }
.cloudBars .cb.clear { background: rgba(227,195,131,.75); }
.cloudLabels { display: flex; justify-content: space-between; font-family: var(--sans); font-size: .62rem; color: var(--paper-faint); letter-spacing: .04em; }

/* fist illustration */
.fistRow { display: flex; align-items: flex-end; gap: .8rem; margin-top: .7rem; }
.fistRow svg { flex: none; }
.fistRow p { font-size: .85rem; color: var(--paper-faint); font-style: italic; }

/* ---------- looked ---------- */
.looked { text-align: center; padding: 2.6rem 0 1rem; }
.lookBtn {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: 1.15rem; color: var(--ink);
  background: linear-gradient(160deg, #f0d9a8, var(--gold));
  padding: .75em 1.7em; border-radius: 999px;
  box-shadow: 0 2px 26px rgba(227,195,131,.28);
  transition: transform .2s, box-shadow .2s;
}
.lookBtn:hover { transform: translateY(-2px); box-shadow: 0 6px 34px rgba(227,195,131,.4); }
.lookBtn:disabled { opacity: .8; transform: none; cursor: default; }
.lookCount { margin-top: .9rem; color: var(--paper-dim); font-style: italic; font-size: .98rem; min-height: 1.6em; }
.lookCount strong { color: var(--gold); font-weight: 500; }

/* ---------- footer ---------- */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 1.2rem 1.2rem 2.6rem; text-align: center; border-top: 1px solid var(--line); }
.footNote { font-size: .8rem; color: var(--paper-faint); font-style: italic; }
.footLinks { margin-top: .5rem; font-family: var(--sans); font-size: .78rem; color: var(--paper-faint); }
.footLinks .dot { margin: 0 .6em; }

/* ---------- modal ---------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(3, 5, 10, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 1.2rem;
}
.modalCard {
  position: relative; width: 100%; max-width: 24rem;
  background: linear-gradient(170deg, #121829, #0a0e1b);
  border: 1px solid rgba(227,195,131,.25); border-radius: 20px;
  padding: 1.8rem 1.6rem 1.6rem;
  box-shadow: 0 18px 70px rgba(0,0,0,.6);
}
.modalTitle { font-family: var(--serif); font-weight: 430; font-size: 1.45rem; }
.modalSub { color: var(--paper-faint); font-size: .88rem; margin: .3rem 0 1.2rem; font-style: italic; }
.bigChoice {
  display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; padding: .85rem 1rem;
  font-size: .92rem; line-height: 1.3; color: var(--paper);
  transition: border-color .2s, background .2s;
}
.bigChoice:hover { border-color: rgba(227,195,131,.5); background: rgba(227,195,131,.06); }
.bigChoice small { color: var(--paper-faint); }
.bigChoiceIcon { font-size: 1.3rem; color: var(--gold); }
.orRule { display: flex; align-items: center; gap: .8em; margin: 1.1rem 0 .8rem; color: var(--paper-faint); font-family: var(--sans); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.orRule::before, .orRule::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#citySearch {
  width: 100%; font-family: var(--serif); font-size: 1rem;
  background: rgba(6, 9, 17, 0.7); color: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: .7em 1em;
}
#citySearch:focus { outline: none; border-color: rgba(227,195,131,.55); }
#citySearch::placeholder { color: var(--paper-faint); font-style: italic; }
.cityResults { margin-top: .5rem; display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; }
.cityResults button {
  text-align: left; padding: .55em .9em; border-radius: 9px; font-size: .9rem;
  color: var(--paper-dim); font-family: var(--serif);
}
.cityResults button:hover, .cityResults button:focus { background: rgba(227,195,131,.1); color: var(--paper); }
.cityResults .crCountry { color: var(--paper-faint); font-size: .78rem; margin-left: .5em; }
.modalClose {
  position: absolute; top: .8rem; right: .9rem;
  color: var(--paper-faint); font-size: 1rem; padding: .3em .5em; border-radius: 8px;
}
.modalClose:hover { color: var(--paper); }

/* ---------- wide screens ---------- */
@media (min-width: 700px) {
  #skySection { height: 66vh; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card.wide { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
