/*==================
BASE — reset, page shell, shared primitives
===================*/

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

* {
    margin: 0;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--step-0);
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
}

main {
    flex: 1;
}

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

img {
    height: auto;
}

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
}

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

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

h1,
h2,
h3,
h4 {
    color: var(--title);
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
}

h1 {
    font-size: var(--step-5);
}

h2 {
    font-size: var(--step-4);
}

h3 {
    font-size: var(--step-3);
}

h4 {
    font-size: var(--step-2);
}

code,
pre,
kbd,
samp {
    font-family: var(--font-mono);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Typewriter caret — shown only while js/typewriter.js is revealing text.
   currentColor keeps it legible on both dark code blocks and light surfaces. */
.is-typing::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: currentColor;
    animation: caret-blink 1s steps(1) infinite;
}

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

.hidden {
    display: none !important;
}

.container {
    width: min(100% - 2rem, 72rem);
    margin-inline: auto;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Button */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button-primary {
    background: var(--brand);
    color: var(--brand-ink);
}

.button-primary:hover {
    background: color-mix(in srgb, var(--brand) 88%, black);
    color: var(--brand-ink);
}

.button-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--title);
}

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

/* Eyebrow label */
.eyebrow {
    margin-bottom: var(--space-2);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: var(--step--1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Hero */
.hero {
    padding-block: var(--space-8) var(--space-7);
    text-align: center;
}

.hero h1 {
    letter-spacing: -0.02em;
}

.hero-subtitle {
    max-width: var(--measure);
    margin: var(--space-4) auto 0;
    color: var(--text-muted);
    font-size: var(--step-2);
}

/* Feature cards */
.feature-card {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.feature-card h3 {
    font-size: var(--step-2);
}

.feature-card p {
    margin-top: var(--space-2);
    color: var(--text-muted);
}

/* Inline code syntax tokens (js/zith-highlight.js) */
.cm { color: var(--code-comment); font-style: italic; }
.kw { color: var(--code-keyword); font-weight: 600; }
.ty { color: var(--code-type); }
.fn { color: var(--code-function); }
.st { color: var(--code-string); }
.num { color: var(--code-number); }

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
