/* JsnLabs site. Palette "Electric Indigo": cool lavender-white or deep navy surfaces, indigo for
   buttons, lilac as the second accent; glass tiles and soft waves as the recurring graphics. Light or dark as the system says, unless
   the switch in the bar chose (theme-light or theme-dark on <html>, set by the server from a cookie). No scripts: the
   floating bar is sticky CSS, the small-screen menu a <details> element. */

@font-face {
    font-family: "Space Grotesk";
    src: url("../fonts/SpaceGrotesk.ttf") format("truetype");
    font-weight: 300 700;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter.ttf") format("truetype");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/JetBrainsMono.ttf") format("truetype");
    font-weight: 100 800;
    font-display: swap;
}

:root {
    /* light-dark(light, dark): the colour scheme below picks one, so each colour is written once. */
    --bg: light-dark(#F5F6FC, #0E1224);
    --surface: light-dark(#FFFFFF, #151A33);
    --raised: light-dark(#E9EAFF, #1B1F3B);
    --line: light-dark(#DFE1F3, #272C52);
    --text: light-dark(#334155, #E6E9FF);
    --heading: light-dark(#111426, #F4F5FF);
    --muted: light-dark(#64748B, #94A3B8);
    /* Text links and small marks; buttons use --primary. Both are a shade deeper or lighter than the
       palette sheet where the sheet's value would be too faint as text. */
    --accent: light-dark(#5B4BE8, #A78BFA);
    --primary: light-dark(#6D5EF9, #7C3AED);
    --on-primary: #FFFFFF;
    --highlight: light-dark(#7C3AED, #C4B5FD);
    --lilac: #A78BFA;
    --glow: light-dark(rgb(109 94 249 / 0.20), rgb(124 58 237 / 0.32));
    --glow-2: light-dark(rgb(167 139 250 / 0.18), rgb(167 139 250 / 0.12));
    --grid: light-dark(rgb(17 20 38 / 0.045), rgb(230 233 255 / 0.045));
    --nav-bg: light-dark(rgb(255 255 255 / 0.75), rgb(21 26 51 / 0.72));
    --shadow: 0 0.75rem 2.5rem light-dark(rgb(55 48 163 / 0.08), rgb(0 0 0 / 0.40));
    /* Glass tiles and waves in the graphics. */
    --glass: light-dark(rgb(255 255 255 / 0.72), rgb(124 58 237 / 0.16));
    --glass-edge: light-dark(rgb(255 255 255 / 0.95), rgb(196 181 253 / 0.35));
    --wave-bg: light-dark(#ECEBFF, #12163A);

    /* Luciola brings its own colors to its band (Mint on Aubergine). */
    --luciola-gradient: linear-gradient(135deg, #763062 0%, #3D1747 45%, #28076A 100%);
    --luciola-text: #E9EEEB;
    --luciola-accent: #6FC09E;

    --font-text: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", ui-monospace, monospace;

    --radius: 16px;
    --width: 72rem;
    --reading: 42rem;

    /* The system decides, dark first; the switch in the bar sets a class on <html> to override it. */
    color-scheme: dark light;
}

:root.theme-light {
    color-scheme: light;
}

:root.theme-dark {
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 1.0625rem;
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--heading);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.4rem, 5.5vw + 0.5rem, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem;
}

h3 {
    font-size: 1.05rem;
    margin: 0 0 0.25rem;
}

a {
    color: var(--accent);
    text-underline-offset: 0.2em;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

code,
kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.bar {
    width: min(100% - 2.5rem, var(--width));
    margin-inline: auto;
}

.skip {
    position: absolute;
    left: -100vw;
}

.skip:focus {
    left: 1rem;
    top: 1rem;
    z-index: 30;
    background: var(--surface);
    padding: 0.5rem 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.muted {
    color: var(--muted);
}

/* Floating bar */

/* Same outer width as .bar below, so the pill lines up with the content. */
.site-header {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    padding-inline: 1.25rem;
    margin-top: 0.75rem;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, var(--width));
    margin-inline: auto;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--nav-bg);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: var(--shadow);
}

.brand {
    color: var(--text);
    text-decoration: none;
}

/* Wordmark until there is a logo: Space Grotesk 600 with a small accent square after "Labs". */
.wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.wordmark .mark {
    display: inline-block;
    width: 0.32em;
    height: 0.32em;
    margin-left: 0.12em;
    background: var(--accent);
}

.links,
.menu-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.links a:not(.button),
.menu-links a:not(.button) {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.links a:not(.button):hover {
    color: var(--text);
    background: var(--raised);
}

.lang {
    margin-inline: 0.5rem;
}

.lang-switch {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.links .lang-switch a,
.menu-links .lang-switch a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    line-height: 1;
}

.lang-switch a[aria-current] {
    background: var(--raised);
    color: var(--text);
}

.flag {
    width: 1.1rem;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2);
}

.menu {
    display: none;
}

.menu summary {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    cursor: pointer;
    list-style: none;
}

.menu summary::-webkit-details-marker {
    display: none;
}

.burger,
.burger::before,
.burger::after {
    display: block;
    width: 1.1rem;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
}

.burger {
    position: relative;
}

.burger::before,
.burger::after {
    content: "";
    position: absolute;
    left: 0;
}

.burger::before {
    top: -6px;
}

.burger::after {
    top: 6px;
}

.menu[open] .burger {
    background: transparent;
}

.menu[open] .burger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu[open] .burger::after {
    top: 0;
    transform: rotate(-45deg);
}

.menu-links {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.menu-links .button {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* Design switch: a sun leads to light, a moon to dark; only the one away from the current design shows. */
.theme-switch {
    display: flex;
    margin: 0;
}

.theme-switch button {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.theme-switch button:hover {
    color: var(--text);
    background: var(--raised);
}

.theme-switch button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-switch .to-dark {
    display: none;
}

@media (prefers-color-scheme: light) {
    :root:not(.theme-light, .theme-dark) .theme-switch .to-light {
        display: none;
    }

    :root:not(.theme-light, .theme-dark) .theme-switch .to-dark {
        display: grid;
    }
}

:root.theme-light .theme-switch .to-light {
    display: none;
}

:root.theme-light .theme-switch .to-dark {
    display: grid;
}

/* In the bar the links take the free space, so the switch sits next to them; on small screens next to the menu. */
.nav .links {
    margin-left: auto;
}

.nav .theme-switch {
    margin-left: -0.5rem;
}

@media (max-width: 52rem) {
    .links {
        display: none;
    }

    .menu {
        display: block;
    }

    .nav .theme-switch {
        margin-left: auto;
    }
}

/* Hero: large type on a faint grid that fades out, lit from the top right. */

.hero {
    position: relative;
    isolation: isolate;
    margin-top: -5rem;
    padding-top: 5rem;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 3.5rem 3.5rem;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(40rem 26rem at 85% 5%, var(--glow), transparent 70%),
        radial-gradient(34rem 22rem at 5% 30%, var(--glow-2), transparent 70%);
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    padding-block: clamp(4rem, 9vw, 6rem) clamp(1rem, 4vw, 3rem);
}

.hero h1 {
    max-width: 58rem;
    font-size: clamp(2.4rem, 3.6vw + 0.5rem, 3.75rem);
}

.hero .accent-text {
    white-space: nowrap;
}

/* Glass tiles and waves (_HeroArt, _Wave): gradients and fills come from here so they follow the design. */
.hero-art {
    width: 100%;
    height: auto;
    max-width: 30rem;
    justify-self: end;
    overflow: visible;
}

.hero + .section {
    margin-top: clamp(2rem, 5vw, 4rem);
}

.stop-primary { stop-color: var(--primary); }
.stop-lilac { stop-color: var(--lilac); }
.stop-clear { stop-color: var(--lilac); stop-opacity: 0; }
.stop-glass { stop-color: var(--glass-edge); }
.stop-glass-low { stop-color: var(--glass); }

.hero-art .wave-fill { fill: url(#hero-wave); }
.hero-art .wave-line { stroke: url(#hero-line); }

.wave-fill {
    opacity: 0.48;
}

.wave-fill.soft {
    opacity: 0.22;
}

.wave-line {
    fill: none;
    stroke-width: 1.2;
    opacity: 0.55;
}

.wave-bg {
    fill: var(--wave-bg);
}

.wave-dot {
    fill: var(--lilac);
    opacity: 0.45;
}

.tile-glass {
    fill: url(#hero-glass);
    stroke: var(--glass-edge);
    stroke-width: 1.5;
}

.tile-shadow {
    fill: var(--primary);
    opacity: 0.32;
}

.wave-art {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 60rem) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-art {
        justify-self: center;
        max-width: 22rem;
        order: -1;
        margin-bottom: -1rem;
    }
}

@media (max-width: 36rem) {
    .hero-art {
        display: none;
    }
}

.accent-text {
    color: var(--accent);
    background: linear-gradient(90deg, var(--primary), var(--lilac));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    padding: 0.3rem 0.9rem 0.3rem 0.3rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.pill:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.pill-tag {
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.8rem;
}

.lead {
    max-width: var(--reading);
    font-size: 1.2rem;
    color: var(--muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Sections */

.section {
    margin-top: clamp(4rem, 9vw, 7rem);
}

.kicker {
    margin: 0 0 0.75rem;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-title {
    font-size: clamp(1.75rem, 2.5vw + 1rem, 2.6rem);
    max-width: 36rem;
}

.eyebrow {
    margin: 0 0 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

/* Three pillars side by side, each with a glass icon badge. */

.bento {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 60%, var(--bg)));
    overflow: hidden;
}


/* One row per product inside the tall tile; Luciola is the first. */
.product-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem 0.75rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--text);
    text-decoration: none;
}

.product-row:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.product-row img {
    border-radius: 10px;
}

.product-row span:not(.arrow) {
    display: grid;
    flex: 1;
}

.product-row small {
    color: var(--muted);
    font-size: 0.9rem;
}

.product-row .arrow {
    color: var(--accent);
}

.tile-wide::after {
    content: "";
    position: absolute;
    right: -6rem;
    bottom: -8rem;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--glow), transparent);
    pointer-events: none;
}

.tile:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.tile h2 {
    margin: 0.5rem 0 0;
    font-size: 1.5rem;
}

.tile p {
    margin: 0;
    flex: 1;
    max-width: 34rem;
    color: var(--muted);
}

.icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--accent);
}

/* In the pillars the icon sits on a small glass tile, as in the hero. */
.tile .icon {
    width: 3.5rem;
    height: 3.5rem;
    border: 1px solid var(--glass-edge);
    border-radius: 16px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lilac) 26%, var(--surface)), color-mix(in srgb, var(--primary) 14%, var(--surface)));
    box-shadow: 0 0.75rem 1.75rem color-mix(in srgb, var(--primary) 22%, transparent), inset 0 1px 0 var(--glass-edge);
    color: var(--primary);
}

.tile .icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 2;
}

.more .arrow {
    display: inline-block;
}

.more {
    font-weight: 600;
    text-decoration: none;
}

.more:hover {
    text-decoration: underline;
}

/* The product band keeps the product's own colors: Luciola's Aubergine gradient with Mint. */

.product-band {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
    gap: 2.5rem;
    padding: clamp(1.75rem, 4vw, 3rem);
    border-radius: calc(var(--radius) + 4px);
}

.product-band.luciola {
    background: var(--luciola-gradient);
    color: var(--luciola-text);
}

.product-band h2 {
    font-size: clamp(1.75rem, 2vw + 1rem, 2.4rem);
}

.product-band.luciola h2 {
    color: inherit;
}

.product-band.luciola .eyebrow {
    color: var(--luciola-accent);
}

.product-band.luciola .button {
    border-color: rgb(233 238 235 / 0.45);
    color: var(--luciola-text);
}

.product-band.luciola .button:hover {
    border-color: var(--luciola-accent);
}

.screen {
    margin: 0;
}

.screen img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.45);
}

/* Consulting: text beside numbered steps, focus areas below. */

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem 4rem;
    align-items: start;
}

.wave-panel {
    height: clamp(9rem, 16vw, 12rem);
    margin-bottom: 1.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.steps {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.steps li {
    display: grid;
    grid-template-columns: 3rem 1fr;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.steps span {
    color: var(--highlight);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding-top: 0.15rem;
}

.steps p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.chips {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chips li {
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
}

/* Buttons: primary filled in indigo, ghost as an outline; in the floating bar they stay pills. */

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.5rem 1.35rem;
    border: 1px solid color-mix(in srgb, var(--text) 28%, transparent);
    border-radius: 10px;
    background: transparent;
    color: var(--heading);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    border-color: var(--accent);
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--primary) 32%, transparent);
}

.nav .button,
.menu-links .button {
    border-radius: 999px;
}

.button.primary:hover {
    filter: brightness(1.08);
}

.button.ghost {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.button .arrow {
    transition: transform 160ms ease;
}

.button:hover .arrow,
.more:hover .arrow {
    transform: translateX(0.15rem);
}

.button.small {
    min-height: 2.4rem;
    padding: 0.35rem 1.1rem;
    font-size: 0.95rem;
}

/* Content pages */

.page {
    padding-top: 4rem;
}

.narrow > * {
    max-width: var(--reading);
}

.narrow > .cards {
    max-width: none;
}

.prose > * {
    max-width: var(--reading);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.card h2,
.card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.card p {
    margin: 0;
    flex: 1;
    color: var(--muted);
}

address {
    font-style: normal;
}

/* Contact form: no script, the browser's own controls in the site's colors. */

.contact-form {
    display: grid;
    gap: 1.25rem;
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.field {
    display: grid;
    align-content: start; /* in a row of fields, a hint must not stretch label and control apart */
    gap: 0.4rem;
}

.field label {
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.field textarea {
    resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.field [aria-invalid="true"] {
    border-color: var(--accent);
}

.field-hint,
.contact-form > .field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.field-error,
.form-error {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
}

.contact-form .actions {
    margin-top: 0;
}

/* Honeypot: off screen instead of display: none, which some bots skip. */
.trap {
    position: absolute;
    left: -100vw;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
}

.notice h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.notice p {
    margin-bottom: 0;
    color: var(--muted);
}

/* Admin area (behind Cloudflare Access): its own frame from _AdminLayout, full width, working sizes. */

.admin-bar {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.admin-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 2rem;
    padding-block: 0.75rem;
}

.admin-bar .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-tag {
    padding: 0.05rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-nav a {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}

.admin-nav a:hover {
    color: var(--text);
}

.admin-nav a[aria-current] {
    background: var(--raised);
    color: var(--text);
}

.admin-who {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0 0 0 auto;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.admin-bar-inner .theme-switch {
    margin-left: -1.25rem;
}

.admin {
    padding-block: 2rem 4rem;
}

.admin h1 {
    font-size: clamp(1.6rem, 1.5vw + 1rem, 2.1rem);
    letter-spacing: -0.02em;
    margin: 0;
}

.admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin > h1 {
    margin-bottom: 1.5rem;
}

.admin-back {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
}

.admin-back a {
    color: var(--muted);
    text-decoration: none;
}

.admin-back a:hover {
    color: var(--accent);
}

.admin .notice {
    margin: 0 0 1.5rem;
}

.admin .cards {
    margin-top: 0;
}

.admin .meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.admin-list li {
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.admin-list li > .meta {
    margin-top: 0.25rem;
}

.admin-posts li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.admin-post {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.admin-post h2 {
    margin: 0;
    font-size: 1.15rem;
}

.admin-post h2 a {
    color: var(--text);
    text-decoration: none;
}

.admin-post h2 a:hover {
    color: var(--accent);
}

.admin-post .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.admin-path {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.admin-links {
    display: flex;
    gap: 1rem;
    margin: 0;
    font-size: 0.95rem;
}

.admin-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.admin-foot code {
    overflow-wrap: anywhere;
}

.admin-errors {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1.25rem;
}

/* Editor: the text in the wide column, the details in a narrower one beside it. */

.editor {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 64rem) {
    .editor {
        grid-template-columns: minmax(0, 1fr) 20rem;
    }

    .editor-side {
        position: sticky;
        top: 1rem;
    }
}

.editor-main {
    display: grid;
    gap: 1.25rem;
}

.editor-main .editor-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
}

.editor-main textarea {
    min-height: 60vh;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
}

.editor-side {
    display: grid;
    gap: 1rem;
}

.editor-side > p {
    margin: 0;
}

.editor-panel {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.editor-panel .field label {
    font-size: 0.9rem;
}

.editor-panel .field-hint {
    font-size: 0.82rem;
}

.editor-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0;
}

.editor-actions .button {
    flex: 1;
    justify-content: center;
}

.editor-links {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.9rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
}

.admin-preview {
    margin-top: 2rem;
    padding: clamp(1.25rem, 4vw, 3rem);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.admin-preview .page-title {
    font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem);
}

.admin-upload {
    margin: 0 0 1.5rem;
    max-width: var(--reading);
}

.admin-upload input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--raised);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.admin-images {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
}

.admin-images li {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 1rem;
    align-items: center;
}

.admin-images img {
    width: 8rem;
    height: 6rem;
    object-fit: cover;
    border-radius: 8px;
}

.admin-images p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.admin-split {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 64rem) {
    .admin-split {
        grid-template-columns: 18rem minmax(0, 1fr);
    }
}

.admin-versions a[aria-current] {
    color: var(--text);
    font-weight: 600;
}

.admin-source {
    margin: 0;
    overflow-x: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.admin-split .actions {
    margin-top: 1rem;
}

.admin-message {
    max-width: var(--reading);
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.admin-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.admin-periods a {
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.admin-periods a:hover,
.admin-periods a[aria-current] {
    border-color: var(--accent);
    color: var(--text);
}

.admin-stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.admin-stat-tiles li {
    display: grid;
    gap: 0.2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.admin-stat-tiles strong {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-variant-numeric: tabular-nums;
}

.admin-stat-tiles span {
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-chart {
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.admin-chart figcaption {
    margin-bottom: 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-chart svg {
    display: block;
    width: 100%;
    height: 10rem;
    border-bottom: 1px solid var(--line);
}

.admin-chart .chart-bar {
    fill: var(--accent);
}

.admin-chart .chart-hit {
    fill: transparent;
}

.admin-chart g:hover .chart-hit {
    fill: var(--grid);
}

.admin-chart .meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.8rem;
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.5rem 2rem;
}

.admin-stat-table h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.admin-stat-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.admin-stat-table th,
.admin-stat-table td {
    padding: 0.4rem 0.5rem 0.4rem 0;
    border-bottom: 1px solid var(--line);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.admin-stat-table th:first-child,
.admin-stat-table td:first-child {
    text-align: left;
    overflow-wrap: anywhere;
}

.admin-stat-table th {
    color: var(--muted);
    font-weight: 500;
}

/* Content pages from content/ */

.page-title {
    font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem);
    letter-spacing: -0.03em;
    max-width: 48rem;
    margin-bottom: 1.25rem;
}

.prose h2 {
    margin-top: 2.5rem;
    font-size: 1.4rem;
}

.prose p,
.prose li {
    color: color-mix(in srgb, var(--text) 85%, var(--muted));
}

.prose li + li {
    margin-top: 0.35rem;
}

.prose code {
    padding: 0.1em 0.35em;
    border-radius: 6px;
    background: var(--raised);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
}

.prose th,
.prose td {
    padding: 0.5rem 0.75rem 0.5rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.draft {
    display: inline-block;
    padding: 0.05rem 0.55rem;
    border: 1px dashed var(--highlight);
    border-radius: 999px;
    color: var(--highlight);
    font-size: 0.8rem;
}

.product-list,
.project-list,
.service-grid {
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.product-list {
    display: grid;
    gap: 1.25rem;
}

.product-card {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    background: var(--surface);
}

.product-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.product-head img {
    border-radius: 14px;
}

.product-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem);
}

.product-head p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.product-body {
    max-width: var(--reading);
    margin-top: 1rem;
}

/* Brand looks for product cards; the strict CSP allows no inline styles, so each brand is a class. */
.brand-luciola {
    border: 0;
    background: var(--luciola-gradient);
    color: var(--luciola-text);
}

.brand-luciola .product-head p,
.brand-luciola .product-body {
    color: rgb(233 238 235 / 0.82);
}

.brand-luciola .button {
    border-color: rgb(233 238 235 / 0.45);
    color: var(--luciola-text);
}

.brand-luciola .button.primary {
    background: var(--luciola-accent);
    border-color: var(--luciola-accent);
    color: #000000;
    box-shadow: none;
}

.project-list {
    display: grid;
    gap: 0.75rem;
}

.project-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.project-main {
    flex: 1 1 24rem;
}

.project-main h2 {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
}

.project-main h2 a {
    color: var(--text);
    text-decoration: none;
}

.project-main h2 a:hover {
    color: var(--accent);
}

.project-main p {
    margin: 0;
    color: var(--muted);
}

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin-top: 0.75rem !important;
    font-size: 0.85rem;
}

.badge {
    padding: 0.05rem 0.6rem;
    border-radius: 999px;
    background: var(--raised);
    color: var(--muted);
    font-weight: 600;
}

.badge.status-active {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
}

.badge.status-maintained {
    background: color-mix(in srgb, var(--highlight) 16%, transparent);
    color: var(--highlight);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
    margin-top: 0;
}

.service-grid .tile h2 {
    font-size: 1.2rem;
}

.cta {
    padding: clamp(2rem, 5vw, 3.5rem);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 4px);
    background:
        radial-gradient(30rem 16rem at 100% 0%, var(--glow), transparent 70%),
        var(--surface);
}

.cta .section-title {
    margin-top: 0;
}

/* Blog */

.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.post-card article {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 160ms ease;
}

/* Cover image, or a wave when the post has none. */
.post-art {
    aspect-ratio: 16 / 7;
    background: var(--wave-bg);
}

.post-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.post-card article:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.post-card h2 {
    margin: 0.5rem 0 0.4rem;
    font-size: 1.2rem;
}

.post-card h2 a {
    color: var(--heading);
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--accent);
}

.post-card p {
    margin: 0;
    max-width: var(--reading);
    color: var(--muted);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
    margin: 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.tags a {
    display: inline-block;
    padding: 0.15rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.tags a:hover {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.tag-filter {
    margin-top: 1.5rem;
}

.post {
    max-width: var(--reading);
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-header .page-title {
    font-size: clamp(2rem, 3vw + 1rem, 3rem);
}

.translation {
    margin: 1rem 0 0;
    font-size: 0.95rem;
}

.post-cover {
    margin: 0 0 2.5rem;
}

.post-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.75;
}

.post-body > * {
    max-width: none;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.post-body blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid var(--highlight);
    color: var(--muted);
}

.post-tags {
    margin-top: 2.5rem;
}

.post-cta {
    margin-top: 3rem;
}

/* New posts by email: the box under the blog and the form on /newsletter. */

.newsletter-box {
    margin-top: 3rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.newsletter-box .section-title {
    margin-top: 0;
    font-size: clamp(1.35rem, 1.5vw + 1rem, 1.8rem);
}

.newsletter-form {
    margin-top: 1.5rem;
}

.newsletter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.newsletter-row input {
    flex: 1 1 16rem;
    width: auto;
}

.admin-section {
    margin-top: 2.5rem;
}

.admin-section .actions {
    margin-top: 0.75rem;
}

.admin-subscriber {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.related {
    margin-top: 3rem;
}

.related .post-list {
    margin-top: 1rem;
}

.related .post-card h2 {
    font-size: 1.15rem;
}

/* Blog search: a plain GET form, results rendered on the server. */

.blog-search {
    display: flex;
    gap: 0.5rem;
    max-width: 34rem;
    margin-top: 1.5rem;
}

.blog-search input {
    flex: 1;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}

.blog-search input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: transparent;
}

.search-count {
    margin: 1.5rem 0 0;
}

.post-card .excerpt {
    margin-top: 0.6rem;
    font-size: 0.95rem;
}

.excerpt mark {
    padding: 0 0.1em;
    border-radius: 3px;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--text);
}

/* Code blocks: highlighted on the server with tok-* classes, no script. */

pre.code {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
    tab-size: 4;
}

pre.code code {
    padding: 0;
    background: none;
    color: var(--text);
}

.tok-comment { color: var(--muted); font-style: italic; }
.tok-string { color: light-dark(#276B2B, #9AD9A1); }
.tok-number { color: light-dark(#9A5B00, #F2C572); }
.tok-keyword { color: var(--highlight); }
.tok-function { color: light-dark(#B4237A, #F49AC1); }
.tok-variable { color: light-dark(#0B65A3, #7FC8F8); }
.tok-key { color: light-dark(#0B65A3, #7FC8F8); }
.tok-tag { color: light-dark(#B4237A, #F49AC1); }

/* Footer */

.site-footer {
    margin-top: clamp(5rem, 10vw, 8rem);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding-block: 3rem 2rem;
}

.footer-brand .wordmark {
    color: var(--text);
}

.footer-brand p {
    max-width: 22rem;
    margin: 0.75rem 0 0;
}

.footer-grid h2 {
    margin: 0 0 0.75rem;
    color: var(--text);
    font-family: var(--font-text);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.footer-grid ul {
    display: grid;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-grid a {
    color: var(--muted);
    text-decoration: none;
}

.footer-grid a:hover {
    color: var(--text);
}

.footer-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 1.25rem 2rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
}

@media (max-width: 52rem) {
    .bento,
    .split-section,
    .product-band {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }

    .button,
    .tile,
    .pill,
    a {
        transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, filter 160ms ease;
    }

    .burger::before,
    .burger::after {
        transition: transform 160ms ease, top 160ms ease;
    }

    /* Sections rise in as they scroll into view, where the browser supports scroll timelines. */
    @supports (animation-timeline: view()) {
        .tile,
        .product-band,
        .steps li {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 50%;
        }
    }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
    .wordmark .mark,
    .burger,
    .burger::before,
    .burger::after {
        background: CanvasText;
    }

    .nav {
        backdrop-filter: none;
    }

    .product-band.luciola {
        background: Canvas;
        color: CanvasText;
    }
}
