/* ---------------------------------------------------
   Trevor Sparks — tuner dial design system
   bg near-black · navy bubbles · amber signal glow
--------------------------------------------------- */

:root{
  --bg: #08090b;
  --bg-vignette: #0c0e12;
  --panel: #12141a;
  --bubble: #1a2030;
  --bubble-border: #2a3448;
  --bubble-border-active: #4a5c82;
  --text: #eef0f4;
  --text-dim: #7d879c;
  --text-faint: #4c5464;
  --accent: #e7a75f;
  --accent-soft: rgba(231, 167, 95, 0.35);
  --accent-glow: rgba(231, 167, 95, 0.18);
  --mono: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;

  --stage-width: min(1100px, 92vw);
  --scale: 1;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body{
  font-family: var(--mono);
  background:
    radial-gradient(ellipse 900px 500px at 50% 0%, var(--bg-vignette) 0%, var(--bg) 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection{ background: var(--accent-soft); color: var(--bg); }

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Header ---------------- */

.site-header{
  width: var(--stage-width);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 48px 0 12px;
}

.callsign{
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-text h1{
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(20px, 3.4vw, 28px);
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

.tagline{
  margin: 2px 0 0;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

/* ---------------- Frequency readout ---------------- */

.freq-readout{
  width: var(--stage-width);
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 26px 2px 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.freq-label{
  color: var(--text-faint);
  text-transform: uppercase;
  font-size: 11px;
}

.freq-value{
  color: var(--accent);
  font-weight: 600;
  font-size: 16px;
  text-shadow: 0 0 14px var(--accent-glow);
  transition: text-shadow 0.2s ease;
}

.freq-status{
  margin-left: auto;
  color: var(--text-faint);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.14em;
  position: relative;
  padding-left: 14px;
}

.freq-status::before{
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.freq-status.locked{ color: var(--accent); }
.freq-status.locked::before{
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 1.6s ease-in-out infinite;
}

@keyframes pulse-dot{
  0%, 100%{ opacity: 1; }
  50%{ opacity: 0.35; }
}

/* ---------------- Stage / dials ---------------- */

.stage{
  position: relative;
  width: var(--stage-width);
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edge-tick{
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--bubble-border) 20%, var(--bubble-border) 80%, transparent);
  z-index: 1;
}
.edge-tick--left{ left: 0; }
.edge-tick--right{ right: 0; }

.dial-group{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(0px);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.dial-group.with-response{
  transform: translateY(-78px);
}

.carousel-row{
  position: relative;
  width: 100%;
  height: 150px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.carousel-row:active{ cursor: grabbing; }

.row-mask{
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 14%, black 86%, transparent 100%);
}

.carousel-track{
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
}

.bubble{
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 126px;
  padding: 0 30px;
  height: 93px;
  border-radius: 30px;
  background: var(--bubble);
  border: 1px solid var(--bubble-border);
  color: var(--text-dim);
  font-family: var(--mono);
  white-space: nowrap;
  will-change: transform, opacity;
  pointer-events: none;
}

.bubble .glyph{
  font-size: 16px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

.bubble .label{
  font-size: 25px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.bubble.is-center{
  color: var(--text);
  border-color: var(--bubble-border-active);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 8px 30px -8px var(--accent-glow);
}
.bubble.is-center .label{ color: var(--accent); }
.bubble.is-center .glyph{ color: var(--accent); opacity: 0.8; }

.center-marker{
  position: relative;
  width: 100%;
  height: 34px;
  flex-shrink: 0;
}

.marker-arm{
  position: absolute;
  left: 50%;
  width: 1px;
  height: 12px;
  background: var(--accent);
  opacity: 0.55;
}
.marker-arm--top{ top: 0; transform: translateX(-50%); }
.marker-arm--bottom{ bottom: 0; transform: translateX(-50%); }

/* ---------------- Terminal readout ---------------- */

.terminal{
  width: var(--stage-width);
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--bubble-border);
  border-radius: 12px;
  padding: 18px 22px 22px;
  min-height: 108px;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.terminal.visible{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.terminal-header{
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--bubble-border);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.terminal-dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.terminal-body{
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
}

.cursor{
  color: var(--accent);
  animation: blink 1s step-start infinite;
}

@keyframes blink{
  50%{ opacity: 0; }
}

/* ---------------- Footer ---------------- */

.site-footer{
  width: var(--stage-width);
  padding: 30px 0 60px;
  text-align: center;
}

.site-footer p{
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px){
  .stage{ height: 280px; }
  .carousel-row{ height: 122px; }
  .bubble{ height: 78px; min-width: 100px; padding: 0 21px; border-radius: 24px; gap: 4px; }
  .bubble .label{ font-size: 20px; }
  .bubble .glyph{ font-size: 13px; }
  .dial-group.with-response{ transform: translateY(-62px); }
  .freq-readout{ font-size: 12px; }
}
