/*
 * Chrome shared by every page: the palette, the fonts, the room the page sits in,
 * the drifting cat, the header and the footer. Anything a single page alone needs
 * stays inline in that page.
 */

/* The game's own display and UI faces, self-hosted so the site needs no third party. */
@font-face {
    font-family: 'Titan One';
    src: url('/fonts/TitanOne-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka';
    src: url('/fonts/Fredoka.ttf') format('truetype');
    font-weight: 300 700;
    font-display: swap;
}

/*
 * The blues are sampled straight out of the game's own home-screen backdrop, so the
 * page and the app read as the same room. Two text systems, because the page has two
 * surfaces: light type over the blue room, dark type inside the white panels.
 */
:root {
    --room: #5B8FEE;
    --room-bright: #7AAFF2;
    --room-deep: #4768DA;
    --room-floor: #5D63E5;
    --wall: #415ECF;

    --panel: rgba(255, 255, 255, 0.93);
    --panel-soft: rgba(255, 255, 255, 0.78);
    --panel-line: rgba(21, 36, 73, 0.12);
    --panel-shadow: 0 10px 30px rgba(14, 25, 60, 0.18);

    /* Inside a white panel. */
    --text: #152449;
    --muted: #4C5C87;
    --link: #1567C8;

    /* Directly over the blue room. */
    --on-room: #FFFFFF;
    --on-room-muted: #DCE7FF;
    --on-room-shadow: 0 2px 10px rgba(12, 24, 62, 0.42);

    /* The game's own material tints, kept for anything that stands for a device. */
    --liquid: #2C86D8;
    --liquid-deep: #0D4E92;
    --liquid-rim: #BFE0FF;
    --liquid-glow: #6FC7FF;
    --frozen: #2E7F99;
    --device: #8A7C5C;
    --hazard: #D6455C;
    --exit: #1E9E52;
    --lantern: #FFB14E;

    --display: 'Titan One', 'Fredoka', system-ui, sans-serif;
    --body: 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body);
    background: var(--room);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/*
 * The room itself — the same painted backdrop the game opens on. Its side columns
 * fall either side of the content column at any width, and the flat middle is what
 * the page is actually read against.
 */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
            linear-gradient(180deg, rgba(80, 131, 233, 0.35) 0%, rgba(122, 175, 242, 0.08) 45%, rgba(93, 99, 229, 0.4) 100%),
            url('/images/bg-room.webp') center / cover no-repeat,
            var(--room);
}

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.2px;
}

a {
    color: var(--link);
}

section {
    padding: 4.2rem 0;
}

/*
 * Text that sits over the room needs a surface of its own. White on the bright blue
 * measures 2.3:1 — nowhere near readable — so chrome text gets the same deep-blue
 * glass the game puts its own UI on, which brings it to about 7:1.
 */
.on-room-panel {
    background: rgba(13, 30, 78, 0.62);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(9, 20, 54, 0.28);
}

.section-head {
    max-width: 44rem;
    margin-bottom: 2.6rem;
    padding: 1.5rem 1.7rem;
    color: var(--on-room);
    background: rgba(13, 30, 78, 0.62);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(9, 20, 54, 0.28);
}

.section-head h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    margin-bottom: 0.7rem;
}

.section-head p {
    color: var(--on-room-muted);
    font-size: 1.05rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(6px);
}

.card h3 {
    font-size: 1.12rem;
    margin-bottom: 0.55rem;
    color: var(--text);
}

.card p {
    color: var(--muted);
    font-size: 0.96rem;
}

/* ---------- the cat drifting behind the page ---------- */
/*
 * Mizu pours across the room behind the content: right, drop, right, drop — the same
 * shape a swipe makes in the game. He is under everything (z-index below the content)
 * and never takes a pointer event, so he cannot get between a reader and a word.
 */
.mizu-drift {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 190px;
    height: 190px;
    pointer-events: none;
    opacity: 0.5;
    will-change: transform;
    animation: mizuPour 54s linear infinite;
}

.mizu-drift .mizu-body {
    transform-origin: 50% 62%;
    animation: mizuWobble 3.4s ease-in-out infinite;
}

.mizu-drift--far {
    width: 96px;
    height: 96px;
    opacity: 0.3;
    animation-duration: 78s;
    animation-delay: -26s;
}

.mizu-drift--far .mizu-body {
    animation-duration: 4.6s;
}

@keyframes mizuPour {
    0%   { transform: translate(-14vw, 12vh); }
    18%  { transform: translate(34vw, 12vh); }
    26%  { transform: translate(34vw, 46vh); }
    46%  { transform: translate(78vw, 46vh); }
    54%  { transform: translate(78vw, 74vh); }
    72%  { transform: translate(30vw, 74vh); }
    80%  { transform: translate(30vw, 24vh); }
    100% { transform: translate(-24vw, 24vh); }
}

@keyframes mizuWobble {
    0%, 100% { transform: scale(1, 1); }
    30%      { transform: scale(1.09, 0.9); }
    62%      { transform: scale(0.94, 1.07); }
}

/* ---------- header ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-line);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--display);
    font-size: 1.35rem;
    color: var(--text);
    text-decoration: none;
}

.logo img {
    width: 42px;
    height: 42px;
    border-radius: 11px;
}

.logo span {
    color: var(--liquid);
}

nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.98rem;
    transition: color 0.2s;
}

nav a:hover, nav a:focus-visible {
    color: var(--link);
}

.nav-cta {
    font-family: var(--display);
    font-size: 0.9rem;
    color: #FFFFFF !important;
    background: var(--liquid);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(44, 134, 216, 0.35);
}

.nav-cta:hover {
    background: var(--liquid-deep);
}

/* ---------- footer ---------- */
footer {
    background: rgba(13, 30, 78, 0.62);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    padding: 2.4rem 0 3rem;
    color: var(--on-room-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--on-room);
}

.footer-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.footer-links {
    display: flex;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--liquid-rim);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    nav a:not(.nav-cta) {
        display: none;
    }

    /* A phone is mostly content; one small cat is enough life behind it. */
    .mizu-drift {
        width: 120px;
        height: 120px;
        opacity: 0.34;
    }

    .mizu-drift--far {
        display: none;
    }
}

@media (max-width: 560px) {
    section {
        padding: 3rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .mizu-drift,
    .mizu-drift .mizu-body {
        animation: none;
    }

    .mizu-drift {
        transform: translate(6vw, 30vh);
    }

    .mizu-drift--far {
        transform: translate(74vw, 62vh);
    }
}
