/* ============================================================
   yamato.quest — Cinematic Dark-Neon Styles
   Palette: Deep Space #0a0a14, Neon Magenta #ff2d6f,
            Plasma Blue #2d5fff, Pearl White #e8e4ef,
            Gradient Mesh A #1a0a2e, Gradient Mesh B #0a1a3e,
            Warm Gold #d4a843
   Fonts: Space Grotesk (display), Noto Sans JP (body),
          Share Tech Mono (HUD/data)
   ============================================================ */

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

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

body {
    background-color: #0a0a14;
    color: #e8e4ef;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ----- Color Utilities ----- */
.gold-text    { color: #d4a843; }
.magenta-text { color: #ff2d6f; }
.plasma-text  { color: #2d5fff; }

/* ----- Typography ----- */
.hud-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* ============================================================
   LETTERBOX / CINEMATIC FRAME SYSTEM
   ============================================================ */

.cinematic-frame {
    position: relative;
    background: #0a0a14;
    overflow: hidden;
}

.letterbox-bar {
    position: absolute;
    left: 0;
    right: 0;
    height: 8vh;
    background: #000;
    z-index: 10;
}

.letterbox-bar.top-bar    { top: 0; }
.letterbox-bar.bottom-bar { bottom: 0; }

/* ============================================================
   HERO SECTION — The Title Card
   ============================================================ */

.hero-frame {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26,10,46,0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(10,26,62,0.8) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 80%, rgba(45,95,255,0.05) 0%, transparent 50%),
        #0a0a14;
    box-shadow: inset 0 0 100px rgba(255,45,111,0.1);
}

.hero-content {
    position: relative;
    z-index: 5;
    text-align: left;
    padding: 0 8vw;
    width: 100%;
    max-width: 1400px;
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.hero-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff2d6f 50%, transparent 50%);
    background-size: 20px 2px;
    animation: dash-scroll 2s linear infinite;
    margin-bottom: 3vh;
}

.hero-line.bottom-line {
    margin-bottom: 0;
    margin-top: 3vh;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 7vw, 6rem);
    font-weight: 700;
    color: #e8e4ef;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 2vh;
    transform: scale(0.95);
    animation: hero-push-in 5s ease-out forwards;
}

.hero-subtitle {
    color: #d4a843;
    margin-top: 1.5vh;
}

@keyframes hero-push-in {
    0%   { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ============================================================
   ANIMATED DASH LINES
   ============================================================ */

@keyframes dash-scroll {
    from { background-position: 0 0; }
    to   { background-position: 40px 0; }
}

/* ============================================================
   STORYBOARD GRID — Modular Blocks
   ============================================================ */

.storyboard-section {
    padding: 2px 2px;
    background: #000;
}

.block-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

/* Block sizes */
.block-large  { grid-column: span 2; grid-row: span 2; min-height: 400px; }
.block-medium { grid-column: span 2; min-height: 200px; }
.block-small  { grid-column: span 1; min-height: 200px; }

/* Base block styles */
.block {
    position: relative;
    border: 1px solid rgba(255,45,111,0.3);
    overflow: hidden;
    background: #0a0a14;
    /* Zoom-focus default state */
    transform: scale(0.9);
    filter: blur(3px);
    opacity: 0.7;
    transition: transform 0.8s ease-out, filter 0.8s ease-out, opacity 0.8s ease-out;
}

.block.in-view {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

/* Large block gradient meshes */
.block-large {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(26,10,46,0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(10,26,62,0.85) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 20%, rgba(45,95,255,0.06) 0%, transparent 50%),
        #0a0a14;
    box-shadow: inset 0 0 100px rgba(255,45,111,0.1);
}

.block-scifi {
    background:
        radial-gradient(ellipse at 20% 60%, rgba(10,26,62,0.95) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(26,10,46,0.8) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 80%, rgba(45,95,255,0.1) 0%, transparent 50%),
        #0a0a14;
    box-shadow: inset 0 0 120px rgba(45,95,255,0.08), inset 0 0 100px rgba(255,45,111,0.07);
}

.block-return {
    background:
        radial-gradient(ellipse at 40% 50%, rgba(26,10,46,0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 20%, rgba(212,168,67,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(10,26,62,0.8) 0%, transparent 55%),
        #0a0a14;
    box-shadow: inset 0 0 100px rgba(255,45,111,0.12);
}

/* Block inner content */
.block-inner {
    padding: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.block-label {
    color: rgba(212,168,67,0.6);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    color: #e8e4ef;
}

.block-subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #e8e4ef;
}

.block-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(232,228,239,0.85);
    max-width: 520px;
}

/* HUD block internals */
.hud-block {
    gap: 0.5rem;
    justify-content: center;
    align-items: flex-start;
}

.hud-label {
    color: rgba(232,228,239,0.45);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hud-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
    color: #e8e4ef;
}

/* ============================================================
   HUD CORNER BRACKETS
   ============================================================ */

.hud-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 5;
    transition: opacity 0.3s ease;
}

.hud-corner.top-left {
    top: 8px;
    left: 8px;
    border-top: 2px solid #ff2d6f;
    border-left: 2px solid #ff2d6f;
}

.hud-corner.bottom-right {
    bottom: 8px;
    right: 8px;
    border-bottom: 2px solid #ff2d6f;
    border-right: 2px solid #ff2d6f;
}

.block:hover .hud-corner {
    animation: hud-pulse 1s ease-in-out infinite alternate;
}

@keyframes hud-pulse {
    from { opacity: 1; }
    to   { opacity: 0.4; }
}

/* ============================================================
   THE BRIDGE SECTION
   ============================================================ */

.bridge-section {
    background: #0a0a14;
    padding: 3rem 8vw;
    position: relative;
    overflow: hidden;
}

.bridge-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.bridge-dashes {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #ff2d6f 50%, transparent 50%);
    background-size: 20px 1px;
    animation: dash-scroll 2s linear infinite;
    margin: 1.5rem 0;
}

.bridge-readouts {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 4rem;
    justify-content: space-between;
    padding: 1rem 0;
}

.hud-readout {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.readout-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: rgba(232,228,239,0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.readout-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* ============================================================
   CREDITS ROLL — Footer
   ============================================================ */

.credits-frame {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
}

.credits-viewport {
    position: relative;
    flex: 1;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(10,26,62,0.4) 0%, transparent 70%),
        #0a0a14;
    /* Star-field background */
    background-image:
        radial-gradient(1px 1px at 15% 25%, rgba(232,228,239,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 35% 70%, rgba(232,228,239,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 40%, rgba(232,228,239,0.6) 0%, transparent 100%),
        radial-gradient(1px 1px at 75% 15%, rgba(232,228,239,0.3) 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 60%, rgba(232,228,239,0.5) 0%, transparent 100%),
        radial-gradient(1px 1px at 5% 80%, rgba(232,228,239,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 85%, rgba(212,168,67,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 45%, rgba(45,95,255,0.4) 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 35%, rgba(255,45,111,0.3) 0%, transparent 100%),
        radial-gradient(ellipse at 50% 50%, rgba(10,26,62,0.3) 0%, transparent 70%),
        #0a0a14;
    padding: 8vh 0;
}

.credits-roll {
    animation: credits-roll 30s linear infinite;
    animation-play-state: running;
}

.credits-roll:hover,
.credits-viewport:hover .credits-roll {
    animation-play-state: paused;
}

@keyframes credits-roll {
    from { transform: translateY(100%); }
    to   { transform: translateY(-100%); }
}

.credits-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    text-align: center;
}

.credit-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.credit-role {
    color: rgba(232,228,239,0.4);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.credit-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #e8e4ef;
    letter-spacing: 0.02em;
}

.credit-divider {
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff2d6f, transparent);
    margin: 0.5rem auto;
}

.credit-end {
    gap: 0.8rem;
}

.large-credit {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1;
    color: #d4a843;
}

.credit-spacer {
    height: 200px;
}

/* ============================================================
   SCIFI STORYBOARD — slight color variant
   ============================================================ */

.storyboard-scifi .block-medium {
    background:
        radial-gradient(ellipse at 30% 50%, rgba(10,26,62,0.9) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(26,10,46,0.7) 0%, transparent 55%),
        #0a0a14;
    box-shadow: inset 0 0 80px rgba(45,95,255,0.07);
}

.storyboard-scifi .block-small {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(10,26,62,0.8) 0%, transparent 70%),
        #0a0a14;
    border-color: rgba(45,95,255,0.4);
}

.storyboard-scifi .block-small .hud-corner.top-left,
.storyboard-scifi .block-small .hud-corner.bottom-right {
    border-color: #2d5fff;
}

/* ============================================================
   ZOOM-FOCUS DEFAULT (pre-intersection)
   ============================================================ */

.zoom-focus-target {
    transform: scale(0.9);
    filter: blur(3px);
    opacity: 0.7;
    transition: transform 0.8s ease-out, filter 0.8s ease-out, opacity 0.8s ease-out;
}

/* Hero title overrides (has its own push-in animation) */
#hero-title.zoom-focus-target {
    transform: none;
    filter: none;
    opacity: 1;
    animation: hero-push-in 5s ease-out forwards;
}

.zoom-focus-target.in-view {
    transform: scale(1);
    filter: blur(0);
    opacity: 1;
}

/* ============================================================
   RESPONSIVE — tablet / mobile
   ============================================================ */

@media (max-width: 900px) {
    .block-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .block-large  { grid-column: span 2; grid-row: span 1; min-height: 280px; }
    .block-medium { grid-column: span 2; min-height: 200px; }
    .block-small  { grid-column: span 1; min-height: 160px; }

    .bridge-readouts {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 560px) {
    .block-grid {
        grid-template-columns: 1fr;
    }

    .block-large,
    .block-medium,
    .block-small {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 200px;
    }

    .hero-content {
        padding: 10vh 6vw;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }
}
