/* (c) 2026 Noetive */

@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/SpaceGrotesk-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/SpaceGrotesk-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('/assets/SpaceGrotesk-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('/assets/Outfit-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('/assets/Outfit-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Outfit';
    src: url('/assets/Outfit-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

a,
button,
select,
summary,
label[for],
[type="submit"],
[type="button"],
[role="button"] {
    cursor: pointer;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--ink);
    border-radius: 5px;
    border: var(--border-width) solid var(--ground);
}

/* Blog prose: rendered markdown on the Noetive type ladder. Square corners,
   no shadows, tokens only. Headings use the display family, code blocks and
   tables follow noe-code and noe-table. */
.prose-blog {
    overflow-wrap: break-word;
    color: var(--ink);
}

.prose-blog h2 {
    font: var(--text-band-title);
    color: var(--ink);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 5rem;
}

.prose-blog h3 {
    font: var(--text-section);
    color: var(--ink);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 5rem;
}

.prose-blog h4 {
    font: var(--text-label);
    color: var(--ink);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 5rem;
}

.prose-blog p {
    font: var(--text-body);
    color: var(--ink-soft);
    margin-bottom: 1.25rem;
}

.prose-blog a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose-blog a:hover {
    text-decoration-thickness: 3px;
}

.prose-blog strong {
    font-weight: 700;
    color: var(--ink);
}

.prose-blog ul,
.prose-blog ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose-blog ul {
    list-style-type: square;
}

.prose-blog ol {
    list-style-type: decimal;
}

.prose-blog li {
    font: var(--text-body);
    color: var(--ink-soft);
    margin-bottom: 0.375rem;
}

.prose-blog blockquote {
    border-left: var(--rule-width) solid var(--ink);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--ink-soft);
}

.prose-blog code {
    font: var(--text-command);
    background: var(--surface);
    color: var(--ink);
    padding: 0.125rem 0.375rem;
    border: var(--border-width) solid var(--ink);
}

.prose-blog pre {
    background: var(--ink);
    color: var(--ground);
    padding: 1rem 1.25rem;
    border: var(--border-width) solid var(--ink);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.prose-blog pre code {
    font: var(--text-code);
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    white-space: pre;
}

.prose-blog img {
    max-width: 100%;
    height: auto;
    border: var(--border-width) solid var(--ink);
    margin: 1.5rem 0;
}

.prose-blog table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    border: var(--border-width) solid var(--ink);
    background: var(--surface);
}

.prose-blog th {
    font: var(--text-tag);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--ink);
    color: var(--on-ink);
    text-align: left;
    padding: 0.625rem 0.875rem;
    border: var(--border-width) solid var(--ink);
}

.prose-blog td {
    font: var(--text-table);
    color: var(--ink);
    padding: 0.625rem 0.875rem;
    border: var(--border-width) solid var(--ink);
}

.prose-blog hr {
    border: none;
    border-top: var(--border-width) solid var(--ink);
    margin: 2rem 0;
}

/* Running text caps near 72 characters. Space Grotesk's zero is wider
   than its average letter, so 62ch lands there rather than at 80. Code
   blocks, tables and images keep the full column. */
.prose-blog p,
.prose-blog ul,
.prose-blog ol,
.prose-blog blockquote {
    max-width: 62ch;
}

.prose-blog p:has(> img) {
    max-width: none;
}

.prose-blog li > p {
    margin-bottom: 0.5rem;
}

.prose-blog li ul,
.prose-blog li ol {
    margin: 0.25rem 0 0;
}

/* A heading after a code block or table needs more air than one after a
   paragraph, whose own bottom margin already separates them. */
.prose-blog pre + h2,
.prose-blog table + h2 {
    margin-top: 3rem;
}

.prose-blog h2:first-child,
.prose-blog h3:first-child,
.prose-blog h4:first-child {
    margin-top: 0;
}

/* The article column supplies the bottom spacing. */
.prose-blog > :last-child {
    margin-bottom: 0;
}

/* Active TOC link indicator: the current section is underlined and bold. */
[data-toc-link].toc-active {
    color: var(--ink);
    font-weight: 700;
    text-decoration: underline;
}

/* Capacity status lamps. The rhythm carries the state as much as the colour:
   a quick blip is a heartbeat (normal), a slow pulse is a resource the sampler
   holds no reading for, and a hard on/off flash is a fault — faster the worse
   it is. The fastest flash is two a second, under WCAG 2.3.1's limit of
   three flashes a second. */
.capacity-lamp-normal {
    animation: capacity-lamp-blip 2s linear infinite;
}

.capacity-lamp-unknown {
    animation: capacity-lamp-pulse 3s ease-in-out infinite;
}

.capacity-lamp-watch {
    animation: capacity-lamp-flash 1s step-end infinite;
}

.capacity-lamp-saturated {
    animation: capacity-lamp-flash 0.5s step-end infinite;
}

/* Lit, with a dip lasting about a tenth of the cycle. */
@keyframes capacity-lamp-blip {
    0%, 88%, 100% { opacity: 1; }
    94% { opacity: 0.2; }
}

@keyframes capacity-lamp-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes capacity-lamp-flash {
    0% { opacity: 1; }
    50% { opacity: 0.1; }
}

/* Without motion the rhythm is gone, so a lamp with no reading is dimmed to
   keep it distinct from a healthy one by more than hue. Watch and saturated
   keep their colour and, for saturated, the red tile. */
@media (prefers-reduced-motion: reduce) {
    .capacity-lamp-normal,
    .capacity-lamp-unknown,
    .capacity-lamp-watch,
    .capacity-lamp-saturated {
        animation: none;
    }

    .capacity-lamp-unknown {
        opacity: 0.4;
    }
}

/* Homepage relay (partials/home-relay). One 16s timeline shared by every
   element; the acts are keyframe percentages, not delays, so the elements
   cannot drift apart. Act 1 (0-47%) is you carrying a note between agent
   windows, a cross and a "Don't copy 'n paste" stamp strike it (44-55%), and Act 2
   (56-96%) is the agents reaching each other. Translations
   are in SVG user units and count from each element's authored resting
   place, which is the end of Act 2. */
.relay-anim {
    animation-duration: 16s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.relay-caption-before { animation-name: relay-caption-before; }
.relay-caption-after { animation-name: relay-caption-after; }
.relay-cursor { animation-name: relay-cursor; }
.relay-clip { animation-name: relay-clip; }
.relay-paste-tests { animation-name: relay-paste-tests; }
.relay-paste-docs { animation-name: relay-paste-docs; }
.relay-link { animation-name: relay-link; }
.relay-msg {
    animation-name: relay-msg;
    transform-box: fill-box;
    transform-origin: center;
}
.relay-mail {
    animation-name: relay-mail;
    transform-box: fill-box;
    transform-origin: center;
}

/* Where each Semantik beam starts, the coder's note, relative to the
   centre of the card it lands on. */
.relay-beam { animation-name: relay-beam; }
.relay-beam-tests { --relay-from-x: 196px; --relay-from-y: -162px; }
.relay-beam-docs { --relay-from-x: 0px; --relay-from-y: -162px; }

/* The Bud beam leaves the tests card for the planner's envelope. It reuses
   the Semantik beam's keyframes 16% (2.56s) later; a negative delay of
   16s minus 2.56s shifts the phase without a blank first lap. */
.relay-beam-mail { --relay-from-x: 0px; --relay-from-y: 151px; }

.relay-beam-mail,
.relay-beam-mail .relay-anim {
    animation-delay: -13.44s;
}

.relay-beam-squash {
    animation-name: relay-beam-squash;
    transform-box: fill-box;
    transform-origin: center;
}

/* The blurred trail is anchored at the beam's head (the right edge of its
   box in the beam's frame) and stretches back from it. */
.relay-beam-trail {
    animation-name: relay-beam-trail;
    transform-box: fill-box;
    transform-origin: 100% 50%;
}

@keyframes relay-caption-before {
    0% { opacity: 0; }
    3%, 52% { opacity: 1; }
    55%, 100% { opacity: 0; }
}

@keyframes relay-caption-after {
    0%, 55% { opacity: 0; }
    58%, 96% { opacity: 1; }
    100% { opacity: 0; }
}

/* Centre, to the coder's note, into tests, into docs, then away. Each
   The paste stops sit high and inside enough that the clipboard tag at the
   pointer's bottom-right stays clear of the 360x320 viewBox edge, which
   clips it: the docs stop ends at x 70, both paste stops at y 108.
   glide bows off the straight line, accelerates out of its start, eases
   into its target, overshoots by a few units and settles: a hand on a
   mouse, not a tween. One keyframe percent is 160ms. */
@keyframes relay-cursor {
    0% { opacity: 0; transform: translate(-10px, 8px); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
    4% { opacity: 1; transform: translate(0, 0); }
    5% { transform: translate(0, 0); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
    8% { transform: translate(14px, -33px); animation-timing-function: cubic-bezier(.1, .4, .3, 1); }
    10.8% { transform: translate(57px, -53px); animation-timing-function: ease-in-out; }
    11.8%, 16% { transform: translate(54px, -50px); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
    19.5% { transform: translate(-8px, 36px); animation-timing-function: cubic-bezier(.1, .4, .3, 1); }
    23.6% { transform: translate(-109px, 111px); animation-timing-function: ease-in-out; }
    24.8%, 29% { transform: translate(-106px, 108px); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
    32.5% { transform: translate(-18px, 106px); animation-timing-function: cubic-bezier(.1, .4, .3, 1); }
    36.4% { transform: translate(73px, 110px); animation-timing-function: ease-in-out; }
    37.4%, 42% { opacity: 1; transform: translate(70px, 108px); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
    47%, 100% { opacity: 0; transform: translate(100px, 86px); }
}

/* Clicks at 12.6% (copy), 25.4% and 38% (paste): the pointer settles,
   clicks once to set the caret, and only then does the key chord follow. The arrow squeezes toward its tip
   for about 100ms and springs back; fill-box puts the 0 0 origin on the
   tip, the top-left of the arrow's box. */
.relay-press {
    animation-name: relay-press;
    transform-box: fill-box;
    transform-origin: 0 0;
}

@keyframes relay-press {
    0%, 12.3% { transform: scale(1); }
    12.6% { transform: scale(.82); }
    13.2% { transform: scale(1.04); }
    13.6%, 25.1% { transform: scale(1); }
    25.4% { transform: scale(.82); }
    26% { transform: scale(1.04); }
    26.4%, 37.7% { transform: scale(1); }
    38% { transform: scale(.82); }
    38.6% { transform: scale(1.04); }
    39%, 100% { transform: scale(1); }
}

/* After the click, the chord: the keycaps appear at the pointer's
   bottom-left, Ctrl goes down, then C or V, and the clipboard or the
   pasted note appears on the second key. Pressed means the cap slides
   onto its hard shadow, the site's press-in. Copy happens once, at the
   coder; paste twice, at tests and at docs. */
.relay-keys-copy { animation-name: relay-keys-copy; }
.relay-keys-paste { animation-name: relay-keys-paste; }
.relay-key-ctrl-copy { animation-name: relay-key-ctrl-copy; }
.relay-key-c { animation-name: relay-key-c; }
.relay-key-ctrl-paste { animation-name: relay-key-ctrl-paste; }
.relay-key-v { animation-name: relay-key-v; }

.relay-keys-copy,
.relay-keys-paste,
.relay-key-ctrl-copy,
.relay-key-c,
.relay-key-ctrl-paste,
.relay-key-v {
    animation-timing-function: linear;
}

@keyframes relay-keys-copy {
    0%, 13% { opacity: 0; }
    13.3%, 15% { opacity: 1; }
    15.5%, 100% { opacity: 0; }
}

@keyframes relay-key-ctrl-copy {
    0%, 13.5% { transform: translate(0, 0); }
    13.65%, 14.7% { transform: translate(2px, 2px); }
    14.85%, 100% { transform: translate(0, 0); }
}

@keyframes relay-key-c {
    0%, 13.9% { transform: translate(0, 0); }
    14.05%, 14.6% { transform: translate(2px, 2px); }
    14.75%, 100% { transform: translate(0, 0); }
}

@keyframes relay-keys-paste {
    0%, 25.7% { opacity: 0; }
    26%, 27.6% { opacity: 1; }
    28%, 38.3% { opacity: 0; }
    38.6%, 40.2% { opacity: 1; }
    40.6%, 100% { opacity: 0; }
}

@keyframes relay-key-ctrl-paste {
    0%, 26.1% { transform: translate(0, 0); }
    26.25%, 27.3% { transform: translate(2px, 2px); }
    27.45%, 38.7% { transform: translate(0, 0); }
    38.85%, 39.9% { transform: translate(2px, 2px); }
    40.05%, 100% { transform: translate(0, 0); }
}

@keyframes relay-key-v {
    0%, 26.45% { transform: translate(0, 0); }
    26.6%, 27.2% { transform: translate(2px, 2px); }
    27.35%, 39.05% { transform: translate(0, 0); }
    39.2%, 39.8% { transform: translate(2px, 2px); }
    39.95%, 100% { transform: translate(0, 0); }
}

@keyframes relay-clip {
    0%, 14.05% { opacity: 0; }
    14.3%, 42% { opacity: 1; }
    43%, 100% { opacity: 0; }
}

@keyframes relay-paste-tests {
    0%, 26.6% { opacity: 0; }
    26.8%, 52% { opacity: 1; }
    55%, 100% { opacity: 0; }
}

@keyframes relay-paste-docs {
    0%, 39.2% { opacity: 0; }
    39.4%, 52% { opacity: 1; }
    55%, 100% { opacity: 0; }
}

@keyframes relay-link {
    0%, 56% { opacity: 0; }
    60%, 96% { opacity: 1; }
    100% { opacity: 0; }
}

/* Semantik: published once from the coder, the message zaps to tests
   and docs as a beam (58.5-63.5%), which stretches as it accelerates,
   squashes flat against the landing spot and vanishes as the card
   flickers in with a vertical pop, like a Mega Man teleport. */
@keyframes relay-beam {
    0%, 58.4% { opacity: 0; transform: translate(var(--relay-from-x), var(--relay-from-y)); }
    58.5% { opacity: 1; transform: translate(var(--relay-from-x), var(--relay-from-y)); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
    63.5%, 65.2% { opacity: 1; transform: translate(0, 0); }
    65.4%, 100% { opacity: 0; transform: translate(0, 0); }
}

/* In the beam's own frame x runs along its path: it stretches in flight
   and on landing collapses along the path while spreading across it. */
@keyframes relay-beam-squash {
    0%, 58.5% { transform: scale(.4, 1); }
    60.5% { transform: scale(1.25, .85); }
    63.5% { transform: scale(1, 1); }
    64.2% { transform: scale(.45, 1.9); }
    65%, 100% { transform: scale(.15, 2.6); }
}

/* The trail streams out as the beam accelerates and is gone the moment
   it lands, so the squash reads crisp. */
@keyframes relay-beam-trail {
    0%, 58.5% { opacity: 0; transform: scale(.2, 1); }
    60.5% { opacity: 1; transform: scale(.7, 1); }
    63.2% { opacity: 1; transform: scale(1, 1); }
    63.8%, 100% { opacity: 0; transform: scale(.3, 1); }
}

@keyframes relay-msg {
    0%, 65% { opacity: 0; transform: scale(1, .2); }
    65.1% { opacity: 1; transform: scale(1, .2); }
    65.4% { opacity: 0; transform: scale(1, .45); }
    65.7% { opacity: 1; transform: scale(1, .7); }
    66% { opacity: .35; transform: scale(1, .9); }
    66.3% { opacity: 1; transform: scale(1, 1.08); }
    66.8%, 96% { opacity: 1; transform: scale(1, 1); }
    100% { opacity: 0; transform: scale(1, 1); }
}

/* Bud: the envelope flickers in at the planner as its beam squashes, the
   same materialize as the Semantik cards, 16% later. */
@keyframes relay-mail {
    0%, 81% { opacity: 0; transform: scale(1, .2); }
    81.1% { opacity: 1; transform: scale(1, .2); }
    81.4% { opacity: 0; transform: scale(1, .45); }
    81.7% { opacity: 1; transform: scale(1, .7); }
    82% { opacity: .35; transform: scale(1, .9); }
    82.3% { opacity: 1; transform: scale(1, 1.08); }
    82.8%, 96% { opacity: 1; transform: scale(1, 1); }
    100% { opacity: 0; transform: scale(1, 1); }
}

/* WCAG 2.2.2: motion longer than five seconds can be stopped. Stopping
   drops the animation rather than pausing it, so the picture settles on
   its authored end state, agents talking directly, instead of freezing
   mid-relay. Browsers without :has() cannot honour the box, so there the
   relay never moves and the box is hidden. */
.home-relay:has(.relay-pause:checked) .relay-anim {
    animation: none;
}

@supports not selector(:has(*)) {
    .relay-anim {
        animation: none;
    }

    .relay-pause-control {
        display: none;
    }
}

/* Without motion every element falls back to its authored attributes,
   which are the end of Act 2: agents already talking directly. */
@media (prefers-reduced-motion: reduce) {
    .relay-anim {
        animation: none;
    }
}

/* The turn between the acts. Once the cursor has left, two strokes strike
   the copy-paste scene (44-46.5%), a "Don't copy 'n paste" stamp lands on the cross with
   a small overshoot, and both hold for about a second before clearing
   (52-55%) so Act 2 starts on a clean picture. */
.relay-cross { animation-name: relay-cross; }
.relay-cross-a { animation-name: relay-cross-a; }
.relay-cross-b { animation-name: relay-cross-b; }

.relay-dont {
    animation-name: relay-dont;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes relay-cross {
    0%, 43.9% { opacity: 0; }
    44%, 52% { opacity: 1; }
    55%, 100% { opacity: 0; }
}

@keyframes relay-cross-a {
    0%, 44% { stroke-dashoffset: 1; }
    45.5%, 100% { stroke-dashoffset: 0; }
}

@keyframes relay-cross-b {
    0%, 45% { stroke-dashoffset: 1; }
    46.5%, 100% { stroke-dashoffset: 0; }
}

@keyframes relay-dont {
    0%, 46% { opacity: 0; transform: scale(1.3); }
    47% { opacity: 1; transform: scale(.95); }
    47.6%, 52% { opacity: 1; transform: scale(1); }
    55%, 100% { opacity: 0; transform: scale(1); }
}
