/* ============================================================
   mujun.work — Candlelit Contradiction Workshop
   Colors: #b89f6a #c4a67a #6b7d8a #f5ece0 #e8dcc8 #4a3f32 #8a9caa #7a5c3a #3a3028 #2a2320
   Fonts: Oswald, Cormorant, Inter, Space Mono
   ============================================================ */

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

:root {
    --gold: #c4a67a;
    --gold-deep: #b89f6a;
    --gold-dark: #7a5c3a;
    --slate: #6b7d8a;
    --slate-mid: #5a6d7a;
    --slate-light: #8a9caa;
    --amber-glow: #d4a088;
    --parchment: #f5ece0;
    --parchment-dark: #e8dcc8;
    --earth: #4a3f32;
    --dark: #3a3028;
    --darkest: #2a2320;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    background: var(--darkest);
    color: var(--parchment);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ---- Scanlines ---- */
.scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
}

/* ---- HUD Corner Brackets ---- */
.hud-bracket {
    position: fixed;
    width: 40px;
    height: 40px;
    z-index: 100;
    pointer-events: none;
}
.hud-bracket--tl { top: 16px; left: 16px; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); opacity: 0.5; }
.hud-bracket--tr { top: 16px; right: 16px; border-top: 1px solid var(--gold); border-right: 1px solid var(--gold); opacity: 0.5; }
.hud-bracket--bl { bottom: 16px; left: 16px; border-bottom: 1px solid var(--gold); border-left: 1px solid var(--gold); opacity: 0.5; }
.hud-bracket--br { bottom: 16px; right: 16px; border-bottom: 1px solid var(--gold); border-right: 1px solid var(--gold); opacity: 0.5; }

/* ---- HUD Status Bar ---- */
.hud-status-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    padding: 20px 64px;
    z-index: 100;
    pointer-events: none;
}

.hud-label {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: clamp(0.55rem, 1vw, 0.75rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.6;
}

.hud-micro {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.65rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--slate-light);
    opacity: 0.7;
}

/* ---- HERO ---- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero__watercolor {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(196,166,122,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 70% 60%, rgba(107,125,138,0.1) 0%, transparent 70%),
        radial-gradient(ellipse 100% 100% at 50% 50%, rgba(245,236,224,0.05) 0%, transparent 80%);
    background-color: var(--darkest);
}

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

.hero__hud-frame {
    margin-bottom: 2rem;
}

.hero__title {
    font-family: 'Cormorant', serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.02em;
    color: var(--parchment);
    margin-bottom: 0.5rem;
}

.hero__kanji {
    display: block;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 1;
    color: var(--gold);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.hero__kanji.revealed {
    opacity: 1;
    transform: scale(1);
}

.hero__subtitle {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: var(--parchment-dark);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease 0.6s, transform 1.2s ease 0.6s;
}

.hero__subtitle.revealed {
    opacity: 0.8;
    transform: translateY(0);
}

.hero__readout {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 1s ease 1.2s;
}

.hero__readout.revealed {
    opacity: 1;
}

.hero__meter {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--gold);
    letter-spacing: 0.05em;
}

/* ---- Candle ---- */
.candle {
    position: absolute;
    bottom: 15%;
    right: 18%;
    z-index: 3;
}

.candle__body {
    width: 8px;
    height: 60px;
    background: linear-gradient(to bottom, var(--parchment-dark), var(--gold-dark));
    margin: 0 auto;
    border-radius: 2px 2px 0 0;
}

.candle__flame {
    position: relative;
    width: 30px;
    height: 50px;
    margin: 0 auto;
    transform: translateY(8px);
}

.candle__flame-outer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 40px;
    background: radial-gradient(ellipse at 50% 80%, #d4a088 0%, transparent 70%);
    opacity: 0.3;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 3s ease-in-out infinite alternate;
}

.candle__flame-mid {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 30px;
    background: radial-gradient(ellipse at 50% 80%, rgba(196,166,122,0.8) 0%, transparent 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 2s ease-in-out 0.5s infinite alternate;
}

.candle__flame-inner {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 18px;
    background: radial-gradient(ellipse at 50% 80%, var(--parchment) 0%, rgba(196,166,122,0.5) 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 1.5s ease-in-out 0.2s infinite alternate;
}

.candle__glow {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(196,166,122,0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: glow-pulse 4s ease-in-out infinite alternate;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scaleY(1) scaleX(1); opacity: 1; }
    25% { transform: translateX(-50%) scaleY(1.04) scaleX(0.96); }
    50% { transform: translateX(-50%) scaleY(0.97) scaleX(1.02); opacity: 0.9; }
    75% { transform: translateX(-50%) scaleY(1.02) scaleX(0.98); }
    100% { transform: translateX(-50%) scaleY(0.98) scaleX(1.01); opacity: 0.95; }
}

@keyframes glow-pulse {
    0% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    100% { opacity: 0.8; transform: translateX(-50%) scale(1.08); }
}

/* ---- Sections (general) ---- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6rem 8vw;
    overflow: hidden;
}

.section__watercolor {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.section__watercolor--cool {
    background:
        radial-gradient(ellipse 70% 50% at 20% 50%, rgba(107,125,138,0.15) 0%, transparent 70%),
        radial-gradient(ellipse 50% 70% at 80% 30%, rgba(196,166,122,0.08) 0%, transparent 70%);
}

.section__watercolor--warm {
    background:
        radial-gradient(ellipse 60% 60% at 60% 50%, rgba(196,166,122,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 80% 40% at 30% 70%, rgba(122,92,58,0.08) 0%, transparent 70%);
}

.section__watercolor--dark {
    background:
        radial-gradient(ellipse 80% 80% at 50% 50%, rgba(58,48,40,0.3) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 70% 40%, rgba(107,125,138,0.1) 0%, transparent 70%);
}

.section__watercolor--mixed {
    background:
        radial-gradient(ellipse 50% 50% at 25% 50%, rgba(107,125,138,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 75% 50%, rgba(196,166,122,0.12) 0%, transparent 70%);
}

.section__hud-frame {
    position: absolute;
    top: 2rem;
    left: 4vw;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hud-reticle {
    width: 12px;
    height: 12px;
    border: 1px solid var(--gold);
    border-radius: 50%;
    opacity: 0.4;
    position: relative;
}

.hud-reticle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 3px;
    background: var(--gold);
    border-radius: 50%;
}

.section__content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.section__content--centered {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.section__title {
    font-family: 'Cormorant', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    color: var(--parchment);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

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

.section__title--large {
    font-size: clamp(2rem, 5vw, 4rem);
}

.section__body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: var(--parchment-dark);
    line-height: 1.8;
    max-width: 680px;
    margin-bottom: 3rem;
    opacity: 0.85;
}

/* ---- Contradiction Pairs ---- */
.contradiction-pair {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    border: 1px solid rgba(196,166,122,0.15);
    background: rgba(42,35,32,0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.contradiction-pair.revealed {
    opacity: 1;
    transform: translateY(0);
}

.contradiction-pair__left,
.contradiction-pair__right {
    flex: 1;
}

.contradiction-pair__left p,
.contradiction-pair__right p {
    font-family: 'Cormorant', serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-style: italic;
    color: var(--parchment);
    margin-top: 0.5rem;
}

.contradiction-pair__right {
    text-align: right;
}

.contradiction-pair__divider {
    width: 2px;
    display: flex;
    align-items: center;
}

.contradiction-pair__line {
    width: 2px;
    height: 60px;
}

/* ---- Workshop Grid ---- */
.workshop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.workshop-card {
    padding: 2rem;
    border: 1px solid rgba(196,166,122,0.12);
    background: rgba(42,35,32,0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease, border-color 0.3s ease;
}

.workshop-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.workshop-card:hover {
    border-color: rgba(196,166,122,0.35);
}

.workshop-card h3 {
    font-family: 'Cormorant', serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--gold);
    margin: 0.75rem 0;
}

.workshop-card p {
    font-size: 0.9rem;
    color: var(--parchment-dark);
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.workshop-card__meter {
    height: 2px;
    background: rgba(107,125,138,0.2);
    position: relative;
    overflow: hidden;
}

.workshop-card__fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    width: var(--fill);
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s ease;
}

.workshop-card.revealed .workshop-card__fill {
    transform: scaleX(1);
}

/* ---- Koan Ring ---- */
.koan-ring {
    margin: 3rem auto;
    width: 300px;
    height: 300px;
}

.koan-ring__svg {
    width: 100%;
    height: 100%;
    animation: rotate-slow 60s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---- Footer ---- */
.footer {
    position: relative;
    padding: 4rem 8vw;
    text-align: center;
    border-top: 1px solid var(--slate-mid);
    /* amber-glow: #d4a088 used in candle flame */
}

.footer__hud {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer__text {
    font-family: 'Cormorant', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--parchment-dark);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.footer__copy {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--slate-mid);
    opacity: 0.4;
}

/* ---- Reveal animation helpers ---- */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .section {
        padding: 4rem 6vw;
    }
    .hud-status-bar {
        padding: 16px 24px;
    }
    .contradiction-pair {
        flex-direction: column;
        gap: 1rem;
    }
    .contradiction-pair__right {
        text-align: left;
    }
    .contradiction-pair__divider {
        width: 60px;
        height: 2px;
    }
    .contradiction-pair__line {
        width: 60px;
        height: 2px;
    }
    .candle {
        right: 10%;
        bottom: 10%;
    }
}
