/* ── Theta App Styles ──────────────────────────────────────────
   Premium wellness design system
   ──────────────────────────────────────────────────────────── */

:root {
  --color-bg: #F8F4F0;
  --color-bg-alt: #F5F0EA;
  --color-surface: #FFFFFF;
  --color-primary: #6B3F5E;
  --color-primary-light: #7D4E72;
  --color-accent: #D4A57A;
  --color-text: #2C2C2C;
  --color-text-muted: #666666;
  --color-border: rgba(196, 149, 106, 0.15);
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', 'Plus Jakarta Sans', sans-serif;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.10), 0 16px 48px rgba(0,0,0,0.06);
  --shadow-btn: 0 4px 20px rgba(107, 63, 94, 0.25);
  --transition-base: all 250ms ease;
  --transition-card: all 300ms ease;
  /* Legacy aliases */
  --bg: #F8F4F0;
  --bg-alt: #F5F0EA;
  --fg: #2C2C2C;
  --fg-muted: #666666;
  --accent: #6B3F5E;
  --accent-deep: #7D4E72;
  --accent-secondary: #D4A57A;
  --border: rgba(196, 149, 106, 0.15);
  --about-bg: #F8F4F0;
  --rose-gold: #D4A57A;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(245, 240, 234, 0.8) 0%, transparent 70%);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  padding: 18px 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  background: rgba(248, 244, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-logo-symbol {
  display: inline-block;
  margin-right: auto;
  height: 48px;
  width: auto;
}
.nav-logo-symbol img {
  height: 48px;
  width: auto;
}
.nav-center {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-menu {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 24px;
}
.nav-home-link {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.nav-home-icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.nav-admin-link { color: var(--accent); }
.nav-link {
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.nav-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--accent-secondary);
}
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-base);
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--accent-deep);
  transform: scale(1.02);
  box-shadow: var(--shadow-btn);
}
.lang-switch {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.lang-switch:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Mobile hamburger ─────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--fg);
}
.nav-hamburger svg { display: block; }

@media (max-width: 768px) {
  .nav { padding: 16px 20px; position: relative; }
  .nav-menu { display: none; }
  .nav-center { display: none; }
  .nav-right { display: none; }
  .nav-cta { display: none; }
  .nav-hamburger { display: block; margin-left: auto; }
  .nav.open .nav-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  }
  .nav.open .nav-center,
  .nav.open .nav-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: static;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 16px;
  }
  .nav.open .nav-right { margin-left: 0; }
  .nav-home-label { display: none; }
  .nav.open .nav-cta {
    display: inline-block;
    text-align: center;
    margin-top: 8px;
  }
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
}
h1 { font-size: 3.2rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 1.6rem; }
em { font-style: italic; font-weight: 400; }

/* ── Page layout ────────────────────────────────────────── */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 100px 24px;
}

.container {
  width: 100%;
  max-width: 560px;
}

/* ── Forms ──────────────────────────────────────────────── */
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-card);
}

.form-heading {
  font-size: 1.75rem;
  margin-bottom: 8px;
  color: var(--fg);
}
.form-subheading {
  color: var(--fg-muted);
  margin-bottom: 36px;
  font-size: 0.95rem;
}
.form-error {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.form-disclaimer {
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.8rem;
  margin-top: 12px;
}

.form-group {
  margin-bottom: 24px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 0.2s;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,107,123,0.18);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7570' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Duration chips ────────────────────────────────────── */
.duration-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.duration-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--bg);
  color: var(--fg-muted);
  transition: all 0.2s;
  font-family: var(--font-body);
}
.duration-chip:hover { border-color: var(--accent); color: var(--fg); }
.duration-chip.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ── Soundscape selector ──────────────────────────────── */
.soundscape-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ── Session type selector ─────────────────────────────── */
.session-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Voice preference row ─────────────────────────────── */
.voice-preference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Voice selector ──────────────────────────────────────── */
.voice-gender-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}
.voice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.voice-card {
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--color-surface);
  transition: var(--transition-card);
  font-family: var(--font-body);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.voice-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.voice-card.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.voice-card-name {
  font-size: 0.9rem;
  font-weight: 400;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 14px 32px;
  border-radius: 26px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition-base);
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}
.btn-primary:hover {
  background: var(--accent-deep);
  transform: scale(1.02);
  box-shadow: var(--shadow-btn);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--border);
  height: 44px;
  padding: 10px 24px;
  font-size: 0.9rem;
}
.btn-secondary:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── Session player ─────────────────────────────────────── */
.player-layout {
  width: 100%;
  max-width: 640px;
}

.player-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.meta-pill {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.meta-pill-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.meta-pill-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

/* ── Audio controls ──────────────────────────────────────── */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.play-btn:hover { background: var(--accent-deep); }
.play-icon { width: 0; height: 0; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent white; }
.pause-icon { width: 16px; height: 18px; display: flex; gap: 4px; }
.pause-icon span { width: 5px; height: 18px; background: white; border-radius: 2px; }

.time-display {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.volume-icon { color: var(--fg-muted); flex-shrink: 0; }
.volume-slider {
  flex: 1;
  height: 3px;
  padding: 11px 0;
  box-sizing: content-box;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  flex: 1;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s linear;
}

/* ── Playback timeline ───────────────────────────────────── */
.player-timeline {
  padding: 18px 20px;
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.player-timeline-title {
  font-size: 1.2rem;
  margin: 0;
}
.player-timeline-status {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 12px 0 0;
  color: var(--fg-muted);
  font-size: 0.82rem;
}
.player-timeline-status[hidden] { display: none; }
.player-timeline--loading .player-timeline-status { position: relative; }
.player-timeline--loading .player-timeline-status-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.player-timeline-skeleton {
  display: none;
  flex: 1;
  gap: 3px;
}
.player-timeline--loading .player-timeline-skeleton { display: grid; }
.player-timeline-skeleton-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 8px;
}
.player-timeline-skeleton-row::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: none;
  border: 1px solid var(--accent-secondary);
  border-radius: 50%;
  background: var(--color-surface);
}
.player-timeline-skeleton-piece {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-alt);
}
.player-timeline-skeleton-piece::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--accent-secondary), transparent);
  opacity: 0.35;
  animation: player-timeline-shimmer 1.5s ease-in-out infinite;
}
.player-timeline-skeleton-label { width: 42%; }
.player-timeline-skeleton-row:nth-child(2) .player-timeline-skeleton-label { width: 56%; }
.player-timeline-skeleton-row:nth-child(3) .player-timeline-skeleton-label { width: 34%; }
.player-timeline-skeleton-time { width: 14%; margin-left: auto; }
@keyframes player-timeline-shimmer {
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .player-timeline-skeleton-piece::after { animation: none; }
}
.player-timeline--empty .player-timeline-status {
  justify-content: center;
  padding: 11px 16px;
  color: var(--fg-muted);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.player-timeline--error .player-timeline-status {
  justify-content: center;
  padding: 12px 16px;
  color: #7a4a10;
  text-align: center;
  background: #fff7eb;
  border: 1px solid #c9853a;
  border-left: 3px solid #c9853a;
  border-radius: var(--radius-sm);
}
.player-timeline-retry { margin-top: 12px; }
.player-timeline-retry[hidden] { display: none; }
.player-timeline-retry:focus-visible {
  outline: 3px solid var(--accent-secondary);
  outline-offset: 3px;
}
.player-timeline-list {
  position: relative;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  margin: 12px 0 0;
  padding: 2px 8px 2px 22px;
}
.player-timeline-list:empty { display: none; }
.player-timeline-list::before {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 1px;
  background: var(--border);
}
.player-timeline-item {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}
.player-timeline-item::before {
  content: '';
  position: absolute;
  top: 13px;
  left: -18px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--accent-secondary);
  border-radius: 50%;
  background: var(--color-surface);
}
.player-timeline-label {
  min-width: 0;
  color: var(--fg);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.player-timeline-time {
  flex-shrink: 0;
  color: var(--fg-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ── Script details (collapsible) ──────────────────────── */
.script-details {
  margin-bottom: 20px;
}
.script-summary {
  font-size: 0.85rem;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  list-style: none;
}
.script-summary::-webkit-details-marker { display: none; }
.script-summary::before {
  content: '\25B8 ';
  color: var(--accent);
}
.script-details[open] .script-summary::before { content: '\25BE '; }

.player-script {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 28px;
  margin-top: 12px;
  max-height: 400px;
  overflow-y: auto;
}
.script-line-text {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: 12px;
}
.script-line-text:last-child { margin-bottom: 0; }

/* ── Player footer ──────────────────────────────────────── */
.player-footer {
  display: flex;
  justify-content: center;
  align-items: center;
}
.player-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.complete-btn {
  padding: 10px 20px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}
.complete-btn:hover { background: #000; }

/* ── Modality/soundscape cards ─────────────────────────── */
.modality-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  cursor: pointer;
  text-align: center;
  background: var(--color-surface);
  transition: var(--transition-card);
  font-family: var(--font-body);
  box-shadow: var(--shadow-card);
}
.modality-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.modality-card.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.modality-card-name {
  font-size: 0.9rem;
  font-weight: 400;
}
.modality-card-desc {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* ── Generating page ───────────────────────────────────── */
.gen-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.gen-steps {
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}
.gen-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
  opacity: 0.5;
  transition: all 0.3s;
}
.gen-step.active { opacity: 1; color: var(--fg); }
.gen-step.done { opacity: 0.7; color: var(--accent); }
.gen-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.3s;
}
.gen-step.active .gen-step-dot {
  background: var(--accent);
  animation: pulse 1.5s ease infinite;
}
.gen-step.done .gen-step-dot { background: var(--accent); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.gen-disclaimer {
  margin-top: 32px;
  font-size: 0.75rem;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* ── Session history ───────────────────────────────────── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-decoration: none;
  color: var(--fg);
  transition: var(--transition-card);
  box-shadow: var(--shadow-card);
}
.history-item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.history-item-name { font-weight: 400; margin-bottom: 2px; }
.history-item-meta { font-size: 0.8rem; color: var(--fg-muted); }
.history-item-date { font-size: 0.8rem; color: var(--fg-muted); }
.history-item-duration { font-family: var(--font-display); font-size: 1.1rem; color: var(--fg); }
.history-item-actions { display: flex; align-items: center; gap: 16px; }
.history-item-play-form { display: inline; }
.history-play-btn { padding: 10px 22px; font-size: 0.9rem; }

/* ── Home page ──────────────────────────────────────────── */
.home {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}
.home-inner {
  max-width: 600px;
  text-align: center;
}
.home-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 20px;
}
.home-heading {
  font-size: 3.6rem;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.home-heading em {
  font-style: italic;
  color: var(--accent);
}
.home-subtext {
  font-size: 1.05rem;
  color: var(--fg-muted);
  line-height: 1.75;
  max-width: 65ch;
  margin: 0 auto 36px;
}
.home-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 52px;
}
.btn-lg { padding: 16px 36px; font-size: 1.05rem; height: 56px; border-radius: 28px; }
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  text-decoration: none;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--fg); }

.home-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  transition: var(--transition-card);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.feature-icon { color: var(--accent); margin-bottom: 10px; display: flex; justify-content: center; }
.feature-label { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.feature-desc { font-size: 0.8rem; color: var(--fg-muted); }

.home-disclaimer {
  font-size: 0.75rem;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* ── Image overlays ─────────────────────────────── */
/* Ivory gradient overlays — make images dissolve into the ivory page background */
.img-overlay-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, rgba(250,248,245,0.35) 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
.img-overlay-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, rgba(250,248,245,0.50) 0%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

/* ── Hero background image ──────────────────────── */
/* Defined in index.ejs inline <style> to avoid conflicts between
   app.css (base) and index.ejs (page-specific override) */

/* ── O Theta background image ──────────────────── */
.o-theta-right {
  background-image: url('https://pub-629428d185ca4960a0a73c850d32294b.r2.dev/company_150831/images/7fdc662d-f45a-4907-a815-df0d78c7d397.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  min-height: 480px;
}
.o-theta-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(248, 245, 240, 0.55),
    rgba(248, 245, 240, 0.15),
    rgba(248, 245, 240, 0.65)
  );
  pointer-events: none;
  z-index: 1;
}
.o-theta-right::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #F8F4F0 0%, transparent 15%),
    linear-gradient(to top, #F8F4F0 0%, transparent 15%);
  pointer-events: none;
  z-index: 2;
}
.o-theta-right > * {
  position: relative;
  z-index: 2;
}

/* ── Complete page ───────────────────────────────────────── */
.complete-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  text-align: center;
}
.complete-card { max-width: 440px; }
.complete-emoji { font-size: 3rem; margin-bottom: 20px; }
.complete-heading { font-size: 1.75rem; margin-bottom: 12px; }
.complete-subtext { color: var(--fg-muted); margin-bottom: 28px; font-size: 0.95rem; }

/* ── Text & section spacing ─────────────────────────────── */
p { max-width: 65ch; }

/* ── Responsive ─────────────────────────────────────────── */
/* ── Library category pages ─────────────────────────────── */
.category-header {
  width: 100%;
  min-height: 280px;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  // border-radius: 28px;
}
/* Hero image as background (set via style="background-image:url(...)" on the element) */
.category-header[style*="background-image"] {
  background-size: cover;
  background-position: center;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 12%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 12%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  filter: brightness(1.05) contrast(0.88) saturate(0.85);
}
.category-header-overlay {
  position: relative;
  z-index: 2;
  padding: 40px 48px 36px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  width: 100%;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
}
.breadcrumb a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
.breadcrumb a:hover { color: white; }
.breadcrumb-sep { opacity: 0.6; }
.category-header-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.category-header-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.82);
  max-width: 55ch;
  line-height: 1.5;
}

.recording-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}
.recording-search {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recording-search-input {
  width: 100%;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 0.2s;
}
.recording-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,107,123,0.18);
}
.recording-search-input::placeholder { color: var(--fg-muted); }
.recording-search-clear {
  flex-shrink: 0;
  height: 46px;
  padding: 10px 18px;
}
.recording-search-clear:disabled {
  cursor: default;
  opacity: 0.6;
}
.recording-search-empty {
  padding-top: 24px;
  color: var(--fg-muted);
  text-align: center;
}
.recording-search-empty[hidden] { display: none; }
.recording-row {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.recording-row:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.recording-row-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  gap: 16px;
}
.recording-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.btn-play-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-play-small:hover { background: var(--accent-deep); transform: scale(1.05); }
.play-icon-sm {
  width: 0; height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent white;
  margin-left: 2px;
}
.recording-meta { display: flex; flex-direction: column; min-width: 0; }
.recording-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recording-title:hover { color: var(--accent); }
.recording-duration {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 3px;
}
.recording-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-favorite {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.btn-favorite:hover { border-color: var(--accent); }
.btn-favorite.favorited { border-color: var(--accent); background: rgba(107,63,94,0.08); }
.recording-progress {
  height: 3px;
  background: var(--border);
  width: 100%;
}
.recording-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.category-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--fg-muted);
}

@media (max-width: 600px) {
  .nav { padding: 20px 24px; }
  .form-card { padding: 28px 20px; }
  .player-meta { grid-template-columns: 1fr 1fr; }
  .player-timeline { padding: 16px; }
  .player-timeline-item { flex-wrap: wrap; }
  .player-timeline-time { margin-left: 0; }
  .gen-meta { grid-template-columns: 1fr; }
  .soundscape-grid { grid-template-columns: 1fr 1fr; }
  .session-type-grid { grid-template-columns: 1fr 1fr; }
  .player-actions { flex-direction: column; }
  .home-heading { font-size: 2.2rem; }
  .home-features { grid-template-columns: 1fr; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
  .page { padding: 60px 20px; }
  body { font-size: 15px; }
  .category-header-overlay { padding: 24px 20px 20px; }
  .category-header-title { font-size: 1.8rem; }
  .recording-row-body { padding: 14px 16px; }
  .recording-row-left { gap: 10px; }
  .recording-search { gap: 8px; }
  .recording-search-input { padding: 12px; }
  .recording-search-clear { padding: 10px 14px; }
}
