/* CSS Reset & Variables - Light Fantasy Theme */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #C5A059;
    /* Muted Gold */
    --accent-color: #9370DB;
    /* Medium Purple */
    --text-main: #4A4A4A;
    /* Dark Gray for text */
    --text-heading: #2F2F2F;
    /* Black-ish for headings */
    --bg-body: #FAFAFA;
    /* Off-white */
    --bg-glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(197, 160, 89, 0.3);
    --font-heading: 'Cinzel', serif;
    --font-jp-heading: 'Zen Antique', serif;
    --font-body: 'Shippori Mincho', serif;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 2;
    -webkit-font-smoothing: antialiased;
}

/* Fixed Background */
.fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.white-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    /* Strong white fade */
    backdrop-filter: blur(2px);
    /* Subtle blur for dreaminess */
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
    pointer-events: none;
    /* Let clicks pass through empty space */
}

/* Enable pointer events on interactive elements */
.site-header h1,
.hamburger-menu,
.nav-overlay {
    pointer-events: auto;
}

.site-header h1 {
    font-family: var(--font-jp-heading);
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--text-heading);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1002;
    /* Above nav */
}

/* Hamburger Menu */
.hamburger-menu {
    cursor: pointer;
    z-index: 1002;
    width: 40px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    transition: transform 0.3s;
}

.hamburger-menu .bar {
    width: 100%;
    height: 2px;
    background: var(--text-heading);
    transition: all 0.3s;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Nav Overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 1001;
}

.nav-overlay.active {
    transform: translateX(0);
}

/* Hamburger Animation State */
.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    transform: translateY(-5px) rotate(-45deg);
}

.nav-links {
    list-style: none;
    text-align: center;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-heading);
    text-decoration: none;
    display: block;
    margin: 10px 0;
    transition: color 0.3s;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s, color 0.3s;
}

.nav-overlay.active .nav-link {
    opacity: 1;
    transform: translateY(0);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-cta-btn {
    padding: 15px 40px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 50px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.nav-overlay.active .nav-cta-btn {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.nav-cta-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Common Section */
.section {
    position: relative;
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* No background for sections usually, letting video show through or specific cards */
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    /* Reduced gap for System section tightness */
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
}

.section-title .en {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary-color);
    letter-spacing: 0.05em;
}

.section-title .jp {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    letter-spacing: 0.3em;
    margin-top: 10px;
}

/* Opening Animation */
.opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    /* Let JS handle fade out */
}

.opening-title {
    font-family: var(--font-jp-heading);
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    line-height: 1.8;
}

.opening-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.opening-line {
    width: 0;
    height: 2px;
    background: var(--primary-color);
    margin: 20px auto 0;
}

/* Hero Section Refined */
.hero-section {
    height: 100vh;
    position: relative;
    background: transparent;
    overflow: hidden;
}

/* Dragon Video Styles Removed */
.hero-section::before {
    display: none;
}

.hero-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Vertical Text (Right Side) */
.hero-text-vertical {
    position: absolute;
    top: 50%;
    right: 15%;
    /* Moved slightly left to avoid edge tension */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    /* Block axis (R->L) layout in vertical mode */
    gap: 4vw;
    /* Increased gap for better separation */
    writing-mode: vertical-rl;
    text-orientation: upright;
    height: auto;
    /* Allow natural height */
    max-height: 80vh;
    /* Safety cap */
}

.vertical-line {
    font-family: var(--font-jp-heading);
    color: #1a1a1a;
    /* Dark text as per image */
    margin: 0;
    line-height: normal;
    /* Reset line-height to avoid gaps */
    font-weight: 500;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    /* Slight halo for readability */
    white-space: nowrap;
    /* CRITICAL: Prevents wrapping into multiple columns */
}

/* Unified Font Size as requested */
.vertical-line.main,
.vertical-line.sub {
    font-size: 2.8rem;
    letter-spacing: 0.2em;
}

.vertical-line.sub {
    margin-top: 4rem;
    /* Keeps the visual offset */
    opacity: 0.9;
}

/* Bottom Left Controls */
.hero-bottom-left {
    position: absolute;
    bottom: 8%;
    left: 8%;
    display: flex;
    flex-direction: row;
    /* Button and scroll side-by-side or separated? Image shows button and scroll separate. */
    align-items: flex-end;
    gap: 40px;
}

/* Orange CTA Button */
.hero-cta-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 18px 50px;
    background: linear-gradient(180deg, #F39C12 0%, #D35400 100%);
    /* Orange Gradient */
    color: #fff;
    font-family: var(--font-jp-heading);
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-left: 60px;
    /* Space for scroll line */
}

.hero-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(211, 84, 0, 0.5);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.scroll-text {
    writing-mode: vertical-rl;
    font-family: var(--font-heading);
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: #1a1a1a;
    transform: rotate(180deg);
    /* Text runs up or down? Usually down 's-c-r-o-l-l' */
    margin-bottom: 10px;
}

.scroll-line {
    width: 2px;
    height: 80px;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    /* Ensure content fits in viewport */
    .hero-section {
        height: 100dvh;
        /* Dynamic viewport height */
    }

    /* Vertical Text: Centered and Large on Mobile */
    .hero-text-vertical {
        right: auto;
        left: 50%;
        top: 45%;
        /* Slightly higher to leave room for CTA */
        transform: translate(-50%, -50%);
        align-items: center;
        /* Center lines relative to container */
        gap: 20px;
        max-height: 80vh;
        width: 100%;
        justify-content: center;
    }

    .vertical-line.main,
    .vertical-line.sub {
        font-size: 2.2rem;
        /* Large and impactful */
        letter-spacing: 0.1em;
        /* Soft white glow effect */
        text-shadow:
            0 0 15px rgba(255, 255, 255, 0.9),
            0 0 30px rgba(255, 255, 255, 0.6),
            0 0 5px rgba(255, 255, 255, 1);
    }

    .vertical-line.sub {
        margin-top: 2rem;
    }

    /* Bottom Controls */
    .hero-bottom-left {
        left: 50%;
        transform: translateX(-50%);
        bottom: 10%;
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 15px;
    }

    /* Button: Compact and clear */
    .hero-cta-btn {
        margin-left: 0;
        padding: 14px 40px;
        font-size: 0.95rem;
        width: auto;
        white-space: nowrap;
    }

    /* Scroll: Keep it if space allows, or hide if too cramped. Keeping for now but smaller */
    .scroll-indicator {
        display: flex;
        transform: scale(0.8);
        /* Scale down */
        margin-bottom: 5px;
    }

    .scroll-text {
        margin-bottom: 5px;
    }

    .scroll-line {
        height: 50px;
    }
}

/* Button Styles - Light Mode */
a.cta-button {
    /* More specific selector */
    position: relative;
    display: inline-flex !important;
    /* Force display */
    justify-content: center;
    align-items: center;
    padding: 15px 40px;
    text-decoration: none !important;
    color: #fff !important;
    /* Force white text */
    font-family: var(--font-jp-heading);
    font-weight: bold;
    font-size: 1rem;
    border-radius: 50px;
    background: var(--primary-color);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    animation: btnPulse 2s infinite;
    cursor: pointer;
    border: none;
    /* Reset borders */
}

/* Navigation Buttons for Story */
.book-viewport-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    /* Constrain width */
    margin: 0 auto;
}

.book-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-main);
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-nav-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.book-nav-btn.prev {
    left: 10px;
}

.book-nav-btn.next {
    right: 10px;
}

/* Hide nav buttons on mobile as scroll is natural */
@media (max-width: 768px) {
    .book-nav-btn {
        display: none;
    }
}

.book-viewport {
    /* ... existing styles ... */
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 40px 5%;
    /* Side padding */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.book-viewport::-webkit-scrollbar {
    display: none;
}

.book-container {
    display: flex;
    gap: 30px;
    padding-right: 100px;
}

.book-page {
    flex: 0 0 85vw;
    /* Slightly safer width */
    max-width: 600px;
    scroll-snap-align: center;
    background: #fff;
    padding: 20px 20px;
    border-radius: 4px;
    box-shadow:
        1px 5px 15px rgba(0, 0, 0, 0.05),
        inset 20px 0 30px -10px rgba(0, 0, 0, 0.03);
    /* Spine shadow effect */
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s;
}

.book-page:hover {
    transform: translateY(-5px);
}

.page-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.center-content {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.book-page h3 {
    font-family: var(--font-jp-heading);
    color: var(--text-heading);
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.book-page h4 {
    font-family: var(--font-jp-heading);
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.book-page p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
    text-align: justify;
}

.ornament {
    font-size: 2rem;
    color: var(--primary-color);
    margin: 20px 0;
    opacity: 0.5;
}

.swipe-hint {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 30px;
    animation: bounceRight 1.5s infinite;
}

@keyframes bounceRight {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(10px);
    }
}

.page-num {
    text-align: center;
    font-size: 0.8rem;
    color: #ccc;
    margin-top: auto;
    padding-top: 20px;
}

/* Movie Player - Custom */
.player-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    background: #000;
}

.player-video {
    width: 100%;
    display: block;
    cursor: pointer;
}

.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s;
}

.player-container:hover .custom-controls,
.player-container.paused .custom-controls {
    opacity: 1;
}

.play-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    width: 40px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    border-radius: 2px;
    position: relative;
}

.progress-filled {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    border-radius: 2px;
}

.big-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    pointer-events: none;
    /* Let clicks pass to video */
    transition: all 0.3s;
}

.big-play-btn::after {
    content: '';
    border-style: solid;
    border-width: 15px 0 15px 26px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}

.player-container.playing .big-play-btn {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
}

/* Recruit Section Fixed */
.recruit-section {
    position: relative;
    /* Removed z-index madness, handled by stacking context */
}

/* Recruit Layout - Fixed grid */
.recruit-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    /* Smaller gap for mobile */
    width: 100%;
}

.recruit-visual-col {
    position: relative;
    display: flex;
    justify-content: center;
}

.recruit-info-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Light Mode Cards */
.recruit-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s, box-shadow 0.3s;
    /* Opacity/Transform removed so GSAP .from works correctly */
}

.recruit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.recruit-card h4 {
    font-family: var(--font-jp-heading);
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
}

.recruit-card .cat {
    display: block;
    font-size: 0.7rem;
    color: var(--accent-color);
    font-weight: bold;
    margin-bottom: 10px;
}

/* Final CTA */
.final-cta {
    text-align: center;
    padding: 150px 20px;
    background: #fdfdfd;
}

.final-msg span {
    display: block;
    font-family: var(--font-jp-heading);
    font-size: 2.5rem;
    color: var(--text-heading);
    margin-bottom: 10px;
}

/* System & Tools - Light Mode */
.system-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    /* Increased gap */
    margin-bottom: 80px;
    /* Fix overlap */
}

.sys-item {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

/* System Cards (New Design) */
.sys-item.card-style {
    background: #fff;
    border-radius: 12px;
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    /* Removed top-border */
    border-top: none;
}

.sys-item.card-style:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.sys-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 5px 15px rgba(197, 160, 89, 0.2));
}

.sys-item h4 {
    font-family: var(--font-jp-heading);
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-heading);
}

.sys-item p {
    color: #888;
    font-size: 0.9rem;
}

.tools-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 0;
    /* Reset since grid pushes it */
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Final CTA Redesign */
.final-cta-redesign {
    padding: 100px 20px;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* CTA Video Background */
.cta-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.6;
    /* Balanced visibility */
}

.cta-inner {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.85);
    /* Semi-transparent white */
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 1;
}

/* Deprecated: Background layer inside card */
.cta-bg-layer {
    display: none;
}

.final-cta-redesign h2 {
    font-family: var(--font-jp-heading);
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--text-heading);
    line-height: 1.4;
}

.final-cta-redesign p {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 50px;
    letter-spacing: 0.1em;
}

/* Large Shine Button */
.cta-button.large-btn {
    padding: 20px 60px;
    font-size: 1.3rem;
    border-radius: 50px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), #D4AF37);
    box-shadow: 0 10px 30px rgba(197, 160, 89, 0.4);
}

.final-cta-redesign .cta-button {
    font-family: var(--font-jp-heading);
}

.cta-button.large-btn .shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50px;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    transform: skewX(-20deg);
    animation: shineAuto 3s infinite;
}

@keyframes shineAuto {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

/* GSAP Helper Classes */
.gsap-reveal {
    opacity: 0;
    will-change: transform, opacity;
}

/* Responsive Desktop */
@media (min-width: 900px) {
    .hero-title {
        font-size: 4rem;
    }

    .recruit-wrapper {
        grid-template-columns: 400px 1fr;
        /* Visual fixed width, Content expands */
        align-items: start;
    }

    .recruit-visual-col {
        /* Sticky needs explicit height on container usually, or just top */
        position: sticky;
        top: 150px;
        align-self: start;
    }

    .system-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .book-page {
        flex: 0 0 600px;
        /* Much wider on desktop */
    }
}