/* ============================================================
   reiwa.day — Inflated-3D Burnt-Orange Balloon
   Material futuristic: kiln-fired ceramic warmth meets
   sci-fi HUD precision on aged washi paper
   ============================================================ */

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

:root {
    --kiln-dark: #2A1408;
    --burnt-orange: #5A3818;
    --forge-orange: #A06020;
    --clay-surface: #D8A068;
    --balloon-cream: #FFF6EA;
    --washi-white: #FAF4EA;
    --inset-shadow: rgba(40, 20, 10, 0.04);
    --paper-grain: rgba(90, 56, 24, 0.03);
    --card-shadow: 0 8px 24px rgba(40, 20, 10, 0.08), inset 0 -2px 6px rgba(40, 20, 10, 0.04);
    --card-shadow-hover: 0 12px 36px rgba(40, 20, 10, 0.12), inset 0 -3px 8px rgba(40, 20, 10, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: var(--burnt-orange);
    background-color: var(--washi-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Washi Paper Background --- */
#washi-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(216, 160, 104, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(160, 96, 32, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(90, 56, 24, 0.015) 0%, transparent 60%),
        radial-gradient(circle at 30% 80%, rgba(216, 160, 104, 0.02) 0%, transparent 40%),
        radial-gradient(circle at 70% 20%, rgba(42, 20, 8, 0.01) 0%, transparent 40%);
    filter: url(#washi-noise);
}

/* --- Main Container (Ceramic Column) --- */
#ceramic-column {
    position: relative;
    z-index: 1;
    max-width: 660px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: clamp(60px, 10vh, 100px);
    padding-top: clamp(60px, 12vh, 120px);
    padding-bottom: clamp(80px, 15vh, 150px);
}

/* --- Inflated Cards --- */
.inflated-card {
    background: var(--balloon-cream);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: clamp(32px, 5vw, 56px);
    position: relative;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.inflated-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.4s ease;
}

.inflated-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.inflated-card.visible:hover {
    transform: translateY(-2px);
}

/* --- Hero Section --- */
#hero {
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-era-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1.5px solid var(--forge-orange);
    margin-bottom: 28px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease 0.3s, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.hero-era-badge .hud-data {
    font-size: 1.1rem;
    letter-spacing: 0;
}

.inflated-card.visible .hero-era-badge {
    opacity: 1;
    transform: scale(1);
}

#hero-title {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 7vw, 5rem);
    color: var(--kiln-dark);
    letter-spacing: 0.12em;
    margin-bottom: 24px;
    line-height: 1.1;
}

.hero-subtitle {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: var(--burnt-orange);
    max-width: 480px;
    margin-bottom: 32px;
    line-height: 1.85;
}

/* --- Typography --- */
h2 {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: var(--kiln-dark);
    margin-bottom: 20px;
    line-height: 1.15;
}

h3 {
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--kiln-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

p {
    margin-bottom: 16px;
    color: var(--burnt-orange);
}

p:last-child {
    margin-bottom: 0;
}

/* --- HUD Data Text --- */
.hud-data {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 0.72rem;
    color: var(--forge-orange);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- HUD Frame (Sci-Fi Corners) --- */
.hud-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 20px;
    overflow: hidden;
}

.hud-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

.inflated-card.visible .hud-corner {
    opacity: 0.35;
}

.hud-top-left {
    top: 10px;
    left: 10px;
    border-top: 1.5px solid var(--forge-orange);
    border-left: 1.5px solid var(--forge-orange);
}

.hud-top-right {
    top: 10px;
    right: 10px;
    border-top: 1.5px solid var(--forge-orange);
    border-right: 1.5px solid var(--forge-orange);
}

.hud-bottom-left {
    bottom: 10px;
    left: 10px;
    border-bottom: 1.5px solid var(--forge-orange);
    border-left: 1.5px solid var(--forge-orange);
}

.hud-bottom-right {
    bottom: 10px;
    right: 10px;
    border-bottom: 1.5px solid var(--forge-orange);
    border-right: 1.5px solid var(--forge-orange);
}

/* --- HUD Status Bar --- */
.hud-status-bar {
    position: absolute;
    top: 14px;
    left: 44px;
    right: 44px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.6s ease 0.5s;
}

.inflated-card.visible .hud-status-bar {
    opacity: 1;
}

/* --- HUD Readout --- */
.hud-readout {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(160, 96, 32, 0.12);
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hud-readout-final {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* --- Underline-Draw Effect --- */
.draw-underline {
    display: inline;
    background-image: linear-gradient(var(--clay-surface), var(--clay-surface));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: 4px;
}

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

/* --- Principle Items --- */
.principle-items {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-top: 24px;
}

.principle-item {
    padding: 20px 24px;
    background: rgba(250, 244, 234, 0.5);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(40, 20, 10, 0.04), inset 0 -1px 3px rgba(40, 20, 10, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.principle-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(40, 20, 10, 0.07), inset 0 -1px 3px rgba(40, 20, 10, 0.02);
}

/* --- Process Steps --- */
.process-steps {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 24px;
}

.process-step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
    padding-top: 4px;
    opacity: 0.6;
}

.step-content {
    flex: 1;
}

/* --- Era Grid --- */
.era-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.era-item {
    padding: 18px 16px;
    background: rgba(250, 244, 234, 0.5);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(40, 20, 10, 0.04), inset 0 -1px 3px rgba(40, 20, 10, 0.02);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.era-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(40, 20, 10, 0.07), inset 0 -1px 3px rgba(40, 20, 10, 0.02);
}

.era-item .hud-data {
    display: block;
    margin-bottom: 8px;
    font-size: 0.65rem;
}

.era-item p {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* --- Material Swatches --- */
.material-swatches {
    margin: 28px 0;
}

.swatch-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.swatch {
    flex: 1;
    min-width: 80px;
    height: 72px;
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 8px 4px;
    box-shadow: 0 2px 8px rgba(40, 20, 10, 0.1), inset 0 -2px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.swatch:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 14px rgba(40, 20, 10, 0.15), inset 0 -2px 4px rgba(0, 0, 0, 0.06);
}

.swatch-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: var(--balloon-cream);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.swatch-light .swatch-label {
    color: var(--burnt-orange);
    text-shadow: none;
}

.swatch-light {
    border: 1px solid rgba(160, 96, 32, 0.12);
}

/* --- Signal Bar Animation --- */
@keyframes signal-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#signal-bar {
    animation: signal-pulse 3s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    #ceramic-column {
        padding: 0 16px;
        gap: clamp(40px, 8vh, 70px);
        padding-top: clamp(40px, 8vh, 80px);
    }

    .inflated-card {
        padding: clamp(24px, 5vw, 36px);
        border-radius: 16px;
    }

    #hero {
        min-height: 60vh;
    }

    #hero-title {
        letter-spacing: 0.08em;
    }

    .hero-era-badge {
        width: 52px;
        height: 52px;
        margin-bottom: 20px;
    }

    .hero-era-badge .hud-data {
        font-size: 0.9rem;
    }

    .era-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hud-status-bar {
        display: none;
    }

    .process-step {
        gap: 14px;
    }

    .step-number {
        font-size: 1.4rem;
        width: 36px;
    }

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

    .swatch-row {
        flex-wrap: wrap;
    }

    .swatch {
        min-width: 60px;
        height: 56px;
    }

    .swatch-label {
        font-size: 0.48rem;
    }
}

@media (max-width: 380px) {
    .hud-readout {
        gap: 12px;
    }

    .hud-readout .hud-data {
        font-size: 0.62rem;
    }

    .swatch {
        min-width: 50px;
        height: 48px;
    }
}
