/* 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], .tn:not(.is-close) .tn-also { 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%); }
}

/* On air: OppyWorks Music's channels. A satellite drifts in the sky and sends its signal; a tap opens them. */
.tn-sat { position: fixed; z-index: 30; right: clamp(16px, 6vw, 110px); top: calc(92px + env(safe-area-inset-top, 0px)); }
.tn-sat summary {
  list-style: none; position: relative; width: 64px; height: 64px; display: grid; place-items: center;
  border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tn-sat summary::-webkit-details-marker { display: none; }
.tn-sat summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tn-sat-craft { width: 56px; height: 56px; overflow: visible; animation: tn-sat-drift 20s ease-in-out infinite; }
.tn-sat-wing { fill: #1b2130; stroke: #8f98a6; stroke-width: 1.2; }
.tn-sat-grid { fill: none; stroke: rgba(179, 162, 212, .5); stroke-width: .8; }
.tn-sat-arm { fill: none; stroke: #aab1ba; stroke-width: 1.4; stroke-linecap: round; }
.tn-sat-core { fill: #c3c8d0; stroke: #5d6470; }
.tn-sat-dish { fill: #e4e7ec; stroke: #5d6470; }
.tn-sat-beacon { fill: var(--accent); animation: tn-sat-blink 2.6s infinite; }
/* the signal: rings from the dish, quicker while the card is open */
.tn-sat summary::before, .tn-sat summary::after {
  content: ""; position: absolute; left: 50%; top: 72%; width: 16px; height: 16px; margin: -8px;
  border: 1.5px solid var(--accent); border-radius: 50%; opacity: 0; pointer-events: none; animation: tn-sat-ring 4.5s ease-out infinite;
}
.tn-sat summary::after { animation-delay: 1.5s; }
.tn-sat[open] summary::before, .tn-sat[open] summary::after { animation-duration: 1.5s; }
.tn-sat-tag {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); opacity: 0; transition: opacity .3s;
}
.tn-sat summary:hover .tn-sat-tag, .tn-sat summary:focus-visible .tn-sat-tag { opacity: 1; }
.tn-sat[open] summary .tn-sat-tag { opacity: 0; }
.tn-sat-card {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(260px, calc(100vw - 32px)); padding: 18px 16px 16px;
  background: rgba(19, 22, 27, .96); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  animation: tn-sat-in .35s var(--ease) both;
}
.tn-sat-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.tn-sat-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff5a4f; animation: tn-onair 1.2s ease-in-out infinite; }
.tn-sat-title { margin: 0; font: 600 22px/1.1 'Space Grotesk', sans-serif; color: var(--text); }
.tn-sat-line { margin: 8px 0 14px; font-size: 14px; color: #d4d8de; }
.tn-sat-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 8px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 4px; color: var(--text); font-size: 15px; text-decoration: none; transition: border-color .2s, background .2s;
}
.tn-sat-link:hover { border-color: var(--accent); background: rgba(179, 162, 212, .08); }
.tn-sat-link .xp-brand-ic { width: 20px; height: 20px; }
.tn.has-details .tn-sat { opacity: .08; pointer-events: none; }
html:not(.js) .tn-sat { top: 160px; }
@media (min-width: 1100px) { .tn-sat summary { width: 76px; height: 76px; } .tn-sat-craft { width: 66px; height: 66px; } }
@keyframes tn-sat-drift { 0%, 100% { transform: translate(0, 0) rotate(-9deg); } 50% { transform: translate(-16px, 10px) rotate(7deg); } }
@keyframes tn-sat-blink { 0%, 60% { opacity: .25; } 64%, 80% { opacity: 1; } }
@keyframes tn-sat-ring { 0% { transform: scale(.4); opacity: .75; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes tn-sat-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 760px) {
  .tn-sat { right: 10px; top: calc(70px + env(safe-area-inset-top, 0px)); }
  .tn-sat-craft { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-sat-craft, .tn-sat-beacon, .tn-sat-card, .tn-sat summary::before, .tn-sat summary::after { animation: none; }
  .tn-sat-craft { transform: rotate(-9deg); }
}
