/* ============================================
   ronpa.day — Styles
   Light-academia + neon-electric refutation
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --parchment-warm: #F5ECD7;
    --scholar-brown: #4A3828;
    --refutation-violet: #8B5CF6;
    --strike-red: #EF4444;
    --blob-lavender: #DDD6FE;
    --page-white: #FEFCF8;
    --ink-dark: #1C1917;
    --scroll-pct: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.85;
    color: var(--scholar-brown);
    background-color: var(--parchment-warm);
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
#svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Progress Bar --- */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: calc(var(--scroll-pct) * 100%);
    height: 2px;
    background: var(--refutation-violet);
    z-index: 1000;
    transition: width 0.1s linear;
}

/* --- Sections --- */
.section {
    position: relative;
    overflow: hidden;
}

.section--parchment {
    background-color: var(--parchment-warm);
}

.section--white {
    background-color: var(--page-white);
}

/* --- Paper-Aged Texture --- */
.paper-texture {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(210, 180, 140, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 30%, rgba(194, 165, 120, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(180, 155, 110, 0.08) 0%, transparent 50%);
    filter: url(#paper-noise);
    opacity: 0.6;
}

/* --- The Challenge (Hero) --- */
#the-challenge {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.challenge-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 6vw, 72px);
    color: var(--ink-dark);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: scale(0.98);
    animation: wordmark-in 0.6s ease 0.4s forwards;
}

@keyframes wordmark-in {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wordmark-underline {
    height: 3px;
    background: var(--refutation-violet);
    margin: 8px auto 0;
    width: 0;
    animation: underline-draw 0.4s ease 0.6s forwards;
    border-radius: 2px;
}

@keyframes underline-draw {
    to {
        width: 200px;
    }
}

.tagline {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(14px, 1.3vw, 18px);
    color: var(--scholar-brown);
    margin-top: 20px;
    opacity: 0;
    animation: fade-in 0.5s ease 1s forwards;
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* Hero Blob */
.blob--hero {
    position: absolute;
    width: clamp(200px, 30vw, 350px);
    height: clamp(200px, 30vw, 350px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    opacity: 0;
    animation: blob-fade 0.8s ease 0.1s forwards;
}

@keyframes blob-fade {
    to {
        opacity: 1;
    }
}

.blob--hero svg {
    width: 100%;
    height: 100%;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
    opacity: 0;
    animation: fade-in 0.5s ease 1.4s forwards;
}

.scroll-indicator span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--scholar-brown);
    opacity: 0.6;
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.scroll-arrow {
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* --- Lesson Sections --- */
.lesson-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 60px 20px;
}

.lesson-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    width: 100%;
}

.lesson-text {
    flex: 1;
    max-width: 640px;
    position: relative;
    z-index: 2;
}

/* Section Headings */
.section-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 56px);
    color: var(--ink-dark);
    margin-bottom: 24px;
    line-height: 1.2;
}

/* Highlight / Underline-Draw */
.highlight {
    position: relative;
    display: inline;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--refutation-violet);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.highlight.is-visible::after {
    width: 100%;
}

/* Annotation text */
.annotation {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: var(--scholar-brown);
    opacity: 0.5;
    margin-top: 16px;
    display: block;
}

/* Body paragraph */
.lesson-text p {
    margin-bottom: 12px;
}

.lesson-text em {
    font-style: italic;
    font-weight: 600;
    color: var(--ink-dark);
}

/* Blobs in Lessons */
.blob--left,
.blob--right {
    flex-shrink: 0;
    width: clamp(120px, 18vw, 220px);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.blob--left {
    transform: translateX(-30px);
}

.blob--right {
    transform: translateX(30px);
}

.blob--left.is-visible,
.blob--right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.blob--left svg,
.blob--right svg {
    width: 100%;
    height: auto;
}

/* Fade-in for lesson text */
.lesson-text {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.lesson-text.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- The Arena --- */
#the-arena {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.arena-content {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.arena-heading {
    margin-bottom: 16px;
}

.arena-description {
    max-width: 560px;
    margin: 0 auto 48px;
    color: var(--scholar-brown);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.arena-description.is-visible {
    opacity: 1;
}

.arena-visual {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

#arena-svg {
    width: 100%;
    height: auto;
}

.arena-blob {
    transition: opacity 0.4s ease;
}

.arena-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.8s ease;
}

.arena-line.is-visible {
    stroke-dashoffset: 0;
}

.strike-line {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    transition: stroke-dashoffset 0.4s ease 0.8s, opacity 0.3s ease 0.8s;
}

.strike-line.is-visible {
    stroke-dashoffset: 0;
    opacity: 1;
}

.strike-line--2 {
    transition-delay: 1.1s;
}

.strike-line--2.is-visible {
    transition-delay: 1.1s;
}

/* --- Modes of Ronpa --- */
.modes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 32px;
}

.mode-card {
    background: var(--parchment-warm);
    border-left: 3px solid var(--refutation-violet);
    padding: 24px 28px;
    text-align: left;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.mode-card:nth-child(2) {
    transition-delay: 0.15s;
}

.mode-card:nth-child(3) {
    transition-delay: 0.3s;
}

.mode-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mode-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--ink-dark);
    margin-bottom: 8px;
}

.mode-description {
    font-size: clamp(15px, 1.3vw, 17px);
    line-height: 1.7;
    margin-bottom: 8px;
}

/* --- Scholar's Footer --- */
#scholars-footer {
    padding: 80px 20px;
    text-align: center;
    min-height: auto;
}

.footer-content {
    position: relative;
    z-index: 2;
}

.footer-flourish {
    margin-bottom: 24px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.footer-flourish.is-visible {
    opacity: 1;
}

.footer-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--ink-dark);
    margin-bottom: 4px;
}

.footer-kanji {
    font-size: 36px;
    color: var(--refutation-violet);
    margin-bottom: 12px;
    font-weight: 400;
}

.footer-motto {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 16px;
    color: var(--scholar-brown);
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .lesson-content {
        flex-direction: column;
        gap: 24px;
    }

    .blob--left,
    .blob--right {
        width: clamp(80px, 30vw, 150px);
        order: -1;
    }

    .lesson-section {
        padding: 40px 16px;
    }

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

    #the-arena {
        padding: 40px 16px;
    }

    .arena-visual {
        overflow-x: auto;
    }
}

@media (min-width: 769px) {
    .modes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
