/* FlyxCloud. Tokens come from design-system/flyxcloud/MASTER.md. */

/* Fonts are served from this site rather than Google Fonts, so visiting the page
   sends nothing to a third party. Latin subsets of the variable fonts, licensed
   under the SIL Open Font License (fonts/OFL-*.txt). */
@font-face {
    font-family: "IBM Plex Sans";
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url("fonts/ibm-plex-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url("fonts/jetbrains-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: dark;

    --color-primary: #1E293B;
    --color-secondary: #334155;
    --color-accent: #22C55E;
    --color-on-accent: #0F172A;
    --color-background: #0F172A;
    --color-foreground: #F8FAFC;
    --color-card: #1B2336;
    --color-muted: #272F42;
    --color-muted-foreground: #94A3B8;
    --color-border: #475569;
    --color-destructive: #EF4444;
    --color-ring: #FFFFFF;

    --color-border-soft: #2B3549;
    --color-accent-soft: rgba(34, 197, 94, 0.12);

    --font-head: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --header-h: 64px;
}

/* Base */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + var(--space-md));
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-foreground);
    font: 400 1rem/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: var(--font-head);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

p {
    margin: 0;
    text-wrap: pretty;
}

a {
    color: inherit;
}

code {
    font-family: var(--font-head);
    font-size: 0.875em;
    font-weight: 500;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.sprite,
[hidden] {
    display: none !important;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.skip-link {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 100;
    padding: var(--space-sm) var(--space-md);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font-weight: 600;
    border-radius: var(--radius-md);
    transform: translateY(-150%);
    transition: transform 150ms var(--ease-out);
}

.skip-link:focus {
    transform: none;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-inline: var(--space-md);
}

.muted {
    color: var(--color-muted-foreground);
}

.eyebrow {
    margin-bottom: var(--space-md);
    font: 500 0.8125rem/1.4 var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font: 600 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms var(--ease-out);
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-on-accent);
}

.btn-primary:hover {
    background: #4ADE80;
    transform: translateY(-1px);
}

.btn-ghost {
    border-color: var(--color-border);
    color: var(--color-foreground);
}

.btn-ghost:hover {
    border-color: var(--color-muted-foreground);
    background: var(--color-primary);
}

.btn-sm {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 0.9375rem;
}

.btn:active {
    transform: translateY(0);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}

.site-header.is-scrolled {
    border-bottom-color: var(--color-border-soft);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 44px;
    font: 700 1.0625rem var(--font-head);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    color: var(--color-accent);
    width: 1.5em;
    height: 1.5em;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.site-nav a:not(.btn) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-md);
    border-radius: var(--radius-md);
    color: var(--color-muted-foreground);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 150ms ease, background-color 150ms ease;
}

/* Tablet widths: tighter links so the full nav fits on one line */
@media (min-width: 768px) and (max-width: 1023px) {
    .site-nav a:not(.btn) {
        padding: 0 var(--space-sm);
    }
}

.site-nav a:not(.btn):hover {
    color: var(--color-foreground);
    background: var(--color-primary);
}

.site-nav li:last-child {
    margin-left: var(--space-sm);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-foreground);
    cursor: pointer;
}

.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-open {
    display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
}

/* Hero */

.hero {
    position: relative;
    padding-block: var(--space-3xl);
    overflow: hidden;
}

/* Faint grid that fades out, so the hero has depth without an image */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--color-border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border-soft) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 10%, transparent 75%);
    opacity: 0.5;
    pointer-events: none;
    /* One tile per loop, so the drift repeats seamlessly; about 6px a second */
    animation: grid-drift 8s linear infinite;
}

@keyframes grid-drift {
    to {
        background-position: 48px 48px;
    }
}

/* Hide the headline until DecryptedText has scrambled it, so it doesn't flash.
   The animation is a fallback that shows it anyway if the script never runs. */
.js [data-decrypt]:not(.decrypt-ready) {
    visibility: hidden;
    animation: decrypt-fallback 0s 2s forwards;
}

@keyframes decrypt-fallback {
    to {
        visibility: visible;
    }
}

.hero-grid {
    position: relative;
    display: grid;
    gap: var(--space-2xl);
    align-items: center;
}

.hero h1 {
    font-size: clamp(2rem, 1.2rem + 3.6vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.lede {
    max-width: 58ch;
    margin-block: var(--space-lg) var(--space-xl);
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
}

/* Terminal */

.terminal {
    margin: 0;
    min-width: 0;
    background: #0B1120;
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(34, 197, 94, 0.04), 0 0 60px rgba(34, 197, 94, 0.06);
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-soft);
    background: var(--color-card);
}

.terminal-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-secondary);
}

.terminal-bar code {
    margin-left: auto;
    color: var(--color-muted-foreground);
    font-size: 0.75rem;
}

.terminal-body {
    margin: 0;
    padding: var(--space-lg);
    overflow-x: auto;
    font: 500 0.8125rem/1.75 var(--font-head);
    color: var(--color-foreground);
}

.terminal-body code {
    font-size: inherit;
}

.terminal .prompt {
    color: var(--color-accent);
}

.terminal .key {
    color: #7DD3FC;
}

.terminal .dim {
    color: var(--color-muted-foreground);
}

.flx-price {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.flx-change {
    font-variant-numeric: tabular-nums;
}

.flx-change.up {
    color: var(--color-accent);
}

.flx-change.down {
    color: #F87171;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.1em;
    margin-left: 4px;
    vertical-align: -0.2em;
    background: var(--color-accent);
    animation: blink 1.1s steps(1) infinite;
}

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

/* Sections */

.section {
    padding-block: var(--space-3xl);
    border-top: 1px solid var(--color-border-soft);
}

.section-head {
    max-width: 72ch;
    margin-bottom: var(--space-2xl);
}

.section-head h2,
.about-grid h2,
.contact h2 {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
    letter-spacing: -0.03em;
}

.section-lede {
    margin-top: var(--space-md);
    font-size: 1.125rem;
    color: var(--color-muted-foreground);
}

.play-money {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--color-muted-foreground);
}

.play-money .icon {
    color: var(--color-accent);
}

.subhead {
    margin-top: var(--space-3xl);
}

.subhead h3 {
    font-size: 1.375rem;
}

.subhead>.muted,
.subhead-row .muted {
    margin-top: var(--space-sm);
}

.subhead-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-md);
}

/* Flyconomy stats */

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
    margin: 0;
}

.stat {
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
}

.stat dt {
    font-size: 0.9375rem;
    color: var(--color-muted-foreground);
}

.stat dd {
    order: -1;
    margin: 0 0 var(--space-xs);
    /* 1.2 matches CountUp's reel height, so the card doesn't shift when the plain number returns */
    font: 700 clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem)/1.2 var(--font-head);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--color-accent);
}

.stats-note {
    margin-top: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--color-muted-foreground);
}

/* Overview / Technical toggle */

.segmented {
    display: inline-flex;
    padding: 4px;
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: 10px;
}

.segmented button {
    min-height: 40px;
    padding: 0 var(--space-md);
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-muted-foreground);
    font: 500 0.9375rem var(--font-body);
    cursor: pointer;
    transition: background-color 200ms ease, color 200ms ease;
}

.segmented button:hover {
    color: var(--color-foreground);
}

.segmented button[aria-pressed="true"] {
    background: var(--color-secondary);
    color: var(--color-foreground);
}

/* Without JS both levels show; once script.js sets data-detail, only the chosen one does */
[data-detail-scope][data-detail="overview"] .tech {
    display: none;
}

/* Systems */

.systems {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.system {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    transition: border-color 200ms ease;
}

.system:hover {
    border-color: var(--color-border);
}

.system-icon {
    width: 40px;
    height: 40px;
    padding: 9px;
    margin-bottom: var(--space-sm);
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.system h4 {
    font-size: 1.0625rem;
}

.system p {
    color: var(--color-muted-foreground);
}

.system .tech {
    margin-top: var(--space-xs);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--color-border-soft);
    font-size: 0.9375rem;
    color: var(--color-foreground);
}

.system .tech code,
.lesson code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--color-muted);
    color: #BBF7D0;
}

/* Architecture flow */

.flow {
    position: relative;
    display: grid;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
    counter-reset: flow;
}

.flow-step {
    position: relative;
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
}

/* Arrow to the next step: down on narrow screens, right on wide ones */
.flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(-1 * var(--space-xl) + 6px);
    width: 2px;
    height: calc(var(--space-xl) - 12px);
    background: linear-gradient(var(--color-border), var(--color-accent));
    transform: translateX(-50%);
}

.flow-num {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: var(--space-md);
    border-radius: 50%;
    background: var(--color-accent);
    color: var(--color-on-accent);
    font: 700 0.875rem var(--font-head);
}

.flow-step h4 {
    margin-bottom: var(--space-sm);
    font-size: 1.0625rem;
}

.flow-step p {
    color: var(--color-muted-foreground);
}

.flow-step code {
    color: var(--color-foreground);
}

.flow-step .flow-tech {
    margin-top: var(--space-md);
    font: 500 0.8125rem var(--font-head);
    color: #7DD3FC;
}

/* The shared steps share a dashed frame to show the container boundary */
.flow-step {
    border-style: dashed;
    border-color: var(--color-border);
}

/* Two ways in: Discord and the web dashboard, side by side above the flow */

.entries {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
}

.entry-head {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.entry-head .system-icon {
    margin-bottom: 0;
}

.entry-label {
    font: 500 0.75rem/1.4 var(--font-head);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.entry h4 {
    font-size: 1.25rem;
}

.entry > p:not(.flow-tech) {
    color: var(--color-muted-foreground);
}

.entry-panel {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-muted);
}

.entry-panel--secure {
    background: var(--color-accent-soft);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.entry-panel h5 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 0 var(--space-sm);
    font: 600 0.9375rem/1.3 var(--font-head);
}

.entry-panel h5 .icon {
    color: var(--color-accent);
}

.checks {
    display: grid;
    gap: var(--space-sm);
    font-size: 0.9375rem;
}

/* Icon positioned outside the text so inline code doesn't split the line */
.checks li {
    position: relative;
    padding-left: 1.75em;
}

.checks .icon {
    position: absolute;
    left: 0;
    top: 0.2em;
    width: 1.1em;
    height: 1.1em;
    color: var(--color-accent);
}

.entry .flow-tech {
    margin-top: auto;
    font: 500 0.8125rem var(--font-head);
    color: #7DD3FC;
}

/* Merge connector: one line down on phones; both cards joining into one on wide screens */
.merge {
    position: relative;
    height: var(--space-xl);
}

.merge::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(var(--color-border), var(--color-accent));
    transform: translateX(-50%);
}

.merge-label {
    margin: var(--space-sm) auto 0;
    max-width: 60ch;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: center;
}

.merge-label + .flow {
    margin-top: var(--space-lg);
}

.flow-note {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    font-size: 0.9375rem;
    color: var(--color-muted-foreground);
}

.frame-swatch {
    flex: none;
    width: 20px;
    height: 14px;
    border: 1.5px dashed var(--color-border);
    border-radius: 3px;
}

/* Lessons */

.lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.lesson {
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-lg);
}

.lesson h4 {
    margin-bottom: var(--space-md);
    font-size: 1.0625rem;
}

.lesson .before {
    color: var(--color-muted-foreground);
}

.lesson .after {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    font-weight: 500;
}

.lesson .after .icon {
    margin-top: 0.15em;
    color: var(--color-accent);
}

.spotlight-actions {
    margin-top: var(--space-2xl);
}

/* Projects */

.projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: var(--space-md);
}

.project {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
    transition: border-color 200ms ease, transform 200ms var(--ease-out), box-shadow 200ms ease;
}

.project:hover {
    border-color: var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.project:focus-within {
    border-color: var(--color-muted-foreground);
}

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font: 500 0.8125rem var(--font-head);
    color: var(--color-muted-foreground);
}

.tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.project h3 {
    margin-top: var(--space-xs);
    font-size: 1.1875rem;
}

.project h3 a {
    text-decoration: none;
}

/* The title link covers the card; other links sit above it */
.stretched::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.project .stretched:focus-visible {
    outline: none;
}

.project:has(.stretched:focus-visible) {
    outline: 2px solid var(--color-ring);
    outline-offset: 3px;
}

.project p {
    color: var(--color-muted-foreground);
}

.project-links {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: var(--space-sm);
}

.project-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: none;
}

.project-links a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-links .icon {
    width: 1em;
    height: 1em;
}

/* Free and open source */

.principles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: var(--space-md);
}

.principle {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
}

.principle h3 {
    font-size: 1.0625rem;
}

.principle p {
    color: var(--color-muted-foreground);
}

.principle .principle-proof {
    margin-top: auto;
    padding-top: var(--space-sm);
    font: 500 0.8125rem var(--font-head);
    color: #7DD3FC;
}

/* Self-hosting call to action, closing the open-source section */

.self-host {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-lg);
}

.self-host .system-icon {
    margin-bottom: 0;
}

.self-host-body {
    display: grid;
    gap: var(--space-md);
}

.self-host h3 {
    font-size: 1.1875rem;
}

.self-host p {
    max-width: 70ch;
    color: var(--color-muted-foreground);
}

/* About */

.about-grid {
    display: grid;
    gap: var(--space-2xl);
}

.prose {
    display: grid;
    gap: var(--space-md);
    max-width: 62ch;
    margin-top: var(--space-lg);
    font-size: 1.0625rem;
    color: var(--color-muted-foreground);
}

.skills {
    display: grid;
    gap: var(--space-md);
    align-content: start;
}

.skill-group {
    padding: var(--space-lg);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-lg);
}

.skill-group h3 {
    margin-bottom: var(--space-md);
    font-size: 0.9375rem;
    color: var(--color-muted-foreground);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chips li {
    padding: 4px 12px;
    border: 1px solid var(--color-border-soft);
    border-radius: 999px;
    background: var(--color-muted);
    font-size: 0.9375rem;
}

/* Contact */

.contact-card {
    display: grid;
    justify-items: start;
    gap: var(--space-lg);
    padding: var(--space-2xl) var(--space-lg);
    background:
        radial-gradient(ellipse at top right, rgba(34, 197, 94, 0.14), transparent 60%),
        var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: 16px;
}

.contact-card p {
    max-width: 56ch;
    font-size: 1.0625rem;
    color: var(--color-muted-foreground);
}

/* Legal page */

.legal {
    border-top: 0;
}

.legal h1 {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
    letter-spacing: -0.03em;
}

.legal-body {
    display: grid;
    gap: var(--space-2xl);
    max-width: 72ch;
}

.legal-body section {
    display: grid;
    gap: var(--space-md);
}

.legal-body h2 {
    font-size: 1.25rem;
}

.legal-body p,
.legal-body li,
.legal-body dd {
    color: var(--color-muted-foreground);
}

.legal-body ul {
    display: grid;
    gap: var(--space-sm);
    padding-left: 1.25rem;
    list-style: disc;
}

.legal-body strong,
.legal-body dt {
    color: var(--color-foreground);
    font-weight: 600;
}

.legal-body a,
.site-footer a {
    color: var(--color-accent);
    text-underline-offset: 3px;
}

/* Self-hosting guide */
.guide .steps {
    display: grid;
    gap: var(--space-lg);
    padding-left: 1.5rem;
    list-style: decimal;
}

.guide .steps li {
    min-width: 0;
}

.guide .steps li > * + *,
.guide details > * + * {
    margin-top: var(--space-sm);
}

.guide .steps li::marker {
    color: var(--color-accent);
    font-family: var(--font-head);
    font-weight: 700;
}

.guide pre {
    margin: 0;
    padding: var(--space-md);
    overflow-x: auto;
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
    color: var(--color-foreground);
    line-height: 1.6;
}

.guide :not(pre) > code,
.guide kbd {
    padding: 0.1em 0.35em;
    background: var(--color-muted);
    border-radius: var(--radius-sm);
    color: var(--color-foreground);
}

.guide kbd {
    font-family: var(--font-head);
    font-size: 0.85em;
    border-bottom: 2px solid var(--color-border);
}

.guide .callout {
    padding: var(--space-md);
    background: var(--color-accent-soft);
    border-left: 3px solid var(--color-accent);
    border-radius: var(--radius-sm);
}

.guide .table-wrap {
    overflow-x: auto;
}

.guide table {
    width: 100%;
    border-collapse: collapse;
}

.guide th,
.guide td {
    padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
    border-bottom: 1px solid var(--color-border-soft);
    color: var(--color-muted-foreground);
    text-align: left;
    vertical-align: top;
}

.guide th {
    color: var(--color-foreground);
    font-weight: 600;
}

.guide details {
    padding: var(--space-md);
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-md);
}

.guide summary {
    min-height: 24px;
    color: var(--color-foreground);
    font-weight: 600;
    cursor: pointer;
}

.credits {
    display: grid;
    gap: var(--space-md);
    margin: 0;
}

.credits dd {
    margin: 0;
}

/* Footer */

.site-footer {
    padding-block: var(--space-xl);
    border-top: 1px solid var(--color-border-soft);
    font-size: 0.9375rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-sm);
}

/* Scroll reveal, only when script.js has opted in */

.js-reveal .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 450ms var(--ease-out), transform 450ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 60ms);
}

.js-reveal .reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Breakpoints */

@media (max-width: 767px) {
    .nav-toggle {
        display: grid;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: var(--space-sm) var(--space-md) var(--space-md);
        background: var(--color-background);
        border-bottom: 1px solid var(--color-border-soft);
        box-shadow: var(--shadow-lg);
    }

    /* Hidden only once JS can reopen it */
    .has-nav-toggle .site-nav:not(.is-open) {
        display: none;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    .site-nav a:not(.btn) {
        padding-inline: var(--space-sm);
    }

    .site-nav li:last-child {
        margin: var(--space-sm) 0 0;
    }

    .site-nav .btn {
        width: 100%;
    }

    .actions .btn {
        flex: 1 1 auto;
    }

    .self-host {
        flex-direction: column;
    }
}

@media (min-width: 768px) {
    .container {
        padding-inline: var(--space-lg);
    }

    .entries {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* A bracket from the middle of each card, joining into one line down */
    .merge {
        height: calc(var(--space-xl) * 1.5);
    }

    .merge::before {
        content: "";
        position: absolute;
        top: 0;
        left: calc(25% - var(--space-md) / 4);
        right: calc(25% - var(--space-md) / 4);
        height: 50%;
        border: 2px solid var(--color-border);
        border-top: 0;
        border-radius: 0 0 12px 12px;
    }

    .merge::after {
        top: 50%;
    }

    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* Four projects sit best as a 2 × 2 grid rather than 3 + 1 */
    .projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-card {
        padding: var(--space-3xl);
    }
}

@media (min-width: 1024px) {
    .hero {
        padding-block: 6rem;
    }

    .hero-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .flow {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-xl);
    }

    .flow-step:not(:last-child)::after {
        left: auto;
        right: calc(-1 * var(--space-xl) + 6px);
        top: 40px;
        bottom: auto;
        width: calc(var(--space-xl) - 12px);
        height: 2px;
        background: linear-gradient(90deg, var(--color-border), var(--color-accent));
        transform: none;
    }

    .about-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

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

    .hero::before {
        animation: none;
    }

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