/**
 * Entrain — Light & Sound Sessions
 * Conceived and developed by Andre Esbizaro
 * © 2026 Andre Esbizaro. All rights reserved.
 */

:root {
  --bg: #000;
  --surface: #0a0a0a;
  --surface-hover: #171717;
  --border: #262626;
  --border-hover: #525252;
  --border-strong: #737373;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-dim: #525252;
  --text-dimmer: #404040;
  --accent: #a3a3a3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.5;
}

button {
  font-family: inherit;
  font-weight: 300;
  cursor: pointer;
  background: transparent;
  color: inherit;
  border: none;
}

a { color: inherit; text-decoration: none; }

/* Layout ---------------------------------------------------- */
.page {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.page--welcome { align-items: center; }

.container { width: 100%; margin: 0 auto; }
.container--narrow { max-width: 560px; }
.container--medium { max-width: 720px; }

/* Typography ------------------------------------------------ */
.kicker {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.kicker--warning { color: #fde68a; }

.display {
  font-size: 48px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 12px 0 24px;
}
.display-sm {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 12px 0 16px;
}
.heading {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.lead {
  font-size: 17px;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
}
.text-strong { color: var(--text); }
.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 8px;
  font-weight: 300;
}
.hint--center { text-align: center; margin-top: 24px; }

/* Welcome --------------------------------------------------- */
.welcome-header { margin-bottom: 64px; }
.welcome-header .lead { margin-top: 8px; }

.safety-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 40px;
}
.safety-body {
  margin-top: 16px;
  color: #d4d4d4;
  font-size: 14px;
  line-height: 1.7;
}
.safety-body p + p { margin-top: 12px; }

/* Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: all 200ms ease;
  text-align: center;
}
.btn--block { display: flex; width: 100%; }
.btn--outline { border: 1px solid var(--border-hover); color: var(--text); }
.btn--outline:hover { border-color: var(--border-strong); }
.btn--primary {
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 500;
  border: none;
}
.btn--primary:hover { transform: scale(1.01); }
.btn-text {
  display: block;
  padding: 12px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  transition: color 200ms;
}
.btn-text:hover { color: var(--text-muted); }

/* Select page ----------------------------------------------- */
.page-header { margin-bottom: 40px; padding-top: 32px; }

.session-list { display: flex; flex-direction: column; gap: 12px; }

.session-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 200ms ease;
}
.session-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.session-card__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  opacity: 0.9;
  flex-shrink: 0;
  transition: all 200ms;
}
.session-card:hover .session-card__dot { width: 16px; height: 16px; }
.session-card__body { flex: 1; min-width: 0; }
.session-card__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.session-card__name { font-size: 20px; color: var(--text); }
.session-card__meta {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.session-card__desc { color: var(--text-muted); font-size: 14px; }
.session-card__arrow {
  color: var(--text-dimmer);
  font-size: 20px;
  transition: color 200ms;
}
.session-card:hover .session-card__arrow { color: var(--text-muted); }

/* Setup ----------------------------------------------------- */
.back-link {
  display: inline-block;
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 32px;
  margin-bottom: 32px;
  transition: color 200ms;
}
.back-link:hover { color: var(--text-muted); }

.setup-header { margin-bottom: 40px; }
.setup-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  opacity: 0.9;
}

.setup-form { display: flex; flex-direction: column; }
.field { margin-bottom: 32px; }
.field__label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.label { font-size: 14px; color: var(--text-muted); letter-spacing: 0.02em; }
.value-display { color: var(--text); font-size: 18px; font-weight: 300; }

/* Range slider --------------------------------------------- */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 12px var(--accent);
}
.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px var(--accent);
}
.range-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 6px;
}

/* Audio options -------------------------------------------- */
.audio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.audio-option {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 200ms;
  text-align: center;
}
.audio-option:hover { border-color: var(--border-hover); color: var(--text); }
.audio-option input { display: none; }
.audio-option:has(input:checked) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-hover);
}

.setup-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dimmer);
  line-height: 1.6;
}

/* Site footer (credit + copyright) ------------------------- */
.site-footer {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 80px auto 0 auto;
  padding: 32px 16px 16px 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  clear: both;
}
.site-footer__credit,
.site-footer__copyright {
  display: block;
  width: 100%;
  text-align: center;
  margin-left: 0;
  margin-right: 0;
}
.site-footer__credit {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 0;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.site-footer__copyright {
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 0;
  margin-bottom: 0;
  letter-spacing: 0.04em;
}

/* Player phases -------------------------------------------- */
.phase {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hidden { display: none !important; }

.player-body { background: #000; overflow: hidden; }

.countdown-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
  opacity: 0.18;
  pointer-events: none;
}
.countdown-content { position: relative; text-align: center; }
.countdown-number {
  font-size: 140px;
  font-weight: 200;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin: 32px 0;
}
.countdown-sub { color: var(--text-dim); margin-top: 32px; }

/* Active phase --------------------------------------------- */
.phase--active { cursor: pointer; overflow: hidden; }
.flicker-layer {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 70%);
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}
.static-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
}

.controls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 700ms;
}
.controls-overlay.fade { opacity: 0; pointer-events: none; }

.player-top {
  padding: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.player-session-name { font-size: 18px; color: var(--text-muted); margin-top: 4px; }
.player-time { text-align: right; }
.time-display {
  font-size: 24px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.player-bottom { margin-top: auto; padding: 32px; }
.player-bottom-inner { max-width: 440px; margin: 0 auto; }

.progress-bar {
  height: 2px;
  background: #171717;
  border-radius: 1px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  opacity: 0.6;
  width: 0;
  transition: width 100ms linear;
}

.live-control {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.live-control .kicker { width: 56px; flex-shrink: 0; }
.live-control .range { flex: 1; }
.live-control__val {
  font-size: 11px;
  color: var(--text-dim);
  width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.button-row { display: flex; gap: 12px; margin-top: 24px; }
.button-row .btn { flex: 1; padding: 12px 16px; font-size: 14px; }

/* End phase ------------------------------------------------ */
.end-content { text-align: center; max-width: 400px; padding: 0 24px; }
.end-orb {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.35;
  margin: 0 auto 40px;
}
.end-buttons {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.end-credit {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dimmer);
  line-height: 1.8;
  letter-spacing: 0.04em;
}

/* Responsive ----------------------------------------------- */
@media (max-width: 640px) {
  .display { font-size: 36px; }
  .display-sm { font-size: 28px; }
  .heading { font-size: 22px; }
  .countdown-number { font-size: 96px; }
  .player-top, .player-bottom { padding: 20px; }
  .audio-grid { grid-template-columns: 1fr; }
}