/* ============================================================
   THE ARCHIVE — record.css
   The sacred recording page. No menus. No distractions.
   An 85-year-old must use this alone.
   ============================================================ */

/* Isolate from main layout – recording page has no nav, no footer */
.record-body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2.5rem 1.25rem 4rem;
  position: relative;
}

/* Grain still applied via body::before from archive.css */

/* ---- Logo bar (minimal – just a mark) ---- */
.record-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
}

.record-logo__mark {
  width: 48px;
  height: 48px;
  margin-bottom: 0.6rem;
}

.record-logo__tagline {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  text-align: center;
}

/* ---- Question display ---- */
.record-question {
  max-width: 680px;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
}

.record-question__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 1.25rem;
  opacity: 0.8;
}

.record-question__text {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  color: var(--fg);
}

/* ---- Narration audio (hidden player, functional) ---- */
.record-narration {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.record-narration__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.75rem;
  display: block;
}

.record-narration audio {
  width: 100%;
  accent-color: var(--accent);
}

/* Listen again button */
.btn-listen-again {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(200, 169, 110, 0.4);
  transition: color var(--transition), text-decoration-color var(--transition);
  margin-bottom: 2rem;
}

.btn-listen-again:hover {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

.btn-listen-again:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---- Main record button ---- */
.record-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* The BIG button */
.btn-record {
  width: 100%;
  min-height: 88px;  /* well above 72px minimum */
  font-family: var(--font-mono);
  font-size: 1.1rem;   /* ~20px — above 24pt requirement */
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  overflow: hidden;
}

.btn-record:hover {
  background: #d4b97a;
  border-color: #d4b97a;
}

.btn-record:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.btn-record:active {
  transform: scale(0.99);
}

/* Recording state — pulsing */
.btn-record--recording {
  background: #1a0f0f;
  border-color: var(--error);
  color: #c05a5a;
}

.btn-record--recording:hover {
  background: #200d0d;
  border-color: #a04040;
}

/* Review state */
.btn-record--review {
  background: transparent;
  border-color: var(--border-mid);
  color: var(--muted);
  font-size: 0.88rem;
  min-height: 72px;
}

/* Pulse indicator */
.record-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--error);
  flex-shrink: 0;
  display: none;
}

.is-recording .record-dot {
  display: block;
  animation: recordPulse 1.2s ease-in-out infinite;
}

@keyframes recordPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ---- Timer display ---- */
.record-timer {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: var(--fg);
  display: none;
  text-align: center;
}

.record-timer.is-visible { display: block; }

.record-timer--warning { color: var(--accent); }
.record-timer--danger  { color: var(--error); }

/* ---- Review controls ---- */
.review-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.review-controls.is-visible { display: flex; }

.review-playback {
  width: 100%;
  accent-color: var(--accent);
  margin-bottom: 0.5rem;
}

.review-actions {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.review-actions .btn {
  flex: 1;
  min-height: 72px;
  font-size: 0.9rem;
}

/* Send / submit button */
.btn-send {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  min-height: 72px;
  font-size: 0.9rem;
}

.btn-send:hover {
  background: #6a8560;
  border-color: #6a8560;
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Soft cap banner ---- */
.soft-cap-banner {
  display: none;
  background: rgba(200, 169, 110, 0.08);
  border: 1px solid rgba(200, 169, 110, 0.25);
  border-radius: 2px;
  padding: 1rem 1.5rem;
  text-align: center;
  max-width: 520px;
  width: 100%;
  animation: fadeInBanner 400ms ease forwards;
}

.soft-cap-banner.is-visible { display: block; }

@keyframes fadeInBanner {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.soft-cap-banner__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent);
  line-height: 1.55;
}

/* ---- Error / retry message ---- */
.record-error {
  display: none;
  text-align: center;
  max-width: 480px;
}

.record-error.is-visible { display: block; }

.record-error__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- Upload progress ---- */
.upload-progress {
  display: none;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.upload-progress.is-visible { display: block; }

.upload-progress__bar-wrap {
  background: var(--border);
  border-radius: 1px;
  height: 2px;
  width: 100%;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.upload-progress__bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 200ms linear;
}

.upload-progress__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Consent overlay ---- */
.consent-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.consent-overlay.is-dismissed {
  animation: fadeOut 200ms ease forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  to { opacity: 0; }
}

.consent-card {
  background: var(--card-bg);
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  padding: 2.5rem 2rem;
  max-width: 580px;
  width: 100%;
  text-align: center;
}

.consent-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-style: italic;
  margin-bottom: 1.25rem;
  color: var(--fg);
}

.consent-card__body {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--fg);
  margin-bottom: 2rem;
  font-family: var(--font-display);
}

.consent-card__agree {
  width: 100%;
  min-height: 80px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background var(--transition);
}

.consent-card__agree:hover { background: #d4b97a; }

.consent-card__agree:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* ---- Expired link page ---- */
.expired-page {
  min-height: 80dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem;
}

.expired-page__glyph {
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.35;
  margin-bottom: 1.5rem;
}

.expired-page__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-style: italic;
  margin-bottom: 1rem;
}

.expired-page__text {
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Done page ---- */
.done-page {
  min-height: 90dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem;
  gap: 1.5rem;
}

.done-page__mark {
  color: var(--accent);
  font-size: 2rem;
  opacity: 0.6;
  line-height: 1;
}

.done-page__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-style: italic;
  line-height: 1.1;
  color: var(--fg);
}

.done-page__tagline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.7;
}

.done-page__sub {
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 400px;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 480px) {
  .record-body {
    padding: 1.5rem 1rem 3rem;
  }

  .btn-record {
    min-height: 80px;
    font-size: 1rem;
  }

  .record-question__text {
    font-size: clamp(1.5rem, 7vw, 2.2rem);
  }

  .review-actions {
    flex-direction: column;
  }
}

@media (min-width: 900px) {
  .record-body {
    padding: 3.5rem 1.25rem 5rem;
  }

  .btn-record {
    min-height: 96px;
    font-size: 1.2rem;
  }
}
