/* ============================================
   ppuzzle.org — Japanese-Minimal Aurora Sanctuary
   ============================================ */

/* --- Design Palette ---
   #101828 Deep Indigo (headings)
   #384050 Slate Indigo (body text)
   #60A890 Aurora Green (primary accent, HUD)
   #8868B0 Aurora Violet (secondary accent)
   #C07898 Aurora Rose (tertiary accent)
   #F8FAFA Sanctuary White (background)
   #F0F4F4 Void Space (HUD frame interior)
   #507060 Leaf Moss (organic motifs)
   --- */

:root {
    --deep-indigo: #101828;
    --slate-indigo: #384050;
    --aurora-green: #60A890;
    --aurora-violet: #8868B0;
    --aurora-rose: #C07898;
    --sanctuary-white: #F8FAFA;
    --void-space: #F0F4F4;
    --leaf-moss: #507060;
}

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

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.9;
    color: #384050;
    background-color: #F8FAFA;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #101828;
    font-weight: 600;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: 0.12em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

em {
    font-style: italic;
    color: #507060;
}

/* --- HUD Labels (Monospace) --- */
.hud-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: #60A890;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

/* --- Ink Underline Draw --- */
.ink-underline {
    display: inline;
    background-image: linear-gradient(#60A890, #60A890);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 400ms ease;
    padding-bottom: 4px;
}

.ink-underline.drawn {
    background-size: 100% 2px;
}

/* --- Geometric Ikebana Background --- */
.ikebana-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ikebana-shape {
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.ikebana-shape.visible {
    opacity: 1;
}

.ikebana-circle-1 {
    width: 280px;
    height: 280px;
    top: 8%;
    right: -5%;
}

.ikebana-oval-1 {
    width: 200px;
    height: 300px;
    top: 30%;
    left: -3%;
}

.ikebana-rect-1 {
    width: 160px;
    height: 240px;
    bottom: 15%;
    right: 8%;
}

.ikebana-circle-2 {
    width: 180px;
    height: 180px;
    bottom: 5%;
    left: 10%;
}

.ikebana-oval-2 {
    width: 250px;
    height: 150px;
    top: 55%;
    right: 15%;
}

/* --- Leaf Motifs Background --- */
.leaf-motifs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.leaf {
    position: absolute;
    opacity: 0;
    transition: opacity 2s ease, transform 3s ease;
}

.leaf.settled {
    opacity: 1;
}

.leaf-maple-1 {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 5%;
    transform: rotate(-15deg);
}

.leaf-bamboo-1 {
    width: 40px;
    height: 80px;
    top: 45%;
    right: 4%;
    transform: rotate(10deg);
}

.leaf-maple-2 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    right: 12%;
    transform: rotate(25deg);
}

.leaf-bamboo-2 {
    width: 35px;
    height: 70px;
    bottom: 35%;
    left: 8%;
    transform: rotate(-8deg);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

/* --- HUD Frame --- */
.hud-frame {
    position: relative;
    max-width: 720px;
    width: 100%;
    border: 1px solid rgba(100, 180, 160, 0.15);
    background: rgba(248, 250, 250, 0.6);
    backdrop-filter: blur(8px);
    padding: 3rem 2.5rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hud-frame.materialized {
    opacity: 1;
    transform: translateY(0);
}

/* --- Corner Brackets --- */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.corner-bracket.visible {
    opacity: 1;
}

.corner-tl {
    top: -1px;
    left: -1px;
}

.corner-tr {
    top: -1px;
    right: -1px;
}

.corner-bl {
    bottom: -1px;
    left: -1px;
}

.corner-br {
    bottom: -1px;
    right: -1px;
}

/* --- Status Bar --- */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    background: rgba(240, 244, 244, 0.8);
    border-bottom: 1px solid rgba(100, 180, 160, 0.1);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: #60A890;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    overflow: hidden;
}

.status-separator {
    color: rgba(100, 180, 160, 0.3);
}

.status-label {
    margin-left: auto;
}

/* --- Hero Content --- */
.hero-content {
    text-align: center;
    margin-top: 2rem;
}

.hero-title {
    font-weight: 400;
    margin-bottom: 0.8rem;
    display: inline-block;
}

.hero-subtitle {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: #507060;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    margin-bottom: 2rem;
}

.hero-divider {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

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

.divider-line {
    width: 120px;
    height: 2px;
}

.hero-description {
    max-width: 480px;
    margin: 0 auto;
    color: #384050;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 2;
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
}

/* --- HUD Panel --- */
.hud-panel {
    position: relative;
    max-width: 720px;
    width: 100%;
    border: 1px solid rgba(100, 180, 160, 0.15);
    background: rgba(248, 250, 250, 0.6);
    backdrop-filter: blur(8px);
    padding: 3rem 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hud-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.panel-status-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(100, 180, 160, 0.1);
}

/* --- Section Text --- */
.section-title {
    display: inline;
    margin-bottom: 1.5rem;
}

.section-body {
    margin-top: 1.5rem;
    color: #384050;
}

/* --- Leaf Transitions --- */
.leaf-transition {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    position: relative;
    z-index: 1;
}

.transition-leaf {
    width: 50px;
    height: 50px;
    opacity: 0;
    transform: translateY(-10px) rotate(0deg);
    transition: opacity 1s ease, transform 1.5s ease;
}

.transition-leaf.fallen {
    opacity: 1;
    transform: translateY(0) rotate(15deg);
}

.transition-leaf-alt {
    width: 30px;
    height: 60px;
}

.transition-leaf-alt.fallen {
    transform: translateY(0) rotate(-10deg);
}

/* --- Ikebana Display --- */
.ikebana-display {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ikebana-arrangement {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    height: 180px;
}

.ike-shin {
    width: 40px;
    height: 160px;
    align-self: flex-start;
}

.ike-soe {
    width: 80px;
    height: 80px;
    align-self: center;
}

.ike-hikae {
    width: 65px;
    height: 48px;
    align-self: flex-end;
}

.ike-labels {
    display: flex;
    gap: 3rem;
}

/* --- Aurora Spectrum --- */
.aurora-spectrum {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.aurora-band {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.aurora-swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--aurora-color);
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.aurora-band:hover .aurora-swatch {
    opacity: 0.8;
    transform: scale(1.1);
}

.aurora-hex {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #384050;
    opacity: 0.6;
    margin-left: auto;
}

/* --- Wabi-Sabi Quote --- */
.wabi-quote {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    border-left: 2px solid #8868B0;
    background: #F0F4F4;
}

.wabi-quote p {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #101828;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 0;
}

/* --- Footer --- */
.sanctuary-footer {
    position: relative;
    z-index: 1;
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
}

.footer-hud {
    max-width: 720px;
    width: 100%;
    text-align: center;
}

.footer-status {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #60A890, #C07898, transparent);
    margin-bottom: 2rem;
    opacity: 0.3;
}

.footer-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #101828;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}

/* --- Aurora Accent Utilities --- */
.accent-violet {
    color: #8868B0;
}

.accent-rose {
    color: #C07898;
}

/* --- Aurora Gradient Ambient Glow --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(96, 168, 144, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 60%, rgba(136, 104, 176, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(192, 120, 152, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: auroraShift 20s ease-in-out infinite alternate;
}

@keyframes auroraShift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(-2%, 1%) rotate(0.5deg);
    }
    66% {
        transform: translate(1%, -1%) rotate(-0.3deg);
    }
    100% {
        transform: translate(-1%, 2%) rotate(0.2deg);
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hud-frame,
    .hud-panel {
        padding: 2.5rem 1.5rem;
    }

    .status-bar {
        font-size: 0.5rem;
        gap: 0.5rem;
    }

    .ikebana-arrangement {
        gap: 1rem;
        height: 140px;
    }

    .ike-shin {
        height: 120px;
        width: 30px;
    }

    .ike-soe {
        width: 60px;
        height: 60px;
    }

    .ike-hikae {
        width: 50px;
        height: 36px;
    }

    .ike-labels {
        gap: 1.5rem;
    }

    .aurora-band {
        gap: 0.8rem;
    }

    .aurora-swatch {
        width: 36px;
        height: 36px;
    }

    .corner-bracket {
        width: 18px;
        height: 18px;
    }

    .ikebana-circle-1 {
        width: 180px;
        height: 180px;
    }

    .ikebana-oval-1 {
        width: 140px;
        height: 200px;
    }

    .ikebana-rect-1 {
        width: 100px;
        height: 150px;
    }

    .ikebana-circle-2 {
        width: 120px;
        height: 120px;
    }

    .ikebana-oval-2 {
        width: 160px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .hud-frame,
    .hud-panel {
        padding: 2rem 1.2rem;
    }

    .status-bar {
        padding: 0 0.5rem;
    }

    .status-coords,
    .status-separator:nth-of-type(2) ~ .status-separator {
        display: none;
    }

    .hero-title {
        font-size: clamp(1.6rem, 5vw, 2.4rem);
    }

    .footer-status {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
}
