/* tsundere.one — Sunset Warm Palette / Victorian Ornate */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Palette — Sunset Warm */
    --midnight-oak:   #1C0F06;
    --dark-mahogany:  #2C1B0E;
    --antique-cream:  #FAF3E8;
    --amber-filigree: #C4956A;
    --tarnished-gold: #8B6B3D;
    --lilac-dusk:     #C4A8C7;
    --sunset-ember:   #E8733A;
    --dove-ash:       #D6CEC4;
    --rust-umber:     #7A3E1F;

    /* Typography */
    --font-display:   'Playfair Display', Georgia, serif;
    --font-body:      'Instrument Sans', system-ui, sans-serif;
    --font-accent:    'Cormorant Garamond', Georgia, serif;

    /* Spacing */
    --gutter:   48px;
    --padding:  40px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* ===== BASE ===== */
body {
    background-color: var(--midnight-oak);
    color: var(--dove-ash);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

body.warmed {
    background-color: var(--dark-mahogany);
}

/* ===== SVG DEFS (hidden) ===== */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===== MOVEMENT I — HERO ===== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: var(--midnight-oak);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lsystem-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(232, 115, 58, 0.6) 0%, rgba(28, 15, 6, 0.95) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Floating elements */
.floating-elements {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.float-item {
    position: absolute;
    opacity: 0.2;
    transition: opacity 0.6s ease;
    pointer-events: none;
    will-change: transform;
}

.float-fern    { top: 22%; left: 15%; }
.float-seal    { top: 35%; right: 18%; }
.float-compass { bottom: 30%; left: 22%; }
.float-watch   { bottom: 25%; right: 25%; }

.floating-visible .float-item {
    opacity: 0.2;
    animation: float-gentle 6s ease-in-out infinite;
}

.float-item:nth-child(1) { animation-delay: 0s; }
.float-item:nth-child(2) { animation-delay: 1.5s; }
.float-item:nth-child(3) { animation-delay: 3s; }
.float-item:nth-child(4) { animation-delay: 4.5s; }

@keyframes float-gentle {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25%       { transform: translateY(-6px) rotate(2deg); }
    50%       { transform: translateY(-3px) rotate(-1deg); }
    75%       { transform: translateY(-8px) rotate(1.5deg); }
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: var(--padding);
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.hero-content.visible {
    opacity: 1;
}

.hero-corner-label {
    position: absolute;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--amber-filigree);
    opacity: 0.6;
}

.hero-corner-tl { top: 0; left: 0; }
.hero-corner-tr { top: 0; right: 0; }

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(56px, 8vw, 96px);
    font-weight: 900;
    color: var(--tarnished-gold);
    letter-spacing: -0.03em;
    line-height: 1.0;
    margin-bottom: 24px;
    text-shadow: 0 0 60px rgba(196, 168, 199, 0.3), 0 2px 4px rgba(28, 15, 6, 0.8);
    cursor: pointer;
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 20px;
    color: var(--dove-ash);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 1.2s ease-out 0.5s, transform 0.8s ease-out 0.5s;
    margin-bottom: 8px;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-subtitle-en {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--amber-filigree);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 1s ease-out 0.8s;
}

.hero-subtitle-en.visible {
    opacity: 0.7;
}

/* ===== GENERATIVE DIVIDERS ===== */
.gen-divider {
    width: 100%;
    height: 120px;
    position: relative;
    overflow: hidden;
    background-color: transparent;
}

.gen-divider canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== SECTION LABELS ===== */
.section-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--amber-filigree);
    opacity: 0.5;
    text-align: center;
    padding: 32px 0 16px;
}

/* ===== MOVEMENT II — BLOCKS ===== */
#movement-ii {
    padding: 0 var(--gutter) var(--gutter);
    background-color: transparent;
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gutter);
    max-width: 1200px;
    margin: 0 auto;
}

/* Block base */
.block {
    position: relative;
    padding: var(--padding);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out,
                box-shadow 0.4s ease, border-color 0.4s ease;
    cursor: pointer;
}

.block.stagger-visible {
    opacity: 1;
    transform: translateY(0);
}

.block-dark {
    background-color: var(--dark-mahogany);
    color: var(--dove-ash);
    box-shadow: inset 0 0 0 1px rgba(196, 149, 106, 0.25),
                0 4px 24px rgba(28, 15, 6, 0.6);
}

.block-light {
    background-color: var(--antique-cream);
    color: var(--dark-mahogany);
    filter: url(#paper-grain);
    box-shadow: inset 0 0 0 1px rgba(196, 149, 106, 0.3),
                0 4px 24px rgba(28, 15, 6, 0.4);
}

.block-dark:hover {
    box-shadow: inset 0 0 0 1px rgba(232, 115, 58, 0.5),
                0 8px 40px rgba(28, 15, 6, 0.8),
                0 0 30px rgba(196, 149, 106, 0.1);
    transform: translateY(-2px);
}

.block-light:hover {
    box-shadow: inset 0 0 0 1px rgba(196, 149, 106, 0.6),
                0 8px 40px rgba(28, 15, 6, 0.3);
    transform: translateY(-2px);
}

/* Corner labels */
.block-corner-label {
    position: absolute;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.5;
}

.block-dark .block-corner-label {
    color: var(--amber-filigree);
}

.block-light .block-corner-label {
    color: var(--rust-umber);
}

.block-corner-tl { top: 12px; left: 16px; }
.block-corner-tr { top: 12px; right: 16px; }

/* Block ornament top */
.block-ornament-top {
    width: 100%;
    margin-bottom: 20px;
    overflow: hidden;
}

.block-ornament-top svg {
    width: 100%;
    height: 20px;
    display: block;
}

/* Block typography */
.block-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 16px;
    margin-top: 8px;
    transition: color 0.3s ease;
}

.block-dark .block-title {
    color: var(--amber-filigree);
}

.block-light .block-title {
    color: var(--dark-mahogany);
}

.block-dark:hover .block-title {
    color: var(--sunset-ember);
}

.block-light:hover .block-title {
    color: var(--rust-umber);
}

.block-body {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    margin-bottom: 20px;
}

.block-dark .block-body  { color: var(--dove-ash); }
.block-light .block-body { color: var(--dark-mahogany); opacity: 0.85; }

.block-accent.jp {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 20px;
    display: block;
    margin-top: auto;
}

.block-dark  .block-accent.jp { color: var(--lilac-dusk); }
.block-light .block-accent.jp { color: var(--rust-umber); }

/* ===== MOVEMENT III — WARMING ===== */
#movement-iii {
    padding: 0 var(--gutter) var(--gutter);
}

.pull-quote-block {
    max-width: 800px;
    margin: 0 auto var(--gutter);
    text-align: center;
    padding: var(--padding);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.pull-quote-block.stagger-visible {
    opacity: 1;
    transform: translateY(0);
}

.pull-quote.jp {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 32px;
    color: var(--amber-filigree);
    margin-bottom: 12px;
    line-height: 1.4;
}

.pull-quote-en {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--dove-ash);
    letter-spacing: 0.04em;
    opacity: 0.6;
}

.warm-blocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gutter);
    max-width: 1200px;
    margin: 0 auto;
}

/* Warm block overrides */
.warm-block.block-dark:hover .block-title,
.warm-block.block-dark .warm-title {
    color: var(--sunset-ember);
}

.warm-block.block-dark {
    border-top: 2px solid rgba(232, 115, 58, 0.3);
}

.warm-block.block-light {
    border-top: 2px solid rgba(232, 115, 58, 0.4);
}

/* ===== MOVEMENT IV — YIELDING CLOSE ===== */
#movement-iv {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--antique-cream);
    padding: var(--padding) var(--gutter);
    text-align: center;
    position: relative;
    filter: url(#paper-grain);
}

.closing-ornament {
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.closing-ornament.visible {
    opacity: 1;
}

.closing-quote.jp {
    font-family: var(--font-accent);
    font-style: italic;
    font-weight: 300;
    font-size: 48px;
    color: var(--dark-mahogany);
    line-height: 1.3;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease-out 0.2s, transform 0.9s ease-out 0.2s;
}

.closing-quote.jp.visible {
    opacity: 1;
    transform: translateY(0);
}

.closing-quote-en {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 400;
    color: var(--rust-umber);
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.8s ease-out 0.5s;
}

.closing-quote-en.visible {
    opacity: 0.8;
}

.closing-rule {
    width: 60%;
    max-width: 600px;
    margin-top: 48px;
    opacity: 0;
    transition: opacity 0.6s ease-out 0.8s;
}

.closing-rule.visible {
    opacity: 1;
}

/* ===== FOOTER ===== */
#site-footer {
    background-color: var(--midnight-oak);
    padding: 32px var(--gutter) 24px;
    position: relative;
    overflow: hidden;
}

.footer-rule {
    width: 100%;
    margin-bottom: 20px;
}

.footer-canvas-container {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    pointer-events: none;
}

#footer-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-domain {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: lowercase;
    color: var(--amber-filigree);
    opacity: 0.5;
    position: relative;
    z-index: 1;
}

.footer-privacy {
    text-align: center;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.footer-privacy a {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--dove-ash);
    opacity: 0.3;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: opacity 0.3s ease;
}

.footer-privacy a:hover {
    opacity: 0.6;
}

/* ===== RIPPLE SYSTEM ===== */
#ripple-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-expand 400ms ease-out forwards;
    pointer-events: none;
}

.ripple-dark {
    background: radial-gradient(circle, rgba(232, 115, 58, 0.3) 0%, transparent 70%);
    width: 400px;
    height: 400px;
}

.ripple-light {
    background: radial-gradient(circle, rgba(196, 168, 199, 0.3) 0%, transparent 70%);
    width: 400px;
    height: 400px;
}

@keyframes ripple-expand {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    70%  { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

/* ===== SCROLL PROGRESS (subtle) ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-filigree), var(--sunset-ember));
    z-index: 100;
    opacity: 0.6;
    transition: width 0.1s linear;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    :root {
        --gutter: 24px;
        --padding: 24px;
    }

    .blocks-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .warm-blocks-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(40px, 10vw, 72px);
    }

    .closing-quote.jp {
        font-size: 32px;
    }
}

@media (max-width: 600px) {
    .blocks-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 40px;
    }

    .footer-domain {
        gap: 16px;
    }
}
