/* ─── Tokens ───────────────────────────────────── */
:root {
    /* Cocina de Noche — espresso + burnt sienna + culantro */
    --bg:            #16110c;
    --bg-card:       #1e1812;
    --border:        #2b2118;
    --border-strong: #3b3128;
    --border-faint:  #241c14;

    --text:          #d6cdbe;
    --text-bright:   #f4ecdc;
    --text-body:     #b3a690;
    --text-dim:      #9a8c76;
    --text-faint:    #8a7d68;

    --accent:        #c97b5e;
    --accent-deep:   #6e4636;
    --accent-shadow: #3a2418;
    --green:         #6fa05c;
    --green-deep:    #3c5a33;
    --green-tile:    #243d20;
    --green-bright:  #9fc78a;
    --gold:          #dfb05e;
    --gold-tile:     #46361c;

    --pixel:     "Pixelify Sans", sans-serif;
    --pixel-alt: "Silkscreen", sans-serif;
    --sans:      "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, sans-serif;
    --mono:      "JetBrains Mono", ui-monospace, "SF Mono", monospace;

    --measure: 920px;
}

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

html {
    background: var(--bg);
    color: var(--text-body);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* warm pixel-dot grid */
    background-image: radial-gradient(rgba(201, 123, 94, 0.08) 1.5px, transparent 1.5px);
    background-size: 26px 26px;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
}

img {
    max-width: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.pixelated {
    image-rendering: pixelated;
}

::selection {
    background: rgba(201, 123, 94, 0.25);
    color: var(--text-bright);
}

/* ─── Nav ──────────────────────────────────────── */
nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(22, 17, 12, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    width: 26px;
    height: 26px;
    image-rendering: pixelated;
}

.logo span {
    font-family: var(--pixel);
    font-weight: 500;
    font-size: 17px;
    color: var(--text-bright);
}

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

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: lowercase;
}

.nav-links a:hover { color: var(--accent); }
.nav-links a.active { color: var(--accent); }

/* Nav dropdown ("on the stove") */
.nav-dd { position: relative; }

.nav-dd summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: lowercase;
}
.nav-dd summary::-webkit-details-marker { display: none; }
.nav-dd summary::marker { content: ""; }
.nav-dd summary:hover,
.nav-dd[open] summary,
.nav-dd summary.active { color: var(--accent); }

.nav-dd-caret { font-size: 9px; transition: transform 0.15s ease; }
.nav-dd[open] .nav-dd-caret { transform: rotate(180deg); }

.nav-dd-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    min-width: 180px;
    max-width: calc(100vw - 40px);
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    box-shadow: 4px 4px 0 var(--accent-shadow);
    z-index: 60;
}
.nav-dd-menu a {
    display: block;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: lowercase;
    padding: 9px 10px;
    white-space: nowrap;
}
.nav-dd-menu a:hover { color: var(--accent); background: var(--border); }
.nav-dd-menu a.active,
.nav-dd-menu a[aria-current="page"] { color: var(--accent); }

/* ─── Page wrappers ────────────────────────────── */
main {
    flex: 1;
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding: 80px 32px 72px;
}

main.page-product { max-width: 720px; }
main.page-narrow  { max-width: 600px; }

/* ─── Shared bits ─────────────────────────────── */
.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent);
    flex-shrink: 0;
}

.section-label {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 14px;
}

/* Pixel button */
.btn-pixel {
    display: inline-block;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bg);
    background: var(--accent);
    padding: 13px 22px;
    box-shadow: 4px 4px 0 var(--accent-shadow);
    transition: all 0.12s ease;
}

.btn-pixel:hover {
    background: var(--text-bright);
    color: var(--bg);
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 var(--accent-shadow);
}

.btn-pixel:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--accent-shadow);
}

/* Pixel divider */
.pixel-divider {
    height: 4px;
    background: repeating-linear-gradient(90deg,
        var(--accent) 0 8px, transparent 8px 24px,
        var(--green) 24px 32px, transparent 32px 48px);
    opacity: 0.55;
}

/* Status chips */
.chip {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 10px;
    white-space: nowrap;
}

.chip-accent { color: var(--accent); border: 1px solid var(--accent-deep); }
.chip-green  { color: var(--green);  border: 1px solid var(--green-deep); }

/* ─── Home: hero ──────────────────────────────── */
main.home { padding-top: 0; padding-bottom: 0; }

.hero {
    display: flex;
    align-items: center;
    gap: 52px;
    padding: 92px 0 64px;
    flex-wrap: wrap;
}

.dish {
    position: relative;
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.dish img {
    width: 150px;
    height: 150px;
    image-rendering: pixelated;
}

.dish:active img { transform: translateY(3px); }

.steam {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.steam-1 { left: 50px; top: 2px;  width: 11px; height: 11px; background: #cfc4ae; }
.steam-2 { left: 76px; top: 8px;  width: 9px;  height: 9px;  background: var(--text-dim); }
.steam-3 { left: 62px; top: -6px; width: 8px;  height: 8px;  background: var(--green); }

.dish.steaming .steam-1 { animation: steamRise 1.1s  steps(6) forwards; }
.dish.steaming .steam-2 { animation: steamRise 1.15s steps(6) 0.12s forwards; }
.dish.steaming .steam-3 { animation: steamRise 1.2s  steps(6) 0.22s forwards; }

@keyframes steamRise {
    0%   { opacity: 0; transform: translateY(8px); }
    18%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-46px); }
}

.hero-text { flex: 1; min-width: 360px; }

.hero-line { display: block; }

.hero-text h1 {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: clamp(3rem, 7vw, 4.25rem);
    line-height: 0.95;
    color: var(--text-bright);
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-body);
    max-width: 46ch;
    margin-bottom: 16px;
}

.hero-hint {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

/* ─── Home: projects ──────────────────────────── */
.projects {
    padding: 48px 0 72px;
}

.projects .section-label { margin-bottom: 8px; }

.project-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 12px;
    border-bottom: 1px solid var(--border);
}

.project-row:hover { background: var(--bg-card); }

.project-row .icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.tile {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--pixel-alt);
    font-weight: 700;
}

.tile-green { background: var(--green-tile); color: var(--green-bright); font-size: 18px; }
.tile-gold  { background: var(--gold-tile);  color: var(--gold);         font-size: 14px; }

.project-row .info { flex: 1; }

.project-row .name {
    font-family: var(--pixel);
    font-weight: 500;
    font-size: 20px;
    color: var(--text-bright);
}

.project-row .desc {
    font-size: 14px;
    color: var(--text-dim);
}

.project-row .arrow {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 16px;
    color: var(--accent);
}

/* ─── Lucky Split page ────────────────────────── */
.product-head {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 28px;
}

.product-head img {
    width: 72px;
    height: 72px;
    image-rendering: pixelated;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.product-head h1 {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: 46px;
    line-height: 1;
    color: var(--text-bright);
    margin-bottom: 8px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.pull-quote {
    font-size: 21px;
    line-height: 1.5;
    color: var(--text-bright);
    max-width: 38ch;
    margin-bottom: 14px;
}

.intro {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-body);
    max-width: 56ch;
    margin-bottom: 48px;
}

.feature-list {
    list-style: none;
    margin-bottom: 44px;
}

.feature-list li {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--text);
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li::before {
    content: "→";
    font-family: var(--mono);
    font-weight: 500;
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
}

.feature-list strong {
    color: var(--text-bright);
    font-weight: 700;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 48px;
}

.game-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 18px 20px;
}

.game-card .glyph {
    font-size: 30px;
    line-height: 1;
    flex-shrink: 0;
}

.game-card .glyph-text {
    font-family: var(--pixel-alt);
    font-weight: 700;
    font-size: 19px;
    line-height: 1;
    flex-shrink: 0;
}

.game-card h3 {
    font-family: var(--pixel);
    font-weight: 500;
    font-size: 17px;
    color: var(--text-bright);
}

.game-card p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
}

.c-accent { color: var(--accent); }
.c-green  { color: var(--green); }
.c-gold   { color: var(--gold); }

.screenshots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

.screenshots img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
}

.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 26px 28px;
    margin-bottom: 20px;
}

.cta-card .ask {
    font-family: var(--pixel);
    font-weight: 500;
    font-size: 18px;
    color: var(--text-bright);
}

.fine-print {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    margin-bottom: 44px;
}

.legal-row {
    display: flex;
    gap: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.legal-row a {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
}

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

/* ─── About page ──────────────────────────────── */
.about-head {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}

.about-head img {
    width: 84px;
    height: 84px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.about-head h1 {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: 52px;
    line-height: 1;
    color: var(--text-bright);
    margin-bottom: 6px;
}

.location {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.about-intro {
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-body);
    max-width: 52ch;
    margin-bottom: 48px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 48px;
}

.chips span {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
    border: 1px solid var(--border-strong);
    padding: 7px 13px;
}

.elsewhere { display: flex; flex-direction: column; }

.elsewhere a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 4px;
    border-bottom: 1px solid var(--border);
}

.elsewhere a:last-child { border-bottom: none; }
.elsewhere a:hover { background: var(--bg-card); }

.elsewhere .label {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.elsewhere .value {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-faint);
}

/* ─── 404 ─────────────────────────────────────── */
main.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 32px;
    max-width: none;
}

.nf-dish {
    width: 110px;
    height: 110px;
    image-rendering: pixelated;
    filter: grayscale(1) brightness(0.75);
    margin-bottom: 28px;
}

.nf-code {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: 72px;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 16px;
}

.nf-headline {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: 26px;
    line-height: 1.25;
    color: var(--text-bright);
    max-width: 420px;
    margin-bottom: 12px;
}

.nf-sub {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dim);
    max-width: 360px;
    margin-bottom: 36px;
}

/* ─── Footer ──────────────────────────────────── */
footer {
    border-top: 1px solid var(--border-faint);
}

.footer-inner {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 24px 32px 32px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

footer span {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-faint);
}

/* ─── Skip link (a11y) ────────────────────────── */
.skip-link {
    position: absolute;
    left: 8px;
    top: -52px;
    z-index: 200;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--bg);
    background: var(--accent);
    padding: 10px 14px;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; }

/* ─── Gallery page ────────────────────────────── */
.gallery-h1 {
    font-family: var(--pixel);
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    line-height: 1;
    color: var(--text-bright);
    margin-bottom: 16px;
}

.gallery-note {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-dim);
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ─── Mobile ──────────────────────────────────── */
@media (max-width: 640px) {
    .nav-inner {
        padding: 12px 20px;
        flex-wrap: wrap;
        gap: 8px 16px;
    }
    .nav-links { gap: 14px 18px; flex-wrap: wrap; }

    main { padding: 56px 20px 56px; }
    main.home { padding-top: 0; padding-bottom: 0; }

    .hero { padding: 56px 0 44px; gap: 32px; }
    .hero-text { min-width: 0; }

    .projects { padding: 36px 0 56px; }
    .project-row { gap: 14px; padding: 16px 8px; }
    .project-row .chip { display: none; }

    .games-grid { grid-template-columns: 1fr; }
    .screenshots { grid-template-columns: repeat(3, 1fr); gap: 8px; }

    .product-head h1 { font-size: 36px; }

    .footer-inner { padding: 20px 20px 28px; }
}
