/* ============================================
   ronpa.day - Art Deco Chrome Metallic
   ============================================ */

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

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

body {
    background: #0D0D12;
    color: #F0F0F4;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Art-Deco Frame --- */
#deco-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
}

#frame-svg {
    width: 100%;
    height: 100%;
}

.frame-line {
    stroke: #C0C0C0;
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.frame-line.drawn {
    stroke-dashoffset: 0;
}

.frame-corner {
    stroke: #D4AF37;
    stroke-width: 2;
    fill: none;
    opacity: 0;
    transition: opacity 0.6s ease 1.0s;
}

.frame-corner.drawn {
    opacity: 1;
}

/* --- Scroll Progress Indicator --- */
#progress-track {
    position: fixed;
    right: 16px;
    top: 48px;
    bottom: 48px;
    width: 2px;
    background: linear-gradient(to bottom, #4A4A56, #C0C0C0, #4A4A56);
    z-index: 101;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#progress-track.visible {
    opacity: 1;
}

#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #C0C0C0, #E8E8EC);
    transition: height 0.15s ease-out;
}

.progress-diamond {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #4A4A56;
    border: 1px solid #C0C0C0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    transition: background 0.4s ease, border-color 0.4s ease;
}

.progress-diamond.active {
    background: #D4AF37;
    border-color: #D4AF37;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Sunburst --- */
#sunburst-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 150vmax;
    height: 150vmax;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease 0.8s;
}

#sunburst-container.visible {
    opacity: 0.15;
}

#sunburst {
    width: 100%;
    height: 100%;
}

#sunburst line {
    stroke: #4A4A56;
    stroke-width: 0.5;
}

/* --- Argument Sections --- */
.argument-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    z-index: 1;
    will-change: transform, opacity, filter;
}

.argument-section.shake {
    animation: demolish 400ms ease-out;
}

.argument-section.demolished {
    opacity: 0;
    transform: translateY(60px);
    filter: blur(40px);
    transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.argument-section.entering {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@keyframes demolish {
    0%   { transform: translateX(0); }
    10%  { transform: translateX(-8px); }
    20%  { transform: translateX(8px); }
    30%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    50%  { transform: translateX(-3px); }
    60%  { transform: translateX(3px); }
    70%  { transform: translateX(-1px); }
    80%  { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    z-index: 2;
}

.section-inner {
    text-align: center;
}

#hero-title {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #F0F0F4;
    opacity: 0;
    background: linear-gradient(
        90deg,
        #F0F0F4 0%,
        #E8E8EC 40%,
        #D4AF37 50%,
        #E8E8EC 60%,
        #F0F0F4 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#hero-title.revealed {
    opacity: 1;
}

#hero-title.shimmer {
    animation: chromeShimmer 1.5s ease forwards;
}

@keyframes chromeShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

#hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    color: #A8A8B0;
    letter-spacing: 0.04em;
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hero-subtitle.revealed {
    opacity: 1;
}

.hero-glow {
    animation: goldPulse 1.2s ease forwards;
}

@keyframes goldPulse {
    0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
    50%  { box-shadow: 0 0 40px 4px rgba(212, 175, 55, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* --- Glassmorphic Cards --- */
.glass-card {
    position: relative;
    background: rgba(28, 28, 36, 0.65);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid rgba(192, 192, 192, 0.15);
    border-top-color: rgba(192, 192, 192, 0.25);
    border-left-color: rgba(192, 192, 192, 0.25);
    border-bottom-color: rgba(192, 192, 192, 0.08);
    border-right-color: rgba(192, 192, 192, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    clip-path: polygon(
        12px 0%,
        100% 0%,
        100% calc(100% - 12px),
        calc(100% - 12px) 100%,
        0% 100%,
        0% 12px
    );
    padding: 48px 56px;
    max-width: 720px;
    width: 100%;
    will-change: transform, filter, backdrop-filter;
    transition: backdrop-filter 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.glass-card:hover {
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 48px rgba(0, 0, 0, 0.4);
    border-color: rgba(232, 232, 236, 0.3);
}

.glass-card.red-flash {
    border-color: #FF2E3A !important;
    transition: border-color 0.2s ease;
}

.glass-card.gold-entry {
    border-top-color: #D4AF37;
    transition: border-top-color 0.6s ease;
}

/* --- Fan Motifs --- */
.fan-motif {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    opacity: 0.12;
}

.fan-tl {
    top: 0;
    left: 0;
    background: conic-gradient(
        from 0deg at 0% 0%,
        rgba(192, 192, 192, 0.3) 0deg,
        rgba(192, 192, 192, 0.2) 22.5deg,
        rgba(192, 192, 192, 0.1) 45deg,
        rgba(192, 192, 192, 0.05) 67.5deg,
        transparent 90deg,
        transparent 360deg
    );
}

.fan-br {
    bottom: 0;
    right: 0;
    background: conic-gradient(
        from 180deg at 100% 100%,
        rgba(192, 192, 192, 0.3) 0deg,
        rgba(192, 192, 192, 0.2) 22.5deg,
        rgba(192, 192, 192, 0.1) 45deg,
        rgba(192, 192, 192, 0.05) 67.5deg,
        transparent 90deg,
        transparent 360deg
    );
}

/* --- Card Typography --- */
.card-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #A8A8B0;
    display: block;
    margin-bottom: 24px;
}

.card-headline {
    font-family: 'Poiret One', cursive;
    font-weight: 400;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #E8E8EC;
    margin-bottom: 24px;
    line-height: 1.2;
}

.card-headline .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-headline .char.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.75;
    color: #F0F0F4;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.card-body.visible {
    opacity: 1;
}

/* --- Chevron Borders --- */
.chevron-border {
    width: 100%;
    max-width: 720px;
    height: 16px;
    overflow: hidden;
    opacity: 0.4;
}

.chevron-border svg {
    width: 100%;
    height: 100%;
}

.chevron-top {
    margin-bottom: 24px;
}

.chevron-bottom {
    margin-top: 24px;
}

/* --- Deco Dividers --- */
.deco-divider {
    width: 100%;
    max-width: 400px;
    height: 20px;
    margin: 32px 0;
    opacity: 0.5;
}

.deco-divider svg {
    width: 100%;
    height: 100%;
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 1;
    padding: 48px 64px;
    text-align: center;
}

.footer-rule {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, #C0C0C0, transparent);
    margin-bottom: 24px;
}

.footer-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7A7A88;
}

/* --- Link Hover Animation --- */
a {
    color: #E8E8EC;
    text-decoration: none;
    background-image: linear-gradient(#D4AF37, #D4AF37);
    background-position: 0 100%;
    background-size: 0% 1px;
    background-repeat: no-repeat;
    transition: background-size 0.4s ease;
}

a:hover {
    background-size: 100% 1px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .argument-section {
        padding: 24px;
    }

    .glass-card {
        padding: 32px 24px;
        border-radius: 16px;
    }

    #deco-frame {
        display: none;
    }

    #progress-track {
        right: 8px;
    }

    .fan-motif {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .argument-section {
        padding: 16px;
    }

    .glass-card {
        padding: 24px 16px;
    }

    .chevron-border,
    .deco-divider {
        display: none;
    }
}

/* --- Utility --- */
.hidden {
    opacity: 0;
    pointer-events: none;
}
