/* The AppTrellis family — what three candidate brand directions share (see Theme/BrandStyle.cs):

     trellis        AppTrellis, Holographic Architecture   design round 5
     trellis-neon   AppTrellis, neon gradient scheme       design round 6
     nebula         App Nebula                             design round 7

   The three are one sheet set drawn three ways: a deep ground, one lit accent, rounded panels with
   hairline borders, tinted status tags, and an app icon as the mark. This sheet holds the structure
   and reads everything that differs from tokens each style declares in its own sheet (trellis.css,
   trellis-neon.css, nebula.css), which loads after this one:

     --font-brand                      wordmark, labels and numerals
     --accent-fill, --accent-ink       the primary button: its fill (a colour or the brand gradient)
                                       and the text on it
     --accent-glow                     the primary button's shadow
     --tint-accent, --edge-accent      a selected surface: the current rail item, a pressed switch
     --ground-glow                     the soft light behind the hero
     --ground-grid                     the wireframe grid's line colour (transparent for no grid)
     --mark, --mark-hero               the app icon at logotype size and at hero size
     --mark-radius, --mark-ring,       how the icon is masked, outlined and lit
     --mark-glow

   Every rule is scoped to the three data-brand values, so this sheet does nothing to any other look.
   Shared markup is restyled, never changed: the four logotype bars become the icon, the stage strip
   becomes four tinted tags. The one page with markup of its own is the home page, which these styles
   render from Components/Pages/BrandHome.razor with their own copy; its rules are the "Home page"
   block below. */

@font-face {
    font-family: "Outfit";
    src: url("../fonts/outfit-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Exo 2";
    src: url("../fonts/exo-2-var.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

[data-brand="trellis"],
[data-brand="trellis-neon"],
[data-brand="nebula"] {
    --font-ui: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: var(--font-ui);

    --radius: 10px;
    --focus: var(--phase-research);
    --track: var(--line-soft);
    --rail: var(--panel);
    --shadow-sheet: 0 10px 30px var(--shadow-ink);

    /* Orange stays reserved for money in every style. */
    --money: light-dark(#d9531c, #f0763f);
    --money-text: light-dark(#ac3b0e, #ff9a6c);
    --money-rule: light-dark(#f1d6c4, #4a3426);
    --tint-money: light-dark(rgba(217, 83, 28, .08), rgba(240, 118, 63, .12));

    /* The border of a tinted tag is its hue at half strength, so tag and tint never drift apart. */
    --edge-research: color-mix(in srgb, var(--phase-research) 50%, transparent);
    --edge-plan: color-mix(in srgb, var(--phase-plan) 50%, transparent);
    --edge-implement: color-mix(in srgb, var(--phase-implement) 50%, transparent);
    --edge-review: color-mix(in srgb, var(--phase-review) 50%, transparent);
    --edge-money: color-mix(in srgb, var(--money) 50%, transparent);

    /* Full-bleed chrome keeps square edges; everything else takes the softer radius. */
    & :is(.site-header, .site-footer, .app-header, .app-header-rule, .app-rail, main.page) {
        border-radius: 0;
    }

    /* ---- Type: Outfit for headings and interface, the brand face for labels ---- */

    & :is(h1, h2, h3, h4):not(.label) {
        font-family: var(--font-display);
    }

    & h1:not(.label) {
        font-weight: 600;
        letter-spacing: -0.02em;
    }

    & h2:not(.label) {
        font-weight: 500;
        letter-spacing: -0.015em;
    }

    & :is(.label, .field > label, .field-label, .rail-group) {
        font-family: var(--font-brand);
        font-weight: 500;
        letter-spacing: 0.24em;
    }

    /* ---- Logotype: the four bars give way to the app icon; the wordmark takes the brand face ---- */

    & .logotype {
        gap: 0.625rem;
    }

    & .logotype-bars {
        display: block;
        flex: none;
        width: 1.875rem;
        height: 1.875rem;
        gap: 0;
        background: var(--mark) center / cover no-repeat;
        border-radius: var(--mark-radius);
        box-shadow: var(--mark-ring);
    }

    & .logotype-bars span {
        display: none;
    }

    & .logotype-word {
        font-family: var(--font-brand);
        font-weight: 500;
        font-size: 1.25rem;
        letter-spacing: 0.01em;
    }

    /* ---- Buttons: the primary is the lit accent, the secondary a hairline outline ---- */

    & :is(.btn, .button-link) {
        border-width: 1px;
        border-radius: 9px;
    }

    & :is(.btn, .button-link):not(.secondary, .neutral, .destructive, .affirm, :disabled, [aria-disabled="true"]) {
        background: var(--accent-fill) border-box;
        color: var(--accent-ink);
        border-color: transparent;
        box-shadow: var(--accent-glow);
        transition: filter 120ms linear;
    }

    & :is(.btn, .button-link):not(.secondary, .neutral, .destructive, .affirm, :disabled, [aria-disabled="true"]):hover {
        background: var(--accent-fill) border-box;
        color: var(--accent-ink);
        filter: brightness(1.08);
    }

    & :is(.btn, .button-link).secondary {
        background: light-dark(var(--panel), transparent);
        color: var(--ink);
        border-color: var(--line);
    }

    & :is(.btn, .button-link).secondary:hover {
        background: var(--tint-accent);
        color: var(--ink);
        border-color: var(--edge-accent);
    }

    /* ---- Status tags: tinted, hairline, sentence case ---- */

    & .badge {
        padding: 5px 12px;
        border: 1px solid var(--edge-research);
        border-radius: 7px;
        background: var(--tint-research);
        font-family: var(--font-ui);
        font-size: 0.75rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        text-transform: none;
    }

    & .badge:is(.ok, .implement) {
        border-color: var(--edge-implement);
        background: var(--tint-implement);
    }

    & .badge:is(.alert, .money) {
        border-color: var(--edge-money);
        background: var(--tint-money);
    }

    & .badge.plan {
        border-color: var(--edge-plan);
        background: var(--tint-plan);
    }

    & .badge.review {
        border-color: var(--edge-review);
        background: var(--tint-review);
    }

    & .badge.neutral {
        border-color: var(--line);
        background: var(--tint-neutral);
    }

    /* The four phase segments become four tags: same order, same hues, the tag shape above. */
    & .stage-strip {
        gap: 0.375rem;
        font-family: var(--font-brand);
        font-weight: 500;
        letter-spacing: 0.18em;
    }

    & .stage-strip span {
        padding: 0.4375rem 0.75rem;
        border: 1px solid transparent;
        border-radius: 7px;
    }

    & .stage-strip .research {
        background: var(--tint-research);
        border-color: var(--edge-research);
        color: var(--phase-research-strong);
    }

    & .stage-strip .plan {
        background: var(--tint-plan);
        border-color: var(--edge-plan);
        color: var(--phase-plan-strong);
    }

    & .stage-strip .implement {
        background: var(--tint-implement);
        border-color: var(--edge-implement);
        color: var(--phase-implement-strong);
    }

    & .stage-strip .review {
        background: var(--tint-review);
        border-color: var(--edge-review);
        color: var(--phase-review-strong);
    }

    /* ---- Public chrome: header and footer sit on the ground, not on a panel ---- */

    & .site-header {
        background: var(--ground);
        border-bottom-color: var(--line-soft);
    }

    & .site-footer {
        background: var(--ground);
        border-top-color: var(--line-soft);
    }

    & .site-nav a,
    & .account-chrome > a:not(.btn) {
        color: var(--ink);
        font-size: 0.9375rem;
        font-weight: 400;
    }

    & .site-nav a:hover,
    & .account-chrome > a:not(.btn):hover {
        color: var(--phase-research);
    }

    & .theme-choice button {
        border-radius: 8px;
        background: transparent;
        font-family: var(--font-brand);
        font-weight: 500;
    }

    & .theme-choice button:hover {
        border-color: var(--edge-accent);
        color: var(--ink);
    }

    /* The pressed state keeps its aria-pressed and heavier weight; the tint is the extra cue. */
    & .theme-choice button[aria-pressed="true"] {
        border-color: var(--edge-accent);
        background: var(--tint-accent);
        color: var(--ink);
        font-weight: 600;
    }

    /* ---- Application chrome: the header follows the theme, the rail is a column of pills ---- */

    & .app-header {
        background: var(--panel);
        border-bottom: 1px solid var(--line-soft);
        padding-block: 0.8125rem;
    }

    & .app-header :is(.logotype, .logotype-word, .run-name) {
        color: var(--ink);
    }

    & .app-header .logotype-bars {
        width: 1.75rem;
        height: 1.75rem;
    }

    & .app-header .logotype-word {
        font-size: 1.125rem;
        font-weight: 600;
    }

    & .app-header :is(.label, .account-email) {
        color: var(--ink-soft);
    }

    & .app-header a:not(.logotype),
    & .app-header .sign-out button {
        color: var(--ink-body);
    }

    & .app-header a:not(.logotype):hover,
    & .app-header .sign-out button:hover {
        color: var(--phase-research);
    }

    & .app-header .wip-banner {
        color: var(--phase-review-strong);
        border-color: var(--phase-review);
    }

    /* The header carries its own hairline, so the 3px strip under it only shows as run progress. */
    & .app-header-rule {
        display: none;
    }

    & .app-header-progress {
        background: var(--line-soft);
    }

    & .app-header-progress > span {
        background: var(--accent-fill);
    }

    & .app-rail {
        border-right-color: var(--line-soft);
        padding: 1.125rem 0.625rem 2rem;
    }

    & .app-rail .rail-group {
        padding: 0 0.75rem;
    }

    & .app-rail .rail-top {
        padding: 0 0 0.25rem;
    }

    & .app-rail ul {
        display: grid;
        gap: 2px;
    }

    /* A rail item is a pill; its phase is a dot before the label instead of a left border. */
    & .app-rail a {
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.5625rem 0.75rem;
        border: 1px solid transparent;
        border-radius: 9px;
        font-size: 0.875rem;
        font-weight: 400;
    }

    & .app-rail a::before {
        content: "";
        flex: none;
        width: 0.4375rem;
        height: 0.4375rem;
        border-radius: 50%;
        background: var(--rail-dot, var(--line));
    }

    & .app-rail a.research { --rail-dot: var(--phase-research); }
    & .app-rail a.plan { --rail-dot: var(--phase-plan); }
    & .app-rail a.implement { --rail-dot: var(--phase-implement); }
    & .app-rail a.review { --rail-dot: var(--phase-review); }
    & .app-rail a.money { --rail-dot: var(--money); }

    & .app-rail a[aria-current="page"] {
        background: var(--tint-accent);
        border-color: var(--edge-accent);
        font-weight: 500;
    }

    & .app-rail .rail-action {
        border-color: var(--line);
        background: transparent;
        padding: 0.5625rem 0.75rem;
    }

    & .app-rail .rail-empty {
        padding-inline: 0.75rem;
    }

    & .app-rail details.rail-app > summary {
        padding: 0.5rem 0.75rem 0.5rem 0.5rem;
        border-radius: 9px;
    }

    & .app-rail .rail-icon {
        border-color: var(--line-soft);
        border-radius: 22%;
    }

    & .app-rail details.rail-app > ul a {
        padding-left: 2rem;
    }

    /* ---- Ground: a soft light behind the hero; the wireframe grid only where a style draws one ---- */

    & .blueprint::before,
    & .blueprint.ruled::before {
        border-radius: 0;
        background:
            radial-gradient(circle 24rem at 76% 17rem, var(--ground-glow), transparent),
            linear-gradient(var(--ground-grid) 1px, transparent 1px) 0 0 / 100% 28px,
            linear-gradient(90deg, var(--ground-grid) 1px, transparent 1px) 0 0 / 28px 100%;
    }

    /* ---- Home page (Components/Pages/BrandHome.razor) ----
       Hero: copy on the left; on the right the lit app icon among four status cards, the design's
       hero visual. Then selling points, the five stages, the why block beside the demo run, the
       questions and the closing call to action. */

    & .hero {
        column-gap: 3rem;
        row-gap: 2.25rem;
        align-items: center;
        padding-top: 2.5rem;
    }

    /* The eyebrow: a label with the accent rule beside it. */
    & .eyebrow {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem 1.125rem;
        margin: 0;
        font-size: 0.75rem;
        line-height: 1.5;
    }

    & .eyebrow::after {
        content: "";
        flex: none;
        width: 4.5rem;
        height: 2px;
        border-radius: 1px;
        background: var(--accent-fill);
    }

    & :is(.hero, .brand-specimen) h1,
    & .brand-specimen .brand-h {
        font-weight: 600;
        letter-spacing: -0.02em;
        line-height: 1.08;
    }

    /* The headline's second half sits on its own line in the accent colour. */
    & .home-hero h1 {
        font-size: clamp(2.125rem, 4.4vw, 3.625rem);
        margin-top: 1.375rem;
    }

    & .home-hero h1 .accent {
        display: block;
    }

    & .hero .lead {
        max-width: 34rem;
        font-size: 1.125rem;
        color: var(--ink-soft);
    }

    & .icon {
        flex: none;
        width: 1.375rem;
        height: 1.375rem;
        border-radius: 0;
        color: var(--phase-research);
    }

    /* Every item carries a hairline divider on its left, and the strip is clipped along its left
       edge: the first item of a line shows no divider, however the line wraps. */
    & .proof-strip {
        list-style: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem 1.5rem;
        margin: 1.75rem 0 0 -1.5rem;
        padding: 0;
        clip-path: inset(0 0 0 1.5rem);
        font-size: 0.9375rem;
        color: var(--ink);
    }

    & .proof-strip li {
        display: inline-flex;
        align-items: center;
        gap: 0.625rem;
        padding-left: 1.5rem;
        border-left: 1px solid var(--line);
        border-radius: 0;
    }

    & .hero-side {
        container-type: inline-size;
        display: grid;
        justify-items: center;
        gap: 1.25rem;
        min-width: 0;
    }

    /* Three columns: status cards, the icon, status cards. The icon spans both rows, so a card
       centred in its row sits a quarter of the way down or up the icon's side. */
    & .hero-visual {
        display: grid;
        grid-template-columns: max-content minmax(9rem, 21rem) max-content;
        grid-template-rows: 1fr 1fr;
        justify-content: center;
        column-gap: 1.25rem;
        align-items: center;
        width: 100%;
    }

    & .hero-mark {
        grid-column: 2;
        grid-row: 1 / span 2;
        aspect-ratio: 1;
        background: var(--mark-hero) center / cover no-repeat;
        border-radius: var(--mark-radius);
        box-shadow: var(--mark-ring), var(--mark-glow);
    }

    & .status-card {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.625rem;
        padding: 0.625rem 0.75rem;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: var(--shadow-sheet);
        line-height: 1.2;
        white-space: nowrap;
    }

    & .status-card.left {
        grid-column: 1;
        justify-self: end;
    }

    & .status-card.right {
        grid-column: 3;
        justify-self: start;
    }

    & .status-card.top { grid-row: 1; }
    & .status-card.bottom { grid-row: 2; }

    /* A short connector from each card to the icon, ending in a node. */
    & .status-card::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 1.25rem;
        height: 1.5px;
        border-radius: 0;
        background: var(--phase-research);
        opacity: 0.8;
    }

    & .status-card::before {
        content: "";
        position: absolute;
        top: calc(50% - 0.25rem);
        z-index: 1;
        width: 0.5625rem;
        height: 0.5625rem;
        border-radius: 50%;
        background: var(--node, var(--phase-implement));
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--node, var(--phase-implement)) 25%, transparent);
    }

    & .status-card.left::after { left: 100%; }
    & .status-card.left::before { left: calc(100% + 1rem); }
    & .status-card.right::after { right: 100%; }
    & .status-card.right::before { right: calc(100% + 1rem); }
    & .status-card.left.bottom,
    & .status-card.right.top { --node: var(--phase-plan); }

    & .status-card .icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    & .status-text {
        display: grid;
        gap: 0.3125rem;
    }

    & .status-title {
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--ink);
    }

    & .status-state {
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        font-size: 0.75rem;
        color: var(--ink-soft);
    }

    & .status-dot {
        display: grid;
        place-items: center;
        flex: none;
        width: 0.875rem;
        height: 0.875rem;
        border-radius: 50%;
        background: var(--phase-implement);
        color: var(--on-hue);
    }

    & .status-dot .icon {
        width: 0.5625rem;
        height: 0.5625rem;
        color: inherit;
    }

    & .status-bar {
        display: block;
        width: 6.5rem;
        height: 0.375rem;
        border-radius: 4px;
        background: var(--line-soft);
    }

    & .status-bar > span {
        display: block;
        width: 72%;
        height: 100%;
        border-radius: 4px;
        background: var(--accent-fill);
    }

    & .tagline {
        margin: 0;
        text-align: center;
    }

    /* Too narrow for cards beside the icon: the icon stands alone. */
    @container (max-width: 34rem) {
        & .hero-visual {
            grid-template-columns: minmax(9rem, 15rem);
        }

        & .hero-mark {
            grid-column: 1;
        }

        & .status-card {
            display: none;
        }
    }

    /* Sections below the hero: generous air between them, larger headlines than an app page. */
    & .home-section {
        margin-top: 4.5rem;
    }

    & .home-section > h2 {
        font-size: clamp(1.5rem, 2.8vw, 2.125rem);
        line-height: 1.15;
        text-wrap: balance;
    }

    /* Selling points: four across, or three over two when there are five. */
    & .point-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    & .point-grid[data-count="5"] {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    & .point-grid[data-count="5"] > .point {
        grid-column: span 2;
    }

    & .point-grid[data-count="5"] > .point:nth-child(n + 4) {
        grid-column: span 3;
    }

    & .point {
        display: grid;
        align-content: start;
        gap: 0.625rem;
        padding: 1.375rem 1.5rem;
        border-radius: 14px;
    }

    & .point-number {
        font-family: var(--font-brand);
        font-size: 0.9375rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        color: var(--phase-research);
    }

    & .point h2 {
        margin: 0;
        font-size: 1.25rem;
        line-height: 1.25;
    }

    & .point p {
        margin: 0;
        color: var(--ink-soft);
    }

    /* The five stages, in order. */
    & .stage-cards {
        list-style: none;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.875rem;
        margin: 1.5rem 0 0;
        padding: 0;
    }

    & .stage-card {
        display: grid;
        align-content: start;
        gap: 0.75rem;
        padding: 1.25rem 1.125rem;
        border-radius: 14px;
    }

    & .stage-head {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    & .stage-icon {
        display: grid;
        place-items: center;
        flex: none;
        width: 2.75rem;
        height: 2.75rem;
        border: 1px solid var(--edge-accent);
        border-radius: 12px;
        background: var(--tint-accent);
    }

    & .stage-card .label {
        margin: 0;
    }

    & .stage-card h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 500;
        line-height: 1.2;
    }

    & .stage-card p:not(.label) {
        margin: 0;
        font-size: 0.9375rem;
        color: var(--ink-soft);
    }

    /* Why: the argument on the left, signed, and the demo run on the right as its proof. */
    & .why-block {
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        grid-template-rows: auto auto 1fr;
        column-gap: 3rem;
        align-items: start;
    }

    & .why-block > :is(h2, p) {
        grid-column: 1;
    }

    & .why-block > h2 {
        margin-top: 0;
    }

    & .why-block > p {
        max-width: 36rem;
        font-size: 1.0625rem;
    }

    /* The founder's signature under the note: smaller and quieter than the argument it signs. */
    & .why-block > .signature {
        margin: 0;
        font-size: 0.9375rem;
        color: var(--ink-soft);
    }

    & .why-block > .demo-panel {
        grid-column: 2;
        grid-row: 1 / span 3;
    }

    & .faq {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
        gap: 1rem;
        margin: 1.25rem 0 0;
    }

    & .faq > div {
        padding: 1.25rem 1.375rem;
        border-radius: 14px;
    }

    & .faq dt {
        margin-bottom: 0.5rem;
        font-size: 1.0625rem;
        font-weight: 600;
        color: var(--ink);
    }

    & .faq dd {
        margin: 0;
        color: var(--ink-soft);
    }

    /* The closing call to action: the accent-tinted banner. */
    & .home-cta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1.25rem 2rem;
        padding: 2rem 2.25rem;
        border: 1px solid var(--edge-accent);
        border-radius: 16px;
        background: var(--tint-accent);
    }

    & .home-cta > h2 {
        margin: 0;
        font-size: clamp(1.375rem, 2.4vw, 1.875rem);
    }

    & .section-block.home-cta > h2:not(.label)::before {
        display: none;
    }

    & .demo-panel {
        border-color: var(--line-soft);
        border-radius: 14px;
        box-shadow: var(--shadow-sheet);
        overflow: hidden;
    }

    & .demo-panel > header {
        border-bottom-color: var(--line-soft);
    }

    & .demo-steps li {
        border-radius: 0 8px 8px 0;
    }

    & .demo-steps li.gate {
        border-width: 1px;
        border-radius: 8px;
    }

    /* The conversation: two hairline bubbles. The answer is the accent tint rather than a solid
       fill, so a long transcript does not turn into a wall of the primary colour. */
    & .transcript li {
        border-radius: 12px;
    }

    & .transcript .q {
        border: 1px solid var(--line-soft);
    }

    & .transcript .a {
        background: var(--tint-accent);
        border: 1px solid var(--edge-accent);
        color: var(--ink);
    }

    & .transcript :is(.q, .a) .who {
        font-family: var(--font-brand);
        font-weight: 500;
        letter-spacing: 0.2em;
        color: var(--phase-research);
        opacity: 1;
    }

    /* A short accent rule over each section heading: the design's label-and-rule eyebrow, kept to
       the rule because the pages carry no eyebrow text. */
    & .section-block > h2:not(.label)::before {
        content: "";
        display: block;
        width: 4rem;
        height: 2px;
        margin-bottom: 0.875rem;
        border-radius: 1px;
        background: var(--accent-fill);
    }

    & .inset {
        border-radius: 10px;
    }

    /* Table cells stay square: rounding each one notches the header row between columns. */
    & :is(table, caption, thead, tbody, tfoot, tr, th, td) {
        border-radius: 0;
    }

    /* Below the widest layout: selling points pair up (a fifth spans the last row), and the five
       stages go three over two. */
    @media (max-width: 72rem) {
        & .point-grid,
        & .point-grid[data-count="5"] {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        & .point-grid[data-count="5"] > .point,
        & .point-grid[data-count="5"] > .point:nth-child(n + 4) {
            grid-column: auto;
        }

        & .point-grid[data-count="5"] > .point:last-child {
            grid-column: span 2;
        }

        & .stage-cards {
            grid-template-columns: repeat(6, minmax(0, 1fr));
        }

        & .stage-card {
            grid-column: span 2;
        }

        & .stage-card:nth-child(n + 4) {
            grid-column: span 3;
        }
    }

    @media (max-width: 56rem) {
        /* One column throughout: copy then visual in the hero, argument then demo run in the why block. */
        & .home-section {
            margin-top: 3.25rem;
        }

        & .proof-strip {
            flex-direction: column;
            gap: 0.625rem;
        }

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

        & .stage-card,
        & .stage-card:nth-child(n + 4) {
            grid-column: auto;
        }

        & .stage-card:last-child {
            grid-column: span 2;
        }

        & .why-block {
            grid-template-columns: minmax(0, 1fr);
            grid-template-rows: none;
            row-gap: 1.25rem;
        }

        & .why-block > .demo-panel {
            grid-column: 1;
            grid-row: auto;
        }

        & .home-cta {
            padding: 1.5rem;
        }

        & .app-rail {
            border-bottom-color: var(--line-soft);
            padding: 0.5rem 0.625rem 0.75rem;
        }

        /* The Account leaves still wrap into one row, as app.css lays them out at this width. */
        & .app-rail ul.rail-account {
            display: flex;
            flex-wrap: wrap;
            gap: 0.25rem 0.5rem;
            padding: 0;
        }

        & .app-rail ul.rail-account a {
            border: 1px solid transparent;
            padding: 0.5625rem 0.75rem;
        }

        & .app-rail ul.rail-account a[aria-current="page"] {
            border-color: var(--edge-accent);
        }
    }

    @media (max-width: 40rem) {
        & .point-grid,
        & .point-grid[data-count="5"],
        & .stage-cards {
            grid-template-columns: minmax(0, 1fr);
        }

        & .point-grid[data-count="5"] > .point:last-child,
        & .stage-card:last-child {
            grid-column: auto;
        }
    }
}

/* Panels and cards take the softer hairline. :where() keeps this at the weight of app.css's own
   .panel/.card rule, so a phase-edged panel (.panel.research and friends) still colours its edge. */
:where([data-brand="trellis"], [data-brand="trellis-neon"], [data-brand="nebula"]) :is(.panel, .card) {
    border-color: var(--line-soft);
    border-radius: 12px;
}
