/*
 * The landing page: six full-bleed panels that borrow the app's own idiom -
 * a dotted canvas, rulers, a selection frame with handles, teammates' cursors -
 * and set the copy in the display sizes from app.css's type scale.
 *
 * Motion is CSS: keyframes for the loops, transitions for the scroll-in effects,
 * and a scroll-driven animation for the app window where the browser has it.
 * Scripts only toggle classes and set custom properties (see the reveal,
 * showcase, selection and hero-demo controllers). Everything decorative is
 * inside a no-preference motion query, so a visitor who asked for reduced
 * motion gets the same page, still.
 */

:root,
[data-bs-theme="light"] {
    --canvas-dot: rgba(31, 31, 34, 0.16);
    --ruler-bg: var(--neutral-50);
    --ruler-ink: var(--neutral-500);
    --handle-fill: #ffffff;
    --blob-opacity: 0.20;
    --panel-dark-bg: var(--neutral-900);
    --panel-dark-surface: rgba(255, 255, 255, 0.06);
    --cursor-green: var(--hue-green);
    --cursor-purple: var(--brand-purple-500);
    --cursor-orange: var(--hue-orange);
    --vg-window: #ffffff;
    --vg-window-alt: var(--neutral-50);
    --vg-ink: var(--neutral-900);
    --vg-muted: var(--neutral-200);
}

[data-bs-theme="dark"] {
    --canvas-dot: rgba(255, 255, 255, 0.14);
    --ruler-bg: var(--neutral-950);
    --ruler-ink: var(--neutral-400);
    --handle-fill: var(--neutral-900);
    --blob-opacity: 0.22;
    --panel-dark-bg: var(--neutral-1000);
    --panel-dark-surface: rgba(255, 255, 255, 0.05);
    --vg-window: var(--neutral-800);
    --vg-window-alt: var(--neutral-900);
    --vg-ink: #ffffff;
    --vg-muted: var(--neutral-600);
}

/* --------------------------------------------------------------- panels */

.panel {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-content: center;
    padding-block: clamp(4rem, 10vh, 8rem);
}

.panel-alt {
    background: var(--site-surface-alt);
}

/* A dark panel keeps Bootstrap's colour roles, remapped, so the pieces inside
   it - kicker, check list, code - need no rules of their own. */
.panel-dark {
    --bs-body-color: var(--neutral-200);
    --bs-emphasis-color: #ffffff;
    --bs-secondary-color: var(--neutral-400);
    --bs-border-color: rgba(255, 255, 255, 0.12);
    --site-surface: var(--panel-dark-surface);
    --tint-blue-fg: var(--brand-blue-300);
    background: var(--panel-dark-bg);
    color: var(--bs-body-color);
}

.panel-head {
    max-width: 52rem;
    margin-bottom: clamp(2.5rem, 6vh, 4.5rem);
}

.panel-head .section-title {
    margin-top: 1rem;
}

.panel-head .section-lead {
    margin-top: 1.25rem;
    margin-bottom: 0;
}

.display-title {
    font-size: var(--type-display);
    line-height: 0.95;
    letter-spacing: -0.035em;
    font-weight: 800;
}

/* --------------------------------------------------------------- canvas */

.canvas {
    background-color: var(--bs-body-bg);
    background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1.5px);
    background-size: 24px 24px;
}

/* The selection frame: the blue outline, four handles and the size label that
   Levee draws around whatever is selected. */
.selection {
    --sel-gap: 0.75rem;
    --sel-color: var(--brand-blue-500);
    position: relative;
    display: inline-block;
    outline: 2px solid var(--sel-color);
    outline-offset: var(--sel-gap);
}

/* A frame in a teammate's colour: theirs, not the visitor's. The hero demo
   sets the owner while a cursor has the thing selected. */
.selection[data-owner="green"]  { --sel-color: var(--cursor-green); }
.selection[data-owner="purple"] { --sel-color: var(--cursor-purple); }

.selection-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--handle-fill);
    border: 2px solid var(--sel-color);
    border-radius: 2px;
}

.selection-handle-tl { top: calc(-1 * var(--sel-gap) - 7px); left: calc(-1 * var(--sel-gap) - 7px); }
.selection-handle-tr { top: calc(-1 * var(--sel-gap) - 7px); right: calc(-1 * var(--sel-gap) - 7px); }
.selection-handle-bl { bottom: calc(-1 * var(--sel-gap) - 7px); left: calc(-1 * var(--sel-gap) - 7px); }
.selection-handle-br { bottom: calc(-1 * var(--sel-gap) - 7px); right: calc(-1 * var(--sel-gap) - 7px); }

.selection-size {
    position: absolute;
    right: calc(-1 * var(--sel-gap));
    top: calc(100% + var(--sel-gap) + 0.6rem);
    padding: 0.2rem 0.55rem;
    border-radius: 0.4rem;
    background: var(--sel-color);
    color: #ffffff;
    font-family: var(--bs-font-monospace);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* A teammate's pointer, in their colour, with their name on a tag. */
.cursor {
    position: absolute;
    left: var(--x);
    top: var(--y);
    z-index: 2;
    color: var(--cursor-color);
    pointer-events: none;
}

.cursor-body {
    position: relative;
    display: block;
}

.cursor svg {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--cursor-color);
    stroke: #ffffff;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.cursor-tag {
    position: absolute;
    left: 1.2rem;
    top: 1.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--cursor-color);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Under the name: what that cursor is changing right now, as the hero demo
   writes it. Empty means nothing, and nothing is hidden. */
.cursor-chip {
    position: absolute;
    left: 1.2rem;
    top: 3.1rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--bs-border-color);
    border-left: 3px solid var(--cursor-color);
    border-radius: 0.4rem;
    background: var(--site-surface);
    color: var(--bs-body-color);
    box-shadow: var(--site-shadow);
    font-family: var(--bs-font-monospace);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.cursor-chip:empty {
    opacity: 0;
    translate: 0 -0.25rem;
}

.cursor-green  { --cursor-color: var(--cursor-green); }
.cursor-purple { --cursor-color: var(--cursor-purple); }
.cursor-orange { --cursor-color: var(--cursor-orange); }

/* ----------------------------------------------------------------- hero */

.hero {
    position: relative;
}

.hero-deco {
    position: absolute;
    inset: 0;
    overflow: clip;
    pointer-events: none;
}

.hero-blob {
    position: absolute;
    width: min(52vw, 760px);
    height: min(52vw, 760px);
    border-radius: 50%;
    opacity: var(--blob-opacity);
    filter: blur(90px);
    will-change: transform;
}

.hero-blob-blue {
    left: -12%;
    top: -18%;
    background: var(--brand-blue-500);
}

.hero-blob-purple {
    right: -16%;
    top: 4%;
    background: var(--brand-purple-500);
}

/* Rulers along the top and left edges, the way the canvas has them. */
.ruler {
    position: absolute;
    display: none;
    color: var(--ruler-ink);
    background: var(--ruler-bg);
    font-family: var(--bs-font-monospace);
    font-size: 9px;
}

.ruler path { stroke: currentColor; stroke-width: 1; fill: none; }
.ruler text { fill: currentColor; }

.ruler-x {
    top: 0;
    left: 1.5rem;
    right: 0;
    height: 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.ruler-y {
    top: 1.5rem;
    bottom: 0;
    left: 0;
    width: 1.5rem;
    border-right: 1px solid var(--bs-border-color);
}

/* The pointer's position on the rulers: a line in the selection blue,
   following the mouse. Shown only while a pointer is over the hero, and only
   where there is a ruler to show it on. */
.ruler-marker {
    position: absolute;
    display: none;
    background: var(--brand-blue-500);
    pointer-events: none;
}

.ruler-marker-x {
    top: 0;
    left: calc(1.5rem + var(--mx, 0px));
    width: 1px;
    height: 1.5rem;
}

.ruler-marker-y {
    top: calc(1.5rem + var(--my, 0px));
    left: 0;
    width: 1.5rem;
    height: 1px;
}

@media (min-width: 768px) {
    .hero.is-tracking .ruler-marker {
        display: block;
    }
}

.ruler-corner {
    position: absolute;
    display: none;
    top: 0;
    left: 0;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--ruler-bg);
    border-right: 1px solid var(--bs-border-color);
    border-bottom: 1px solid var(--bs-border-color);
}

@media (min-width: 768px) {
    .ruler,
    .ruler-corner {
        display: block;
    }
}

.hero-body {
    position: relative;
    z-index: 1;
    min-height: calc(100svh - var(--header-h) - 12vh);
    display: grid;
    align-content: center;
    justify-items: start;
    padding-top: clamp(3rem, 6vh, 5rem);
    padding-bottom: clamp(1.5rem, 4vh, 3rem);
}

/* While the demo runs, the body keeps the height and the content offset it had
   when the round started (the controller measures both), so Mara shrinking the
   headline moves nothing below the hero, not the window, not the layers panel. */
.hero.is-live .hero-body {
    min-height: var(--hero-h);
    align-content: start;
    padding-top: var(--hero-top);
}

.eyebrow {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: var(--tint-blue-bg);
    color: var(--tint-blue-fg);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

a.eyebrow {
    text-decoration: none;
}

a.eyebrow:hover,
a.eyebrow:focus-visible {
    text-decoration: underline;
}

.hero-selection {
    margin-top: 2rem;
    margin-right: 1rem;
}

/* --hero-scale and --hero-weight are the hero demo's: Mara's resize and her
   weight changes. Without them the headline is the display size at 800.
   font-synthesis stays off so no faux bold is drawn while the weight is
   between the serif's one cut and the sans's many. */
.hero-title {
    margin: 0;
    font-size: calc(var(--type-display) * var(--hero-scale, 1));
    line-height: 0.95;
    letter-spacing: -0.035em;
    font-weight: var(--hero-weight, 800);
    font-synthesis: none;
}

/* The serif Mara tries on. */
.hero-title.is-serif {
    font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Each line in a clip box of its own, so it can rise into view; the padding
   keeps descenders out of the clip. */
.hero-title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.12em;
    margin-bottom: -0.12em;
}

.hero-title .line > span {
    display: block;
}

.hero-lead {
    max-width: 40rem;
    margin-top: 2.75rem;
    margin-bottom: 0;
    font-size: var(--type-lead);
    line-height: 1.5;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
}

.hero-actions .btn-lg {
    --bs-btn-padding-y: 0.8rem;
    --bs-btn-padding-x: 1.75rem;
    --bs-btn-font-size: 1.15rem;
}

/* The frame Jonas draws around the download button. A flex item exactly the
   button's size, so the row lays out as before; the outline and the handles
   are painted outside it and take no clicks, so the link keeps its whole
   hit area. Shown only while selected. */
.hero-button-frame {
    --sel-gap: 0.35rem;
    display: inline-flex;
}

.hero-button-frame:not(.is-selected) {
    outline-color: transparent;
}

.hero-button-frame .selection-handle {
    opacity: 0;
    scale: 0.4;
    pointer-events: none;
}

.hero-button-frame.is-selected .selection-handle {
    opacity: 1;
    scale: 1;
}

/* What Jonas changes on the button: its corners and its fill, through the
   button's own variables while the demo runs. The hover, focus and active
   colours are Bootstrap's untouched, so the visitor's pointer always wins. */
.hero-button-frame > .btn {
    --demo-fill: var(--site-primary);
    --demo-radius: 0.5rem;
}

.hero-button-frame > .btn[data-fill="purple"] { --demo-fill: var(--cursor-purple); }
.hero-button-frame > .btn[data-fill="green"]  { --demo-fill: var(--cursor-green); }
/* Half the button's height: the same pill as 999px, but the change is visible
   for the whole of its transition. */
.hero-button-frame > .btn[data-radius="pill"] { --demo-radius: 1.5em; }

.hero.is-live .hero-button-frame > .btn {
    --bs-btn-border-radius: var(--demo-radius);
    --bs-btn-bg: var(--demo-fill);
    --bs-btn-border-color: var(--demo-fill);
}

.hero-note {
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
}

/* Where the cursors sit: beside the headline, out of the words' way. */
.hero-cursor-1 { --x: 84%; --y: 9%; --in: 0; }
.hero-cursor-2 { --x: 68%; --y: 72%; --in: 1; display: none; }

@media (min-width: 768px) {
    .hero-cursor-1 { --x: 60%; --y: 26%; }
    .hero-cursor-2 { display: block; }
}

/* The layers panel, floating at the right of the canvas on a wide screen. */
.layers {
    position: absolute;
    right: var(--bs-gutter-x, 0.75rem);
    top: 44%;
    z-index: 1;
    display: none;
    width: 15rem;
    translate: 0 -50%;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--site-surface);
    box-shadow: var(--site-shadow);
    font-size: 0.85rem;
    overflow: clip;
}

@media (min-width: 1200px) {
    .layers {
        display: block;
    }
}

.layers-head {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-emphasis-color);
    font-weight: 700;
}

.layers-list {
    margin: 0;
    padding: 0.4rem;
    list-style: none;
}

.layers-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem;
    padding-left: calc(0.5rem + var(--depth, 0) * 1rem);
    border-radius: 0.45rem;
    color: var(--bs-body-color);
    font-weight: 600;
    white-space: nowrap;
}

.layers-row svg {
    flex: none;
    width: 0.95rem;
    height: 0.95rem;
    color: var(--bs-secondary-color);
}

.layers-chevron {
    width: 0.8rem;
    height: 0.8rem;
}

.layers-row.is-selected {
    background: var(--tint-blue-bg);
    color: var(--tint-blue-fg);
}

.layers-row.is-selected[data-owner="green"] {
    background: var(--tint-green-bg);
    color: var(--tint-green-fg);
}

.layers-row.is-selected[data-owner="purple"] {
    background: var(--tint-purple-bg);
    color: var(--tint-purple-fg);
}

.layers-row.is-selected svg {
    color: inherit;
}

/* The stage the window tilts on, seen from a little above its middle. */
.hero-window {
    position: relative;
    z-index: 1;
    padding-bottom: clamp(3rem, 8vh, 6rem);
    perspective: 1600px;
    perspective-origin: 50% 10%;
}

.hero-shot-frame {
    position: relative;
    max-width: 1240px;
    margin-inline: auto;
    transform-origin: 50% 100%;
}

/* A glow in the logo's colours behind the window. */
.hero-shot-frame::before {
    content: "";
    position: absolute;
    inset: 10% 8% -3%;
    z-index: -1;
    border-radius: 3rem;
    background: var(--brand-gradient);
    filter: blur(64px);
    opacity: 0.3;
}

/* The light that slides across the glass while the window comes up. */
.hero-shot-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.4) 44%, rgba(255, 255, 255, 0.06) 52%, transparent 62%) no-repeat;
    background-size: 260% 100%;
    background-position: 120% 0;
    opacity: 0;
    pointer-events: none;
}

.hero-shot {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--site-shot-shadow);
    outline: 1px solid rgba(0, 0, 0, 0.08);
    outline-offset: -1px;
}

[data-bs-theme="dark"] .hero-shot {
    outline-color: rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------- showcase */

.showcase {
    display: grid;
    gap: 3rem;
}

.showcase-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.showcase-item {
    padding-block: 2rem;
    border-top: 1px solid var(--bs-border-color);
}

.showcase-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-size: var(--type-h3);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.showcase-title .feature-icon {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.1rem;
}

.showcase-text {
    margin: 0.85rem 0 0;
    color: var(--bs-secondary-color);
    font-size: var(--type-body-lg);
    line-height: 1.6;
    text-wrap: pretty;
}

.showcase-stage {
    display: none;
}

.showcase-figure {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    border-radius: 1.5rem;
    overflow: clip;
}

.showcase-figure svg {
    width: min(88%, 560px);
    height: auto;
    overflow: visible;
}

@media (min-width: 992px) {
    .showcase {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: clamp(2rem, 5vw, 5rem);
        align-items: start;
    }

    .showcase-item {
        display: grid;
        min-height: 55vh;
        align-content: center;
        border-top: 0;
        padding-block: 1rem;
        transition: opacity 0.4s ease;
    }

    .showcase-item:not(.is-active) {
        opacity: 0.4;
    }

    .showcase-title .feature-icon {
        display: none;
    }

    .showcase-stage {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
        display: block;
        height: calc(100svh - var(--header-h) - 4rem);
    }

    .showcase-figure {
        opacity: 0;
        scale: 0.98;
        transition: opacity 0.5s ease, scale 0.5s ease;
    }

    .showcase-figure.is-active {
        opacity: 1;
        scale: 1;
    }
}

/* Vignettes: the drawings on the stage. Fills and strokes come from the
   figure's tint and the theme, so one drawing works in both schemes. */
.vg-window { fill: var(--vg-window); }
.vg-window-alt { fill: var(--vg-window-alt); }
.vg-ink { fill: var(--vg-ink); }
.vg-muted { fill: var(--vg-muted); }
.vg-line { stroke: var(--vg-muted); fill: none; }
.vg-accent { fill: currentColor; }
.vg-accent-stroke { stroke: currentColor; fill: none; }
.vg-blue { fill: var(--brand-blue-500); }
.vg-blue-stroke { stroke: var(--brand-blue-500); fill: none; }
.vg-label {
    font-family: var(--bs-font-monospace);
    font-size: 12px;
    font-weight: 600;
    fill: currentColor;
}
.vg-text {
    font-family: var(--bs-font-sans-serif);
    font-weight: 700;
    fill: var(--vg-ink);
}
.vg-text-on {
    font-family: var(--bs-font-sans-serif);
    font-weight: 700;
    fill: #ffffff;
}
.vg-pill { fill: currentColor; }
.vg-pill-text {
    font-family: var(--bs-font-monospace);
    font-size: 12px;
    font-weight: 700;
    fill: #ffffff;
}
.vg-dots {
    fill: var(--canvas-dot);
}
.vg-guide { stroke: var(--hue-red); stroke-width: 1.5; fill: none; }
.vg-guide-fill { fill: var(--hue-red); }
.vg-caret { fill: var(--brand-blue-500); }
.vg-anchor { fill: var(--vg-window); stroke: var(--brand-blue-500); }

/* Vignette 1: one Levee window as each system draws it. The window is the
   app's own dark in either scheme, and the accent each system's default.
   Without motion it stays the Mac's. */
.vg-app-chrome { fill: var(--neutral-900); }
.vg-app-panel { fill: var(--neutral-850); }
.vg-app-stage { fill: var(--neutral-950); }
.vg-app-row { fill: var(--neutral-700); }
.vg-app-glyph { fill: none; stroke: var(--neutral-300); stroke-width: 1.2; }
.vg-app-text {
    font-family: var(--bs-font-sans-serif);
    font-weight: 600;
    fill: var(--neutral-300);
}
.vg-app-board { fill: #ffffff; }
.vg-app-board-ink { fill: var(--neutral-850); }
.vg-app-board-muted { fill: var(--neutral-200); }
.vg-app-handle { fill: #ffffff; }
.vg-os-accent { fill: #3584e4; }
.vg-os-accent-stroke { stroke: #3584e4; }
rect.vg-os-accent-stroke:not(.vg-app-handle) { fill: none; }
.vg-os-mac { opacity: 0; }

/* ----------------------------------------------------------------- rule */

.rule-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 992px) {
    .rule-grid {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        column-gap: clamp(3rem, 6vw, 6rem);
    }
}

/* Beside a column of their own, the titles take a size down. */
.rule-grid .section-title,
.together-grid .section-title {
    margin-top: 1rem;
    font-size: clamp(2.25rem, 4.8vw, 4rem);
}

.rule-grid .section-text {
    margin-top: 1.75rem;
}

.check-list {
    margin-top: 1.5rem;
}

.check-list li {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-top: 0.9rem;
    font-size: var(--type-body-lg);
    line-height: 1.5;
}

.check-list svg {
    flex: none;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.2rem;
    color: #8ff0a4;
}

/* The rule, made visible: the button as drawn, then the CSS the export writes. */
.rule-demo {
    margin: 0;
    border-radius: var(--bs-border-radius-xl);
    background: var(--site-code-bg);
    box-shadow: var(--site-shot-shadow);
    overflow: clip;
}

.demo-canvas {
    display: grid;
    place-items: center;
    min-height: 16rem;
    padding: 3rem 2rem;
    background-color: var(--bs-body-bg);
}

/* The button the code panel describes, property for property. */
.demo-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--logo-indigo), var(--logo-purple));
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
}

.demo-card svg {
    width: 1.1em;
    height: 1.1em;
}

.demo-selection {
    --sel-gap: 0.6rem;
}

.code-panel {
    margin: 0;
    padding: 1.5rem 1.75rem;
    background: var(--site-code-bg);
    color: var(--neutral-300);
    font-size: 0.9rem;
    line-height: 1.7;
    /* A long value wraps rather than scrolls; the indent holds on the wrapped
       part too, as an editor would show it. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow: visible;
}

.code-panel .sel { color: #ffffff; font-weight: 700; }
.code-panel .pr { color: var(--brand-blue-400); }

.code-line {
    display: block;
}

.code-line-in {
    padding-left: 2ch;
}

/* A caret at the end of the code, still blinking: the export keeps writing. */
.code-caret {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    margin-left: 0.1em;
    vertical-align: text-bottom;
    background: var(--brand-blue-400);
}

.demo-caption {
    padding: 0.85rem 1.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--site-code-bg);
    color: var(--neutral-400);
    font-size: 0.9rem;
}

/* --------------------------------------------------------------- export */

.format-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-bottom: 1px solid var(--bs-border-color);
}

.format-row {
    display: grid;
    gap: 0.75rem 2rem;
    align-items: center;
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2vw, 1.75rem);
    border-top: 1px solid var(--bs-border-color);
    transition: background-color 0.35s ease;
}

.format-name {
    margin: 0;
    color: var(--row-fg);
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    font-weight: 800;
    transition: translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.format-text {
    margin: 0;
    max-width: 30rem;
    font-size: var(--type-body-lg);
    line-height: 1.55;
    text-wrap: pretty;
}

.format-arrow {
    display: none;
    color: var(--row-fg);
    opacity: 0.5;
    transition: translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease;
}

.format-arrow svg {
    width: 2.5rem;
    height: 2.5rem;
}

@media (min-width: 768px) {
    .format-row {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    }

    .format-arrow {
        display: block;
    }
}

@media (hover: hover) {
    .format-row:hover {
        background: var(--row-bg);
    }

    .format-row:hover .format-name {
        translate: 0.5rem 0;
    }

    .format-row:hover .format-arrow {
        translate: 0.5rem 0;
        opacity: 1;
    }
}

/* ------------------------------------------------------------- together */

.together-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 992px) {
    .together-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        column-gap: clamp(3rem, 6vw, 6rem);
    }
}

.together-grid .section-text {
    margin-top: 1.75rem;
}

.together-grid .btn {
    margin-top: 1.5rem;
}

/* Two people on one canvas: a frame, their cursors, and the box one of them
   is dragging out. */
.collab-canvas {
    position: relative;
    aspect-ratio: 5 / 4;
    border: 1px solid var(--bs-border-color);
    border-radius: 1.5rem;
    box-shadow: var(--site-shadow);
    overflow: clip;
}

.collab-presence {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--bs-border-color);
    background: var(--site-surface);
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.avatar + .avatar {
    margin-left: -0.6rem;
    box-shadow: 0 0 0 2px var(--site-surface);
}

.avatar-green  { background: var(--cursor-green); }
.avatar-purple { background: var(--cursor-purple); }

.collab-frame {
    position: absolute;
    left: 12%;
    top: 22%;
    width: 60%;
    height: 56%;
    border-radius: 0.75rem;
    background: var(--site-surface);
    box-shadow: var(--site-shadow);
}

.collab-frame-label {
    position: absolute;
    left: 0;
    bottom: calc(100% + 0.4rem);
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
}

.collab-shape {
    position: absolute;
    border-radius: 0.5rem;
}

.collab-shape-title {
    left: 10%;
    top: 14%;
    width: 55%;
    height: 12%;
    background: var(--bs-emphasis-color);
    opacity: 0.85;
}

.collab-shape-text {
    left: 10%;
    top: 34%;
    width: 70%;
    height: 6%;
    background: var(--bs-border-color);
}

.collab-shape-text-2 {
    left: 10%;
    top: 46%;
    width: 48%;
    height: 6%;
    background: var(--bs-border-color);
}

.collab-shape-button {
    left: 10%;
    top: 64%;
    width: 30%;
    height: 14%;
    border-radius: 0.5rem;
    background: var(--brand-blue-500);
}

.collab-shape-image {
    right: 8%;
    top: 14%;
    width: 22%;
    height: 40%;
    background: var(--tint-purple-bg);
}

/* The box Jonas is dragging out - a dashed rectangle in his colour. */
.collab-drag {
    position: absolute;
    left: 44%;
    top: 50%;
    width: 0;
    height: 0;
    border: 1.5px dashed var(--cursor-purple);
    background: rgba(145, 65, 172, 0.10);
    opacity: 0;
}

.collab-cursor-1 { --x: 30%; --y: 40%; }
.collab-cursor-2 { --x: 44%; --y: 50%; }

.together-points {
    display: grid;
    gap: 2rem;
    margin: clamp(3rem, 8vh, 5rem) 0 0;
    padding: clamp(2rem, 5vh, 3rem) 0 0;
    list-style: none;
    border-top: 1px solid var(--bs-border-color);
}

@media (min-width: 768px) {
    .together-points {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: clamp(2rem, 4vw, 4rem);
    }
}

.together-points .feature-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
}

.together-points .feature-title {
    margin-top: 1.25rem;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.together-points .feature-text {
    font-size: 1.05rem;
}

/* ------------------------------------------------------------- download */

.download {
    color: #ffffff;
    background:
        radial-gradient(60% 80% at 0% 0%, rgba(1, 173, 254, 0.55), transparent 65%),
        radial-gradient(70% 90% at 15% 10%, rgba(255, 255, 255, 0.12), transparent 60%),
        linear-gradient(120deg, #3d3fd6 0%, var(--logo-indigo) 40%, var(--logo-violet) 78%, var(--logo-purple) 100%);
    background-size: 100% 100%, 100% 100%, 200% 200%;
    background-position: 0 0, 0 0, 50% 50%;
}

/* A little grain over the gradient, so it reads as a surface, not a fill. */
.download-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.09;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.download .container {
    position: relative;
}

.download .section-kicker {
    color: rgba(255, 255, 255, 0.85);
}

.download-title {
    margin-top: 1rem;
    color: #ffffff;
    text-wrap: balance;
}

.download-text {
    max-width: 38rem;
    margin: 1.75rem auto 0;
    font-size: var(--type-lead);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    text-wrap: pretty;
}

.platform-row {
    margin-top: clamp(2.5rem, 6vh, 4rem);
}

.platform-card {
    padding: 1.75rem;
    border-radius: var(--bs-border-radius-xl);
    background: var(--site-surface);
    color: var(--bs-body-color);
    box-shadow: var(--site-shot-shadow);
    text-align: left;
    transition: translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
    .platform-card:hover {
        translate: 0 -4px;
    }
}

.platform-card .feature-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
}

.platform-title {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.platform-title .badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0;
}

.platform-card .feature-text {
    font-size: 1.05rem;
}

/* The card for the visitor's own system, once the platform controller has
   named it: a ring, and a word in the corner. The order stays as it is. */
.platform-yours {
    display: none;
    flex: none;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--tint-blue-bg);
    color: var(--tint-blue-fg);
    font-size: 0.75rem;
    font-weight: 700;
}

.download[data-platform-detected="macos"] .platform-card[data-platform="macos"],
.download[data-platform-detected="linux"] .platform-card[data-platform="linux"] {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), var(--site-shot-shadow);
}

.download[data-platform-detected="macos"] [data-platform="macos"] .platform-yours,
.download[data-platform-detected="linux"] [data-platform="linux"] .platform-yours {
    display: inline-block;
}

.platform-guide {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    text-decoration: none;
}

.platform-guide:hover {
    text-decoration: underline;
}

.platform-guide svg {
    width: 1em;
    height: 1em;
}

/* --------------------------------------------------------------- motion */

/* Scroll-in: anything marked data-reveal waits below its place until the
   reveal controller sees it. Only once the script is known to run (html.js),
   so nothing is hidden from a visitor without it. */
.js [data-reveal] {
    opacity: 0;
    translate: 0 1.75rem;
    transition:
        opacity 0.8s ease,
        translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--reveal-i, 0) * 90ms);
}

.js [data-reveal].is-visible {
    opacity: 1;
    translate: 0 0;
}

@media (prefers-reduced-motion: no-preference) {
    /* The hero's entrance: the pieces arrive from below, one after another. */
    .hero-in {
        animation: hero-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
        animation-delay: calc(var(--in, 0) * 130ms + 80ms);
    }

    .hero-title .line > span {
        animation: line-up 1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
        animation-delay: calc(var(--line, 0) * 110ms + 160ms);
    }

    /* The frame is drawn once the words are in place. frame-in ends on the
       colour the rule already gives it, so it fills backwards only: a filled
       animation would hold outline-color and block the owner-colour change. */
    .hero-selection {
        animation:
            hero-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 80ms both,
            frame-in 0.5s ease 900ms backwards;
    }

    .hero-selection .selection-handle,
    .hero-selection .selection-size {
        animation: pop-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
        animation-delay: calc(var(--pop, 0) * 60ms + 950ms);
    }

    .hero-cursor {
        animation: cursor-in 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
        animation-delay: calc(var(--in, 0) * 200ms + 700ms);
    }

    .layers {
        animation: hero-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 600ms both;
    }

    .hero-cursor .cursor-body {
        animation: cursor-drift 9s ease-in-out infinite alternate;
        animation-delay: calc(var(--in, 0) * -3s);
    }

    /* The cursor demo (hero_demo_controller.js). The script sets --x and --y in
       pixels and a --move duration; these transitions do the moving. The drift
       is paused rather than removed: removing it would jump the cursor and, on
       its return, replay the entrance. Every other change the script makes -
       a class, a data attribute, a custom property - lands on a transition
       below, so it is drawn rather than switched. */
    .hero.is-live .hero-cursor .cursor-body {
        animation-play-state: paused;
    }

    /* Once the round is over the cursors stay where they came to rest. */
    .hero.is-done .hero-cursor .cursor-body {
        animation: none;
    }

    .hero.is-live .cursor {
        transition:
            left var(--move, 0.9s) cubic-bezier(0.2, 0.7, 0.2, 1),
            top var(--move, 0.9s) cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    /* A press: the arrow dips around its tip. */
    .hero.is-live .cursor svg {
        transform-origin: 4px 5px;
        transition: scale 0.12s ease;
    }

    .hero.is-live .cursor.is-pressed svg {
        scale: 0.8;
    }

    .hero.is-live .cursor-chip {
        transition:
            opacity 0.25s ease,
            translate 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    .hero.is-live .hero-selection {
        transition: outline-color 0.35s ease;
    }

    .hero.is-live .selection-handle {
        transition:
            border-color 0.35s ease,
            opacity 0.3s ease,
            scale 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
        transition-delay: 0s, calc(var(--pop, 0) * 40ms), calc(var(--pop, 0) * 40ms);
    }

    .hero.is-live .selection-size {
        transition: background-color 0.35s ease;
    }

    .hero.is-live .hero-button-frame {
        transition: outline-color 0.25s ease;
    }

    .hero.is-live .layers-row {
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .hero.is-live .hero-title {
        transition:
            font-size var(--move, 1.3s) cubic-bezier(0.2, 0.7, 0.2, 1),
            font-weight 0.6s ease,
            letter-spacing 0.4s ease;
    }

    .hero.is-live .hero-button-frame > .btn {
        transition:
            color 0.15s ease-in-out,
            box-shadow 0.15s ease-in-out,
            background-color 0.4s ease,
            border-color 0.4s ease,
            border-radius 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
    }

    /* For the one forced layout in which the script measures where a drag
       will end: nothing may start moving. */
    .hero.is-measuring .hero-title,
    .hero.is-measuring .cursor {
        transition: none;
    }

    .hero-blob-blue {
        animation: blob-drift 24s ease-in-out infinite alternate;
    }

    .hero-blob-purple {
        animation: blob-drift 30s ease-in-out -10s infinite alternate-reverse;
    }

    /* Where the browser can tie an animation to scrolling, the window lies
       tilted back as it comes up the screen and stands up to face the reader,
       its glow growing and a light passing over it on the way. The stage is
       the timeline and the frame moves, so the motion cannot feed back into
       where the timeline is. Elsewhere the window simply sits there. */
    @supports (animation-timeline: view()) {
        .hero-window {
            view-timeline: --hero-window block;
        }

        .hero-shot-frame {
            animation: window-tilt linear both;
            animation-timeline: --hero-window;
            animation-range: entry 0% cover 50%;
        }

        .hero-shot-frame::before {
            animation: window-glow linear both;
            animation-timeline: --hero-window;
            animation-range: entry 0% cover 50%;
        }

        .hero-shot-frame::after {
            animation: window-sheen linear both;
            animation-timeline: --hero-window;
            animation-range: entry 25% cover 50%;
        }
    }

    .code-caret {
        animation: blink 1s steps(2, start) infinite;
    }

    /* The vignettes' loops only run on the drawing that is showing. */
    .vg-anim {
        animation-play-state: paused;
    }

    .showcase-figure.is-active .vg-anim {
        animation-play-state: running;
    }

    @media (max-width: 991.98px) {
        /* No stage, no active drawing - the phone shows the list alone. */
        .vg-anim {
            animation: none;
        }
    }

    .vg-os-linux { animation: vg-os 6s ease-in-out infinite; }
    .vg-os-mac { animation: vg-os 6s ease-in-out -3s infinite; }
    .vg-os-accent { animation: vg-os-accent 6s ease-in-out infinite; }
    .vg-os-accent-stroke { animation: vg-os-accent-stroke 6s ease-in-out infinite; }

    .vg-master { animation: vg-recolour 7s ease-in-out infinite; }
    .vg-instance { animation: vg-recolour 7s ease-in-out infinite; animation-delay: 0.25s; }

    .vg-text-caret { animation: blink 1s steps(2, start) infinite; }

    /* The zoom keeps the first board's centre in place and carries it to the
       middle of the view; the readout steps once per level. */
    .vg-zoom { transform-origin: 155px 130px; animation: vg-zoom 10s ease-in-out infinite; }
    .vg-zoom-readout { animation: vg-zoom-readout 10s steps(5, jump-none) infinite; }

    .vg-snap-box { animation: vg-snap-box 5s cubic-bezier(0.2, 0.7, 0.2, 1) infinite; }
    .vg-snap-guide { animation: vg-snap-guide 5s ease infinite; }

    .vg-pen-path { animation: vg-pen-draw 6s ease-in-out infinite; }
    .vg-pen-point { animation: vg-pen-point 6s ease infinite; }

    .collab-cursor-1 .cursor-body { animation: collab-path-1 14s ease-in-out infinite; }
    .collab-cursor-2 .cursor-body { animation: collab-path-2 14s ease-in-out infinite; }
    .collab-drag { animation: collab-drag 14s ease-in-out infinite; }

    .download {
        animation: gradient-drift 18s ease-in-out infinite alternate;
    }
}

@media (prefers-reduced-motion: reduce) {
    .js [data-reveal] {
        opacity: 1;
        translate: none;
        transition: none;
    }

    /* The dragged box has no drag to show; leave it at its full size. */
    .collab-drag {
        width: 30%;
        height: 26%;
        opacity: 1;
    }

    .format-name,
    .format-arrow,
    .platform-card,
    .showcase-item,
    .showcase-figure {
        transition: none;
    }
}

@keyframes hero-in {
    from { opacity: 0; translate: 0 1.5rem; }
    to   { opacity: 1; translate: 0 0; }
}

@keyframes line-up {
    from { translate: 0 110%; }
    to   { translate: 0 0; }
}

@keyframes frame-in {
    from { outline-color: transparent; }
    to   { outline-color: var(--sel-color); }
}

@keyframes pop-in {
    from { opacity: 0; scale: 0.4; }
    to   { opacity: 1; scale: 1; }
}

@keyframes cursor-in {
    from { opacity: 0; translate: 6rem 4rem; }
    to   { opacity: 1; translate: 0 0; }
}

@keyframes cursor-drift {
    0%   { transform: translate(0, 0); }
    33%  { transform: translate(-1.5rem, 1rem); }
    66%  { transform: translate(1rem, -1.25rem); }
    100% { transform: translate(-0.5rem, 1.75rem); }
}

@keyframes blob-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(8vw, 6vh) scale(1.08); }
    100% { transform: translate(-4vw, 10vh) scale(0.96); }
}

@keyframes window-tilt {
    from { transform: translateY(8vh) rotateX(42deg) scale(0.86); opacity: 0.55; }
    40%  { opacity: 1; }
    to   { transform: none; opacity: 1; }
}

@keyframes window-glow {
    from { opacity: 0; scale: 0.7; }
    to   { opacity: 0.45; scale: 1; }
}

@keyframes window-sheen {
    from { opacity: 0; background-position: 120% 0; }
    25%  { opacity: 1; }
    75%  { opacity: 1; }
    to   { opacity: 0; background-position: -20% 0; }
}

@keyframes blink {
    to { visibility: hidden; }
}

@keyframes gradient-drift {
    from { background-position: 0 0, 0 0, 15% 50%; }
    to   { background-position: 0 0, 0 0, 85% 50%; }
}

/* Vignette 1: Linux, then macOS, three seconds each. */
@keyframes vg-os {
    0%, 45%       { opacity: 1; }
    50%, 95%      { opacity: 0; }
    100%          { opacity: 1; }
}

@keyframes vg-os-accent {
    0%, 45%       { fill: #3584e4; }
    50%, 95%      { fill: #007aff; }
    100%          { fill: #3584e4; }
}

@keyframes vg-os-accent-stroke {
    0%, 45%       { stroke: #3584e4; }
    50%, 95%      { stroke: #007aff; }
    100%          { stroke: #3584e4; }
}

/* Vignette 2: the original changes, the copies follow. */
@keyframes vg-recolour {
    0%, 28%  { fill: var(--brand-purple-500); }
    36%, 62% { fill: var(--brand-blue-500); }
    70%, 94% { fill: var(--hue-green); }
    100%     { fill: var(--brand-purple-500); }
}

/* Vignette 4: the view zooms in on the first board to actual size (50% x 2)
   and back out; the readout rides along, one 20-unit step per level. */
@keyframes vg-zoom {
    0%, 12%   { transform: translate(0, 0) scale(1); }
    38%, 62%  { transform: translate(85px, 50px) scale(2); }
    88%, 100% { transform: translate(0, 0) scale(1); }
}

@keyframes vg-zoom-readout {
    0%, 12%   { transform: translateY(0); }
    38%, 62%  { transform: translateY(-80px); }
    88%, 100% { transform: translateY(0); }
}

/* Vignette 5: the box slides in and snaps to the guide. */
@keyframes vg-snap-box {
    0%, 12%  { transform: translate(120px, 26px); }
    55%, 88% { transform: translate(0, 0); }
    100%     { transform: translate(120px, 26px); }
}

@keyframes vg-snap-guide {
    0%, 50%  { opacity: 0; }
    56%, 86% { opacity: 1; }
    92%, 100% { opacity: 0; }
}

/* Vignette 6: the path is drawn, then its anchors appear. */
@keyframes vg-pen-draw {
    0%       { stroke-dashoffset: 900; }
    55%, 90% { stroke-dashoffset: 0; }
    100%     { stroke-dashoffset: 900; }
}

@keyframes vg-pen-point {
    0%, 50%  { opacity: 0; }
    58%, 88% { opacity: 1; }
    96%, 100% { opacity: 0; }
}

/* Work together: Mara wanders the frame while Jonas drags out a box. */
@keyframes collab-path-1 {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(140px, -40px); }
    50%  { transform: translate(90px, 120px); }
    75%  { transform: translate(-40px, 60px); }
    100% { transform: translate(0, 0); }
}

@keyframes collab-path-2 {
    0%, 20%  { transform: translate(0, 0); }
    50%, 62% { transform: translate(150px, 110px); }
    80%      { transform: translate(60px, -30px); }
    100%     { transform: translate(0, 0); }
}

@keyframes collab-drag {
    0%, 18%  { width: 0; height: 0; opacity: 0; }
    22%      { opacity: 1; }
    50%, 62% { width: 150px; height: 110px; opacity: 1; }
    68%      { width: 150px; height: 110px; opacity: 0; }
    100%     { width: 0; height: 0; opacity: 0; }
}
