/* ========================================
   ronri.day - A Day for Structured Wonder
   ======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #F5EDE0;
    color: #5C4B3C;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
    position: relative;
    min-height: 600vh;
}

/* ========================================
   Grain Texture Overlay
   ======================================== */

.grain-filter {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    filter: url(#noiseFilter);
}

/* ========================================
   HUD Layer
   ======================================== */

.hud-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-scanlines {
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 3px,
        rgba(196, 149, 106, 0.08) 3px,
        rgba(196, 149, 106, 0.08) 4px
    );
}

.hud-scanlines-top {
    top: 0;
}

.hud-scanlines-bottom {
    bottom: 0;
}

.hud-reticle {
    position: absolute;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    animation: reticle-rotate 30s linear infinite;
    opacity: 0.3;
    transition: top 0.8s ease-out;
}

@keyframes reticle-rotate {
    from { transform: translateY(-50%) rotate(0deg); }
    to { transform: translateY(-50%) rotate(360deg); }
}

.hud-progress {
    position: fixed;
    right: 12px;
    top: 10%;
    width: 2px;
    height: 80%;
    background: rgba(196, 149, 106, 0.1);
    border-radius: 1px;
}

.hud-progress-fill {
    width: 100%;
    height: 0%;
    background: #C4956A;
    opacity: 0.4;
    border-radius: 1px;
    transition: height 0.3s ease-out;
}

.hud-readout {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #C4956A;
    opacity: 0;
    animation: hud-fade 4s ease-in-out infinite;
    letter-spacing: 0.05em;
}

.hud-readout-tl {
    top: 20px;
    left: 20px;
    animation-delay: 0s;
}

.hud-readout-tr {
    top: 20px;
    right: 40px;
    animation-delay: 1s;
}

.hud-readout-bl {
    bottom: 20px;
    left: 20px;
    animation-delay: 2s;
}

.hud-readout-br {
    bottom: 20px;
    right: 40px;
    animation-delay: 3s;
}

@keyframes hud-fade {
    0%, 100% { opacity: 0; }
    30%, 70% { opacity: 0.35; }
}

/* ========================================
   Navigation
   ======================================== */

.nav-trigger {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 237, 224, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 149, 106, 0.2);
    cursor: pointer;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-trigger:hover {
    background: rgba(245, 237, 224, 0.85);
    box-shadow: 0 4px 16px rgba(59, 47, 47, 0.1);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 237, 224, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.nav-link {
    font-family: 'Shippori Mincho', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: #5C4B3C;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #A0522D;
}

/* ========================================
   SVG Connective Paths
   ======================================== */

.svg-paths-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.logic-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    opacity: 0.6;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* ========================================
   Propositions - General
   ======================================== */

.proposition {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    transition: opacity 1.2s ease-out;
}

.proposition.past {
    opacity: 0.3;
}

/* ========================================
   Kanji Watermarks
   ======================================== */

.kanji-watermark {
    position: absolute;
    font-family: 'Shippori Mincho', serif;
    font-weight: 600;
    font-size: clamp(15rem, 25vw, 25rem);
    color: #2C2420;
    opacity: 0.05;
    z-index: 1;
    user-select: none;
    line-height: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================
   Proposition Zero: Hero
   ======================================== */

.proposition-zero {
    flex-direction: column;
    min-height: 100vh;
}

.hero-content {
    text-align: center;
    z-index: 10;
    opacity: 0;
    animation: hero-fade-in 1s ease-out 1.5s forwards;
}

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

.hero-title-svg {
    width: clamp(280px, 50vw, 600px);
    height: auto;
    display: block;
    margin: 0 auto 1.5rem;
}

.hero-title-text {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw-title 3s ease-out 1.5s forwards;
}

@keyframes draw-title {
    to {
        stroke-dashoffset: 0;
        fill: #2C2420;
    }
}

.hero-subtitle {
    font-family: 'Shippori Mincho', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #8B7D6B;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: subtitle-fade 1.2s ease-out 4.5s forwards;
}

@keyframes subtitle-fade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.scroll-chevron {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: chevron-pulse 2.5s ease-in-out 5.5s infinite;
    z-index: 10;
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.6; transform: translateX(-50%) translateY(6px); }
}

/* ========================================
   Glassmorphic Cards
   ======================================== */

.glass-card {
    background: rgba(245, 237, 224, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(196, 149, 106, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(59, 47, 47, 0.08);
    padding: 2.5rem 3rem;
    max-width: 520px;
    width: 90%;
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

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

.glass-card-left {
    align-self: flex-start;
    margin-right: auto;
    margin-left: 8%;
    transform: translateY(30px) rotate(-0.8deg);
}

.glass-card-left.visible {
    transform: translateY(0) rotate(-0.8deg);
}

.glass-card-right {
    align-self: flex-end;
    margin-left: auto;
    margin-right: 8%;
    transform: translateY(30px) rotate(0.6deg);
}

.glass-card-right.visible {
    transform: translateY(0) rotate(0.6deg);
}

.glass-card-center {
    align-self: center;
    margin: 0 auto;
}

.glass-card-resolution {
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    max-width: 580px;
    border: 1px solid rgba(196, 149, 106, 0.35);
    box-shadow: 0 8px 32px rgba(59, 47, 47, 0.08), 0 0 20px rgba(196, 149, 106, 0.1);
}

/* ========================================
   Typography - Proposition Elements
   ======================================== */

.proposition-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.9em;
    color: #6B5B4F;
    text-shadow: 0 0 8px rgba(139, 125, 107, 0.3);
    display: block;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.proposition-title {
    font-family: 'Shippori Mincho', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #3B2F2F;
    letter-spacing: 0.03em;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

.proposition-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: #5C4B3C;
    line-height: 1.85;
    margin-bottom: 1rem;
}

.proposition-body:last-child {
    margin-bottom: 0;
}

.mono-inline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    color: #6B5B4F;
    text-shadow: 0 0 8px rgba(139, 125, 107, 0.3);
}

/* ========================================
   Resolution Section
   ======================================== */

.proposition-resolution {
    flex-direction: column;
    gap: 3rem;
    min-height: 120vh;
}

.resolution-closing {
    z-index: 10;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

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

.closing-svg {
    width: clamp(240px, 40vw, 400px);
    height: auto;
    display: block;
    margin: 0 auto;
}

.closing-text {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.closing-text.drawn {
    stroke-dashoffset: 0;
}

/* ========================================
   Coda
   ======================================== */

.proposition-coda {
    min-height: 40vh;
    align-items: flex-end;
    justify-content: flex-end;
    padding-bottom: 2rem;
    padding-right: 2rem;
}

.coda-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #8B7D6B;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.coda-date.visible {
    opacity: 0.6;
}

/* ========================================
   Proposition-specific spacing
   ======================================== */

.proposition-one {
    min-height: 100vh;
    padding-top: 30vh;
}

.proposition-two {
    min-height: 120vh;
    padding-top: 30vh;
}

.proposition-three {
    min-height: 120vh;
    padding-top: 30vh;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .glass-card {
        padding: 2rem;
        max-width: 90%;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .glass-card-left,
    .glass-card-right {
        transform: translateY(30px) rotate(0deg);
    }

    .glass-card-left.visible,
    .glass-card-right.visible {
        transform: translateY(0) rotate(0deg);
    }

    .hud-reticle {
        display: none;
    }

    .kanji-watermark {
        font-size: clamp(10rem, 40vw, 15rem);
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 14px;
    }

    .proposition-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
}
