/* neko.dev v2 — parody of the redesigned pi.dev "blueprint" look.
 * Original CSS written for this site; only color/font tokens were
 * cross-referenced from the live site. */

:root {
    --bg-deep: #0d1116;
    --bg-canvas: #161d27;
    --panel: #212730e6;
    --panel-soft: #252f3dd1;
    --line: #49505980;
    --line-strong: #757d8975;
    --text: #ebe7e4;
    --copy: #ebe7e4bf;
    --muted: #9fa4abad;
    --accent: #6a9fcc;
    --rust: #b86b52;
    --live: #5db87a;
    --grid-minor: hsl(218 60% 80% / 0.025);
    --grid-major: hsl(218 60% 80% / 0.06);
    --serif: "Plantin MT Pro", Plantin, "Iowan Old Style", Georgia, "Times New Roman", serif;
    --mono: "Commit Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg-deep: #dacbc2;
    --bg-canvas: #ebe7e4;
    --panel: #f4f2f0;
    --panel-soft: #eef1f3;
    --line: #8b847d59;
    --line-strong: #5c575240;
    --text: #252f3df5;
    --copy: #384251dc;
    --muted: #5c5752c4;
    --accent: #4b607c;
    --grid-minor: #252f3d10;
    --grid-major: #252f3d1d;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-canvas);
    background-image:
        linear-gradient(var(--grid-major) 0 1px, transparent 1px),
        linear-gradient(to right, var(--grid-major) 0 1px, transparent 1px),
        linear-gradient(var(--grid-minor) 0 1px, transparent 1px),
        linear-gradient(to right, var(--grid-minor) 0 1px, transparent 1px);
    background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
    color: var(--copy);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.55;
    min-height: 100vh;
}

/* Crooked mode: the cat knocked the site over. */
.tilt-layer {
    transform-origin: 50% 0;
    transition: transform 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.crooked .tilt-layer {
    transform: rotate(1.6deg) translateX(0.6rem);
}

.crooked-callout[hidden] {
    display: none;
}

.crooked-callout {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    background: var(--panel);
    border: 1px solid var(--line-strong);
    border-left: 2px solid var(--rust);
    padding: 0.6rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 6px 24px #00000040;
}

.page {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
    text-underline-offset: 3px;
}

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

code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--panel-soft);
    border: 1px solid var(--line);
    padding: 0.1em 0.35em;
}

h1, h2, h3, .section-title {
    font-family: var(--serif);
    color: var(--text);
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Sticky nav */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--bg-deep) 92%, transparent));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line-strong);
}

.sticky-nav-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0.4rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sticky-nav-logo img {
    height: 30px;
    display: block;
    image-rendering: pixelated;
}

.sticky-nav-page-links {
    display: flex;
    gap: 0.25rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    overflow-x: auto;
}

.sticky-nav-page-link {
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sticky-nav-page-link:hover {
    color: var(--text);
}

.sticky-nav-page-link.is-active {
    color: var(--text);
    border-color: var(--line);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border-bottom: 2px solid var(--accent);
}

.sticky-nav-spacer {
    margin-left: auto;
}

.sticky-nav-social {
    color: var(--muted);
    display: flex;
}

.sticky-nav-social:hover {
    color: var(--text);
}

/* Hero */
.hero {
    text-align: center;
    padding: 3.5rem 0 1.5rem;
}

.hero-cat {
    display: block;
    margin: 0 auto 0.25rem;
    image-rendering: pixelated;
    width: 100%;
    max-width: 480px;
    /* height is set by neko.js from devicePixelRatio so sprite pixels
     * land on whole device pixels (crisp, like the TUI half-blocks) */
    cursor: pointer;
}

.hero-cat-hint {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}

.hero-subtitle {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    line-height: 1.25;
    color: var(--text);
    margin: 0 auto 1rem;
    max-width: 620px;
    font-weight: 500;
}

.hero-subtitle-line {
    display: block;
}

.hero-subtitle-accent {
    color: var(--accent);
    font-style: italic;
}

.hero-rotator {
    transition: opacity 300ms ease;
}

.hero-rotator.is-fading {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .hero-rotator {
        transition: none;
    }
}

.hero-orient {
    color: var(--muted);
    font-size: 1rem;
    margin: 0 auto 1.5rem;
    max-width: 480px;
}

.hero-orient-line {
    display: block;
}

/* Install switcher */
.install-switcher {
    background: var(--panel);
    border: 1px solid var(--line-strong);
    margin: 1.5rem 0;
    text-align: left;
    box-shadow: 0 10px 30px #00000030;
}

.install-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--text) 3%, transparent);
    overflow-x: auto;
}

.install-tab {
    appearance: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
    white-space: nowrap;
}

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

.install-tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.install-command-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
}

.install-command-row code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text);
    overflow-x: auto;
    white-space: nowrap;
}

.install-command-row code::before {
    content: "$ ";
    color: var(--muted);
}

.action-button {
    appearance: none;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.35rem 0.9rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.action-button:hover {
    border-color: var(--accent);
}

/* Figure frame (panel with corner ticks + caption bar) */
.figure-frame {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    margin: 1.5rem 0;
    box-shadow: 0 10px 30px #00000030;
}

.figure-corner {
    position: absolute;
    width: 9px;
    height: 9px;
    border-color: var(--line-strong);
    border-style: solid;
    border-width: 0;
}

.figure-corner--tl { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.figure-corner--tr { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.figure-corner--bl { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
.figure-corner--br { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }

.figure-caption {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--muted);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--live);
    margin-left: auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    50% { opacity: 0.3; }
}

/* Demo terminal */
.demo-body {
    padding: 1rem 1.1rem;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.7;
    min-height: 15em;
    white-space: pre-wrap;
    color: var(--text);
}

.demo-body .dim { color: var(--muted); }
.demo-body .acc { color: var(--accent); }
.demo-body .ok { color: var(--live); }

.demo-cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    background: var(--text);
    vertical-align: text-bottom;
    animation: blink 1.1s steps(1) infinite;
}

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

/* Sections */
.section {
    margin: 3.5rem 0;
}

.section-title {
    font-size: 1.6rem;
    margin: 0 0 1rem;
}

.section p {
    margin: 0 0 1rem;
}

.section strong {
    color: var(--text);
    font-weight: 600;
}

.docs-button a,
.link-button {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.8rem;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    padding: 0.5rem 1.1rem;
    text-decoration: none;
    transition: border-color 0.15s;
}

.docs-button a:hover,
.link-button:hover {
    border-color: var(--accent);
}

.easter-link {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
}

/* Feature cards ("What we didn't build") */
.callout-header {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 2rem;
}

.feature-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem 1rem;
}

@media (max-width: 640px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-card {
    text-align: center;
    padding: 0 0.5rem;
}

.feature-card-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.6rem;
    filter: grayscale(0.2);
}

.feature-card-title {
    font-size: 1.05rem;
    margin: 0 0 0.4rem;
}

.feature-card-body {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

/* Get involved cards */
.card-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.content-card {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 1rem 1.1rem;
}

.content-card h3 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.content-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* Footer */
.site-footer {
    margin: 4rem 0 2rem;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-family: var(--mono);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
}

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

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

.footer-cat {
    image-rendering: pixelated;
    height: 40px;
    width: auto;
    display: block;
    margin-bottom: 0.5rem;
}

.theme-toggle {
    appearance: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--line-strong);
}
