/* kroskinski.com -- the only stylesheet.
   Every color comes from the tokens below; a theme just redefines them,
   so components never need per-theme overrides. */

/* --- Theme tokens -------------------------------------------------- */
:root {
    --bg: #09090b;
    --surface: #18181b;
    --border: #27272a;
    --muted: #a1a1aa;
    --text-2: #d4d4d8;
    --text: #f4f4f5;
    --accent-300: #f9a8d4;
    --accent-400: #f472b6;
    --accent-500: #ec4899;
    --accent-600: #db2777;
    --accent-900: #831843;
    --accent-950: #500724;
    --on-accent: #09090b;
    /* Error pages stay red in every theme: they should read as "broken". */
    --error: #ef4444;
    --error-bg: color-mix(in oklab, #ef4444 12%, transparent);
    --faint: color-mix(in oklab, var(--muted) 65%, var(--bg));
    --grid-strength: 3%;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
/* Accent text is darkened on light themes to keep WCAG AA contrast. */
html.light {
    --bg: #f4f4f5; --surface: #e4e4e7; --border: #d4d4d8;
    --muted: #52525b; --text-2: #27272a; --text: #18181b;
    --accent-300: #be185d; --accent-400: #be185d; --accent-500: #db2777;
    --accent-600: #db2777; --accent-900: #fbcfe8; --accent-950: #fdf2f8;
    --on-accent: #ffffff; --error: #b91c1c; --grid-strength: 5%;
}
[data-theme="bronze-midnight"] {
    --accent-300: #df9b58; --accent-400: #D88A3E; --accent-500: #b56c25;
    --accent-600: #9c591a; --accent-900: #4a2705; --accent-950: #2b1501;
    --bg: #14213D; --surface: #1d2e54; --border: #273b6b;
    --muted: #93a8db; --text-2: #b6c4e8; --text: #dfe5f5;
}
[data-theme="neon-violet"] {
    --accent-300: #d6ff66; --accent-400: #C8FF3D; --accent-500: #aee619;
    --accent-600: #93c70a; --accent-900: #334700; --accent-950: #1b2600;
    --bg: #2D1B69; --surface: #3c258a; --border: #4d31ab;
    --muted: #b3a1f7; --text-2: #c5b5fa; --text: #e9e3fe;
}
[data-theme="orange-vanilla"] { /* light */
    --accent-300: #b43c03; --accent-400: #b43c03; --accent-500: #e8530b;
    --accent-600: #cc4504; --accent-900: #fce2d7; --accent-950: #faebd7;
    --bg: #FFF4D6; --surface: #ffebb5; --border: #fadd96;
    --muted: #6e5235; --text-2: #593f24; --text: #2b1c0e;
    --on-accent: #ffffff; --error: #b91c1c; --grid-strength: 5%;
}
[data-theme="mint-graphite"] {
    --accent-300: #cffaf0; --accent-400: #B8F7E4; --accent-500: #93e8ce;
    --accent-600: #6dd9b8; --accent-900: #1f5444; --accent-950: #0f3026;
    --bg: #25272C; --surface: #2f3238; --border: #3c4048;
    --muted: #9ba0aa; --text-2: #b5bac4; --text: #e2e5eb;
}
[data-theme="lime-olive"] {
    --accent-300: #e2ff9e; --accent-400: #CFFF74; --accent-500: #bae64c;
    --accent-600: #a1cc2e; --accent-900: #425907; --accent-950: #233300;
    --bg: #2F3A1D; --surface: #3c4a26; --border: #4a5c31;
    --muted: #a9bf87; --text-2: #bdd19f; --text: #e4f2cf;
}
[data-theme="indigo-lilac"] { /* light */
    --accent-300: #4a2ee0; --accent-400: #4a2ee0; --accent-500: #4a2ee0;
    --accent-600: #3b20c2; --accent-900: #d6ccf5; --accent-950: #c9bcf0;
    --bg: #E8DEFF; --surface: #d9ccfa; --border: #c6b2f7;
    --muted: #5a4887; --text-2: #4d3a7d; --text: #291a4d;
    --on-accent: #ffffff; --error: #b91c1c; --grid-strength: 5%;
}
[data-theme="orchid-plum"] {
    --accent-300: #ee9cff; --accent-400: #E46CFF; --accent-500: #d147f0;
    --accent-600: #b522d6; --accent-900: #5e1170; --accent-950: #3b0547;
    --bg: #2E0F35; --surface: #3f1747; --border: #52215c;
    --muted: #b386be; --text-2: #cca3d6; --text: #ebd3f2;
}

/* --- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, color-mix(in oklab, var(--accent-500) var(--grid-strength), transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in oklab, var(--accent-500) var(--grid-strength), transparent) 1px, transparent 1px);
}
::selection { background: var(--accent-500); color: var(--on-accent); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-400); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Keyboard-only focus ring in the active theme's accent. */
a:focus-visible, button:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent-500);
    outline-offset: 2px;
    border-radius: 2px;
}

.wrap { width: 100%; max-width: 64rem; margin-inline: auto; padding: 1.5rem; }
.wrap-narrow { max-width: 56rem; flex-grow: 1; }

/* --- Header / footer ----------------------------------------------- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.05em; color: var(--accent-400); }
.brand:hover { text-decoration: none; }
.brand-dot { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--accent-500); animation: pulse 2s ease-in-out infinite; }
.brand-error { color: var(--error); }
.brand-error .brand-dot { background: var(--error); }
@keyframes pulse { 50% { opacity: 0.5; } }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; font-size: 0.875rem; }
.site-nav a { color: var(--text-2); }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--accent-400); text-decoration: none; }
.site-nav a[aria-current] { font-weight: 600; }
.theme-select {
    font: inherit;
    font-weight: 700;
    color: var(--accent-400);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
}
.theme-select option { background: var(--surface); color: var(--text); }

.site-footer { border-top: 1px solid var(--border); text-align: center; font-size: 0.75rem; color: var(--faint); }
.site-footer p { margin: 0.25rem 0; }

/* --- Terminal window ----------------------------------------------- */
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem 0.75rem 0 0;
}
.terminal-bar span { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #ef4444cc; }
.terminal-bar span:nth-child(2) { background: #eab308cc; }
.terminal-bar span:nth-child(3) { background: #22c55ecc; }
.terminal-bar p { margin: 0 0 0 0.5rem; font-size: 0.75rem; color: var(--faint); }
.terminal-body {
    padding: 1.5rem;
    background: color-mix(in oklab, var(--surface) 55%, transparent);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}
@media (min-width: 48rem) { .terminal-body { padding: 2rem; } }

.prompt { color: var(--accent-400); margin: 2rem 0 0.75rem; }
.prompt:first-child { margin-top: 0; }
.prompt span { color: var(--text-2); }
.cursor { animation: pulse 1s steps(1) infinite; }

h1 { font-size: 1.6rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 1rem; }
h1.hero { font-size: 2rem; }
@media (min-width: 48rem) { h1 { font-size: 2.25rem; } h1.hero { font-size: 3rem; } }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 1.5rem; }
.meta, .stat { font-size: 0.75rem; color: var(--faint); margin: 0 0 1.5rem; }

/* --- Buttons ------------------------------------------------------- */
.actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    background: var(--surface);
    color: var(--text-2);
    font-weight: 600;
    text-align: center;
}
.btn:hover { text-decoration: none; border-color: var(--accent-500); }
.btn-primary { background: var(--accent-400); border-color: var(--accent-400); color: var(--on-accent); font-weight: 800; }
.btn-primary:hover { background: var(--accent-300); border-color: var(--accent-300); }

/* --- Project cards (home) ------------------------------------------ */
.project-list { list-style: none; padding: 0; margin: 0 0 0.5rem; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.project-empty { color: var(--faint); font-size: 0.85rem; }
.project-card a {
    display: block;
    height: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-2);
    transition: border-color 0.15s, transform 0.15s;
}
.project-card a:hover { text-decoration: none; border-color: var(--accent-500); transform: translateY(-2px); }
.project-card img { border-radius: 0.25rem; margin-bottom: 0.75rem; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.project-card h2 { font-size: 1rem; margin: 0 0 0.25rem; color: var(--accent-400); }
.project-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }

/* --- Long-form Markdown content (project pages) -------------------- */
.prose { color: var(--text-2); }
.prose h2 { font-size: 1.25rem; color: var(--text); margin: 2.25rem 0 0.75rem; }
.prose h3 { font-size: 1.05rem; color: var(--text); margin: 1.75rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose li::marker { color: var(--accent-500); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }
.prose code { font-size: 0.9em; color: var(--accent-300); }
.prose pre {
    overflow-x: auto;
    padding: 1rem;
    margin: 0 0 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    line-height: 1.35;
}
.prose pre code { color: var(--text-2); font-size: 0.8rem; }
/* Markdown blockquotes render as note boxes. */
.prose blockquote {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: color-mix(in oklab, var(--accent-950) 35%, transparent);
    border: 1px solid color-mix(in oklab, var(--accent-900) 60%, transparent);
    border-radius: 0.5rem;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.85rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.4rem 0.75rem; text-align: left; }
.screenshot { margin: 1.5rem 0; }
.screenshot img { border: 1px solid var(--border); border-radius: 0.5rem; }
.screenshot figcaption { font-size: 0.75rem; color: var(--faint); margin-top: 0.5rem; text-align: center; }

/* --- Error pages --------------------------------------------------- */
.terminal-error .terminal-bar, .terminal-error .terminal-body { border-color: color-mix(in oklab, var(--error) 40%, var(--border)); }
.terminal-error .prompt { color: var(--error); }
.alert { padding: 0.75rem 1rem; margin: 0 0 1.5rem; color: var(--error); background: var(--error-bg); border: 1px solid color-mix(in oklab, var(--error) 40%, transparent); border-radius: 0.5rem; font-size: 0.85rem; }

/* --- Typewriter + skate easter egg --------------------------------- */
#typewriter-cursor {
    display: inline-block;
    width: 0.05em;
    border-right: 3px solid var(--accent-500);
    animation: blink-caret 0.9s step-end infinite;
    margin-left: 2px;
}
@keyframes blink-caret { 50% { border-color: transparent; } }

.ascii-skater {
    position: fixed;
    bottom: 2rem;
    left: -150px;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-500);
    font-weight: 800;
    line-height: 1.1;
    z-index: 9999;
    pointer-events: none;
    white-space: pre;
    animation: skate-across 4s linear forwards;
}
@keyframes skate-across {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    40% { transform: translateX(45vw) translateY(0) rotate(0deg); }
    45% { transform: translateX(50vw) translateY(-80px) rotate(-15deg); } /* ollie */
    50% { transform: translateX(55vw) translateY(0) rotate(0deg); }       /* land */
    100% { transform: translateX(calc(100vw + 300px)) translateY(0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
