/* ==========================================================================
   UI layer: store buttons, trailers strip + modal, Discord band, splash,
   transparent-then-solid header with a Games dropdown. Loads last.
   ========================================================================== */

/* ----- Studio logo mark in the nav ----- */
.brand-mark {
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #12091c;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 6px 16px -8px rgba(255, 136, 0, 0.6);
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* ----- Header sits on top of the hero / page header, solid once you scroll ----- */
.site-header { transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease; }
.site-header.at-top {
    background: transparent;
    border-bottom-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.hero, .game-head { margin-top: calc(var(--nav-h) * -1); }
.hero { min-height: clamp(580px, 56.25vw, 100vh); padding-top: calc(var(--nav-h) + 60px); }
.game-head { min-height: clamp(560px, 56.25vw, 100vh); padding-top: calc(var(--nav-h) + 56px); }

/* kicker and title stack on their own lines even when the title is inline-block */
.section-head .section-title { display: block; width: fit-content; }

/* ----- Games dropdown ----- */
.nav-drop { position: relative; }
.nav-drop .caret { font-size: 0.7em; opacity: 0.7; }
.drop-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    min-width: 230px;
    padding: 8px;
    background: rgba(20, 24, 28, 0.96);
    border: 1px solid var(--line-2);
    border-radius: 16px;
    box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
/* invisible bridge so the menu doesn't close while the mouse crosses the gap */
.drop-menu::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-drop:hover .drop-menu, .nav-drop:focus-within .drop-menu {
    opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.drop-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s ease;
}
.drop-menu a:hover { background: var(--panel-2); }
.drop-menu a i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }
.drop-menu .drop-all { color: var(--dim); font-weight: 500; font-size: 0.84rem; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.drop-menu .drop-all:hover { color: var(--accent); }
@media (max-width: 600px) {
    .drop-menu, .nav-watch, .nav-drop .caret { display: none; }
    /* keep the phone nav on one line: Games · News · Contact */
    .nav-link[href$="#studio"] { display: none; }
    .nav-inner { gap: 8px; }
    .nav-links { gap: 0; }
    .footer-socials { flex-wrap: wrap; justify-content: center; }
}

/* ----- Store buttons ----- */
.game-head .head-actions { gap: 12px; }
.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px 10px 16px;
    border-radius: 14px;
    background: rgba(11, 13, 16, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.store-btn:hover { transform: translateY(-2px); border-color: var(--c, var(--accent)); box-shadow: 0 14px 30px -14px var(--c, var(--accent)); }
.sb-ico { width: 28px; height: 28px; display: grid; place-items: center; flex: none; }
.sb-ico svg { width: 100%; height: 100%; }
.sb-txt { display: flex; flex-direction: column; line-height: 1.15; }
.sb-txt small { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.sb-txt b { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.store-btn--main { background: var(--c, var(--accent)); border-color: transparent; color: #0b0d10; }
.store-btn--main .sb-txt small { color: rgba(11, 13, 16, 0.7); }
.store-btn--main:hover { filter: brightness(1.08); border-color: transparent; }

/* ----- Trailers strip ----- */
.watch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.watch-card {
    appearance: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    background: var(--panel);
    border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line));
    border-radius: 20px;
    overflow: hidden;
    padding: 0;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.watch-card:hover, .watch-card:focus-visible {
    transform: translateY(-5px);
    border-color: var(--c);
    box-shadow: 0 22px 50px -26px var(--c);
}
.wc-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #000; }
.wc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.watch-card:hover .wc-thumb img { transform: scale(1.06); }
.wc-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--c) 30%, rgba(0, 0, 0, 0.5)), transparent 60%); }
.wc-play {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    display: grid;
    place-items: center;
    padding-left: 3px;
    font-size: 1.15rem;
    color: #0b0d10;
    background: var(--c);
    border-radius: 50%;
    box-shadow: 0 8px 26px -6px var(--c);
    transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.watch-card:hover .wc-play { transform: scale(1.15); }
.wc-meta { display: flex; flex-direction: column; padding: 14px 18px 16px; }
.wc-meta b { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.wc-meta small { color: var(--dim); font-size: 0.82rem; }

/* ----- Video modal ----- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 5, 7, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.video-modal[hidden] { display: none; }
.vm-frame {
    width: min(1100px, 94vw);
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 40px 110px rgba(0, 0, 0, 0.85);
    animation: lightboxIn 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.vm-frame iframe { width: 100%; height: 100%; border: 0; }
.vm-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    background: rgba(11, 13, 16, 0.7);
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.2s ease;
}
.vm-close:hover { transform: rotate(90deg); border-color: var(--accent); }

/* ----- Discord band ----- */
.discord-band {
    border-top: 1px solid var(--line);
    padding: 72px 0;
    background:
        radial-gradient(600px 260px at 12% 50%, rgba(88, 101, 242, 0.16), transparent 70%),
        radial-gradient(500px 240px at 95% 50%, rgba(88, 101, 242, 0.08), transparent 70%);
}
.discord-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.discord-band h2 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-weight: 900; letter-spacing: -0.03em; }
.discord-band p { color: var(--dim); max-width: 52ch; margin-top: 8px; }
.discord-band .kicker { color: #8c96ff; }
.discord-band .kicker::before { background: #8c96ff; }
.discord-band .btn-primary { background: #5865f2; color: #fff; box-shadow: 0 4px 0 #3c46b5, 0 10px 26px -10px rgba(88, 101, 242, 0.7); }
.discord-band .btn-primary:hover { background: #6a76f5; box-shadow: 0 6px 0 #3c46b5, 0 16px 30px -10px rgba(88, 101, 242, 0.8); }
.discord-band .btn-primary:active { box-shadow: 0 1px 0 #3c46b5; }
.dc-count { color: var(--green); font-weight: 700; white-space: nowrap; }
.dc-count::before { content: '●'; margin-right: 6px; font-size: 0.7em; vertical-align: 1px; }

/* ----- Splash (homepage, once per session) ----- */
.splash-overlay { display: none; }
html.splash .splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg);
    animation: splashOut 0.6s ease 1.5s forwards;
}
html.splash .splash-overlay .brand-mark {
    width: 56px; height: 56px; font-size: 1.9rem; border-radius: 15px;
    animation: splashPop 0.8s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.splash-word { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.04em; animation: splashWord 0.7s ease 0.15s both; }
.splash-word i { font-style: normal; color: var(--accent); }
@keyframes splashPop { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } to { transform: rotate(-6deg); opacity: 1; } }
@keyframes splashWord { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { html.splash .splash-overlay { display: none; } }

/* ----- Latest devlogs ----- */
.devlog-row {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 6px 4px 22px;
    margin: 0 -4px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}
.devlog-card {
    appearance: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    flex: none;
    width: 230px;
    scroll-snap-align: start;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    padding: 0;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.devlog-card:not(.is-short) { width: 340px; }
.devlog-card:hover, .devlog-card:focus-visible {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 22px 50px -28px rgba(250, 204, 21, 0.6);
}
.dl-thumb { position: relative; display: block; aspect-ratio: 9 / 16; overflow: hidden; background: #000; }
.devlog-card:not(.is-short) .dl-thumb { aspect-ratio: 16 / 9; }
.dl-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.devlog-card:hover .dl-thumb img { transform: scale(1.05); }
.dl-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent 55%); }
.dl-play {
    position: absolute; z-index: 1; left: 50%; top: 50%;
    width: 48px; height: 48px; margin: -24px 0 0 -24px;
    display: grid; place-items: center; padding-left: 3px;
    font-size: 1rem; color: #0b0d10; background: var(--accent); border-radius: 50%;
    box-shadow: 0 8px 24px -6px rgba(250, 204, 21, 0.7);
    transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.devlog-card:hover .dl-play { transform: scale(1.15); }
.dl-tag {
    position: absolute; z-index: 1; top: 10px; left: 10px;
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(11, 13, 16, 0.7); border: 1px solid rgba(255, 255, 255, 0.18);
}
.dl-meta { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 16px; }
.dl-meta b { font-size: 0.95rem; font-weight: 700; line-height: 1.3; }
.dl-meta small { color: var(--dim); font-size: 0.8rem; }
.devlog-more { margin-top: 10px; }

/* portrait popup for Shorts */
.vm-frame.portrait { width: auto; height: min(86vh, 900px); aspect-ratio: 9 / 16; max-width: 94vw; }

/* ----- Share button ----- */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    min-height: 52px;
    font: 700 0.95rem/1 var(--font);
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.share-btn svg { width: 18px; height: 18px; }
.share-btn:hover { border-color: var(--c, var(--accent)); color: var(--c, var(--accent)); transform: translateY(-2px); }

/* ----- Phone screenshot cycling on cards (no hover there) ----- */
.card-shots { position: absolute; inset: 0; pointer-events: none; }
.card-shots img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.9s ease; }
.card-shots img.on { opacity: 1; }

@media (max-width: 980px) {
    .hero, .game-head { min-height: 0; }
    .hero { padding-top: calc(var(--nav-h) + 48px); }
    .game-head { padding-top: calc(var(--nav-h) + 40px); }
}
