@font-face {
    font-family: "Kalam";
    src: url("../fonts/Kalam-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Khula";
    src: url("../fonts/Khula-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-bg: #f3efe6;
    --color-bg-elevated: #fffcf7;
    --color-surface: #e7e1d4;
    --color-text: #1a1414;
    --color-text-muted: #5c5550;
    --color-accent: #780000;
    --color-accent-hover: #9a0000;
    --color-border: rgba(26, 20, 20, 0.1);
    --color-border-strong: rgba(26, 20, 20, 0.18);
    --font-karasu: "Kalam", cursive;
    --font-studio: "Khula", sans-serif;
    --font-display: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --space: 1.25rem;
    --max: 72rem;
    --header-h: 4.5rem;
    --radius: 0.75rem;
    --shadow: 0 18px 40px rgba(26, 20, 20, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.65;
}

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

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

a:hover {
    color: var(--color-accent-hover);
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4.25rem);
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

h3 {
    font-size: 1.35rem;
}

p {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    background: var(--color-accent);
    color: #fff;
    padding: 0.5rem 0.75rem;
    z-index: 100;
}

.skip-link:focus {
    top: 1rem;
}

.wrap {
    width: min(100% - 2.5rem, var(--max));
    margin-inline: auto;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    background: rgba(243, 239, 230, 0.92);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

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

.brand:hover {
    color: var(--color-text);
}

.brand img {
    width: 3.1rem;
    height: 3.1rem;
}


.brand .brand-name,
.footer-brand .brand-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    line-height: 0.95;
}

.brand-karasu {
    font-family: var(--font-karasu);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.brand .brand-karasu,
.footer-brand .brand-karasu {
    font-size: 1.35rem;
    padding-top: 0.2em;
}

.brand-studio {
    font-family: var(--font-studio);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.brand .brand-studio,
.footer-brand .brand-studio {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
}

.eyebrow .brand-name {
    color: var(--color-text);
}

.eyebrow .brand-karasu {
    font-size: 1.15rem;
}

.eyebrow .brand-studio {
    font-size: 0.85rem;
    color: var(--color-accent);
}

.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 0.4rem;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    position: relative;
    margin: 0 auto;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle span::before {
    top: -6px;
}

.nav-toggle span::after {
    top: 6px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav a,
.site-nav .nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.site-nav a:hover,
.site-nav .nav-btn:hover,
.site-nav a.is-active {
    color: var(--color-text);
    background: var(--color-surface);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 14rem;
    padding: 0.4rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.nav-dropdown.is-open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
    display: grid;
}

.nav-dropdown-menu a {
    border-radius: 0.45rem;
}

.chevron {
    width: 0.55rem;
    height: 0.55rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
}

/* Main */
.site-main {
    flex: 1;
}

.hero {
    padding: clamp(3.5rem, 10vw, 7rem) 0 3rem;
}

.hero p {
    max-width: 38rem;
    font-size: 1.15rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.btn-ghost {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn-ghost:hover {
    border-color: var(--color-text-muted);
    color: var(--color-text);
}

.section {
    padding: 2.5rem 0 5rem;
}

.section-intro {
    max-width: 36rem;
    margin-bottom: 2rem;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow:has(.brand-name) {
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
    gap: 1.5rem;
}

.game-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) + 0.15rem);
    overflow: hidden;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-border-strong);
    color: inherit;
}

.game-card-cover {
    aspect-ratio: 16 / 10;
    background: var(--color-surface);
    overflow: hidden;
}

.game-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.15rem 1.2rem 1.3rem;
    flex: 1;
}

.game-card-body h3 {
    margin: 0;
}

.game-card-body p {
    margin: 0;
    flex: 1;
    font-size: 0.95rem;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--color-border-strong);
    color: var(--color-text-muted);
}

.badge.is-live {
    border-color: color-mix(in srgb, var(--color-accent) 50%, transparent);
    color: var(--color-accent);
}

/* Game detail */
.game-hero {
    padding: 3.5rem 0 4.5rem;
}

.game-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 2.5rem;
    align-items: center;
}

.game-hero-cover {
    border-radius: calc(var(--radius) + 0.25rem);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.game-hero-cover img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.page-header {
    padding: 3.5rem 0 1rem;
}

.page-header p {
    max-width: 36rem;
}

.contact-panel,
.prose {
    max-width: 40rem;
}

.contact-email {
    display: inline-block;
    margin: 0.5rem 0 1.5rem;
    font-size: 1.25rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-accent);
}

.contact-email:hover {
    color: var(--color-accent-hover);
}

.form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.form input,
.form textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-strong);
    background: var(--color-bg-elevated);
    color: var(--color-text);
    font: inherit;
}

.form textarea {
    min-height: 9rem;
    resize: vertical;
}

.form input:focus,
.form textarea:focus {
    outline: 2px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
    outline-offset: 1px;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(46, 125, 90, 0.2);
    border: 1px solid rgba(46, 125, 90, 0.4);
}

.alert-error {
    background: rgba(180, 60, 50, 0.18);
    border: 1px solid rgba(180, 60, 50, 0.4);
}

.prose p,
.prose li {
    color: var(--color-text-muted);
}

.prose ul {
    padding-left: 1.2rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 0 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-copy {
    margin: 0;
    justify-self: start;
    text-align: left;
}

.footer-brand .brand-karasu,
.footer-brand .brand-studio {
    color: var(--color-text);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
    justify-self: end;
}

.footer-links a {
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-text);
}

.prose a {
    color: var(--color-text);
    border-bottom: 1px solid var(--color-accent);
}

.prose a:hover {
    color: var(--color-accent-hover);
}

@media (max-width: 800px) {
    .footer-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .footer-copy,
    .footer-links {
        justify-self: center;
        text-align: center;
        justify-content: center;
    }

    .game-hero {
        padding-top: 2rem;
    }

    .game-hero-inner {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.75rem 1.25rem 1.25rem;
        background: var(--color-bg-elevated);
        border-bottom: 1px solid var(--color-border);
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        min-width: 0;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 0 0 0 0.75rem;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: grid;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.is-open:hover .nav-dropdown-menu {
        display: grid;
    }
}
