/* ==========================================================================
   PetaniAI — Design System v3.0  ·  Smart casual
   Hero stays painterly + CRT pixel.  Body refined: modern type, soft shadows.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Geist:wght@300;400;500;600;700&family=VT323&family=JetBrains+Mono:wght@400;500;700&display=swap");

/* ---------- Tokens — Terminal Forest palette ---------- */
:root {
    /* Backgrounds — cool neutral off-white */
    --cream: #f7f6f2;          /* page bg — cool paper */
    --cream-soft: #fbfaf6;     /* card bg — nearly white */
    --cream-deep: #ebeae4;     /* inset / kbd bg — light gray */
    --paper: #f7f6f2;          /* text on dark surfaces — near white */

    /* Brand greens (unchanged — primary anchor) */
    --green: #033f2a;
    --green-deep: #022d1e;
    --green-mid: #0c5a3e;

    /* Browns — kept for pixel-art continuity (farmer skin, dialog box border) */
    --brown: #89694a;
    --brown-soft: #b69774;
    --brown-deep: #5e4730;

    /* Body + secondary text — charcoal + slate (Terminal Forest) */
    --ink: #2a2a2a;            /* body text — charcoal, softer than pure black */
    --muted: #6e7270;          /* secondary text + eyebrows — slate */
    --line: #dcdbd4;           /* hairline borders — neutral light-gray */

    /* Accents — muted amber (Stripe-docs feel) */
    --gold: #d4a84a;           /* primary accent on light surfaces */
    --gold-warm: #e6bc65;      /* lighter amber for text/eyebrows on dark surfaces */

    /* Atmospheric / scene palette (hero scenes only — keep specific hex stack) */
    --sky-cyan: #25a4c4;
    --sky-low: #f4ecd8;
    --sky-warm: #f0c98f;
    --sky-pink: #e9a786;
    --sun: #fff1c4;
    --hill-far: #6e8a87;
    --hill-mid: #5a8266;
    --hill-near: #3f5e3f;
    --paddy-1: #9bbb6e;
    --paddy-2: #6e8c4a;

    /* Type */
    --font-display: "Fraunces", "PP Eiko", Georgia, serif;
    --font-body: "Geist", "Inter", system-ui, sans-serif;
    --font-pixel: "VT323", "Courier New", monospace;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Layout */
    --nav-h: 64px;
    --max-w: 1180px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Soft, warm shadows (smart casual) */
    --shadow-sm: 0 1px 2px rgba(94, 71, 48, 0.06),
        0 1px 1px rgba(94, 71, 48, 0.04);
    --shadow-md: 0 6px 18px -10px rgba(94, 71, 48, 0.35),
        0 2px 4px -2px rgba(94, 71, 48, 0.1);
    --shadow-lg: 0 24px 48px -24px rgba(94, 71, 48, 0.4),
        0 4px 10px -6px rgba(137, 105, 74, 0.15);

    /* Pixel-style shadows kept for HERO-only emphasis */
    --shadow-px: 0 3px 0 0 var(--brown-deep);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 180ms;
    --dur-base: 320ms;
    --dur-slow: 600ms;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    background: var(--cream);
    background-image:
        radial-gradient(900px 500px at 88% -10%, rgba(212, 168, 74, 0.08), transparent 60%),
        radial-gradient(800px 600px at -8% 110%, rgba(3, 63, 42, 0.06), transparent 60%);
    background-attachment: fixed;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img.pixel,
.pixel-art img,
.pixel-art canvas,
.pixel-art svg {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

a {
    color: var(--green);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--green-mid); }

button { font-family: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--green);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 0;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2.1vw, 1.55rem); }

p {
    margin: 0;
    color: color-mix(in oklab, var(--ink) 92%, transparent);
}

/* Refined eyebrow — JetBrains Mono, sage muted (Greenhouse) */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}

.eyebrow .dot {
    color: var(--brown);
    margin: 0 0.4em;
}

code,
.mono,
.tabular {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* ---------- Layout ---------- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

@media (min-width: 768px) {
    .container { padding: 0 40px; }
}

section {
    position: relative;
    padding: 88px 0;
}

@media (max-width: 640px) {
    section { padding: 56px 0; }
}

/* ---------- Buttons (refined: soft shadows) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 11px 22px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition:
        transform var(--dur-fast) var(--ease-out),
        background var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out);
    text-decoration: none;
    line-height: 1.2;
}

.btn:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.btn-primary {
    background: var(--green);
    color: var(--paper);
    box-shadow: 0 8px 22px -10px rgba(3, 63, 42, 0.55);
}

.btn-primary:hover {
    background: var(--green-mid);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -10px rgba(3, 63, 42, 0.55);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent;
    color: var(--green);
    border-color: var(--line);
}

.btn-secondary:hover {
    background: rgba(3, 63, 42, 0.04);
    border-color: var(--brown);
}

.btn-ghost {
    background: transparent;
    color: var(--green);
    padding: 10px 14px;
}

.btn-ghost:hover { background: rgba(3, 63, 42, 0.06); }

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ---------- Nav ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 50;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: color-mix(in oklab, var(--cream) 82%, transparent);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.28rem;
    color: var(--green);
    letter-spacing: -0.01em;
}

.brand .logo-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--green);
    color: var(--gold-warm);
    border-radius: 7px;
    box-shadow: 0 1px 2px rgba(3, 63, 42, 0.3);
    transition: transform var(--dur-base) var(--ease-out);
}

.brand:hover .logo-icon { transform: rotate(-6deg) scale(1.05); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
    color: var(--green);
    font-size: 0.93rem;
    transition: background var(--dur-fast);
}

.nav-links a.active,
.nav-links a:hover { background: rgba(3, 63, 42, 0.06); }

.nav-cta { display: flex; align-items: center; gap: 8px; }

.nav-burger {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--green);
    cursor: pointer;
    transition: background var(--dur-fast);
}

.nav-burger:hover { background: rgba(3, 63, 42, 0.06); }

.mobile-panel {
    position: fixed;
    top: var(--nav-h);
    left: 12px;
    right: 12px;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 49;
    display: none;
    transform: translateY(-8px);
    opacity: 0;
    transition:
        transform var(--dur-base) var(--ease-out),
        opacity var(--dur-base) var(--ease-out);
}

.mobile-panel.open {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--green);
}

.mobile-panel a + a { margin-top: 2px; }
.mobile-panel a:hover { background: rgba(3, 63, 42, 0.06); }

@media (max-width: 768px) {
    .nav-links,
    .nav-cta .btn:not(.nav-cta-mobile) { display: none; }
    .nav-burger { display: inline-flex; }
}

/* ==========================================================================
   ATMOSPHERE — CRT scanlines, halftone dither, vignette, grain
   Layered ONLY over hero / banner scenes.
   ========================================================================== */

.crt-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    background: repeating-linear-gradient(
        0deg,
        rgba(20, 18, 12, 0.14) 0 1px,
        transparent 1px 3px
    );
    mix-blend-mode: multiply;
    opacity: 0.7;
    animation: crt-flicker 4s steps(1) infinite;
}

.crt-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        120% 80% at 50% 50%,
        transparent 50%,
        rgba(20, 12, 0, 0.35) 100%
    );
    mix-blend-mode: multiply;
}

@keyframes crt-flicker {
    0%, 96%, 100% { opacity: 0.7; }
    97% { opacity: 0.55; }
    98% { opacity: 0.78; }
    99% { opacity: 0.6; }
}

.dither-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'><rect width='1' height='1' fill='%23000' opacity='.32'/><rect x='2' y='2' width='1' height='1' fill='%23000' opacity='.18'/></svg>");
    background-size: 4px 4px;
    mix-blend-mode: multiply;
    opacity: 0.55;
}

.vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    box-shadow: inset 0 0 180px rgba(20, 12, 0, 0.55),
        inset 0 -60px 80px rgba(20, 12, 0, 0.4);
}

.grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
    opacity: 0.18;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    mix-blend-mode: multiply;
}

/* ==========================================================================
   HERO — Ghibli-painted rice paddy at golden hour
   ========================================================================== */

.hero {
    position: relative;
    margin-top: var(--nav-h);
    height: clamp(540px, 86vh, 800px);
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--line);
}

.hero-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: #1a2b22; /* fallback while video loads */
    overflow: hidden;
}

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-video > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-scene::before {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: 46%;
    height: 22%;
    background:
        radial-gradient(closest-side at 8% 100%, rgba(110, 138, 135, 0.7) 0 70px, transparent 71px),
        radial-gradient(closest-side at 22% 100%, rgba(110, 138, 135, 0.7) 0 90px, transparent 91px),
        radial-gradient(closest-side at 40% 100%, rgba(110, 138, 135, 0.65) 0 80px, transparent 81px),
        radial-gradient(closest-side at 60% 100%, rgba(110, 138, 135, 0.7) 0 100px, transparent 101px),
        radial-gradient(closest-side at 78% 100%, rgba(110, 138, 135, 0.65) 0 75px, transparent 76px),
        radial-gradient(closest-side at 95% 100%, rgba(110, 138, 135, 0.7) 0 90px, transparent 91px);
    filter: blur(2px);
    opacity: 0.85;
    pointer-events: none;
}

.hero-scene::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: 40%;
    height: 18%;
    background:
        radial-gradient(closest-side at 14% 100%, var(--hill-mid) 0 60px, transparent 61px),
        radial-gradient(closest-side at 32% 100%, var(--hill-mid) 0 80px, transparent 81px),
        radial-gradient(closest-side at 52% 100%, var(--hill-mid) 0 70px, transparent 71px),
        radial-gradient(closest-side at 72% 100%, var(--hill-mid) 0 95px, transparent 96px),
        radial-gradient(closest-side at 90% 100%, var(--hill-mid) 0 70px, transparent 71px);
    filter: blur(0.8px);
    opacity: 0.92;
    pointer-events: none;
}

.hero-paddies {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    bottom: 0;
    z-index: 1;
}

.hero-paddies > div {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 3px solid rgba(60, 50, 30, 0.55);
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18),
        0 4px 0 rgba(40, 36, 22, 0.35);
}

.hero-paddies > .p-water {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.18) 0 4px,
            transparent 4px 12px
        ),
        linear-gradient(180deg, #b6d2c1 0%, #84ad9a 60%, #5e8579 100%);
}

.hero-paddies > .p-rice {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.06) 0 4px,
            transparent 4px 14px
        ),
        linear-gradient(180deg, var(--paddy-1) 0%, var(--paddy-2) 100%);
}

.hero-paddies > .p-rice.warm {
    background:
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.06) 0 4px,
            transparent 4px 14px
        ),
        linear-gradient(180deg, #b8b665 0%, #8e8a48 100%);
}

.hero-path {
    position: absolute;
    right: 0;
    bottom: 0;
    width: clamp(160px, 22vw, 300px);
    height: 36%;
    z-index: 2;
    background: repeating-linear-gradient(
        180deg,
        #8a5a30 0 14px,
        #5e3a1c 14px 18px,
        #8a5a30 18px 32px,
        #6e4520 32px 36px
    );
    border-left: 4px solid #4a2e16;
    transform: skewX(-2deg);
    box-shadow: inset 0 6px 0 rgba(0, 0, 0, 0.18);
}

.hero-falls {
    position: absolute;
    left: 5%;
    top: 32%;
    width: 60px;
    height: 32%;
    z-index: 1;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.6) 0 4px,
        rgba(220, 235, 240, 0.85) 4px 8px,
        rgba(255, 255, 255, 0.55) 8px 12px
    );
    filter: blur(0.6px);
    border-radius: 8px 8px 0 0;
    box-shadow:
        0 0 24px rgba(255, 255, 255, 0.4),
        inset 0 -10px 12px rgba(255, 255, 255, 0.6);
    animation: falls-flow 1.4s linear infinite;
}

@keyframes falls-flow {
    0% { background-position: 0 0; }
    100% { background-position: 0 -32px; }
}

.hero-sun {
    position: absolute;
    top: 14%;
    left: 22%;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, var(--sun), #f5c576 70%);
    box-shadow: 0 0 90px 30px rgba(255, 217, 156, 0.55);
    z-index: 1;
    animation: floatY 6s var(--ease-in-out) infinite;
}

.cloud {
    position: absolute;
    background: rgba(255, 250, 235, 0.85);
    border-radius: 999px;
    box-shadow:
        24px 6px 0 -4px rgba(255, 250, 235, 0.85),
        48px 4px 0 -8px rgba(255, 250, 235, 0.85),
        -24px 6px 0 -6px rgba(255, 250, 235, 0.85);
    filter: blur(0.5px);
    z-index: 1;
    animation: drift 22s linear infinite;
}

@keyframes drift {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(30px); }
}

/* Hero text */
.hero-content {
    position: relative;
    z-index: 6;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: clamp(48px, 12vh, 120px);
    text-align: center;
}

.hero-eyebrow {
    color: var(--gold-warm);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
    margin-bottom: 18px;
    animation: fadeUp var(--dur-slow) var(--ease-out) both;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.hero h1 {
    color: var(--paper);
    text-shadow: 0 2px 32px rgba(2, 30, 18, 0.55);
    max-width: 18ch;
    margin: 0 auto;
    animation: fadeUp 700ms 80ms var(--ease-out) both;
}

.hero-typer {
    color: var(--gold-warm);
    position: relative;
    display: inline-block;
    min-height: 1em;
    line-height: 1;
}

.hero-typer::after {
    content: "▌";
    margin-left: 4px;
    color: var(--gold-warm);
    font-weight: 400;
    animation: caret 0.8s steps(2) infinite;
}

@keyframes caret { 50% { opacity: 0; } }

.hero-sub {
    margin-top: 18px;
    color: rgba(255, 250, 240, 0.86);
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
    animation: fadeUp 700ms 200ms var(--ease-out) both;
}

.hero-ctas {
    margin-top: 28px;
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 700ms 320ms var(--ease-out) both;
}

.hero-ctas .btn-secondary {
    background: rgba(232, 221, 203, 0.08);
    color: var(--paper);
    border-color: rgba(232, 221, 203, 0.55);
    backdrop-filter: blur(6px);
}

.hero-ctas .btn-secondary:hover {
    background: var(--paper);
    color: var(--green);
    border-color: var(--paper);
}

/* Farmer */
.farmer-wrap {
    position: absolute;
    right: clamp(16px, 6vw, 80px);
    bottom: clamp(20px, 6vh, 60px);
    z-index: 7;
}

/* Wrap defines a fixed-height slot so both sprites render at the SAME size
   (height-based) regardless of their individual aspect ratios. */
.farmer-wrap {
    position: absolute;
    height: clamp(150px, 20vw, 220px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.farmer {
    height: 100%;
    width: auto;
    cursor: pointer;
    transition: transform var(--dur-base) var(--ease-out), opacity 180ms;
    filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.4));
    animation: floatY 5s var(--ease-in-out) infinite;
}

.farmer-stand { position: relative; opacity: 1; }

.farmer-wave {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
}

.farmer-wrap:hover .farmer-stand { opacity: 0; }
.farmer-wrap:hover .farmer-wave  { opacity: 1; }
.farmer-wrap:hover .farmer       { transform: translateY(-6px) scale(1.04); }
.farmer-wrap:hover .farmer-wave  { transform: translateX(-50%) translateY(-6px) scale(1.04); }

.speech-bubble {
    position: absolute;
    right: 100%;
    bottom: 70%;
    margin-right: 16px;
    background: var(--paper);
    color: var(--green);
    padding: 10px 14px;
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 1.05rem;
    border: 3px solid var(--brown-deep);
    box-shadow: 0 4px 0 0 var(--brown-deep);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    pointer-events: none;
    transition:
        opacity var(--dur-base),
        transform var(--dur-base) var(--ease-out);
}

.speech-bubble::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 14px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--paper);
    filter: drop-shadow(0 3px 0 var(--brown-deep));
}

.farmer-wrap:hover .speech-bubble,
.farmer-wrap.show-bubble .speech-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
    .speech-bubble {
        font-size: 0.92rem;
        right: auto;
        left: 0;
        bottom: 100%;
        margin: 0 0 12px 0;
    }
}

/* ---------- Cards (refined) ---------- */
.cards-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 44px;
}

.card {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--dur-base) var(--ease-out),
        box-shadow var(--dur-base) var(--ease-out),
        border-color var(--dur-base) var(--ease-out);
    position: relative;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in oklab, var(--brown) 45%, transparent);
}

.card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--green);
    color: var(--gold-warm);
    border-radius: 10px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px -2px rgba(3, 63, 42, 0.4);
    transition: transform var(--dur-base) var(--ease-out);
}

.card:hover .card-icon { transform: rotate(-3deg) scale(1.03); }

.card h3 { margin-bottom: 6px; }

.card p { font-size: 0.96rem; }

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-weight: 600;
    color: var(--green);
    font-size: 0.93rem;
}

.card-link svg { transition: transform var(--dur-fast); }
.card-link:hover svg { transform: translateX(3px); }

/* ---------- Footer ---------- */
.footer {
    background: var(--green-deep);
    color: var(--paper);
    padding: 64px 0 24px;
    margin-top: 56px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0 8px,
        transparent 8px 16px
    );
    opacity: 0.5;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.footer h4 {
    color: var(--gold-warm);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
    font-weight: 500;
}

.footer ul { list-style: none; margin: 0; padding: 0; }

.footer li + li { margin-top: 8px; }

.footer a {
    color: rgba(239, 229, 210, 0.78);
    font-size: 0.95rem;
}

.footer a:hover { color: var(--gold-warm); }

.footer-tag {
    color: rgba(239, 229, 210, 0.78);
    margin-top: 14px;
    max-width: 32ch;
    line-height: 1.55;
    font-size: 0.95rem;
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 22px;
    border-top: 1px solid rgba(239, 229, 210, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: rgba(239, 229, 210, 0.6);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 30, 18, 0.55);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: translateY(12px) scale(0.96);
    transition: transform var(--dur-base) var(--ease-out);
}

.modal-backdrop.open .modal {
    transform: translateY(0) scale(1);
}

.modal h3 { margin-bottom: 8px; }

.modal-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--brown);
    float: right;
    margin: -8px -8px 0 0;
}

/* ---------- Field (form inputs) ---------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.field label {
    font-weight: 500;
    color: var(--green);
    font-size: 0.92rem;
}

.field input,
.field textarea,
.field select {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--green);
    transition:
        border-color var(--dur-fast),
        box-shadow var(--dur-fast),
        background var(--dur-fast);
    width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(3, 63, 42, 0.1);
    background: #fff;
}

/* ---------- Reveal animations ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 700ms var(--ease-out),
        transform 700ms var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Section helpers ---------- */
.section-head {
    max-width: 720px;
}

.section-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.section-head h2 + p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 56ch;
}

.section-divider {
    height: 1px;
    background: var(--line);
    margin: 0;
}

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
    position: relative;
    margin-top: var(--nav-h);
    height: clamp(360px, 52vh, 480px);
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--line);
}

.page-hero .hero-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.page-hero .container {
    position: relative;
    z-index: 6;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 48px;
}

.page-hero h1 {
    color: var(--paper);
    font-size: clamp(2.3rem, 4.6vw, 3.4rem);
    text-shadow: 0 2px 22px rgba(2, 30, 18, 0.6);
    max-width: 22ch;
}

.page-hero .eyebrow {
    color: var(--gold-warm);
    margin-bottom: 12px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}

.page-hero p {
    margin-top: 16px;
    color: rgba(255, 250, 240, 0.9);
    max-width: 60ch;
    text-shadow: 0 1px 14px rgba(2, 30, 18, 0.5);
    font-size: 1.05rem;
}

.scene-resources .hero-scene,
.scene-about .hero-scene {
    background: #1a2b22 url("assets/page_banner.png") center / cover no-repeat;
}

/* Pixel decoration band (between page hero and content) */
.pixel-band {
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--green) 0 8px,
        var(--gold) 8px 16px,
        var(--brown) 16px 24px,
        var(--green-mid) 24px 32px
    );
    opacity: 0.55;
}

/* ==========================================================================
   FOUNDERS — static 2-card layout, one bubble each
   ========================================================================== */

.founders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .founders-grid { grid-template-columns: 1fr; }
}

.founder-card {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform var(--dur-base), box-shadow var(--dur-base);
}

.founder-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.founder-card .head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.founder-card .portrait {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    background: var(--cream-deep);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.founder-card .meta h3 {
    font-size: 1.25rem;
    line-height: 1.1;
}

.founder-card .meta .role {
    font-family: var(--font-mono);
    letter-spacing: 0.14em;
    color: var(--brown-deep);
    font-size: 0.75rem;
    margin-top: 6px;
    text-transform: uppercase;
}

.founder-card .bubble {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--green);
    padding: 16px 18px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
}

.founder-card .bubble::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 24px;
    width: 12px;
    height: 12px;
    background: var(--paper);
    border-left: 1px solid var(--line);
    border-top: 1px solid var(--line);
    transform: rotate(45deg);
}

/* ---------- Misc ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(3, 63, 42, 0.06);
    color: var(--green);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}

.kbd {
    font-family: var(--font-mono);
    background: var(--cream-deep);
    color: var(--brown-deep);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.88rem;
    border: 1px solid var(--line);
}

.divider-rice {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 24px auto;
    color: var(--brown);
    font-family: var(--font-mono);
    letter-spacing: 0.18em;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.divider-rice::before,
.divider-rice::after {
    content: "";
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* Window-chrome (kept for resources hidden behind, etc.) */
.window {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.window-bar {
    background: var(--green);
    color: var(--gold-warm);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    text-transform: uppercase;
}

.window-bar .dots {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.window-bar .dots span {
    width: 8px;
    height: 8px;
    background: var(--gold-warm);
    border-radius: 50%;
}

.window-bar .dots span:nth-child(2) { background: var(--paper); }
.window-bar .dots span:nth-child(3) { background: var(--brown-soft); }

.window-body { padding: 24px; }

/* ==========================================================================
   NPC DIALOG — Stardew-style cozy game dialog box
   Two portrait buttons side by side, click to start their lines,
   click dialog box to advance/skip.
   ========================================================================== */

.npc-stage {
    max-width: 720px;
    margin: 0 auto;
}

/* Portrait buttons — character-select tiles */
.npc-portraits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.npc-portrait {
    appearance: none;
    background: var(--cream-soft);
    border: 3px solid var(--brown);
    border-radius: 10px;
    padding: 18px 14px 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 0 0 var(--brown);
    font-family: var(--font-body);
    transition:
        transform var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        background var(--dur-fast),
        border-color var(--dur-fast);
    position: relative;
}

.npc-portrait:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 0 0 var(--brown);
    background: var(--paper);
}

.npc-portrait:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}

.npc-portrait.is-active {
    border-color: var(--green);
    background: var(--paper);
    box-shadow: 0 5px 0 0 var(--green);
    transform: translateY(-2px);
}

.npc-portrait.is-active::after {
    content: "▾";
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--green);
    font-size: 1.4rem;
    animation: portrait-bob 1.2s var(--ease-in-out) infinite;
}

@keyframes portrait-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(3px); }
}

.npc-portrait .pixel-frame {
    width: 88px;
    height: 88px;
    background: var(--cream-deep);
    border: 2px solid var(--brown-deep);
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.npc-portrait .pixel-frame svg {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    width: 84px;
    height: 84px;
}

.npc-portrait .name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--green);
    font-size: 1.15rem;
    line-height: 1;
    margin-top: 4px;
}

.npc-portrait .role {
    font-family: var(--font-mono);
    color: var(--brown-deep);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Dialog box — Stardew style */
.npc-dialog {
    position: relative;
    background: var(--cream-soft);
    border: 3px solid var(--brown-deep);
    border-radius: 10px;
    padding: 28px 28px 32px;
    min-height: 200px;
    box-shadow: 0 6px 0 0 var(--brown-deep);
    cursor: pointer;
    user-select: none;
    margin-top: 20px;
    transition: transform var(--dur-fast);
}

.npc-dialog:hover {
    transform: translateY(-1px);
}

.npc-dialog::before {
    /* inner dashed pixel border, classic JRPG style */
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed color-mix(in oklab, var(--brown) 45%, transparent);
    border-radius: 6px;
    pointer-events: none;
}

/* Name tag pinned to top-left */
.npc-name-tag {
    position: absolute;
    top: -14px;
    left: 22px;
    background: var(--green);
    color: var(--gold-warm);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 6px;
    border: 2px solid var(--green-deep);
    box-shadow: 0 2px 0 0 var(--green-deep);
    white-space: nowrap;
}

.npc-text {
    font-family: var(--font-pixel);
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    line-height: 1.5;
    color: var(--green);
    margin-top: 6px;
    min-height: 110px;
    word-break: break-word;
}

.npc-text::after {
    content: "▌";
    margin-left: 2px;
    color: var(--brown);
    animation: caret 0.7s steps(2) infinite;
}

.npc-dialog.is-done .npc-text::after { content: none; }

/* Blinking ▼ "continue" arrow appears when typing is finished */
.npc-continue {
    position: absolute;
    right: 22px;
    bottom: 14px;
    color: var(--brown-deep);
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    animation: continue-bob 0.9s var(--ease-in-out) infinite;
}

.npc-dialog.is-done .npc-continue {
    opacity: 1;
}

@keyframes continue-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(4px); }
}

/* Bottom hint instruction */
.npc-hint {
    margin-top: 18px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--brown-deep);
    text-transform: uppercase;
    opacity: 0.85;
}

.npc-hint kbd {
    background: var(--cream-deep);
    border: 1px solid var(--line);
    color: var(--green);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    margin: 0 2px;
}

/* End-of-script state: show a friendlier instruction */
.npc-dialog.is-end .npc-continue {
    animation: none;
    opacity: 1;
    color: var(--green);
}

.npc-dialog.is-end .npc-continue::after {
    content: " ⟲";
    margin-left: 2px;
}

@media (max-width: 480px) {
    .npc-portrait { padding: 14px 10px 10px; }
    .npc-portrait .pixel-frame { width: 72px; height: 72px; }
    .npc-portrait .pixel-frame svg { width: 68px; height: 68px; }
    .npc-text { font-size: 1.1rem; }
}

/* ==========================================================================
   LUMA CALENDAR EMBED — single full-width iframe with fallback overlay
   All events come from the user's Luma calendar (no hardcoded data).
   ========================================================================== */

.luma-embed {
    position: relative;
    margin-top: 36px;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    min-height: 480px;
}

.luma-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--cream-soft);
}

.luma-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    text-align: center;
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0 12px,
            rgba(110, 114, 112, 0.04) 12px 24px
        ),
        linear-gradient(180deg, var(--cream-soft) 0%, var(--cream) 100%);
    z-index: 1;
    pointer-events: auto;
}

.luma-fallback-inner {
    max-width: 480px;
    color: var(--green);
}

.luma-fallback-inner svg {
    margin: 0 auto;
    color: var(--green);
    opacity: 0.7;
}

.luma-fallback-inner p code.kbd {
    margin: 0 2px;
}

.luma-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    z-index: 2;
}

/* (legacy custom calendar widget styles — kept for any other view that uses them) */
.luma-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    margin-top: 36px;
    align-items: start;
}

@media (max-width: 900px) {
    .luma-grid { grid-template-columns: 1fr; }
}

/* Events list (left) */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.events-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.events-list-head .label {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--brown-deep);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.events-empty,
.events-loading {
    background: var(--cream-soft);
    border: 1px dashed color-mix(in oklab, var(--brown) 35%, transparent);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    line-height: 1.6;
}

.events-loading {
    animation: events-pulse 1.4s ease-in-out infinite;
}

@keyframes events-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.event-row {
    position: relative;
}

.event-row > a.event-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-indent: -9999px;
    overflow: hidden;
}

.event-row {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 0;
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    transition:
        transform var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out);
}

.event-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in oklab, var(--brown) 55%, transparent);
}

.event-row .date-block {
    background: linear-gradient(180deg, var(--green) 0%, var(--green-mid) 100%);
    color: var(--paper);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px;
    text-align: center;
    font-family: var(--font-mono);
    border-right: 1px solid var(--green-deep);
}

.event-row .date-block .day {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 700;
    color: var(--gold-warm);
}

.event-row .date-block .month {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    margin-top: 6px;
    text-transform: uppercase;
    opacity: 0.85;
}

.event-row .date-block .dow {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    margin-top: 2px;
    text-transform: uppercase;
    opacity: 0.6;
}

.event-row .body-block {
    padding: 14px 18px 16px;
    min-width: 0;
}

.event-row .meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--brown-deep);
    letter-spacing: 0.1em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.event-row h3 {
    font-size: 1.08rem;
    margin-bottom: 4px;
    line-height: 1.2;
}

.event-row p {
    font-size: 0.92rem;
    line-height: 1.5;
    color: color-mix(in oklab, var(--ink) 82%, transparent);
}

/* Calendar widget (right column) */
.cal-widget {
    background: var(--cream-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cal-header .label {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--green);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}

.cal-nav {
    display: flex;
    gap: 4px;
}

.cal-nav button {
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    background: var(--cream);
    color: var(--green);
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background var(--dur-fast), border-color var(--dur-fast);
    font-family: var(--font-mono);
    line-height: 1;
}

.cal-nav button:hover {
    background: rgba(3, 63, 42, 0.06);
    border-color: var(--brown);
}

.cal-nav button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-dow {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    color: var(--brown-deep);
    letter-spacing: 0.12em;
    padding: 8px 0 6px;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.7;
}

.cal-day {
    appearance: none;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--green);
    cursor: pointer;
    transition:
        background var(--dur-fast),
        color var(--dur-fast),
        border-color var(--dur-fast);
    background: transparent;
    border: 1px solid transparent;
    position: relative;
    line-height: 1;
    padding: 0;
}

.cal-day.empty {
    cursor: default;
    pointer-events: none;
    opacity: 0;
}

.cal-day:hover:not(.empty):not(.no-event) {
    background: rgba(3, 63, 42, 0.06);
}

.cal-day.no-event {
    cursor: default;
    color: color-mix(in oklab, var(--ink) 38%, transparent);
}

.cal-day.has-event { font-weight: 600; }

.cal-day.has-event::after {
    content: "";
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    margin-top: 3px;
}

.cal-day.is-today {
    border-color: color-mix(in oklab, var(--brown) 55%, transparent);
}

.cal-day.is-selected {
    background: var(--green);
    color: var(--paper);
    font-weight: 700;
}

.cal-day.is-selected::after {
    background: var(--gold-warm);
}

.cal-day:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
}

.cal-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.cal-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--brown-deep);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cal-legend::before {
    content: "";
    width: 5px;
    height: 5px;
    background: var(--gold);
    border-radius: 50%;
}

.cal-clear {
    appearance: none;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--green);
    border-radius: 6px;
    padding: 5px 10px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    text-transform: uppercase;
    transition: background var(--dur-fast), border-color var(--dur-fast);
}

.cal-clear:hover {
    background: rgba(3, 63, 42, 0.06);
    border-color: var(--brown);
}

.cal-clear[hidden] { display: none; }

/* ==========================================================================
   FOUNDERS v2 — bare portraits (no container) + single paragraph dialog
   ========================================================================== */

.np-row {
    display: flex;
    justify-content: center;
    gap: clamp(40px, 8vw, 96px);
    margin: 32px auto 0;
}

.np-portrait {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    transition:
        transform var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast);
    color: var(--green);
    font-family: var(--font-body);
    position: relative;
}

.np-portrait:hover { transform: translateY(-2px); }

.np-portrait svg,
.np-portrait img {
    width: clamp(120px, 16vw, 160px);
    height: auto;
    border-radius: 12px;
    transition: filter var(--dur-fast), transform var(--dur-fast);
    filter: drop-shadow(0 4px 6px rgba(94, 71, 48, 0.18));
}

.np-portrait img {
    object-fit: cover;
    aspect-ratio: 3 / 4;
    background: var(--cream-soft);
    border: 1px solid var(--line);
}

.np-portrait:hover svg,
.np-portrait:hover img {
    filter: drop-shadow(0 6px 10px rgba(94, 71, 48, 0.28))
            brightness(1.04);
}

.np-portrait .np-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 8px;
}

.np-portrait .np-role {
    font-family: var(--font-mono);
    color: var(--brown-deep);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-top: 2px;
}

.np-portrait:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 6px;
    border-radius: 8px;
}

/* Active portrait gets the bobbing arrow + name underlines */
.np-portrait.is-active::after {
    content: "▾";
    color: var(--green);
    font-size: 1.4rem;
    margin-top: 6px;
    animation: portrait-bob 1.2s var(--ease-in-out) infinite;
}

.np-portrait.is-active .np-name {
    color: var(--green-mid);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

/* Non-active portrait fades when one is selected */
.np-row.has-active .np-portrait:not(.is-active) { opacity: 0.45; }
.np-row.has-active .np-portrait:not(.is-active):hover { opacity: 0.8; }

/* Dialog box (single paragraph) */
.np-box {
    position: relative;
    background: var(--cream-soft);
    border: 3px solid var(--brown-deep);
    border-radius: 10px;
    padding: 28px 28px 64px;
    box-shadow: 0 6px 0 0 var(--brown-deep);
    min-height: 180px;
    max-width: 720px;
    margin: 40px auto 0;
}

.np-box::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed color-mix(in oklab, var(--brown) 45%, transparent);
    border-radius: 6px;
    pointer-events: none;
}

.np-name-tag {
    position: absolute;
    top: -14px;
    left: 22px;
    background: var(--green);
    color: var(--gold-warm);
    padding: 5px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    border-radius: 6px;
    border: 2px solid var(--green-deep);
    box-shadow: 0 2px 0 0 var(--green-deep);
    transition: opacity var(--dur-fast);
}

.np-text {
    font-family: var(--font-pixel);
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    line-height: 1.6;
    color: var(--green);
    margin-top: 6px;
}

.np-text.is-typing::after {
    content: "▌";
    color: var(--brown);
    margin-left: 2px;
    animation: caret 0.7s steps(2) infinite;
}

.np-empty-hint {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--brown-deep);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.55;
    text-align: center;
    margin-top: 24px;
}

/* Skip button — visible only while typing */
.np-skip {
    position: absolute;
    bottom: 16px;
    right: 22px;
    appearance: none;
    background: var(--green);
    color: var(--paper);
    border: 2px solid var(--green-deep);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 0 0 var(--green-deep);
    transition: all var(--dur-fast);
    display: none;
}

.np-skip:hover { background: var(--green-mid); }

.np-skip:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 0 var(--green-deep);
}

.np-box.is-typing .np-skip { display: inline-block; }

/* ==========================================================================
   HARVEST RUSH — hero mini-game
   States: idle → playing → gameover → idle
   Click the farmer (idle) to start. Click lanes to harvest golden rice.
   ========================================================================== */

/* Idle → playing transitions on the hero */
.hero.is-playing .hero-content {
    opacity: 0;
    transform: translateY(-16px);
    pointer-events: none;
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

.hero.is-playing .farmer-wrap {
    opacity: 0;
    pointer-events: none;
    transition: opacity 600ms var(--ease-out);
}

.hero.is-playing .hero-scene {
    transform: scale(1.25) translateY(8%);
    filter: brightness(0.5) saturate(1.25);
}

.hero .hero-scene {
    transition:
        transform 1000ms var(--ease-out),
        filter 1000ms var(--ease-out);
}

.hero .hero-content {
    transition:
        opacity 600ms var(--ease-out),
        transform 600ms var(--ease-out);
}

.hero .farmer-wrap {
    transition: opacity 600ms var(--ease-out);
}

/* Game panel — sits over the hero */
.game-panel {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    padding: clamp(16px, 3vw, 28px);
    padding-top: calc(var(--nav-h) + 14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 600ms var(--ease-out);
    color: var(--paper);
    font-family: var(--font-mono);
}

.hero.is-playing .game-panel {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 400ms;
}

/* HUD */
.game-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 3vw, 32px);
    flex-wrap: wrap;
    padding: 10px 14px;
    background: rgba(2, 30, 18, 0.62);
    border: 2px solid var(--green-mid);
    border-radius: 8px;
    box-shadow: 0 4px 0 0 var(--green-deep);
    max-width: 640px;
    margin: 0 auto 16px;
    backdrop-filter: blur(6px);
}

.hud-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    color: var(--gold-warm);
    text-transform: uppercase;
}

.hud-stat strong,
.hud-stat .lives {
    font-family: var(--font-pixel);
    color: var(--paper);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

.hud-stat .lives {
    color: #ff7a7a;
    text-shadow: 0 0 4px rgba(255, 100, 100, 0.5);
    letter-spacing: 0.1em;
}

/* Lanes container */
.game-stage {
    position: relative;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    min-height: 280px;
    max-height: 360px;
}

.game-lane {
    appearance: none;
    background: rgba(2, 30, 18, 0.4);
    border: 2px solid rgba(232, 221, 203, 0.18);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    transition:
        background var(--dur-fast),
        border-color var(--dur-fast),
        transform var(--dur-fast);
}

.game-lane:hover {
    background: rgba(2, 30, 18, 0.55);
    border-color: rgba(232, 221, 203, 0.35);
}

.game-lane.is-active {
    background: rgba(12, 90, 62, 0.5);
    border-color: var(--gold-warm);
    box-shadow: inset 0 0 0 1px rgba(230, 188, 101, 0.4);
}

.game-lane[data-stage="2"] {
    border-color: var(--gold);
    border-style: dashed;
    box-shadow:
        inset 0 0 32px rgba(212, 168, 74, 0.35),
        0 0 24px rgba(212, 168, 74, 0.4);
    animation: lane-pulse 0.9s ease-in-out infinite;
}

.game-lane[data-stage="3"] {
    background: rgba(140, 30, 30, 0.4);
    border-color: rgba(255, 110, 110, 0.55);
}

.game-lane.is-flash-good {
    animation: flash-good 380ms ease-out;
}

.game-lane.is-flash-bad {
    animation: flash-bad 420ms ease-out;
}

@keyframes lane-pulse {
    0%, 100% {
        box-shadow:
            inset 0 0 32px rgba(212, 168, 74, 0.30),
            0 0 24px rgba(212, 168, 74, 0.35);
    }
    50% {
        box-shadow:
            inset 0 0 48px rgba(212, 168, 74, 0.45),
            0 0 36px rgba(212, 168, 74, 0.55);
    }
}

@keyframes flash-good {
    0% { background: rgba(212, 168, 74, 0.8); }
    100% { background: rgba(2, 30, 18, 0.4); }
}

@keyframes flash-bad {
    0% { background: rgba(220, 70, 70, 0.65); }
    100% { background: rgba(2, 30, 18, 0.4); }
}

.lane-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    color: var(--paper);
    text-transform: uppercase;
    text-align: center;
    opacity: 0.8;
    line-height: 1.1;
    min-height: 2.2em;
}

.game-lane[data-stage="2"] .lane-label {
    color: var(--gold-warm);
    text-shadow: 0 0 6px rgba(230, 188, 101, 0.7);
    opacity: 1;
}

.game-lane[data-stage="3"] .lane-label {
    color: #ff9b9b;
    opacity: 1;
}

.lane-progress {
    width: 100%;
    height: 5px;
    background: rgba(232, 221, 203, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.lane-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gold-warm);
    transition: width 50ms linear;
}

.game-lane[data-stage="0"] .lane-progress-bar { background: #8aaa4a; }
.game-lane[data-stage="1"] .lane-progress-bar { background: #b8c870; }
.game-lane[data-stage="2"] .lane-progress-bar { background: var(--gold-warm); }
.game-lane[data-stage="3"] .lane-progress-bar { background: #ff7a7a; }

.lane-plant {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    position: relative;
}

.lane-plant img,
.lane-plant svg {
    width: clamp(56px, 8vw, 96px);
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    margin: 0 auto;
}

.game-lane[data-stage="2"] .lane-plant img,
.game-lane[data-stage="2"] .lane-plant svg {
    animation: plant-bob 0.8s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(212, 168, 74, 0.55));
}

/* Rotten = dimmed plant + red X overlay */
.lane-plant .p-rotten {
    position: relative;
    display: inline-block;
}

.lane-plant .p-rotten img {
    opacity: 0.4;
    filter: grayscale(0.4);
}

.lane-plant .rotten-x {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ff5b5b;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.6);
    line-height: 1;
}

@keyframes plant-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

/* Stage-specific plant visibility (we render one SVG per stage; show the right one) */
.lane-plant .p-stage { display: none; }
.game-lane[data-stage="0"] .p-sprout { display: block; }
.game-lane[data-stage="1"] .p-green { display: block; }
.game-lane[data-stage="2"] .p-golden { display: block; }
.game-lane[data-stage="3"] .p-rotten { display: block; }

/* Game farmer — moves between lanes */
.game-farmer {
    position: absolute;
    bottom: 14px;
    left: 0;
    width: calc(33.333% - 5px);
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: transform 220ms var(--ease-out);
    will-change: transform;
}

.game-farmer svg,
.game-farmer img {
    width: clamp(56px, 7vw, 84px);
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
}

/* Game over card */
.game-over {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(2, 30, 18, 0.86);
    backdrop-filter: blur(8px);
    z-index: 11;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms var(--ease-out);
}

.game-over.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.game-over-card {
    background: var(--cream-soft);
    color: var(--ink);
    border: 3px solid var(--brown-deep);
    border-radius: 10px;
    padding: 28px 28px 24px;
    box-shadow: 0 8px 0 0 var(--brown-deep);
    text-align: center;
    max-width: 380px;
    width: 100%;
    position: relative;
}

.game-over-card::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px dashed color-mix(in oklab, var(--brown) 45%, transparent);
    border-radius: 6px;
    pointer-events: none;
}

.go-title {
    font-family: var(--font-pixel);
    font-size: 2.2rem;
    color: var(--green);
    letter-spacing: 0.04em;
    line-height: 1;
}

.go-score {
    font-family: var(--font-pixel);
    font-size: 3.4rem;
    color: var(--gold);
    line-height: 1;
    margin-top: 6px;
}

.go-msg {
    font-family: var(--font-body);
    color: var(--muted);
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.go-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
    flex-wrap: wrap;
}

.btn-game {
    appearance: none;
    background: var(--green);
    color: var(--paper);
    border: 2px solid var(--green-deep);
    border-radius: 6px;
    padding: 9px 16px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 3px 0 0 var(--green-deep);
    transition: all var(--dur-fast);
}

.btn-game:hover {
    background: var(--green-mid);
    transform: translateY(-1px);
    box-shadow: 0 4px 0 0 var(--green-deep);
}

.btn-game:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 var(--green-deep);
}

.btn-game.secondary {
    background: var(--cream-soft);
    color: var(--green);
    border-color: var(--brown);
    box-shadow: 0 3px 0 0 var(--brown);
}

.btn-game.secondary:hover {
    background: var(--paper);
    box-shadow: 0 4px 0 0 var(--brown);
}

/* Exit button (top-right of game panel) */
.game-exit {
    position: absolute;
    top: 14px;
    right: 14px;
    appearance: none;
    background: rgba(2, 30, 18, 0.7);
    color: var(--paper);
    border: 1px solid rgba(232, 221, 203, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 12;
    font-family: var(--font-mono);
    transition: background var(--dur-fast);
}

.game-exit:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Tap-hint subtitle below stage */
.game-foot {
    text-align: center;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    color: rgba(245, 240, 233, 0.7);
    text-transform: uppercase;
}

.game-foot kbd {
    background: rgba(2, 30, 18, 0.7);
    border: 1px solid rgba(232, 221, 203, 0.3);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.66rem;
    margin: 0 2px;
}

/* Don't show idle modal when game is playing */
.hero.is-playing ~ #farmer-modal { display: none; }

@media (max-width: 640px) {
    .game-hud {
        padding: 8px 10px;
        font-size: 0.65rem;
    }
    .hud-stat strong, .hud-stat .lives { font-size: 1.15rem; }
    .game-stage { min-height: 240px; }
    .lane-plant { min-height: 64px; }
}
