/* =========================================================================
   PSC Newsletter — airmail
   The identity comes from the product's own world: envelopes, franking marks,
   postage stamps and delivery logs. Paper ground, ink navy, airmail red/blue
   stripe as the one structural device.
   ========================================================================= */

:root {
    /* Ink and paper */
    --ink: #131a2e;
    --ink-soft: #3a4463;
    --franking: #6e7488;
    --paper: #fcfcfa;
    --paper-2: #f1f0ea;
    --paper-3: #e7e5dc;
    --rule: #dcd9cf;

    /* Airmail */
    --red: #d6273e;
    --blue: #2b50c8;
    --teal: #0e8f7e;
    --amber: #b5761b;

    /* Type */
    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --body: "Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

    /* Space */
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --measure: 1120px;
    --radius: 6px;

    /* The airmail stripe. One definition, reused as border, rule and accent. */
    --stripe: repeating-linear-gradient(-45deg,
            var(--red) 0 8px,
            var(--paper) 8px 16px,
            var(--blue) 16px 24px,
            var(--paper) 24px 32px);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.04;
    margin: 0;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.6rem, 6.2vw, 4.5rem);
}

h2 {
    font-size: clamp(1.9rem, 3.6vw, 2.75rem);
}

h3 {
    font-size: 1.2rem;
    letter-spacing: -0.015em;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--blue);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--red);
}

:focus-visible {
    outline: 2.5px solid var(--blue);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Blazor moves focus to the <h1> after each navigation so screen readers
   announce the new page. That focus is programmatic, not a keyboard landing,
   so it should not draw a ring around the headline. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
    outline: none;
}

img,
svg {
    max-width: 100%;
}

/* ------------------------------------------------------------------ layout */

.wrap {
    max-width: var(--measure);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.band {
    padding-block: clamp(3.5rem, 8vw, 6rem);
}

.band--tint {
    background: var(--paper-2);
    border-block: 1px solid var(--rule);
}

.band--ink {
    background: var(--ink);
    color: #c9cee0;
}

.band--ink h2,
.band--ink h3 {
    color: var(--paper);
}

/* The stripe as a hairline rule between major bands. */
.stripe-rule {
    height: 6px;
    background: var(--stripe);
    border: 0;
    margin: 0;
}

/* --------------------------------------------------------------- typography */

.eyebrow {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--franking);
    margin: 0 0 1rem;
}

.eyebrow--red {
    color: var(--red);
}

.lede {
    font-size: clamp(1.05rem, 1.9vw, 1.25rem);
    color: var(--ink-soft);
    max-width: 54ch;
}

.band--ink .lede {
    color: #b3bad0;
}

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

.mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--body);
    font-weight: 600;
    font-size: 0.97rem;
    padding: 0.7rem 1.3rem;
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn--primary {
    background: var(--ink);
    color: var(--paper);
}

.btn--primary:hover {
    background: var(--blue);
    color: var(--paper);
}

.btn--red {
    background: var(--red);
    color: #fff;
}

.btn--red:hover {
    background: #b81e33;
    color: #fff;
}

.btn--ghost {
    border-color: var(--ink);
    color: var(--ink);
    background: transparent;
}

.btn--ghost:hover {
    background: var(--ink);
    color: var(--paper);
}

.band--ink .btn--ghost {
    border-color: #6d789d;
    color: var(--paper);
}

.band--ink .btn--ghost:hover {
    background: var(--paper);
    color: var(--ink);
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* --------------------------------------------------------- header / footer */

.masthead {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
}

.masthead__inner {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    min-height: 68px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.logo__mark {
    width: 34px;
    height: 24px;
    border-radius: 3px;
    background: var(--stripe);
    border: 1.5px solid var(--ink);
    position: relative;
    flex: none;
}

/* The flap: turns the stripe block into an envelope. */
.logo__mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom right, transparent 47%, var(--paper) 47.5%) no-repeat left top / 50% 100%,
        linear-gradient(to bottom left, transparent 47%, var(--paper) 47.5%) no-repeat right top / 50% 100%;
}

.nav {
    display: flex;
    align-items: center;
    gap: clamp(0.7rem, 1.9vw, 1.4rem);
    margin-left: auto;
    font-size: 0.95rem;
    /* Without this the nav refuses to shrink and pushes the page sideways. */
    min-width: 0;
}

.nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.nav a:hover,
.nav a.active {
    color: var(--ink);
}

.colophon {
    background: var(--ink);
    color: #b9bed1;
    padding-block: 3rem 2rem;
    font-size: 0.92rem;
}

.colophon a {
    color: var(--paper);
    text-decoration: none;
}

.colophon a:hover {
    color: #fff;
    text-decoration: underline;
}

.colophon__grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2rem;
    align-items: start;
}

.colophon__grid h4 {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7c85a3;
    margin: 0 0 0.8rem;
    font-weight: 500;
}

.colophon ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.colophon__base {
    border-top: 1px solid #2a3454;
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    font-size: 0.85rem;
}

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

.hero {
    padding-block: clamp(3rem, 7vw, 5.5rem) clamp(3.5rem, 8vw, 6rem);
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(transparent 66%, color-mix(in srgb, var(--red) 26%, transparent) 66%, color-mix(in srgb, var(--red) 26%, transparent) 96%, transparent 96%);
}

.hero .lede {
    margin-top: 1.5rem;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--franking);
}

/* ------------------------------------------------- signature: the envelope */

/* The hero's centrepiece: an airmail envelope whose window shows a send queue
   draining. It is the product's most characteristic moment, so it gets to be
   the one loud element on the page. */
.envelope {
    background: var(--paper);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    box-shadow: 0 18px 44px -28px rgba(19, 26, 46, 0.55);
    overflow: hidden;
}

.envelope__edge {
    height: 10px;
    background: var(--stripe);
}

.envelope__head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px dashed var(--rule);
}

.envelope__to {
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

.envelope__to strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
}

/* Franking mark: circular postmark, rotated a touch so it reads as stamped. */
.postmark {
    margin-left: auto;
    flex: none;
    width: 74px;
    height: 74px;
    border: 2px solid var(--red);
    border-radius: 50%;
    display: grid;
    place-content: center;
    text-align: center;
    color: var(--red);
    font-family: var(--mono);
    font-size: 0.52rem;
    letter-spacing: 0.06em;
    line-height: 1.6;
    white-space: nowrap;
    transform: rotate(-9deg);
    opacity: 0.85;
}

.postmark span {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.envelope__body {
    padding: 1.1rem 1.25rem 1.35rem;
}

.queue__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat {
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.55rem 0.7rem;
    background: var(--paper-2);
}

.stat__n {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat__l {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--franking);
}

.stat--sent .stat__n {
    color: var(--teal);
}

.stat--queued .stat__n {
    color: var(--ink-soft);
}

.stat--opened .stat__n {
    color: var(--blue);
}

.meter {
    height: 6px;
    background: var(--paper-3);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.meter__fill {
    height: 100%;
    background: var(--teal);
    width: 0;
    animation: drain 7s ease-out forwards;
}

@keyframes drain {
    to {
        width: 100%;
    }
}

.log {
    font-family: var(--mono);
    font-size: 0.74rem;
    line-height: 1.9;
    color: var(--ink-soft);
    display: grid;
    gap: 0.1rem;
    max-height: 172px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, #000 68%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent);
}

.log__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: baseline;
    opacity: 0;
    animation: post 0.45s ease-out forwards;
}

.log__row time {
    color: var(--franking);
}

.log__row b {
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log__row .ok {
    color: var(--teal);
    font-weight: 600;
}

@keyframes post {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------- stamps (features) */

.stamps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 1.5rem;
}

/* Perforated edges, punched with a mask. If a browser drops the mask the card
   still reads correctly as a plain panel. */
.stamp {
    --perf: 7px;
    --pitch: 17px;
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 1.4rem 1.3rem 1.5rem;
    -webkit-mask:
        radial-gradient(circle calc(var(--perf) / 2) at 50% 0, #0000 98%, #000) 50% 0 / var(--pitch) 100%,
        radial-gradient(circle calc(var(--perf) / 2) at 50% 100%, #0000 98%, #000) 50% 100% / var(--pitch) 100%,
        radial-gradient(circle calc(var(--perf) / 2) at 0 50%, #0000 98%, #000) 0 50% / 100% var(--pitch),
        radial-gradient(circle calc(var(--perf) / 2) at 100% 50%, #0000 98%, #000) 100% 50% / 100% var(--pitch);
    mask:
        radial-gradient(circle calc(var(--perf) / 2) at 50% 0, #0000 98%, #000) 50% 0 / var(--pitch) 100%,
        radial-gradient(circle calc(var(--perf) / 2) at 50% 100%, #0000 98%, #000) 50% 100% / var(--pitch) 100%,
        radial-gradient(circle calc(var(--perf) / 2) at 0 50%, #0000 98%, #000) 0 50% / 100% var(--pitch),
        radial-gradient(circle calc(var(--perf) / 2) at 100% 50%, #0000 98%, #000) 100% 50% / 100% var(--pitch);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
    transition: transform 0.15s ease;
}

.stamp:hover {
    transform: translateY(-3px);
}

/* The denomination is the tier that unlocks the feature — the label carries
   information rather than decorating the card. */
.stamp__denom {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.9rem;
}

.denom--free {
    background: color-mix(in srgb, var(--teal) 14%, transparent);
    color: var(--teal);
}

.denom--starter {
    background: color-mix(in srgb, var(--blue) 13%, transparent);
    color: var(--blue);
}

.denom--professional {
    background: color-mix(in srgb, var(--red) 13%, transparent);
    color: var(--red);
}

.denom--agency {
    background: color-mix(in srgb, var(--amber) 16%, transparent);
    color: var(--amber);
}

.stamp p {
    color: var(--ink-soft);
    font-size: 0.95rem;
    margin: 0.5rem 0 0;
}

/* ------------------------------------------------------------------ pricing */

.rates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.rate {
    background: var(--paper);
    border: 1.5px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rate--featured {
    border-color: var(--ink);
    box-shadow: 0 20px 46px -30px rgba(19, 26, 46, 0.6);
}

.rate__edge {
    height: 8px;
    background: var(--paper-3);
}

.rate--featured .rate__edge {
    background: var(--stripe);
}

.rate__body {
    padding: 1.6rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rate__name {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.rate__tag {
    color: var(--franking);
    font-size: 0.9rem;
    margin: 0.25rem 0 1.25rem;
}

.rate__price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    font-family: var(--mono);
    margin-bottom: 0.35rem;
}

.rate__price b {
    font-size: 2.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.rate__price span {
    color: var(--franking);
    font-size: 0.85rem;
}

.rate__sites {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--franking);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed var(--rule);
}

.rate ul {
    list-style: none;
    margin: 0 0 1.75rem;
    padding: 0;
    display: grid;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.rate li {
    display: grid;
    grid-template-columns: 1.1rem 1fr;
    gap: 0.6rem;
    align-items: start;
    color: var(--ink-soft);
}

.rate li::before {
    content: "\2192";
    color: var(--red);
    font-family: var(--mono);
}

.rate .btn {
    margin-top: auto;
    justify-content: center;
}

/* -------------------------------------------------------------------- prose */

.prose {
    max-width: 68ch;
}

.prose h2 {
    margin-top: 2.75rem;
    margin-bottom: 0.9rem;
}

.prose h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.prose ul,
.prose ol {
    margin: 0 0 1.25rem;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.4rem;
}

.prose code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.1em 0.35em;
}

.prose pre {
    font-family: var(--mono);
    font-size: 0.85rem;
    background: var(--ink);
    color: #d8dcea;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
}

.prose pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
}

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

.panel {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.panel+.panel {
    margin-top: 1.5rem;
}

.panel__head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.field {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.field label {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--franking);
}

.field input,
.field select,
.field textarea {
    font-family: var(--body);
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid var(--rule);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--blue);
    outline: none;
}

.field--mono input {
    font-family: var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 1rem;
}

.notice {
    border-left: 4px solid var(--blue);
    background: var(--paper-2);
    padding: 0.85rem 1rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.notice--bad {
    border-color: var(--red);
}

.notice--good {
    border-color: var(--teal);
}

/* ------------------------------------------------------------------ tables */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.94rem;
}

.table th {
    text-align: left;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--franking);
    font-weight: 500;
    padding: 0 0.75rem 0.6rem;
    border-bottom: 1px solid var(--rule);
}

.table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table__scroll {
    overflow-x: auto;
}

/*
 * On a phone a six-column table is a sideways-scrolling strip you cannot read.
 * Below 720px each row becomes its own small card and every cell carries its
 * column name, taken from the td's data-label. Rows stay in DOM order, so the
 * reading order is unchanged.
 */
@media (max-width: 720px) {

    .table--stack,
    .table--stack tbody,
    .table--stack tr,
    .table--stack td {
        display: block;
        width: auto;
    }

    /* The labels move into the cells, so the header row has nothing left to say. */
    .table--stack thead {
        display: none;
    }

    .table--stack tr {
        border: 1px solid var(--rule);
        border-radius: var(--radius);
        padding: 0.9rem 1rem;
        margin-bottom: 0.85rem;
        background: var(--paper);
    }

    .table--stack tr:last-child {
        margin-bottom: 0;
    }

    .table--stack td {
        display: grid;
        grid-template-columns: minmax(4.5rem, 7rem) minmax(0, 1fr);
        gap: 0.25rem 0.9rem;
        align-items: baseline;
        border: 0;
        padding: 0.3rem 0;
        text-align: left;
        /* Licence keys and URLs have no spaces to break at. */
        overflow-wrap: anywhere;
    }

    /* A licence key is nowrap in a table row, where it has a column to itself.
       Stacked into a narrow cell it has to be allowed to break. */
    .table--stack .key {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Grid items stretch by default, which would blow a status pill up to the
       full width of the card. These size to their own content instead. */
    .table--stack td > .pill,
    .table--stack td > .key,
    .table--stack td > .btn {
        justify-self: start;
    }

    .table--stack td::before {
        content: attr(data-label);
        font-family: var(--mono);
        font-size: 0.64rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--franking);
    }

    /* Action cells have no column name and read better full width. */
    .table--stack td[data-label=""] {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 0.6rem;
    }

    .table--stack td[data-label=""]::before {
        content: none;
    }

    .table--stack td:empty {
        display: none;
    }

}

/* Narrower than this the label column leaves too little for the value, so the
   label sits above it instead. */
@media (max-width: 460px) {

    .table--stack td,
    .table--stack td[data-label=""] {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.1rem;
    }
}

.key {
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.06em;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

.pill {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
}

.pill--ok {
    background: color-mix(in srgb, var(--teal) 14%, transparent);
    color: var(--teal);
}

.pill--warn {
    background: color-mix(in srgb, var(--amber) 18%, transparent);
    color: var(--amber);
}

.pill--bad {
    background: color-mix(in srgb, var(--red) 13%, transparent);
    color: var(--red);
}

.pill--idle {
    background: var(--paper-3);
    color: var(--franking);
}

/* --------------------------------------------------------- portal / console */

.console {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    padding-block: 2.5rem 4rem;
}

/* Grid items default to min-width:auto, which lets wide content push the whole
   page sideways instead of scrolling inside its own box. */
.console > * {
    min-width: 0;
}

.sidenav {
    display: grid;
    gap: 0.15rem;
    position: sticky;
    top: 88px;
}

.sidenav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidenav a:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.sidenav a.active {
    background: var(--paper-2);
    border-left-color: var(--red);
    color: var(--ink);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.empty {
    text-align: center;
    padding: 3rem 1.5rem;
    border: 1.5px dashed var(--rule);
    border-radius: var(--radius);
    color: var(--franking);
}

.empty h3 {
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.page-head {
    margin-bottom: 1.75rem;
}

.page-head h1 {
    font-size: clamp(1.9rem, 3.6vw, 2.5rem);
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {

    .hero__grid,
    .console {
        grid-template-columns: minmax(0, 1fr);
    }

    .colophon__grid {
        grid-template-columns: 1fr 1fr;
    }

    .sidenav {
        position: static;
        grid-auto-flow: column;
        justify-content: start;
        overflow-x: auto;
        /* Needed for the overflow above to engage rather than widen the page. */
        min-width: 0;
        border-bottom: 1px solid var(--rule);
        padding-bottom: 0.5rem;
        scrollbar-width: thin;
    }

    .sidenav a {
        white-space: nowrap;
        border-left: 0;
        border-bottom: 3px solid transparent;
    }

    .sidenav a.active {
        border-left: 0;
        border-bottom-color: var(--red);
    }
}

/* The masthead is the one row that cannot reflow, so it sheds content in two
   steps as it narrows: first the secondary links, then the wordmark. The
   envelope mark alone still identifies the site. */
@media (max-width: 780px) {
    .nav .nav__hide {
        display: none;
    }
}

@media (max-width: 700px) {
    .masthead .logo__word {
        display: none;
    }
}

@media (max-width: 620px) {
    .masthead__inner {
        gap: 0.75rem;
    }

    .nav {
        font-size: 0.88rem;
    }

    .colophon__grid {
        grid-template-columns: 1fr;
    }

    .queue__stats {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

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

    .meter__fill {
        width: 100%;
    }

    .log__row {
        opacity: 1;
    }
}
