/* ==========================================================================
   ESCAPE CALL - Lightweight Optimized Stylesheet
   ========================================================================== */

@font-face {
    font-family: "Roboto Local";
    font-display: swap;
    font-weight: 100 900;
    src: url("/assets/fonts/google-roboto-latin-variable.woff2") format("woff2");
}

@font-face {
    font-family: "Shadows Into Light Local";
    font-display: swap;
    font-weight: 400 700;
    src: url("/assets/fonts/google-shadows-into-light-latin-400.woff2") format("woff2");
}

:root {
    --ec-blue: #0C71C3;
    --ec-sky: #2ea3f2;
    --ec-purple: #8300E9;
    --ec-green: #7CDA24;
    --ec-dark: #242424;
    --ec-white: #FFFFFF;
    --ec-text: #666666;
    --ec-font-sans: "Roboto Local", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ec-font-hand: "Shadows Into Light Local", cursive, sans-serif;
    --ec-container: 1140px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--ec-font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--ec-text);
    background-color: var(--ec-blue);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 200;
    padding: 12px 18px;
    background-color: #ffffff;
    color: var(--ec-blue);
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 16px;
    outline: 3px solid var(--ec-purple);
    outline-offset: 2px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: var(--ec-container);
    margin: 0 auto;
    padding: 0 32px;
}

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 28px 0;
    background: transparent;
}

.site-header__inner {
    width: 100%;
    max-width: var(--ec-container);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-header__logo {
    display: inline-block;
    width: 185px;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-header__logo:hover {
    transform: scale(1.03);
    opacity: 0.92;
}

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav__link {
    color: var(--ec-white);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.03em;
    padding: 6px 2px;
    position: relative;
    transition: opacity 0.2s ease;
}

.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background-color: var(--ec-white);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s ease;
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
    transform: scaleX(1);
}

.site-nav__link:hover {
    opacity: 0.88;
}

.site-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.site-header__toggle-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--ec-white);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar:nth-child(2) {
    opacity: 0;
}
.site-header__toggle[aria-expanded="true"] .site-header__toggle-bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   Animations (Divi-faithful bounce, slide, slideTop)
   ========================================================================== */

@keyframes ecBounce {
    0%, 20%, 40%, 60%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.08, 1.08, 1.08);
    }
    40% {
        transform: scale3d(0.94, 0.94, 0.94);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.98, 0.98, 0.98);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

@keyframes ecSlide {
    0% {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes ecSlideTop {
    0% {
        opacity: 0;
        transform: translate3d(0, -18px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.anim-ready[data-anim] {
    opacity: 0;
}

.anim-played[data-anim="bounce"] {
    animation: ecBounce 1000ms ease-in-out forwards;
}

.anim-played[data-anim="slide"] {
    animation: ecSlide 1000ms ease-in-out forwards;
}

.anim-played[data-anim="slideTop"] {
    animation: ecSlideTop 600ms ease-in-out forwards;
}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */

.home-hero {
    position: relative;
    min-height: 100vh;
    padding: 96px 0 90px;
    background-color: #164873;
    background-image: url("/assets/img/illust_web03-1920.png.webp");
    background-image: image-set(
        url("/assets/img/illust_web03-1920.png.webp") type("image/webp"),
        url("/assets/img/illust_web03-1920.png") type("image/png")
    );
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.34) 100%);
    pointer-events: none;
}

.home-hero > .container {
    position: relative;
    z-index: 1;
}

.home-hero__logo-wrap {
    text-align: center;
    margin-bottom: 54px;
}

.home-hero__logo-wrap img {
    margin: 0 auto;
    width: min(720px, 88vw);
    height: auto;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

.home-hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}

.postit-card {
    background-image: linear-gradient(154deg, #ffffe2 10%, #ffcb2e 12%, #ffcb2e 92%, #e36d04 94% 100%);
    background-color: #ffcb2e;
    padding: 40px 56px;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 14px 26px -6px rgba(0, 0, 0, 0.42);
    text-align: center;
    font-family: var(--ec-font-hand);
    font-weight: 700;
    color: #000000;
    font-size: 30px;
    line-height: 1.4;
    border-radius: 2px;
}

.postit-card p {
    margin: 0 0 18px;
}

.postit-card p:last-child {
    margin-bottom: 0;
}

.home-hero__cta {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.home-hero__cta-label {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    color: var(--ec-white);
    line-height: 1.3;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7), 0 0 4px rgba(0, 0, 0, 0.5);
}

.play-game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    max-width: 100%;
    padding: 32px 24px;
    background-color: var(--ec-white);
    color: var(--ec-purple);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 6px solid var(--ec-blue);
    border-radius: 30px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, background-color 0.2s ease;
}

.play-game-btn:hover,
.play-game-btn:focus-visible {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.36);
    background-color: #fbf7ff;
    outline: none;
}

.play-game-btn:active {
    transform: translateY(0) scale(0.99);
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */

.site-footer {
    background-color: #084d87;
    color: rgba(255, 255, 255, 0.88);
    padding: 26px 0;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.site-footer__brand {
    margin: 0;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.site-footer__nav a {
    color: rgba(255, 255, 255, 0.92);
    transition: opacity 0.2s ease;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
    opacity: 0.75;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ==========================================================================
   FORMS & BUTTONS
   ========================================================================== */

.ec-form__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ec-input,
.ec-textarea {
    width: 100%;
    padding: 15px 18px;
    font-family: var(--ec-font-sans);
    font-size: 15px;
    color: #333333;
    background-color: var(--ec-white);
    border: 0;
    border-radius: 3px;
    transition: box-shadow 0.2s ease;
}

.ec-input::placeholder,
.ec-textarea::placeholder {
    color: #888888;
}

.ec-input:focus,
.ec-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 163, 242, 0.55);
}

.ec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: var(--ec-font-sans);
    font-size: 18px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ec-btn--outline {
    width: 100%;
    color: var(--ec-white);
    background-color: transparent;
    border: 2px solid var(--ec-white);
}

.ec-btn--outline:hover,
.ec-btn--outline:focus-visible {
    background-color: rgba(255, 255, 255, 0.16);
    outline: none;
}

.ec-btn--submit {
    color: var(--ec-white);
    background-color: rgba(255, 255, 255, 0.14);
    border: 2px solid var(--ec-white);
    min-width: 140px;
}

.ec-btn--submit:hover,
.ec-btn--submit:focus-visible {
    background-color: var(--ec-white);
    color: var(--ec-blue);
    outline: none;
}

.ec-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.ec-btn__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: ecSpin 0.7s linear infinite;
}

.ec-btn.is-loading .ec-btn__spinner {
    display: inline-block;
}

@keyframes ecSpin {
    to { transform: rotate(360deg); }
}

.ec-form__feedback {
    display: none;
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
}

.ec-form__feedback.is-success {
    display: block;
    background-color: rgba(124, 218, 36, 0.22);
    border: 1px solid #7CDA24;
    color: var(--ec-white);
}

.ec-form__feedback.is-error {
    display: block;
    background-color: rgba(255, 92, 92, 0.24);
    border: 1px solid #ff8a8a;
    color: var(--ec-white);
}

/* ==========================================================================
   GAMES PAGE
   ========================================================================== */

.games-hero {
    min-height: 100vh;
    background-color: var(--ec-blue);
    padding: 150px 0 96px;
    color: var(--ec-white);
}

.games-hero__logo-link {
    display: inline-block;
    max-width: 640px;
    margin-bottom: 36px;
    transition: transform 0.22s ease;
}

.games-hero__logo-link:hover {
    transform: scale(1.02);
}

.games-hero__content {
    max-width: 560px;
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.95);
}

.games-hero__content p {
    margin: 0 0 18px;
}

.games-hero__actions {
    margin-top: 32px;
}

/* ==========================================================================
   TALK TO A HUMAN (PLAY PAGE)
   ========================================================================== */

.tth-intro {
    background-color: var(--ec-blue);
    padding: 170px 0 64px;
}

.tth-intro__grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: start;
}

.tth-intro__card {
    background-color: var(--ec-white);
    padding: 0 56px 52px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.tth-intro__logo {
    width: 68%;
    max-width: 390px;
    margin: -82px auto 28px;
}

.tth-intro__card p {
    margin: 0 0 18px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--ec-text);
}

.tth-intro__card p:last-child {
    margin-bottom: 0;
}

.tth-intro__aside {
    padding: 40px 12px;
    color: var(--ec-white);
    font-size: 18px;
    line-height: 1.8;
}

.tth-intro__aside p {
    margin: 0 0 18px;
}

.tth-stage {
    background-color: var(--ec-blue);
    padding: 0 0 88px;
}

.tth-stage__frame {
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 0;
    background-color: #2c1e16;
    background-image: url("/assets/img/bg-wooden-table-1200.jpg.webp");
    background-image: image-set(
        url("/assets/img/bg-wooden-table-1200.jpg.webp") type("image/webp"),
        url("/assets/img/bg-wooden-table-1200.jpg") type("image/jpeg")
    );
    background-size: cover;
    background-position: center;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   ABOUT PAGE
   ========================================================================== */

.about-hero {
    background-color: var(--ec-blue);
    padding: 150px 0 84px;
    color: var(--ec-white);
}

.about-hero__grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    align-items: center;
}

.about-hero__title {
    margin: 0 0 24px;
    font-size: 40px;
    font-weight: 700;
    color: var(--ec-white);
}

.about-hero__text p {
    margin: 0 0 18px;
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.95);
}

.about-hero__text p:last-child {
    margin-bottom: 0;
}

.about-hero__art img {
    margin: 0 auto;
    width: min(440px, 100%);
}

.about-project {
    position: relative;
    background-color: var(--ec-white);
    padding: 150px 0 96px;
}

.about-project__wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-image: url("/assets/img/about-wave.svg");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    pointer-events: none;
}

.about-project__grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 56px;
    align-items: center;
}

.about-project__logo {
    display: block;
    max-width: 400px;
    margin: 0 auto;
    transition: transform 0.22s ease;
}

.about-project__logo:hover {
    transform: scale(1.03);
}

.about-project__card {
    background-color: var(--ec-green);
    padding: 44px 48px;
    text-align: center;
    color: #2f4a12;
    font-size: 16px;
    line-height: 1.7;
}

.about-project__card p {
    margin: 0 0 18px;
}

.about-project__card p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   CONTACT PAGE
   ========================================================================== */

.contact-hero {
    position: relative;
    min-height: 100vh;
    background-color: var(--ec-blue);
    padding: 155px 0 96px;
    color: var(--ec-white);
    overflow: hidden;
}

.contact-hero__mask {
    position: absolute;
    inset: 0;
    background-image: url("/assets/img/contact-mask.svg");
    background-size: calc(100% + 2px) calc(100% + 2px);
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.contact-hero > .container {
    position: relative;
    z-index: 1;
}

.contact-hero__title {
    margin: 0 0 40px;
    font-size: 40px;
    font-weight: 700;
    color: var(--ec-white);
}

.contact-hero__grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 56px;
    align-items: start;
}

.contact-blurb {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.contact-blurb__icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: var(--ec-white);
}

.contact-blurb__label {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ec-white);
}

.contact-blurb__value {
    color: var(--ec-white);
    font-size: 16px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.contact-form-panel__title {
    margin: 0 0 18px;
    font-size: 26px;
    font-weight: 700;
    color: #2b2b2b;
}

.contact-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.contact-form .ec-input,
.contact-form .ec-textarea {
    background-color: #eeeeee;
}

.contact-form .ec-textarea {
    min-height: 165px;
    resize: vertical;
}

.contact-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

/* ==========================================================================
   404 PAGE
   ========================================================================== */

.not-found {
    min-height: 100vh;
    background-color: var(--ec-blue);
    color: var(--ec-white);
    display: flex;
    align-items: center;
    padding: 140px 0 80px;
    text-align: center;
}

.not-found h1 {
    font-size: clamp(56px, 10vw, 96px);
    margin: 0 0 12px;
    line-height: 1;
}

.not-found p {
    font-size: 20px;
    margin: 0 auto 32px;
    max-width: 520px;
    color: rgba(255, 255, 255, 0.9);
}

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

@media (max-width: 980px) {
    .home-hero {
        background-attachment: scroll;
        padding: 72px 0 72px;
    }

    .home-hero__grid,
    .tth-intro__grid,
    .about-hero__grid,
    .about-project__grid,
    .contact-hero__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .postit-card {
        padding: 32px 28px;
        font-size: 25px;
    }

    .tth-intro__card {
        padding: 0 28px 36px;
    }

    .tth-intro__aside {
        padding: 0;
    }

    .contact-form__row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container,
    .site-header__inner {
        padding: 0 20px;
    }

    .site-header__toggle {
        display: flex;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 20px;
        right: 20px;
        background-color: rgba(12, 113, 195, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 12px;
        padding: 16px 24px;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    }

    .site-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .site-nav__list {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .home-hero__cta-label {
        font-size: 26px;
    }

    .play-game-btn {
        width: 280px;
        padding: 24px 20px;
        font-size: 28px;
    }

    .about-hero__title,
    .contact-hero__title {
        font-size: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .anim-ready[data-anim] {
        opacity: 1;
    }
    .anim-played[data-anim] {
        animation: none !important;
    }
}
