/* ==========================================================================
   SPTS8 Research Audio Demonstration System
   Principal Frontend Design — Minimal, Clean & Warm Aesthetic
   Frameless Layout & Warm Stone, Oat & Terracotta Tones
   ========================================================================== */

:root {
  /* Warm Canvas & Tonal Surfaces */
  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-card: #f5efe6;
  --bg-subtle: #eee7dc;
  --bg-subtle-hover: #e5dec0;
  --bg-sand: #f2ece2;

  /* Typography Colors */
  --text-main: #1f1c19;
  --text-secondary: #544e47;
  --text-muted: #82786e;
  --text-light: #9e9387;

  /* Warm Terracotta & Amber Accents */
  --accent: #c05621;
  --accent-hover: #a54717;
  --accent-light: #fbf1e8;
  --accent-wash: #fef5ee;
  --accent-amber: #b45309;

  /* State Highlights */
  --playing-bg: #fcf4eb;

  /* Modern Sans-Serif Stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Plus Jakarta Sans", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;

  /* Soft Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Subtle Warm Shadows */
  --shadow-sm: 0 1px 3px rgba(35, 25, 15, 0.04);
  --shadow-md: 0 4px 12px rgba(35, 25, 15, 0.05);

  --max-width: 980px;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-page);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
}

/* Clean, Frameless Page Layout */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.75rem 6rem 1.75rem;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* ==========================================================================
   HEADER & HERO
   ========================================================================== */

.site-header {
  margin-bottom: 2.75rem;
  border: none;
}

.site-title {
  font-family: var(--font-sans);
  font-size: 2.1rem;
  font-weight: 750;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 1.75rem;
}

/* Summary / Overview Card */
.summary-card {
  background-color: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.75rem;
  margin-bottom: 2rem;
}

.summary-label {
  display: inline-block;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.summary-card p {
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Modern Tab Bar */
.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background-color: var(--bg-subtle);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.35rem;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
  white-space: nowrap;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: var(--text-main);
}

.nav-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   SECTION BLOCKS & CONTENT
   ========================================================================== */

.section-block {
  margin-bottom: 3.25rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(60, 50, 40, 0.08);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.subsection-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  letter-spacing: -0.015em;
}

.cohort-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background-color: var(--bg-subtle);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 600;
}

.section-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* Key Finding Note Box */
.note-box {
  background-color: #f7f1e7;
  border: none;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.note-tag {
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--accent);
}

.note-content {
  color: var(--text-main);
}

/* ==========================================================================
   CLEAN METRICS TABLES
   ========================================================================== */

.table-wrapper {
  margin: 1.5rem 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--bg-sand);
}

.table-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background-color: var(--bg-subtle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
}

.table-toggle-btn {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.table-toggle-btn:hover {
  background-color: var(--accent-light);
}

.booktabs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.booktabs-table th {
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border: none;
}

.booktabs-table td {
  padding: 0.75rem 1.25rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(60, 50, 40, 0.06);
  background-color: transparent;
}

.booktabs-table tr:last-child td {
  border-bottom: none;
}

.booktabs-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 0.825rem;
}

.booktabs-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.5);
}

.booktabs-table tr.highlight-row td {
  background-color: var(--accent-wash);
  font-weight: 600;
  color: var(--accent);
}

.table-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-subtle);
  border: none;
}

/* ==========================================================================
   SAMPLE SELECTOR & CONTROLS
   ========================================================================== */

.control-block {
  background-color: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.selector-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.85rem;
  margin-bottom: 1.25rem;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.curated-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.curated-pill {
  padding: 0.5rem 1rem;
  font-size: 0.825rem;
  background-color: var(--bg-surface);
  border: none;
  border-radius: var(--radius-pill);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.curated-pill:hover {
  color: var(--accent);
  background-color: var(--accent-wash);
}

.curated-pill.active {
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(192, 86, 33, 0.25);
}

.selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.dropdown-field {
  flex: 1 1 240px;
}

.select-input {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-main);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease;
}

.select-input:focus {
  box-shadow: 0 0 0 2px var(--accent);
}

/* Modern Transcript Card */
.transcript-card {
  background-color: var(--bg-surface);
  border: none;
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.transcript-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.transcript-meta-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-right: 0.25rem;
}

.meta-tag {
  font-family: var(--font-mono);
  background-color: var(--bg-subtle);
  border: none;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 500;
}

.transcript-quote {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text-main);
  font-weight: 500;
  padding: 0;
  border: none;
}

/* Playback Actions Bar */
.playback-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(60, 50, 40, 0.08);
}

.btn {
  padding: 0.65rem 1.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Primary Button (Terracotta) */
.btn-primary, .btn-dark {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(192, 86, 33, 0.22);
}

.btn-primary:hover, .btn-dark:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 86, 33, 0.3);
}

/* Secondary Button (Warm Neutral) */
.btn-secondary, .btn-outline {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover, .btn-outline:hover {
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

/* Playback Status Pill */
.playback-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  background-color: var(--bg-subtle);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  border: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

.playback-indicator {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.playback-indicator.active {
  color: var(--accent);
}

/* ==========================================================================
   AUDIO COMPARISON & CARD-ROW LIST
   ========================================================================== */

.audio-section {
  margin-top: 2.5rem;
}

.audio-section-header {
  margin-bottom: 1.25rem;
}

.audio-subnote {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.audio-table-container {
  overflow-x: auto;
  background-color: transparent;
  border: none;
}

.audio-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  font-size: 0.875rem;
}

.audio-table th {
  padding: 0.6rem 1.25rem;
  background-color: transparent;
  font-weight: 700;
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border: none;
}

.audio-table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  background-color: var(--bg-surface);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.audio-table td:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.audio-table td:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.audio-table tr:hover td {
  background-color: #fdfaf6;
}

.audio-table tr.playing-row td {
  background-color: var(--playing-bg) !important;
}

.cond-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  display: block;
}

.cond-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

.audio-player-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.native-audio-player {
  flex: 1 1 auto;
  height: 38px;
  accent-color: var(--accent);
  outline: none;
  border-radius: var(--radius-sm);
  border: none;
}

.btn-audition {
  background-color: var(--bg-subtle);
  border: none;
  padding: 0.45rem 0.85rem;
  font-size: 0.775rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.btn-audition:hover {
  background-color: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   CLEAN FOOTER
   ========================================================================== */

.site-footer {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(60, 50, 40, 0.08);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.footer-sub a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-sub a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 860px) {
  .page-container {
    padding: 2rem 1rem 4rem 1rem;
  }
  .site-title {
    font-size: 1.5rem;
  }
  .audio-table th, .audio-table td {
    padding: 0.75rem 0.65rem;
  }
}
