/* OppyWorks · The tuner (homepage). Builds on explore.css for the bar, menu, buttons, details and About. */
.tn { background: #07080c; touch-action: none; }
.tn .xp-bar { z-index: 40; }

/* Sky, planet, its things and the static between stations */
.tn-screen { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.tn-sky, .tn-planet, .tn-things { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tn-planet, .tn-things { will-change: transform, opacity; }
.tn-static {
  position: absolute; width: 300px; height: 300px; border-radius: 50%; opacity: 0;
  mix-blend-mode: screen; -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
.tn.is-over-planet { cursor: pointer; }
html:not(.js) .tn-screen { background: radial-gradient(ellipse at 65% 45%, #1d1a2c, #07080c 70%); }

/* The station: what you are tuned to */
.tn-station {
  position: fixed; z-index: 20; left: clamp(20px, 6vw, 96px); top: 46%; transform: translateY(-50%);
  width: min(460px, 40vw); transition: transform .9s var(--ease), opacity .6s var(--ease);
}
.tn-label { margin: 0 0 18px; font: 600 12px/1.4 Manrope, sans-serif; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.tn-label span { color: #6f7783; }
.tn-readout { margin: 0 0 10px; display: flex; align-items: baseline; gap: 12px; color: var(--accent); }
.tn-freq { font: 600 15px/1 'Space Grotesk', monospace; font-variant-numeric: tabular-nums; letter-spacing: .08em; min-width: 4.5ch; }
.tn-freq::after { content: " MHz"; font-size: 11px; color: var(--muted); }
.tn-kind { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.tn-title { font-size: clamp(42px, 5.6vw, 76px); line-height: .98; outline: none; text-wrap: balance; }
.tn-status { display: inline-block; margin: 16px 0 0; padding: 4px 11px; border-radius: 999px; font-size: 12px; letter-spacing: .05em; border: 1px solid var(--line); color: var(--muted); }
.tn-status[data-live="true"] { border-color: var(--accent); color: var(--accent-hover); }
.tn-desc { color: #d4d8de; font-size: clamp(16px, 1.3vw, 18px); margin: 16px 0 26px; max-width: 30em; }
.tn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.tn-actions[hidden] { display: none; }
.tn-launch, .tn-more { color: var(--text); font-size: 15px; text-decoration: none; padding: 10px 0; border-bottom: 1px solid transparent; }
.tn-launch:hover, .tn-more:hover { border-bottom-color: var(--accent); }
.tn-more { color: var(--muted); }
.tn-launch[hidden] { display: none; }
.tn-back { display: none; margin: 22px 0 0; padding: 10px 0; background: none; border: 0; color: var(--muted); font: 500 14px Manrope, sans-serif; cursor: pointer; }
.tn-back:hover { color: var(--text); }
.xp-btn-primary { transition: background .6s, border-color .6s, transform .2s var(--ease); }

/* Between stations the words fade with the signal; the frequency keeps counting */
.tn-title, .tn-status, .tn-desc, .tn-actions, .tn-kind { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.tn.is-tuning .tn-title, .tn.is-tuning .tn-status, .tn.is-tuning .tn-desc, .tn.is-tuning .tn-actions, .tn.is-tuning .tn-kind { opacity: .12; transform: translateX(-6px); }
.tn.is-tuning .tn-actions { pointer-events: none; }

/* Tuned in: the planet comes close, the dial steps away */
.tn.is-close .tn-tune-hide, .tn.is-close #tn-tune, .tn.is-close .tn-label { display: none; }
.tn.is-close .tn-back { display: inline-flex; gap: 8px; }
.tn.is-close .tn-dial { opacity: 0; transform: translateY(30px); pointer-events: none; }
.tn.is-close .tn-station { top: 50%; }
.tn.is-close .tn-desc::after { content: attr(data-hint); display: block; margin-top: 10px; font-size: 13px; color: var(--accent-hover); }
/* the song a planet is playing (Signal Room) */
.tn-onair { margin: -10px 0 22px; font-size: 13px; letter-spacing: .02em; color: var(--accent-hover); display: flex; gap: 8px; align-items: baseline; }
.tn-onair[hidden] { display: none; }
.tn-onair::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 8px #ff5a4f; animation: tn-onair 1.2s ease-in-out infinite; }
@keyframes tn-onair { 50% { opacity: .35; } }

/* The dial: a band of stations moving under a fixed red needle */
.tn-dial {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: calc(6px + var(--foot) + var(--safe-b)); height: 92px;
  display: flex; align-items: center; gap: 8px; padding: 0 clamp(8px, 3vw, 36px);
  transition: opacity .6s var(--ease), transform .8s var(--ease);
}
.tn-window {
  position: relative; flex: 1; height: 100%; overflow: hidden; touch-action: none; cursor: ew-resize;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}
.tn-needle {
  position: absolute; z-index: 2; left: 50%; top: 4px; height: 40px; width: 2px; margin-left: -1px; border-radius: 2px;
  background: #ff5a4f; box-shadow: 0 0 10px rgba(255, 90, 79, .8), 0 0 2px #ff5a4f; pointer-events: none;
}
.tn-step {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 18, 22, .7);
  color: var(--text); font-size: 22px; line-height: 1; cursor: pointer;
}
.tn-step:hover { border-color: var(--accent); }
.tn-step[hidden] { display: none; }

/* The project list, as the dial's scale (with JS); a plain list without */
.js .tn-band.xp-rail { position: static; transform: none; max-width: none; opacity: 1; pointer-events: auto; }
.js .tn-band ul {
  position: absolute; left: 0; top: 0; height: 100%; display: block; margin: 0; padding: 0; overflow: visible;
  background: none; border: 0; border-radius: 0; will-change: transform;
}
.js .tn-band ul::before {   /* fine ticks, five per station */
  content: ""; position: absolute; left: -400px; right: -400px; top: 10px; height: 10px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(237, 240, 243, .22) 0 1px, transparent 1px 100%) 0 0 / calc(var(--sp, 140px) / 5) 100%;
  background-position-x: 400px;
}
.js .tn-band li { position: absolute; top: 0; width: 160px; margin-left: -80px; list-style: none; }
.js .tn-band a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; padding: 30px 6px 6px; border: 0; border-radius: 6px;
  font: 600 13px/1.2 'Space Grotesk', sans-serif; color: #8c939d; text-align: center; white-space: normal; background: none;
}
.js .tn-band a::before {   /* the station's tick */
  content: ""; position: absolute; left: 50%; top: 6px; width: 2px; height: 18px; margin-left: -1px; background: rgba(237, 240, 243, .5); border-radius: 1px;
}
.js .tn-band small { font-size: 10px; letter-spacing: .05em; color: #6f7783; }
.js .tn-band a:hover { color: var(--text); background: none; }
.js .tn-band a[aria-current="true"] { color: var(--text); background: none; border: 0; }
.js .tn-band a[aria-current="true"]::before { background: var(--accent); height: 22px; top: 4px; }
.js .tn-band a[aria-current="true"] small { color: var(--accent-hover); }

/* Details over the tuner */
.tn.has-details .tn-station { opacity: .08; }
.tn .xp-world { z-index: 45; }
.tn .xp-about { z-index: 45; }

/* No JS: a calm page with the list along the bottom */
html:not(.js) .tn-station { top: 42%; }
html:not(.js) .tn-dial { height: auto; }
html:not(.js) .tn-needle { display: none; }
html:not(.js) .tn-window { overflow: visible; -webkit-mask-image: none; mask-image: none; }

/* Phone and portrait: planet above, words below, dial at the bottom */
@media (max-width: 760px) {
  .tn-station { left: 20px; right: 20px; width: auto; top: auto; bottom: calc(100px + var(--foot) + var(--safe-b)); transform: none; }
  .tn-label { display: none; }
  .tn-title { font-size: clamp(34px, 10vw, 48px); }
  .tn-desc { font-size: 15px; margin: 12px 0 18px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .tn-status { margin-top: 10px; }
  .tn-dial { height: 80px; padding: 0 6px; }
  .tn-step { width: 38px; height: 38px; }
  .tn.is-close .tn-station { top: auto; bottom: calc(18px + var(--foot) + var(--safe-b)); }
  .tn.is-close .tn-desc { -webkit-line-clamp: 5; }
  .js .tn-band li { width: 120px; margin-left: -60px; }
}
@media (max-height: 560px) and (min-width: 761px) {
  .tn-title { font-size: 40px; }
  .tn-desc { margin: 10px 0 16px; }
}
.tn-status[hidden] { display: none; }
html:not(.js) .tn-readout { display: none; }
/* a soft shade behind the words, so a big planet never fights them */
.tn-station::before {
  content: ""; position: absolute; inset: -60px -80px -60px -40vw; z-index: -1; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease);
  background: radial-gradient(ellipse at 35% 50%, rgba(7, 8, 12, .85), rgba(7, 8, 12, .5) 50%, rgba(7, 8, 12, 0) 72%);
}
.tn.is-close .tn-station::before { opacity: 1; }
@media (max-width: 760px) {
  .tn-station::before { inset: -40px -20px -20px; background: linear-gradient(rgba(7, 8, 12, 0), rgba(7, 8, 12, .82) 22%); }
}
