/* ========================================
   ROOT & VARIABLES
   ======================================== */

:root {
    /* Color palette */
    --color-anthracite-night: #1C2128;
    --color-slate-mist: #E8ECF0;
    --color-iron-smoke: #2A3240;
    --color-platinum-silver: #D6DCE2;
    --color-fog-gray: #9AA3AE;
    --color-deep-slate: #2C343D;
    --color-charcoal-slate: #3A424D;
    --color-tarnished-silver: #8A94A0;
    --color-muted-silver: #7E8894;
    --color-gaslight-amber: #C4A472;
    --color-frosted-lavender: #A8B0C8;
    --color-pewter-gleam: #C8CED6;
    --color-wrought-iron: #4A5568;
    --color-candlelight: #D4BC94;
    --color-moonstone: #B8C4D8;
    --color-stained-glass: #B0B8C4;

    /* Typography scale */
    --size-h1: clamp(3rem, 8vw, 6.5rem);
    --size-h2: clamp(1.8rem, 4vw, 3rem);
    --size-h3: clamp(1.3rem, 2.5vw, 2rem);
    --size-body: clamp(1rem, 1.2vw, 1.15rem);
    --size-label: clamp(0.75rem, 1vw, 0.9rem);

    --spacing-h1: 0.10em;
    --spacing-h2: 0.05em;
    --spacing-h3: 0.03em;
    --spacing-body: 0.015em;
    --spacing-label: 0.08em;

    --hex-size: clamp(180px, 20vw, 320px);
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--color-fog-gray);
    background-color: var(--color-anthracite-night);
    font-size: var(--size-body);
    line-height: 1.85;
    letter-spacing: var(--spacing-body);
    overflow-x: hidden;
    position: relative;
}

/* ========================================
   BOKEH LAYERS
   ======================================== */

.bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -10;
}

.bokeh-far {
    --bokeh-z: -3px;
    --bokeh-scale: 4;
    --bokeh-blur: blur(8px);
    --bokeh-opacity-min: 0.1;
    --bokeh-opacity-max: 0.2;
}

.bokeh-mid {
    --bokeh-z: -1.5px;
    --bokeh-scale: 2.5;
    --bokeh-blur: blur(4px);
    --bokeh-opacity-min: 0.15;
    --bokeh-opacity-max: 0.3;
}

.bokeh-near {
    --bokeh-z: -0.5px;
    --bokeh-scale: 1.5;
    --bokeh-blur: blur(1px);
    --bokeh-opacity-min: 0.2;
    --bokeh-opacity-max: 0.4;
}

.bokeh-container::before,
.bokeh-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 40% 35%,
        rgba(200, 206, 214, var(--bokeh-opacity-max)),
        rgba(168, 176, 200, var(--bokeh-opacity-min)) 50%,
        rgba(28, 33, 40, 0) 70%
    );
    filter: var(--bokeh-blur);
    backdrop-filter: blur(1px);
}

.bokeh-far::before {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 15%;
    animation: drift-slow 60s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.bokeh-far::after {
    width: 160px;
    height: 160px;
    bottom: 20%;
    right: 10%;
    animation: drift-slow 50s cubic-bezier(0.37, 0, 0.63, 1) infinite reverse;
}

.bokeh-mid::before {
    width: 120px;
    height: 120px;
    top: 30%;
    right: 20%;
    animation: drift-medium 40s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.bokeh-mid::after {
    width: 100px;
    height: 100px;
    bottom: 30%;
    left: 25%;
    animation: drift-medium 35s cubic-bezier(0.37, 0, 0.63, 1) infinite reverse;
}

.bokeh-near::before {
    width: 80px;
    height: 80px;
    top: 40%;
    left: 40%;
    animation: drift-fast 25s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.bokeh-near::after {
    width: 70px;
    height: 70px;
    bottom: 40%;
    right: 35%;
    animation: drift-fast 30s cubic-bezier(0.37, 0, 0.63, 1) infinite reverse;
}

@keyframes drift-slow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 30px); }
}

@keyframes drift-medium {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

@keyframes drift-fast {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, 70px); }
}

/* ========================================
   FLOATING ELEMENTS
   ======================================== */

.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -5;
    perspective: 1200px;
}

.kanji-watermark {
    position: fixed;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: clamp(4rem, 10vw, 12rem);
    font-weight: 300;
    color: var(--color-platinum-silver);
    opacity: 0.06;
    pointer-events: none;
    z-index: -8;
}

.kanji-watermark:nth-child(1) {
    top: 10%;
    left: 5%;
    animation: float-vertical 8s ease-in-out infinite;
}

.kanji-watermark:nth-child(2) {
    top: 25%;
    right: 8%;
    animation: float-vertical 10s ease-in-out infinite;
}

.kanji-watermark:nth-child(3) {
    top: 50%;
    left: 10%;
    animation: float-vertical 12s ease-in-out infinite;
}

.kanji-watermark:nth-child(4) {
    top: 65%;
    right: 12%;
    animation: float-vertical 9s ease-in-out infinite;
}

.kanji-watermark:nth-child(5) {
    bottom: 20%;
    left: 15%;
    animation: float-vertical 11s ease-in-out infinite;
}

.kanji-watermark:nth-child(6) {
    bottom: 15%;
    right: 10%;
    animation: float-vertical 13s ease-in-out infinite;
}

.kanji-watermark:nth-child(7) {
    top: 35%;
    left: 50%;
    animation: float-vertical 7s ease-in-out infinite;
}

.kanji-watermark:nth-child(8) {
    bottom: 30%;
    right: 50%;
    animation: float-vertical 10s ease-in-out infinite;
}

@keyframes float-vertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(60px); }
}

/* Hexagonal dust motes */
.hexagonal-motes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -6;
}

.hexagonal-motes::before,
.hexagonal-motes::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--color-frosted-lavender);
    opacity: 0.3;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.hexagonal-motes::before {
    top: 20%;
    left: 30%;
    animation: drift-up 4s ease-in-out infinite;
}

.hexagonal-motes::after {
    top: 50%;
    right: 25%;
    animation: drift-up 5s ease-in-out infinite;
}

@keyframes drift-up {
    0% { transform: translateY(0); opacity: 0.2; }
    50% { opacity: 0.4; }
    100% { transform: translateY(-100px); opacity: 0.1; }
}

/* ========================================
   SCROLL PROGRESS INDICATOR
   ======================================== */

.scroll-progress {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    pointer-events: none;
}

.progress-hexagon {
    width: 12px;
    height: 12px;
    background-color: var(--color-tarnished-silver);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.progress-hexagon.active {
    background-color: var(--color-pewter-gleam);
    opacity: 1;
    transform: scale(1.2);
}

/* ========================================
   HOME ICON
   ======================================== */

.home-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 16px;
    height: 16px;
    background-color: var(--color-muted-silver);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
    border: 1px solid var(--color-charcoal-slate);
}

.home-icon:hover {
    background-color: var(--color-pewter-gleam);
    transform: scale(1.3);
    box-shadow: 0 0 8px var(--color-stained-glass);
}

/* ========================================
   MAIN CONTENT & ZONES
   ======================================== */

.main-content {
    position: relative;
    z-index: 1;
}

.zone {
    min-height: 100vh;
    position: relative;
    transition: background-color 0.6s ease, color 0.6s ease;
}

.zone-1 {
    background-color: var(--color-anthracite-night);
    color: var(--color-platinum-silver);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-2 {
    background-color: var(--color-iron-smoke);
    color: var(--color-fog-gray);
    padding: 60px 40px;
}

.zone-3 {
    background-color: var(--color-slate-mist);
    color: var(--color-deep-slate);
    padding: 80px 60px;
}

.zone-4 {
    background-color: var(--color-anthracite-night);
    color: var(--color-platinum-silver);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
}

h1 {
    font-size: var(--size-h1);
    letter-spacing: var(--spacing-h1);
    color: var(--color-platinum-silver);
    margin-bottom: 1rem;
}

h2 {
    font-size: var(--size-h2);
    letter-spacing: var(--spacing-h2);
    color: var(--color-platinum-silver);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: var(--size-h3);
    letter-spacing: var(--spacing-h3);
    color: var(--color-platinum-silver);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.zone-3 h2,
.zone-3 h3 {
    color: var(--color-deep-slate);
}

.zone-3 p {
    color: var(--color-deep-slate);
}

/* ========================================
   VESTIBULE (Zone I)
   ======================================== */

.vestibule-grid {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.central-hexagon {
    width: var(--hex-size);
    aspect-ratio: 1 / 1.1547;
    background-color: var(--color-iron-smoke);
    border: 2px solid var(--color-wrought-iron);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: morph-in 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-title {
    font-size: clamp(2rem, 6vw, 5rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: center;
    font-style: italic;
}

.satellite-hexagon {
    position: absolute;
    width: clamp(60px, 8vw, 120px);
    aspect-ratio: 1 / 1.1547;
    background-color: var(--color-iron-smoke);
    border: 1px solid var(--color-tarnished-silver);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    opacity: 0;
}

.satellite-1 { top: -15%; left: 50%; transform: translateX(-50%); animation: morph-satellite-1 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards; }
.satellite-2 { top: -5%; right: 15%; animation: morph-satellite-2 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards; }
.satellite-3 { bottom: -5%; right: 15%; animation: morph-satellite-3 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards; }
.satellite-4 { bottom: -15%; left: 50%; transform: translateX(-50%); animation: morph-satellite-4 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.65s forwards; }
.satellite-5 { bottom: -5%; left: 15%; animation: morph-satellite-5 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s forwards; }
.satellite-6 { top: -5%; left: 15%; animation: morph-satellite-6 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.95s forwards; }

@keyframes morph-in {
    from {
        transform: scale(0.5) rotate(45deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes morph-satellite-1 {
    from { transform: translateX(-50%) scale(0) rotate(-45deg); opacity: 0; }
    to { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes morph-satellite-2 {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes morph-satellite-3 {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes morph-satellite-4 {
    from { transform: translateX(-50%) scale(0) rotate(-45deg); opacity: 0; }
    to { transform: translateX(-50%) scale(1) rotate(0deg); opacity: 1; }
}

@keyframes morph-satellite-5 {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes morph-satellite-6 {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ========================================
   HONEYCOMB GRID (Zone II)
   ======================================== */

.honeycomb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 4px;
    max-width: 1400px;
    margin: 0 auto;
}

.honeycomb-grid > :nth-child(odd) {
    margin-top: 0;
}

.honeycomb-grid > :nth-child(even) {
    margin-top: calc(var(--hex-size) * 0.5 * 1.1547 + 4px);
}

.hexagon-cell {
    width: 100%;
    aspect-ratio: 1 / 1.1547;
    background-color: var(--color-iron-smoke);
    border: 1px solid var(--color-wrought-iron);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 1px var(--color-stained-glass);
}

.hexagon-cell h2 {
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    margin: 0 0 0.5rem 0;
}

.hexagon-cell h3 {
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    margin: 0 0 0.4rem 0;
}

.hexagon-cell p {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    margin: 0;
    line-height: 1.6;
}

.empty-cell {
    background-color: rgba(212, 188, 148, 0.08);
    border-color: transparent;
}

.hexagon-cell:hover {
    transform: scale(1.05);
}

/* ========================================
   READING CHAMBER (Zone III)
   ======================================== */

.reading-chamber {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px;
}

.reading-chamber h2 {
    color: var(--color-deep-slate);
    border-bottom: 2px solid var(--color-tarnished-silver);
    padding-bottom: 20px;
}

.reading-chamber h3 {
    color: var(--color-deep-slate);
}

.reading-chamber p {
    color: var(--color-deep-slate);
}

.color-palette {
    background-color: rgba(212, 188, 148, 0.05);
    padding: 30px;
    border-left: 4px solid var(--color-gaslight-amber);
    margin: 30px 0;
}

/* ========================================
   DEPARTURE GRID (Zone IV)
   ======================================== */

.departure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
    max-width: 800px;
    margin: 0 auto;
}

.departure-grid > :nth-child(odd) {
    margin-top: 0;
}

.departure-grid > :nth-child(even) {
    margin-top: calc(80px * 0.5 * 1.1547 + 4px);
}

.departure-cell {
    width: 100%;
    aspect-ratio: 1 / 1.1547;
    background-color: var(--color-iron-smoke);
    border: 1px solid var(--color-wrought-iron);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--color-platinum-silver);
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
}

.final-hexagon {
    background: linear-gradient(135deg, var(--color-gaslight-amber), transparent);
    box-shadow: inset 0 0 30px rgba(196, 164, 114, 0.3);
    font-size: clamp(1.5rem, 3vw, 2rem);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .zone-2 {
        padding: 40px 20px;
    }

    .zone-3 {
        padding: 60px 30px;
    }

    .vestibule-grid {
        padding: 20px;
    }

    .reading-chamber {
        padding: 30px 20px;
    }
}
