/* lottery.day - Zen Lottery Design System */
/* Colors: #2c1810, #8a9a7b, #1a1512, #b8860b, #f5f0e8, #d4a04a, #5c4a3a, #ebe4d6 */
/* Fonts: Abril Fatface (display), Inter (body) */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: #2c1810;
    background-color: #f5f0e8;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Washi Paper Grain Overlay */
#noise-filter {
    position: absolute;
    width: 0;
    height: 0;
}

#washi-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    filter: url(#washi-grain);
    background: #f5f0e8;
}

/* Top Bar */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(44, 24, 16, 0.08);
}

.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-mark {
    font-size: 20px;
    color: #d4a04a;
    line-height: 1;
}

.top-bar-domain {
    font-family: 'Abril Fatface', serif;
    font-size: 18px;
    color: #2c1810;
    letter-spacing: -0.02em;
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #f5f0e8;
}

.hero-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#enso-circle {
    width: 320px;
    height: 320px;
    position: relative;
}

#enso-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawEnso 3s ease-out forwards;
}

@keyframes drawEnso {
    to {
        stroke-dashoffset: 0;
    }
}

#hero-title {
    font-family: 'Abril Fatface', serif;
    font-size: 72px;
    font-weight: 400;
    color: #2c1810;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-top: -200px;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1.5s ease-out 2s forwards;
}

#hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #5c4a3a;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 16px;
    opacity: 0;
    animation: fadeIn 1.5s ease-out 2.5s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 1s ease-out 3.5s forwards;
}

.scroll-kanji {
    font-size: 14px;
    color: #8a9a7b;
    font-weight: 300;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #8a9a7b, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* Content Sections - F-Pattern Layout */
.content-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 120px 40px;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 40px;
    position: relative;
}

.section-number-col {
    position: relative;
}

.section-number {
    font-family: 'Abril Fatface', serif;
    font-size: 48px;
    color: rgba(212, 160, 74, 0.25);
    line-height: 1;
    position: sticky;
    top: 120px;
}

.section-body {
    max-width: 680px;
}

.section-title {
    font-family: 'Abril Fatface', serif;
    font-size: 56px;
    font-weight: 400;
    color: #2c1810;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-divider {
    width: 60px;
    height: 2px;
    background-color: #d4a04a;
    margin-bottom: 40px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: opacity 0.6s ease-out 0.3s, transform 0.6s ease-out 0.3s;
}

.section-divider.visible {
    opacity: 1;
    transform: scaleX(1);
}

.section-prose {
    font-family: 'Inter', sans-serif;
    font-size: 17px;
    font-weight: 300;
    color: #5c4a3a;
    line-height: 1.8;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.4s, transform 0.8s ease-out 0.4s;
}

.section-prose.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-prose em {
    font-style: italic;
    color: #2c1810;
    font-weight: 400;
}

/* Sacred Numbers Grid */
.numbers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.4s, transform 0.8s ease-out 0.4s;
}

.numbers-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

.number-orb {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    border: 1px solid rgba(212, 160, 74, 0.3);
    border-radius: 50%;
    aspect-ratio: 1;
    transition: border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
    cursor: default;
    background: rgba(245, 240, 232, 0.5);
}

.number-orb:hover {
    border-color: #d4a04a;
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 160, 74, 0.15);
}

.orb-value {
    font-family: 'Abril Fatface', serif;
    font-size: 36px;
    color: #2c1810;
    line-height: 1;
}

.orb-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #8a9a7b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 8px;
}

/* The Draw Section */
.draw-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
}

.draw-instruction {
    margin-bottom: 32px;
}

.draw-instruction p {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 300;
    color: #5c4a3a;
    font-style: italic;
}

#draw-button {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    transition: transform 0.4s ease;
}

#draw-button:hover {
    transform: scale(1.08);
}

#draw-button:active {
    transform: scale(0.95);
}

.draw-enso {
    width: 120px;
    height: 120px;
}

.draw-button-text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #d4a04a;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.drawn-numbers {
    display: flex;
    gap: 16px;
    margin-top: 40px;
    min-height: 80px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.drawn-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid #d4a04a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Abril Fatface', serif;
    font-size: 24px;
    color: #2c1810;
    background: rgba(212, 160, 74, 0.08);
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    animation: revealNumber 0.6s ease-out forwards;
}

@keyframes revealNumber {
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.draw-message {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #8a9a7b;
    margin-top: 24px;
    font-style: italic;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.draw-message.visible {
    opacity: 1;
}

/* Ritual Quote */
.ritual-quote {
    border-left: 3px solid #d4a04a;
    padding-left: 24px;
    margin: 40px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.5s, transform 0.8s ease-out 0.5s;
}

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

.ritual-quote p {
    font-family: 'Abril Fatface', serif;
    font-size: 28px;
    color: #2c1810;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.ritual-quote cite {
    display: block;
    margin-top: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #8a9a7b;
    font-style: normal;
    letter-spacing: 0.05em;
}

/* Closing Section */
.closing-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 120px 40px;
}

.closing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.closing-enso {
    width: 200px;
    height: 200px;
    margin-bottom: 40px;
}

.closing-enso-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s ease-out;
}

.closing-enso-path.drawn {
    stroke-dashoffset: 0;
}

.closing-text {
    font-family: 'Abril Fatface', serif;
    font-size: 36px;
    color: #2c1810;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 1s ease-out 0.5s;
}

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

.closing-domain {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #8a9a7b;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 1s ease-out 1s;
}

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

/* Footer */
#site-footer {
    border-top: 1px solid rgba(44, 24, 16, 0.08);
    background: #ebe4d6;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-mark {
    font-size: 16px;
    color: #d4a04a;
}

.footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 300;
    color: #5c4a3a;
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
    #hero-title {
        font-size: 48px;
        margin-top: -160px;
    }

    #enso-circle {
        width: 240px;
        height: 240px;
    }

    .content-section {
        grid-template-columns: 50px 1fr;
        gap: 24px;
        padding: 80px 24px;
    }

    .section-number {
        font-size: 36px;
    }

    .section-title {
        font-size: 36px;
    }

    .numbers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .ritual-quote p {
        font-size: 22px;
    }

    .closing-text {
        font-size: 28px;
    }

    .top-bar-inner,
    .footer-inner {
        padding: 16px 24px;
    }
}

@media (max-width: 480px) {
    #hero-title {
        font-size: 36px;
        margin-top: -140px;
    }

    #enso-circle {
        width: 200px;
        height: 200px;
    }

    .section-title {
        font-size: 28px;
    }

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

    .drawn-numbers {
        gap: 10px;
    }

    .drawn-number {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}
