/* ============================================
   TELL ME A STORY - Variables
   ============================================ */

/* New TMS-specific variables */
:root {
    --ch-dusty-rose: #FFE0EC;
    --ch-warm-sand: #FFE8D0;
    --ch-lavender-mist: #E8D8F8;
    --ch-pale-gold: #FFF3D0;
    --ch-sky-blue: #E0F0FF;
    --ch-mint-leaf: #D8F5D8;

    --stage-transcribe: #4A7B8C;
    --stage-llm: #C49A5C;
    --stage-llm-bg: rgba(196, 154, 92, 0.07);
    --stage-dict: #8B6BAE;
    --stage-dict-bg: rgba(139, 107, 174, 0.07);
    --stage-diarize: #6B9E71;

    --speaker-dad: #4A7B8C;
    --speaker-arti: #6B9E71;

    --ch-pale-gold-hover: #FFEDB8;

    --mono: 'IBM Plex Mono', monospace;
    --charcoal: #1e1b1c;
}

/* ============================================
   SHARED COMPONENTS (used by changelog page)
   ============================================ */

/* Project Hero */
.project-hero {
    margin-bottom: 2rem;
}

.project-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-hook {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-read);
    line-height: 1.6;
}


/* ============================================
   TELL ME A STORY PAGE - New Design
   ============================================ */

/* Contained section bands — colored backgrounds stay within main's max-width */
.tms-hero, .tms-origin, .tms-system,
.tms-ai-kids, .tms-learning {
    border-radius: 12px;
}

/* Section spacing — cream gap between colored sections */
.tms-hero + .tms-origin,
.tms-origin + .tms-system,
.tms-system + .tms-pipeline-section,
.tms-pipeline-section + .tms-ai-kids,
.tms-ai-kids + .tms-principles,
.tms-principles + .tms-learning {
    margin-top: 4rem;
}

/* Container — inner padding for section content */
[class^="tms-"] .container {
    padding: 0 1.5rem;
}

/* ========================================
   HERO
   ======================================== */
.tms-hero {
    padding: 4rem 0 1.5rem;
    text-align: center;
    background: var(--ch-dusty-rose);
}

.tms-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: 2.8rem;
    color: var(--maroon);
    margin-bottom: 0.75rem;
    font-weight: 900;
}

.tms-hero .hook {
    font-size: 1.15rem;
    color: var(--text-read);
    max-width: 540px;
    margin: 0 auto 1.5rem;
}

.byline {
    max-width: 480px;
    margin: 0 auto;
}

.byline-name {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--maroon);
    margin-bottom: 0.4rem;
}

.byline-blurb {
    font-size: 0.88rem;
    color: var(--text-read);
    line-height: 1.5;
}

.hero-github {
    display: inline-block;
    margin-top: 1.25rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--maroon);
    text-decoration: none;
    border-bottom: 1px solid rgba(106, 56, 67, 0.2);
    transition: border-color 0.2s ease;
}

.hero-github:hover {
    border-color: var(--maroon);
}

/* ========================================
   ORIGIN
   ======================================== */
.tms-origin {
    padding: 2.5rem 0;
    background: var(--ch-warm-sand);
}

.tms-origin h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--maroon);
    margin-bottom: 1.25rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.tms-origin p {
    font-size: 1.05rem;
    color: var(--text-read);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.tms-origin p + p {
    margin-top: 0.75rem;
}

.arti-voice {
    font-family: 'Caveat', cursive;
    font-style: normal;
    font-size: 2rem;
    color: var(--stage-diarize);
    display: inline;
    font-weight: 700;
}

.mahabharata-callout {
    background: var(--ch-pale-gold);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    max-width: 600px;
    margin: 0 auto 1rem;
}

.mahabharata-callout h3 {
    font-family: 'Fraunces', serif;
    font-size: 1rem;
    color: var(--maroon);
    margin-bottom: 0.5rem;
}

.mahabharata-callout p {
    font-size: 0.9rem;
    color: var(--text-read);
    line-height: 1.65;
}

/* ========================================
   THE SYSTEM
   ======================================== */
.tms-system {
    padding: 3rem 0;
    background: var(--ch-lavender-mist);
}

.tms-system h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.system-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    max-width: 720px;
    margin: 0 auto;
}

.system-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1rem;
}

.system-card-header {
    margin-bottom: 0.75rem;
}

.system-card-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.system-card-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.system-card-title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.system-badge {
    font-family: var(--mono);
    font-size: 0.65rem;
    letter-spacing: 0.03em;
    display: flex;
    gap: 0.75rem;
}

.badge-line {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    color: var(--text-light);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-dot.working { background: var(--gold); }
.badge-dot.building { background: var(--maroon); }
.badge-dot.planned {
    background: transparent;
    border: 1.5px solid var(--text-light);
}

.system-card p {
    font-size: 0.85rem;
    color: var(--text-read);
    line-height: 1.6;
}

.system-card p + p {
    margin-top: 0.5rem;
}

/* ========================================
   PIPELINE
   ======================================== */
.tms-pipeline-section {
    padding: 0;
}

/* Pipeline trigger */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(191, 162, 101, 0.15),
                           0 2px 8px rgba(106, 56, 67, 0.05); }
    50%      { box-shadow: 0 0 24px rgba(191, 162, 101, 0.35),
                           0 2px 8px rgba(106, 56, 67, 0.05); }
}

.pipeline-trigger {
    text-align: center;
    cursor: pointer;
    padding: 2rem 1rem;
    border-radius: 12px;
    background: var(--ch-pale-gold);
    animation: glow-pulse 3.5s ease-in-out infinite;
    transition: transform 0.25s ease, background 0.25s ease;
    margin-bottom: 2rem;
}

.pipeline-trigger:hover {
    animation: none;
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(191, 162, 101, 0.5), 0 12px 32px rgba(106, 56, 67, 0.18);
    background: var(--ch-pale-gold-hover);
}

.pipeline-trigger:active {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(191, 162, 101, 0.3), 0 4px 12px rgba(106, 56, 67, 0.1);
}

.trigger-arti {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--stage-diarize);
    margin-bottom: 0.5rem;
}

.trigger-action {
    font-size: 0.95rem;
    color: var(--text-read);
}

.trigger-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.pipeline-trigger.open .trigger-arrow {
    transform: rotate(90deg);
}

/* Collapsible pipeline */
.pipeline-collapsible {
    display: none;
}

.pipeline-collapsible.open {
    display: block;
}

.tms-pipeline-section h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--stage-transcribe);
    text-align: center;
    margin-bottom: 0.5rem;
}

.pipeline-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

.dark-card {
    background: var(--charcoal);
    color: white;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.input-card {
    margin-bottom: 1rem;
}

.dark-card .dark-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.75rem;
}

/* Audio player */
.audio-player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.play-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(191, 162, 101, 0.12);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.play-btn:hover {
    background: rgba(191, 162, 101, 0.22);
}

.play-btn:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.play-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--gold);
}

.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: block; }

.audio-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5px;
    height: 40px;
    cursor: pointer;
}

.audio-waveform .bar {
    flex: 1;
    min-width: 0;
    background: var(--gold);
    border-radius: 1px;
    opacity: 0.25;
    transition: opacity 0.15s ease;
}

.audio-waveform .bar.played {
    opacity: 0.85;
}

.audio-duration {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    min-width: 5.8em;
    text-align: right;
}

.audio-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.flow-arrow {
    text-align: center;
    padding: 0.75rem 0;
    color: var(--stage-transcribe);
    font-size: 1.2rem;
}

.pipeline-stages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.stage-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background: var(--warm-white);
}

.stage-card > h3 {
    margin: 0;
}

.stage-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    /* Button reset — native <button> for proper accordion semantics */
    border: none;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    width: 100%;
}

.stage-header:hover { background: rgba(0, 0, 0, 0.02); }

.stage-indicator {
    width: 4px;
    height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Stage-specific card tints */
.stage-transcribe { background: var(--ch-sky-blue); }
.stage-llm { background: var(--ch-warm-sand); }
.stage-dict { background: var(--ch-lavender-mist); }
.stage-diarize { background: var(--ch-mint-leaf); }

.stage-info { flex: 1; }
.stage-name { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); }
.stage-desc { font-size: 0.8rem; color: var(--text-light); }

.stage-toggle {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.stage-card.open .stage-toggle { transform: rotate(180deg); }

.stage-detail {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.stage-card.open .stage-detail { display: block; background: rgba(255, 255, 255, 0.4); }

.stage-prose {
    font-size: 0.9rem;
    color: var(--text-read);
    margin-top: 0.5rem;
    line-height: 1.65;
}

.stage-transcribe .stage-indicator { background: var(--stage-transcribe); }
.stage-llm .stage-indicator { background: var(--stage-llm); }
.stage-dict .stage-indicator { background: var(--stage-dict); }
.stage-diarize .stage-indicator { background: var(--stage-diarize); }

/* ========================================
   RAW TRANSCRIPT (Stage 1)
   ======================================== */
.raw-transcript {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-top: 0.75rem;
    position: relative;
    overflow: hidden;
}

.raw-seg {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.raw-seg:last-child { border-bottom: none; }

.raw-ts {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--text-light);
    flex-shrink: 0;
    min-width: 4ch;
    opacity: 0.5;
}

.raw-text {
    font-size: 0.9rem;
    color: var(--text-read);
    line-height: 1.5;
}

.raw-text .mishearing {
    color: var(--maroon);
    background: rgba(106, 56, 67, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
}

.raw-fade {
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.7));
    height: 2.5rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.raw-more {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: right;
    margin-top: 0.5rem;
}

/* ========================================
   LLM STAGE (Stage 2)
   ======================================== */

/* Prompt excerpt */
.prompt-excerpt {
    background: rgba(255, 255, 255, 0.7);
    border-left: 3px solid var(--stage-llm);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-read);
}

.prompt-excerpt .prompt-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--stage-llm);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.prompt-excerpt em {
    color: var(--text-dark);
    font-style: normal;
    font-weight: 600;
}

/* Correction pairs */
.correction-results {
    margin-top: 1rem;
}

.correction-results .results-header {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
}

.correction-pair {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.correction-pair:last-child { border-bottom: none; }

.pair-from {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.2);
}

.pair-arrow {
    padding: 0 0.75rem;
    color: var(--stage-llm);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pair-to {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.pair-count {
    font-size: 0.75rem;
    color: var(--text-light);
    min-width: 2rem;
    text-align: right;
    flex-shrink: 0;
}

.correction-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.correction-meta .stat {
    font-weight: 600;
    color: var(--text-dark);
}

/* ========================================
   DICTIONARY: correction lanes (Stage 3)
   ======================================== */
.correction-lanes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

.correction-lane {
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.lane-llm { background: var(--stage-llm-bg); }
.lane-dict { background: var(--stage-dict-bg); }

.lane-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.lane-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lane-llm .lane-dot { background: var(--stage-llm); }
.lane-dict .lane-dot { background: var(--stage-dict); }

.lane-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}

.lane-subtitle {
    font-size: 0.7rem;
    color: var(--text-light);
}

.lane-item {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.lane-from { text-decoration: line-through; color: var(--text-light); }
.lane-arrow { color: var(--text-light); font-size: 0.75rem; }
.lane-to { font-weight: 600; color: var(--text-dark); }
.lane-count { font-size: 0.7rem; color: var(--text-light); margin-left: auto; }

.lane-total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
    color: var(--text-light);
}

.zero-overlap {
    font-size: 0.85rem;
    color: var(--text-read);
    text-align: center;
    margin-top: 0.75rem;
}

/* ========================================
   DIARIZATION VISUAL (Stage 4)
   ======================================== */
.diarize-visual {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 1.25rem 1.75rem;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dv-group {
    display: flex;
    align-items: center;
}

.dv-word {
    width: 5.5rem;
    flex-shrink: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-light);
    line-height: 1.8;
    text-align: right;
    padding-right: 0.75rem;
}

.dv-word.dim {
    opacity: 0.35;
}

.dv-line {
    flex: 1;
    height: 1px;
}

.line-s0 { background: rgba(74, 123, 140, 0.25); }
.line-s1 { background: rgba(107, 158, 113, 0.25); }

.dv-slab {
    width: 3rem;
    align-self: stretch;
    flex-shrink: 0;
}

.slab-s0 { background: rgba(74, 123, 140, 0.4); }
.slab-s1 { background: rgba(107, 158, 113, 0.4); }

.dv-break {
    height: 0.4rem;
}

.dv-key {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.dv-key-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-light);
    letter-spacing: 0.02em;
}

.dv-key-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
}

.key-s0 { background: rgba(74, 123, 140, 0.4); }
.key-s1 { background: rgba(107, 158, 113, 0.4); }

.detail-note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ========================================
   OUTPUT TRANSCRIPT
   ======================================== */
.transcript-line { margin-bottom: 0.85rem; }
.transcript-line:last-child { margin-bottom: 0; }

.speaker-label {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

.speaker-dad { color: var(--speaker-dad); }
.speaker-arti { color: var(--speaker-arti); }
.speaker-s0 { color: var(--speaker-dad); }
.speaker-s1 { color: var(--speaker-arti); }

.transcript-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
}

.corrected-name {
    color: var(--gold);
    border-bottom: 1px dotted rgba(191, 162, 101, 0.4);
}

.transcript-continuation {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    margin-top: 1rem;
    padding-top: 0.5rem;
}

.transcript-gap {
    padding: 0.4rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.15em;
}

/* Lessons sub-trigger */
.lessons-trigger {
    text-align: center;
    cursor: pointer;
    padding: 1rem;
    margin: 1.5rem auto 0;
    max-width: 600px;
    font-size: 0.95rem;
    color: var(--text-read);
    border: 1px solid rgba(106, 56, 67, 0.12);
    border-radius: 8px;
    transition: background 0.15s ease;
}

.lessons-trigger:hover {
    background: rgba(106, 56, 67, 0.04);
}

.pipeline-trigger:focus-visible,
.stage-header:focus-visible,
.lessons-trigger:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.lessons-trigger .trigger-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.lessons-trigger.open .trigger-arrow {
    transform: rotate(180deg);
}

.lessons-collapsible {
    display: none;
    max-width: 600px;
    margin: 1rem auto 0;
}

.lessons-collapsible.open {
    display: block;
}

/* ========================================
   LESSON CARDS (inside pipeline)
   ======================================== */
.catch-card {
    background: var(--warm-white);
    border: 1px solid rgba(106, 56, 67, 0.08);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.catch-card:last-child { margin-bottom: 0; }
.catch-card h3 { font-size: 1rem; color: var(--text-dark); margin-bottom: 0.4rem; }
.catch-card p { font-size: 0.9rem; color: var(--text-read); }

.catch-evidence {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.evidence-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

/* ========================================
   AI & KIDS
   ======================================== */
.tms-ai-kids {
    padding: 3rem 0;
    background: var(--ch-mint-leaf);
}

.tms-ai-kids h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--maroon);
    margin-bottom: 1.25rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.tms-ai-kids p {
    font-size: 1rem;
    color: var(--text-read);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.tms-ai-kids p + p {
    margin-top: 0.75rem;
}

.aside-gold {
    font-style: italic;
    color: var(--gold);
}

/* ========================================
   GUIDING PRINCIPLES
   ======================================== */
.tms-principles {
    padding: 2rem 0;
    background: none;
}

.tms-principles h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--maroon);
    margin-bottom: 1.5rem;
    text-align: center;
}

.principle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 660px;
    margin: 0 auto;
}

.principle-card {
    border-radius: 10px;
    padding: 1.5rem;
}

.principle-card:nth-child(1) { background: var(--ch-pale-gold); }
.principle-card:nth-child(2) { background: var(--ch-warm-sand); }
.principle-card:nth-child(3) { background: var(--ch-lavender-mist); }
.principle-card:nth-child(4) { background: var(--ch-mint-leaf); }

.principle-card h3 {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.15rem;
}

.principle-card .by {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
}

.principle-card .by a {
    color: var(--text-light);
    text-decoration: underline;
    text-decoration-color: rgba(106, 56, 67, 0.25);
    text-underline-offset: 2px;
}

.principle-card .by a:hover {
    color: var(--maroon);
}

.principle-card p {
    font-size: 0.9rem;
    color: var(--text-read);
    line-height: 1.65;
}

/* ========================================
   LEARNING
   ======================================== */
.tms-learning {
    padding: 3rem 0;
    background: var(--ch-sky-blue);
}

.tms-learning h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    color: var(--maroon);
    margin-bottom: 1.25rem;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.tms-learning p {
    font-size: 1rem;
    color: var(--text-read);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.tms-learning p + p {
    margin-top: 0.75rem;
}

.learning-list {
    max-width: 620px;
    margin: 0.75rem auto;
    padding-left: 1.25rem;
    color: var(--text-read);
    font-size: 0.95rem;
    line-height: 1.8;
}

/* ========================================
   DEEPER LINK
   ======================================== */
.tms-deeper-link {
    text-align: center;
    padding: 2rem 0 4rem;
    margin-top: 2rem;
}

.tms-deeper-link a {
    color: var(--maroon);
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(106, 56, 67, 0.2);
}

.tms-deeper-link a:hover { border-color: var(--maroon); }

/* ============================================
   TELL ME A STORY PAGE - Responsive Breakpoints
   ============================================ */
@media (max-width: 768px) {
    .system-grid {
        grid-template-columns: 1fr;
    }

    .principle-grid {
        grid-template-columns: 1fr;
    }

    .correction-lanes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tms-hero h1 {
        font-size: 2.2rem;
    }

    .trigger-arti {
        font-size: 1.4rem;
    }
    .dark-card {
        padding: 1.2rem 1rem;
    }
    .audio-player {
        gap: 0.5rem;
    }
    .audio-duration {
        font-size: 0.7rem;
        min-width: 5em;
    }
    .audio-waveform {
        height: 32px;
        gap: 1px;
    }
    .mahabharata-callout {
        padding: 1.2rem 1rem;
    }
    .dv-word {
        width: 4.5rem;
        font-size: 0.6rem;
    }
    .correction-pair {
        gap: 0.3rem;
    }
    .pair-from, .pair-to {
        font-size: 0.85rem;
        min-width: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .pipeline-trigger {
        animation: none;
        box-shadow: 0 0 12px rgba(191, 162, 101, 0.2),
                    0 2px 8px rgba(106, 56, 67, 0.05);
    }
    .pipeline-trigger:hover {
        transform: none;
    }
    .trigger-arrow,
    .stage-toggle {
        transition: none;
    }
    .play-btn {
        transition: none;
    }
    .audio-waveform .bar {
        transition: none;
    }
}

/* ============================================
   CHANGELOG PAGE
   ============================================ */

/* Hero */
.changelog-hero {
    background: var(--ch-pale-gold);
    border-radius: 12px;
    padding: 3rem 1.5rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.changelog-hero h1 {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--maroon);
    margin-bottom: 0.5rem;
}

.changelog-hook {
    font-size: 1rem;
    color: var(--text-read);
    max-width: 480px;
    margin: 0 auto;
}

/* Entry list */
.changelog-section {
    margin-top: 0;
}

.changelog-entry {
    border-bottom: 1px solid var(--dusty-rose);
}

.changelog-entry:last-child {
    border-bottom: none;
}

/* Summary (collapsed header) */
.changelog-summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 1rem 0;
    cursor: pointer;
    list-style: none;
}

.changelog-summary::-webkit-details-marker {
    display: none;
}

.changelog-summary::before {
    content: '+';
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}

.changelog-entry[open] > .changelog-summary::before {
    content: '\2212';
}

.changelog-summary:hover .changelog-title {
    color: var(--maroon);
}

.changelog-summary:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Date */
.changelog-date {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.02em;
    flex-shrink: 0;
    min-width: 6rem;
}

/* Title */
.changelog-title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.35;
}

/* Fields (expanded content) */
.changelog-fields {
    margin: 0;
    padding: 0 0 1.25rem 1.75rem;
    margin-left: 6.75rem;
    border-left: 2px solid var(--dusty-rose);
}

.changelog-fields dt {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--maroon);
    margin-top: 0.75rem;
}

.changelog-fields dt:first-child {
    margin-top: 0;
}

.changelog-fields dd {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--text-read);
    line-height: 1.65;
}

.changelog-fields dd code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--dusty-rose);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

.changelog-fields dd blockquote {
    border-left: 3px solid var(--gold);
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    font-style: italic;
    color: var(--text-read);
    background: rgba(191, 162, 101, 0.05);
    border-radius: 0 4px 4px 0;
}

/* Changelog mobile */
@media (max-width: 600px) {
    .changelog-hero {
        padding: 2rem 1rem 1.5rem;
    }

    .changelog-hero h1 {
        font-size: 1.8rem;
    }

    .changelog-summary {
        flex-wrap: wrap;
        gap: 0.25rem 0.5rem;
    }

    .changelog-date {
        min-width: auto;
    }

    .changelog-fields {
        margin-left: 1.75rem;
        padding-left: 1rem;
    }

    .changelog-fields dd {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .changelog-title {
        font-size: 0.95rem;
    }
}

/* Changelog dynamic loading states */
.changelog-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.changelog-error,
.changelog-noscript {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--dusty-rose);
    border-radius: 8px;
    margin: 1rem 0;
    color: var(--text-read);
    font-size: 0.9rem;
    line-height: 1.6;
}

.changelog-error a,
.changelog-noscript a {
    color: var(--maroon);
    font-weight: 600;
}
