/* StoryForge — App-specific styles (interview + archive)
   Inherits design tokens from theme.css (parchment/amber/ink palette).
   Playfair Display + Source Serif 4 are loaded globally in layout.ejs. */

/* ── Interview Page ─────────────────────────────────── */
.interview-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
}

.interview-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(247,240,227,0.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.interview-header .wordmark {
  font-family: var(--serif-head);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.interview-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-light);
}

.progress-dots {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.3s;
}

.progress-dot.done { background: var(--amber); }
.progress-dot.active { background: var(--amber); box-shadow: 0 0 0 3px rgba(184,115,42,0.2); }

/* ── Prompt Card ──────────────────────────────────────── */
.prompt-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
}

.prompt-card {
  max-width: 640px;
  width: 100%;
  text-align: center;
}

.prompt-number {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  margin-bottom: 2rem;
}

.prompt-text {
  font-family: var(--serif-head);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 3rem;
}

.prompt-hint {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-top: 1rem;
  font-style: italic;
}

/* ── Voice Recording ──────────────────────────────────── */
.voice-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.record-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.record-btn:hover {
  background: rgba(184,115,42,0.1);
}

.record-btn.recording {
  background: var(--amber);
  animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(184,115,42,0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(184,115,42,0); }
  100% { box-shadow: 0 0 0 0 rgba(184,115,42,0); }
}

.record-label {
  font-size: 0.85rem;
  color: var(--ink-light);
  letter-spacing: 0.05em;
}

/* Waveform while recording */
.waveform-live {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
}

.waveform-live.active { display: flex; }

.waveform-live .wb {
  width: 3px;
  border-radius: 2px;
  background: var(--amber);
  animation: live-wave 0.8s ease-in-out infinite;
}

.waveform-live .wb:nth-child(odd) { animation-delay: 0.1s; }
.waveform-live .wb:nth-child(3n)  { animation-delay: 0.25s; }
.waveform-live .wb:nth-child(5n)  { animation-delay: 0.05s; }
.waveform-live .wb:nth-child(2n)  { height: 20px; }
.waveform-live .wb:nth-child(4n)  { height: 28px; }

@keyframes live-wave {
  0%, 100% { transform: scaleY(0.3); }
  50%       { transform: scaleY(1); }
}

.recording-time {
  font-size: 0.9rem;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
  font-family: monospace;
  min-width: 3.5rem;
  text-align: center;
}

/* ── Text Fallback ────────────────────────────────────── */
.text-fallback {
  width: 100%;
  max-width: 500px;
}

.text-fallback textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  padding: 1rem;
  font-family: var(--serif-body);
  font-size: 1rem;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}

.text-fallback textarea:focus { border-color: var(--amber); }

/* ── Next / Submit ────────────────────────────────────── */
.response-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-ghost {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-mid);
  font-family: var(--serif-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

.btn-primary {
  padding: 0.7rem 2rem;
  border-radius: var(--radius);
  border: none;
  background: var(--amber);
  color: white;
  font-family: var(--serif-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover { background: #a06820; }

.btn-primary:disabled {
  background: var(--sepia);
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Audio Playback (recorded) ────────────────────────── */
.playback-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  width: 100%;
  max-width: 500px;
}

.play-btn-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--amber);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.playback-name {
  flex: 1;
  font-size: 0.8rem;
  color: var(--ink-mid);
}

.remove-recording {
  font-size: 0.75rem;
  color: var(--ink-light);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.change-mode {
  font-size: 0.8rem;
  color: var(--ink-light);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.75rem;
}

/* ── Completion Screen ────────────────────────────────── */
.complete-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.complete-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(184,115,42,0.1);
  border: 2px solid var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  margin-bottom: 2rem;
}

.complete-stage h2 {
  font-family: var(--serif-head);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}

.complete-stage p {
  color: var(--ink-mid);
  max-width: 440px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ── Archive Page ──────────────────────────────────────── */
.archive-page {
  min-height: 100vh;
  background: var(--parchment);
}

.archive-header {
  background: rgba(247,240,227,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.archive-header .wordmark {
  font-family: var(--serif-head);
  font-size: 1.1rem;
  font-weight: 600;
}

.archive-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.archive-title {
  font-family: var(--serif-head);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.archive-subtitle {
  color: var(--ink-light);
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

.session-block {
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.session-block:last-child { border-bottom: none; }

.session-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
}

.session-title {
  font-family: var(--serif-head);
  font-size: 1.25rem;
  font-weight: 600;
}

.session-meta {
  font-size: 0.75rem;
  color: var(--ink-light);
  white-space: nowrap;
}

.response-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.response-number {
  font-family: var(--serif-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--amber);
  padding-top: 0.2rem;
}

.response-body {}

.prompt-label {
  font-size: 0.75rem;
  color: var(--sepia);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  font-weight: 600;
}

.response-text {
  font-size: 1rem;
  color: var(--ink-mid);
  line-height: 1.75;
  font-style: italic;
}

.response-audio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--amber);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
}

.response-audio:hover { border-color: var(--amber); }

.empty-archive {
  text-align: center;
  padding: 5rem 2rem;
}

.empty-archive h2 {
  font-family: var(--serif-head);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.empty-archive p { color: var(--ink-mid); margin-bottom: 2rem; }

.start-btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: var(--amber);
  color: white;
  border-radius: var(--radius);
  font-family: var(--serif-body);
  font-weight: 600;
  font-size: 1rem;
}

/* ── Landing nav link to app ──────────────────────────── */
.nav-cta {
  background: var(--amber);
  color: white !important;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  transition: background 0.2s;
}
.nav-cta:hover { background: #a06820; }