/* ================================================================
   GAME PAGE — Dark Cartoony Fantasy
   Aesthetic: Ink-splattered storybook meets villain's manifesto
   ================================================================ */

:root {
    --parchment:      #e8dff5;
    --parchment-dark: #c4b8d9;
    --ink:            #0d0b14;
    --ink-mid:        #160f2a;
    --ink-deep:       #0a0810;
    --accent:         #3d7a4a;      /* forest green — replaces crimson */
    --accent-bright:  #5cb86e;      /* bright green */
    --gold:           #b8932a;      /* kept */
    --gold-light:     #e8c55a;      /* kept */
    --title-red:      #c0282d;      /* game title color */
    --title-red-glow: #e03535;
    --purple-mid:     #4a2d7a;      /* deep purple highlight */
    --purple-bright:  #7b4fc9;      /* vivid purple for glows */
    --smoke:          #362d4a;
    --ash:            #7a6d8f;
    --glow:           rgba(123,79,201,0.18);

    --font-display:   'Cinzel Decorative', serif;
    --font-heading:   'Cinzel', serif;
    --font-body:      'Crimson Pro', serif;
    --font-fraktur:   'UnifrakturMaguntia', cursive;

    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--ink);
    color: var(--parchment);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ── Texture overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

/* ================================================================
   HEADER
   ================================================================ */
#site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(6,4,14,0.97) 80%, transparent);
    border-bottom: 1px solid rgba(184,147,42,0.2);
    padding: 0 2rem;
    overflow: hidden;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.studio-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--ash);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: color 0.3s;
}
.studio-link:hover { color: var(--gold-light); }
.studio-arrow { font-size: 1rem; transition: transform 0.3s; }
.studio-link:hover .studio-arrow { transform: translateX(-4px); }

.header-title-wrap {
    text-align: center;
    flex: 1;
}

.game-title {
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 1.4vw, 1.2rem);
    font-weight: 900;
    color: var(--title-red);
    letter-spacing: 0.08em;
    text-shadow: 0 0 20px rgba(192,40,45,0.4);
    white-space: nowrap;
}

.game-subtitle-header {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}



.header-nav {
    display: flex;
    gap: 1.5rem;
}
.header-nav a {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ash);
    text-decoration: none;
    transition: color 0.3s;
}
.header-nav a:hover { color: var(--gold-light); }

.header-ink-splat {
    position: absolute;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
}
.splat-1 { width: 200px; height: 200px; background: var(--purple-bright); top: -80px; left: -40px; filter: blur(40px); }
.splat-2 { width: 180px; height: 180px; background: var(--gold); top: -80px; right: -20px; filter: blur(50px); }

/* ================================================================
   HERO
   ================================================================ */
/*#hero {*/
/*    min-height: 100vh;*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*    position: relative;*/
/*    padding: 120px 2rem 80px;*/
/*    background:*/
/*            radial-gradient(ellipse 80% 60% at 50% 40%, rgba(74,45,122,0.18) 0%, transparent 70%),*/
/*            radial-gradient(ellipse 60% 80% at 20% 80%, rgba(61,122,74,0.08) 0%, transparent 60%),*/
/*            linear-gradient(175deg, #0a0810 0%, #100b1e 50%, #080610 100%);*/
/*}*/

#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 2rem 80px;
    background:
            radial-gradient(ellipse 80% 60% at 50% 40%, rgba(74,45,122,0.18) 0%, transparent 70%),
            radial-gradient(ellipse 60% 80% at 20% 80%, rgba(61,122,74,0.08) 0%, transparent 60%),
            linear-gradient(to bottom, rgba(10,8,16,0.55) 0%, rgba(10,8,16,0.75) 100%),
            url('screenshots/bkg.jpg') center center / cover no-repeat fixed;
}

.hero-bg-texture {
    position: absolute;
    inset: 0;
    background-image:
            repeating-linear-gradient(
                    90deg,
                    transparent,
                    transparent 60px,
                    rgba(123,79,201,0.025) 60px,
                    rgba(123,79,201,0.025) 61px
            ),
            repeating-linear-gradient(
                    0deg,
                    transparent,
                    transparent 60px,
                    rgba(123,79,201,0.025) 60px,
                    rgba(123,79,201,0.025) 61px
            );
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-eyebrow {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--ash);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out-expo) 0.2s forwards;
}

.hero-gametitle {
    font-family: var(--font-display);
    font-size: clamp(2rem, 8vw, 8rem);
    font-weight: 900;
    color: var(--title-red);
    line-height: 0.9;
    letter-spacing: -0.02em;
    white-space: nowrap;
    text-shadow:
            0 0 60px rgba(192,40,45,0.45),
            0 4px 0 rgba(0,0,0,0.8),
            0 -2px 0 rgba(224,53,53,0.25);
    opacity: 0;
    animation: fadeUp 1.1s var(--ease-out-expo) 0.4s forwards;
}

.hero-subtitle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.6rem;
    opacity: 0;
    animation: fadeUp 1s var(--ease-out-expo) 0.6s forwards;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 1.8vw, 1rem);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold-light);
    white-space: nowrap;
}

.hero-subtitle-rule {
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(to var(--rule-dir, right), transparent, var(--gold));
}
.hero-subtitle-row .hero-subtitle-rule:last-child {
    --rule-dir: left;
    background: linear-gradient(to left, transparent, var(--gold));
}

.hero-rune-divider {
    font-size: 1.2rem;
    color: var(--gold);
    /*letter-spacing: 1em;*/
    margin: 1.5rem 0;
    opacity: 0;
    animation: fadeIn 1s ease 0.8s forwards;
}

.hero-desc {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-style: italic;
    color: var(--parchment-dark);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation: fadeUp 1s var(--ease-out-expo) 1s forwards;
}

#hero-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp 1s var(--ease-out-expo) 1.2s forwards;
}

.btn {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.9rem 2rem;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s var(--ease-spring), box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--purple-mid);
    color: var(--parchment);
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
    box-shadow: 0 4px 20px rgba(74,45,122,0.5);
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(123,79,201,0.7); background: var(--purple-bright); }

.btn-secondary {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.btn-secondary:hover { background: rgba(184,147,42,0.1); box-shadow: 0 4px 20px rgba(184,147,42,0.2); }

.hero-scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 0.3em;
    color: var(--ash);
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards;
}
.scroll-arrow {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, var(--gold), transparent);
    animation: scrollPulse 2s ease infinite;
}

/* ================================================================
   SECTION LABELS & TITLES
   ================================================================ */
.section-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    text-align: center;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--gold);
    text-align: center;
    margin-bottom: 3rem;
    text-shadow: 0 0 30px rgba(184,147,42,0.25);
}

/* ================================================================
   MEDIA VIEWER
   ================================================================ */
#media {
    padding: 6rem 2rem 5rem;
    background:
            radial-gradient(ellipse 100% 50% at 50% 0%, rgba(74,45,122,0.1) 0%, transparent 60%),
            #100c1e;
    border-top: 1px solid rgba(184,147,42,0.1);
}

.viewer-container {
    max-width: 1100px;
    margin: 0 auto;
}

.viewer-main {
    width: 100%;
    aspect-ratio: 16/9;
    position: relative;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(184,147,42,0.2);
    box-shadow:
            0 0 0 1px rgba(0,0,0,0.8),
            0 20px 60px rgba(0,0,0,0.7),
            0 0 80px rgba(123,79,201,0.2);
}

.viewer-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: #08061a;
    overflow: hidden;
}

/* Decorative corner accents */
.viewer-frame::before,
.viewer-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--gold);
    border-style: solid;
    z-index: 10;
    pointer-events: none;
}
.viewer-frame::before {
    top: 10px; left: 10px;
    border-width: 2px 0 0 2px;
}
.viewer-frame::after {
    bottom: 10px; right: 10px;
    border-width: 0 2px 2px 0;
}

.viewer-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.viewer-item.active {
    opacity: 1;
    pointer-events: auto;
}

.viewer-item iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.viewer-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #0a061800;
}

.viewer-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(to top, rgba(8,6,18,0.9), transparent);
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--parchment-dark);
    text-align: center;
    pointer-events: none;
}

/* Thumbnails */
.thumb-nav {
    background: rgba(184,147,42,0.1);
    border: 1px solid rgba(184,147,42,0.3);
    color: var(--gold);
    width: 36px;
    height: 36px;
    border-radius: 0;
    font-size: 1.4rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.thumb-nav:hover { background: rgba(184,147,42,0.2); }
.thumb-nav:disabled { opacity: 0.2; cursor: default; }

.viewer-thumbs-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;   /* ← clipping goes HERE on the outer wrapper */
}

.viewer-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
    /* NO overflow: hidden here — this element needs to be able to extend */
}

.thumb {
    flex-shrink: 0;
    /* width is set by JS to ensure offset math is exact */
    aspect-ratio: 16/9;
    cursor: pointer;
    border: 2px solid rgba(184,147,42,0.15);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s var(--ease-spring);
    background: #08061a;
    position: relative;
}
.thumb:hover { border-color: rgba(184,147,42,0.5); transform: translateY(-2px); }
.thumb.active { border-color: var(--gold); }
.thumb.active::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px inset rgba(232,197,90,0.3);
    pointer-events: none;
}

.thumb img,
.thumb iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.thumb-video-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74,45,122,0.55);
}
.thumb-video-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--parchment);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.thumb-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
}
.page-dot {
    width: 6px;
    height: 6px;
    background: rgba(184,147,42,0.25);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.page-dot.active {
    background: var(--gold);
    transform: scale(1.4);
}

/* ================================================================
   SCROLL REVEAL SECTIONS
   ================================================================ */
.reveal-section {
    padding: 3rem 2rem;
    overflow: hidden;
}

.reveal-block {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: stretch;
}

/* The sliding panel */
.reveal-inner {
    position: relative;
    width: 100%;
    max-width: 700px;
    background:
            linear-gradient(135deg, rgba(30,18,58,0.95) 0%, rgba(18,10,36,0.98) 100%);
    border: 1px solid rgba(184,147,42,0.2);
    padding: 3rem;
    will-change: transform, opacity;
    transform: translateX(-120%);
    opacity: 0;
    transition:
            transform 0.85s var(--ease-out-expo),
            opacity 0.6s ease;
    box-shadow:
            inset 0 1px 0 rgba(184,147,42,0.15),
            0 20px 60px rgba(0,0,0,0.5);
}

/* Accent bar */
.reveal-inner::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--purple-bright), var(--gold), transparent);
}

.reveal-right .reveal-inner {
    margin-left: auto;
    transform: translateX(120%);
}
.reveal-right .reveal-inner::before {
    left: auto; right: 0;
}

/* When panel has landed, text fades in */
.reveal-content {
    opacity: 0;
    transform: translateY(10px);
    transition:
            opacity 0.5s ease 0.15s,
            transform 0.5s var(--ease-out-expo) 0.15s;
}

/* Triggered state */
.reveal-block.in-view .reveal-inner {
    transform: translateX(0);
    opacity: 1;
}
.reveal-block.in-view .reveal-content {
    opacity: 1;
    transform: translateY(0);
    /* Delay text until panel lands (~0.6s into the 0.85s slide) */
    transition-delay: 0.62s;
}

/* Decorative chapter background watermark */
.reveal-block::before {
    content: attr(data-chapter);
    position: absolute;
    font-family: var(--font-fraktur);
    font-size: 12rem;
    color: rgba(123,79,201,0.04);
    top: 50%;
    right: 2rem;
    transform: translateY(-50%);
    pointer-events: none;
    white-space: nowrap;
    z-index: 0;
}
.reveal-right::before { right: auto; left: 2rem; }

.reveal-eyebrow {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.reveal-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: var(--gold-light);
    line-height: 1.15;
    margin-bottom: 1rem;
}

.reveal-text {
    font-size: 1.05rem;
    color: var(--parchment-dark);
    font-style: italic;
    line-height: 1.8;
}

/* Alternating section backgrounds */
.reveal-section:nth-child(odd) {
    background: linear-gradient(to bottom, #0c0919, #100c1e);
}
.reveal-section:nth-child(even) {
    background: linear-gradient(to bottom, #100c1e, #0c0919);
}

/* ================================================================
   FOOTER
   ================================================================ */
#site-footer {
    position: relative;
    background: #070512;
    border-top: 1px solid rgba(184,147,42,0.1);
    padding: 4rem 2rem 3rem;
    text-align: center;
    overflow: hidden;
}

.footer-rune {
    font-size: 1.5rem;
    color: var(--gold);
    opacity: 0.4;
    margin-bottom: 2rem;
}

.footer-inner {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.footer-studio {
    display: block;
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gold);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: text-shadow 0.3s;
}
.footer-studio:hover { text-shadow: 0 0 20px rgba(184,147,42,0.5); }

.footer-copy {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--ash);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}
.footer-links a {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ash);
    text-decoration: none;
    transition: color 0.3s;
}
.footer-links a:hover { color: var(--gold-light); }

.footer-ink {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(74,45,122,0.12), transparent 70%);
    pointer-events: none;
}

/* ================================================================
   KEYFRAMES
   ================================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
    50%       { opacity: 1;   transform: scaleY(1.2); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .header-inner { height: 60px; }
    .header-nav { display: none; }
    .game-tagline { display: none; }
    .hero-gametitle { font-size: clamp(3rem, 4vw, 5rem); }
    .reveal-inner { padding: 2rem 1.5rem; max-width: 100%; }
    .reveal-title { font-size: 1.3rem; }
    .thumb { width: calc((100% - 0.6rem * 3) / 4); }

    #hero { background-attachment: scroll; }
}

@media (max-width: 500px) {
    .thumb { width: calc((100% - 0.6rem * 2) / 3); }
    .viewer-thumbs-wrap { gap: 0.4rem; }
}

/*@media (max-width: 768px) {*/
/*    .hero-gametitle {*/
/*        font-size: 11vw;*/
/*        display: block;*/
/*        position: static;*/
/*        transform: none;*/
/*        left: auto;*/
/*    }*/
/*}*/