/* ════════════════════════════════════════════
   DWAMDWA — Design System
   Branding: warm cream / forest green / soft amber
   ════════════════════════════════════════════ */

:root {
    /* Backgrounds */
    --bg-primary:       #F4EFE3;
    --bg-alt:           #EDE8DC;
    --bg-dark:          #1F2A22;
    --bg-dark-mid:      #243028;

    /* Brand */
    --brand-primary:    #2F4A3A;
    --brand-moss:       #6C8B5D;
    --brand-earth:      #7B5A43;
    --brand-acorn:      #A67B4E;
    --brand-amber:      #E1B45A;
    --brand-amber-dim:  rgba(225, 180, 90, 0.15);
    --brand-amber-glow: rgba(225, 180, 90, 0.3);
    --brand-red:        #B95E4A;

    /* Text */
    --text-primary:     #2B2B2B;
    --text-secondary:   #5B5B5B;
    --text-muted:       #8C846E;
    --text-on-dark:     #F0EBE0;
    --text-muted-dark:  rgba(240, 235, 224, 0.5);

    /* Rules */
    --rule-light:       rgba(43, 43, 43, 0.12);
    --rule-brand:       rgba(47, 74, 58, 0.2);

    /* Typography */
    --font-heading: 'Literata', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;
    --font-jav:     'Noto Serif Javanese', serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    opacity: 1;
    transition: opacity 600ms ease-in;
}
body.page-loading { opacity: 0; }

/* Paper grain overlay — SVG feTurbulence, no external asset */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.045;
    pointer-events: none;
    z-index: 9999;
}

/* No-JS: ensure fade-in sections are visible */
.no-js .fade-in-section {
    opacity: 1 !important;
    transform: none !important;
}

/* ════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: linear-gradient(to bottom, rgba(244,239,227,0.97) 0%, rgba(244,239,227,0) 100%);
    padding: 1.25rem 2rem;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.header-logo img {
    width: 28px;
    height: 28px;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.header-nav a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.25s;
}
.header-nav a:hover { color: var(--brand-primary); }

/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 7rem 2rem 5rem;
    text-align: center;
    position: relative;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 720px;
}

.hero-illustration {
    width: 100%;
    max-width: 720px;
    margin-bottom: 2.5rem;
}

.hero-scene {
    width: 100%;
    height: auto;
    aspect-ratio: 2048 / 734;
    display: block;
}

.hero-eyebrow {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand-moss);
    margin-bottom: 1.25rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 500;
    line-height: 1.15;
    color: var(--brand-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.hero-cta {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--bg-primary);
    background: var(--brand-primary);
    padding: 0.85rem 2.5rem;
    transition: background 0.25s, transform 0.2s;
}
.hero-cta:hover {
    background: var(--brand-moss);
    transform: translateY(-1px);
}

/* ════════════════════════════════════════════
   PHILOSOPHY
   ════════════════════════════════════════════ */
.philosophy-section {
    background: var(--bg-alt);
    padding: 6rem 2rem;
    border-top: 1px solid var(--rule-light);
}

.philosophy-inner {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.section-eyebrow {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--brand-moss);
    margin-bottom: 1rem;
}

.philosophy-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 500;
    line-height: 1.2;
    color: var(--brand-primary);
    margin-bottom: 1.75rem;
}

.philosophy-body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.philosophy-pillars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 2rem;
}

.pillar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--brand-earth);
    letter-spacing: 0.04em;
}

.pillar-mark {
    color: var(--brand-amber);
    font-size: 1.1rem;
    line-height: 1;
}

/* ════════════════════════════════════════════
   GAMES
   ════════════════════════════════════════════ */
.games-section {
    background: var(--bg-primary);
    padding: 6rem 2rem 7rem;
    border-top: 1px solid var(--rule-light);
}

.games-inner {
    max-width: 680px;
    margin: 0 auto;
}

.games-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 3rem;
}

/* Game card */
.game-card {
    border-top: 1px solid var(--rule-brand);
    padding-top: 2rem;
}

.game-card-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.game-name {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.01em;
}

.game-tagline {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-style: italic;
    color: var(--brand-earth);
    height: 2.8rem;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-self: flex-start;
}

.tag {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--rule-brand);
    color: var(--brand-primary);
    background: transparent;
}

.game-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ────── Codex preview ────── */
.codex-preview {
    background: var(--bg-alt);
    border: 1px solid var(--rule-brand);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.codex-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.7rem;
    background: var(--bg-alt);
}

.codex-campaign-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.codex-campaign-title {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-primary);
}

.codex-turn-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.62rem;
    color: var(--text-muted);
}

.turn-arrow { opacity: 0.5; font-size: 0.9rem; }
.turn-label { letter-spacing: 0.04em; }

.codex-timer {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-body);
    font-size: 0.62rem;
    color: var(--text-muted);
}

.codex-gold-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--brand-amber) 30%, var(--brand-amber) 70%, transparent 100%);
    opacity: 0.45;
}

.codex-players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--rule-light);
}

.player-dots { display: flex; gap: 0.5rem; align-items: center; }

.player-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--font-body);
    font-size: 0.6rem;
    color: var(--text-muted);
}
.player-dot::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dot-color, #aaa);
}
.player-dot::after { content: attr(data-name); }
.player-dot--you { font-weight: 600; }

.codex-act-label {
    font-family: var(--font-body);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.codex-scene-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 1rem 0.35rem;
}

.codex-scene-title {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--text-primary);
    opacity: 0.7;
    text-transform: uppercase;
}

.codex-page-label {
    font-family: var(--font-body);
    font-size: 0.58rem;
    color: var(--text-muted);
}

.codex-illustration {
    position: relative;
    width: 100%;
    height: 160px;
    background: var(--bg-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--rule-light);
    border-bottom: 1px solid var(--rule-light);
}
.hatch-fill { position: absolute; inset: 0; width: 100%; height: 100%; }

.illustration-label {
    position: relative;
    z-index: 1;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 0.35rem 0.85rem;
    opacity: 0.85;
}

.codex-narrative {
    padding: 1.1rem 1rem 0.9rem;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.codex-input-row {
    display: flex;
    align-items: stretch;
    margin: 0 1rem 1rem;
    border: 1px solid var(--rule-light);
}

.codex-input-field {
    flex: 1;
    padding: 0 0.75rem;
    height: 2.8rem;
    background: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.codex-input-text {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catchphrase-text.javanese-script {
    font-family: var(--font-jav);
    font-style: normal;
    font-size: 0.9em;
}

.catchphrase-text.glitch {
    animation: mini-glitch 0.35s ease;
}
@keyframes mini-glitch {
    0%   { opacity: 1; transform: translate(0); }
    25%  { opacity: 0.5; transform: translate(-1px, 1px); }
    50%  { opacity: 0.25; transform: translate(1px, -1px); }
    75%  { opacity: 0.6; transform: translate(-1px, 0); }
    100% { opacity: 1; transform: translate(0); }
}

.codex-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    background: var(--brand-primary);
    color: var(--bg-primary);
    font-size: 1.1rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.25s;
}
.codex-submit-btn:hover { background: var(--brand-moss); }

.codex-cta-block {
    display: block;
    background: var(--brand-primary);
    color: var(--bg-primary);
    text-align: center;
    padding: 0.85rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.25s;
}
.codex-cta-block:hover {
    background: var(--brand-amber);
    color: var(--brand-primary);
}

/* ════════════════════════════════════════════
   MASCOTS
   ════════════════════════════════════════════ */
.mascots-section {
    background: var(--bg-alt);
    padding: 6rem 2rem;
    border-top: 1px solid var(--rule-light);
}

.mascots-inner {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.mascots-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 0.75rem;
}

.mascots-intro {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 3.5rem;
}

.mascots-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.mascot-card {
    flex: 1;
    max-width: 300px;
    text-align: center;
}

.mascot-art {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
}

.mascot-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mascot-name {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 0.25rem;
}

.mascot-role {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-moss);
    margin-bottom: 0.85rem;
}

.mascot-desc {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.75;
    color: var(--text-secondary);
}

.mascot-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.mascot-divider-symbol {
    font-size: 1.5rem;
    color: var(--brand-amber);
    opacity: 0.6;
}

/* ════════════════════════════════════════════
   STUDIO
   ════════════════════════════════════════════ */
.studio-section {
    background: var(--bg-dark);
    padding: 6rem 2rem;
    border-top: 1px solid rgba(47,74,58,0.4);
}

.studio-inner {
    max-width: 640px;
    margin: 0 auto;
}

.studio-section .section-eyebrow {
    color: var(--brand-moss);
}

.studio-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 500;
    color: var(--text-on-dark);
    margin-bottom: 2rem;
}

.studio-story {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.studio-story p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.85;
    color: var(--text-muted-dark);
}

.studio-story em {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--brand-amber);
    opacity: 0.9;
    font-style: italic;
}

/* ════════════════════════════════════════════
   FOUNDERS
   ════════════════════════════════════════════ */
.founders-section {
    background: var(--bg-dark-mid);
    padding: 5rem 2rem;
    border-top: 1px solid rgba(47,74,58,0.4);
}

.founders-inner {
    max-width: 720px;
    margin: 0 auto;
}

.founders-section .section-eyebrow {
    color: var(--brand-moss);
    margin-bottom: 2.5rem;
}

.founders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: rgba(47,74,58,0.3);
    border: 1px solid rgba(47,74,58,0.3);
}

.founder-card {
    background: var(--bg-dark);
    padding: 2rem;
}

.founder-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-on-dark);
    margin-bottom: 0.2rem;
}

.founder-role {
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-moss);
    margin-bottom: 1rem;
}

.founder-bio {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-muted-dark);
}

/* ════════════════════════════════════════════
   PRESS
   ════════════════════════════════════════════ */
.press-section {
    background: var(--bg-primary);
    padding: 6rem 2rem;
    border-top: 1px solid var(--rule-light);
}

.press-inner {
    max-width: 640px;
    margin: 0 auto;
}

.press-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 500;
    color: var(--brand-primary);
    margin-bottom: 0.75rem;
}

.press-intro {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.press-quote {
    background: var(--bg-alt);
    border-left: 3px solid var(--brand-amber);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
}

.press-quote p {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.press-quote cite {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: normal;
    letter-spacing: 0.04em;
}

.press-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--rule-light);
    border: 1px solid var(--rule-light);
    margin-bottom: 2rem;
}

.press-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-primary);
}

.press-item-label {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.press-item-status {
    font-family: var(--font-body);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.press-contact {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--rule-brand);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.press-contact:hover {
    color: var(--brand-amber);
    border-color: var(--brand-amber);
}

/* ════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════ */
.site-footer {
    background: var(--bg-dark);
    border-top: 1px solid rgba(47,74,58,0.4);
    padding: 3.5rem 2rem 2.5rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

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

.footer-logo {
    width: 32px;
    height: 32px;
    opacity: 0.65;
}

.footer-oneliner {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-style: italic;
    color: var(--text-muted-dark);
}

.footer-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-nav a {
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: rgba(240,235,224,0.35);
    text-decoration: none;
    transition: color 0.25s;
}
.footer-nav a:hover { color: var(--brand-amber); }

.footer-copy {
    font-family: var(--font-body);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: rgba(240,235,224,0.2);
}

/* ════════════════════════════════════════════
   SCROLL FADE-IN
   ════════════════════════════════════════════ */
.js .fade-in-section {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}
.js .fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 640px) {
    .header-nav { gap: 1.25rem; }
    .header-nav a { font-size: 0.75rem; }

    .hero-sub br { display: none; }

    .mascots-grid {
        flex-direction: column;
        gap: 2.5rem;
    }
    .mascot-divider { display: none; }
    .mascot-card { max-width: 100%; }

    .press-grid { grid-template-columns: 1fr; }

    .founders-grid { grid-template-columns: 1fr; }

    .footer-nav { gap: 1.25rem; }

    .game-card-meta { flex-direction: column; }
    .game-tags { align-self: auto; }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 1rem;
    }
    .header-nav a { font-size: 0.7rem; }
}
