/* ── The wire: shared row rendering ──────────────────────────────────────────
   Extracted out of news.html's page <style> block when the homepage gained a
   "From the wire" band. Both /news and / draw rows with the same news-wire.js,
   so they have to be able to draw them with the same CSS; the alternative was
   a second copy of four hundred lines that would drift the first time one page
   was touched and the other was not.

   What stayed behind in news.html is the page's own chrome: the hero, the live
   dot, the filter pills and the refresh stamp. None of that exists on the
   homepage.

   A few rules here (the skeleton, the empty states, the attribution line) only
   ever match on /news. They are kept with the rest rather than split out,
   because they belong to the same component and matching nothing costs
   nothing.
   ────────────────────────────────────────────────────────────────────────── */

/* ── The wire itself ─────────────────────────────────────────────── */
.wire-panel {
    background: var(--void-up);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Day separator: TODAY / YESTERDAY / 14 AUG 2026 */
.wire-day {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.4rem;
    background: color-mix(in oklch, var(--text-primary) 3%, transparent);
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.wire-day::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── The three bands ─────────────────────────────────────────────
   The wire is no longer one reverse-chronological list. The top of the
   panel answers "what happened this week" and the bottom still answers
   "what came in today", which are different questions and were being
   badly served by one answer.

   The band heading has to read as a heading and not as another day
   separator, so it is larger, lighter and sits on a tinted strip with
   a rule under it. Bands are separated by a heavier line than rows
   are, because a band boundary is where the ORDERING changes, and that
   is the one thing the reader has to notice. */
.wire-tier + .wire-tier { border-top: 1px solid var(--border); }

.wire-tier-head {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 1.15rem 1.4rem 0.9rem;
    background: color-mix(in oklch, var(--text-primary) 4%, transparent);
    border-bottom: 1px solid var(--border);
}
.wire-tier-head h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}
.wire-tier-head span {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* The committee's own choice is the one band a person decided on, so
   it is the one band that gets the accent. */
.wire-tier--pick .wire-tier-head {
    background: color-mix(in oklch, var(--q-cyan) 8%, transparent);
    box-shadow: inset 3px 0 0 var(--q-cyan);
}
.wire-tier--pick .wire-tier-head h2 {
    background: var(--q-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.wire-note {
    margin: 0;
    padding: 0 1.4rem 1.15rem calc(1.4rem + 66px + 1.1rem);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    font-style: italic;
    border-bottom: 1px solid color-mix(in oklch, var(--text-primary) 6%, transparent);
}

/* Ranked rows carry the week, so they get the headline size. Rows in
   Latest stay at wire size: there are fifteen of them and they are a
   list to scan, not copy to read. */
.wire-row--lead .wire-title { font-size: 1.12rem; line-height: 1.4; }

.wire-row {
    position: relative;
    display: grid;
    grid-template-columns: 66px 1fr;
    gap: 1.1rem;
    padding: 1.05rem 1.4rem;
    border-bottom: 1px solid color-mix(in oklch, var(--text-primary) 6%, transparent);
    transition: background 0.3s var(--ease);
}
.wire-row:last-child { border-bottom: 0; }
.wire-row:hover,
.wire-row:focus-within { background: var(--void-card); }

.wire-time {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    padding-top: 0.15rem;
}

.wire-src {
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
/* One tag colour per publisher, straight from the palette. */
.wire-src--insider      { color: var(--q-violet); }
.wire-src--physorg      { color: var(--q-blue); }
.wire-src--quanta       { color: var(--q-pink); }
.wire-src--sciencedaily { color: var(--q-cyan); }
.wire-src--arxiv        { color: var(--q-purple); }
.wire-src--qcr          { color: var(--q-emerald); }
.wire-src--iqt          { color: var(--q-amber); }
/* Every palette token is already spoken for by another publisher, so
   this one is mixed FROM tokens rather than typed as a new literal:
   amber toward pink lands on a coral that no other source is using. */
.wire-src--zeitgeist    { color: color-mix(in oklch, var(--q-amber) 55%, var(--q-pink)); }

.wire-title {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0.3rem 0 0.35rem;
}
.wire-title a {
    color: var(--text-primary);
    transition: color 0.3s var(--ease);
}
/* The headline link owns the whole row's click target. The z-index is
   load-bearing: the overlay sits inside the <h2>, which comes BEFORE the
   excerpt in the DOM, so without it the excerpt paints on top and taps
   on the summary text — most of the row's area on a phone — did
   nothing at all. */
.wire-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.wire-row:hover .wire-title a { color: var(--text-primary); }
.wire-arrow {
    display: inline-block;
    margin-left: 0.15rem;
    color: var(--q-cyan);
    opacity: 0;
    transform: translate(-5px, 4px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.wire-row:hover .wire-arrow,
.wire-row:focus-within .wire-arrow { opacity: 1; transform: none; }

/* The card line is an extractive SUMMARY now, not the first 200
   characters of the article, so it gets a third line: two whole
   sentences rarely fit in two. */
.wire-excerpt {
    font-size: 0.87rem;
    line-height: 1.6;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Open the row and the summary stops being a teaser, so it stops being
   clamped: you can see the whole thing above the article extract. */
.wire-row.is-open .wire-excerpt {
    -webkit-line-clamp: none;
    line-clamp: none;
    display: block;
}

/* A genuinely new row (first seen on a poll, not on first paint) gets a
   brief emerald wash that fades out over ~3s. It is an overlay rather
   than a background so it can never fight the hover state. */
.wire-row.is-new::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg in oklch,
        color-mix(in oklch, var(--q-emerald) 20%, transparent),
        transparent 62%);
    animation: wireFade 3s var(--ease) forwards;
}
@keyframes wireFade { to { opacity: 0; } }

/* ── First-load skeleton ─────────────────────────────────────────── */
.wire-skel {
    display: grid;
    grid-template-columns: 66px 1fr;
    gap: 1.1rem;
    padding: 1.05rem 1.4rem;
    border-bottom: 1px solid color-mix(in oklch, var(--text-primary) 6%, transparent);
}
.wire-skel:last-child { border-bottom: 0; }
.wire-skel-lines { display: flex; flex-direction: column; gap: 0.55rem; }
.wire-shimmer {
    height: 0.65rem;
    border-radius: 4px;
    background: linear-gradient(90deg,
        color-mix(in oklch, var(--text-primary) 5%, transparent),
        color-mix(in oklch, var(--text-primary) 11%, transparent),
        color-mix(in oklch, var(--text-primary) 5%, transparent));
    background-size: 220% 100%;
    animation: wireShimmer 1.7s linear infinite;
}
.wire-shimmer--time  { width: 42px; }
.wire-shimmer--tag   { width: 110px; height: 0.55rem; }
.wire-shimmer--head  { width: 78%; height: 0.85rem; }
.wire-shimmer--body  { width: 92%; }
.wire-shimmer--body2 { width: 64%; }
@keyframes wireShimmer {
    from { background-position: 120% 0; }
    to   { background-position: -120% 0; }
}

/* ── Empty / failed states ───────────────────────────────────────── */
.wire-msg {
    padding: 3.5rem 1.6rem;
    text-align: center;
    color: var(--text-secondary);
}
.wire-msg h2 {
    font-size: var(--fs-md);
    color: var(--text-primary);
    margin-bottom: 0.7rem;
}
.wire-msg p { font-size: 0.92rem; max-width: 46ch; margin: 0 auto 1.4rem; }
.wire-retry {
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-ui);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.wire-retry:hover { background: color-mix(in oklch, var(--text-primary) 8%, transparent); border-color: var(--q-violet); }

/* ── Attribution ─────────────────────────────────────────────────── */
.wire-attrib {
    margin-top: 1.6rem;
    font-size: 0.8rem;
    line-height: 1.75;
    color: var(--text-dim);
}
.wire-attrib strong { color: var(--text-secondary); font-weight: 500; }

.wire-noscript {
    padding: 2.5rem 1.6rem;
    text-align: center;
    color: var(--text-secondary);
}


/* ── Tier 2: chips, disclosure, entity strip, keyboard legend ────── */

/* Chips must clear the headline link's full-row ::after overlay, or
   they are unclickable. position+z-index is what buys that. */
.wire-chip {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: transparent;
    cursor: pointer;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
a.wire-chip { text-decoration: none; }
.wire-chip:hover { color: var(--text-primary); border-color: var(--border-glow); }
.wire-chip--cluster { color: var(--q-emerald); border-color: color-mix(in oklch, var(--q-emerald) 40%, transparent); cursor: default; }
.wire-chip--related { color: var(--q-cyan); border-color: color-mix(in oklch, var(--q-cyan) 40%, transparent); }
.wire-chip--entity  { color: var(--text-secondary); }
/* The tally is a separate element in its own face, so "Quantinuum 3"
   reads as a company and a count rather than as one odd name. */
.wire-chip-count {
    margin-left: 0.42rem;
    padding-left: 0.42rem;
    border-left: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    color: var(--q-cyan);
}
.wire-chip--entity.is-active .wire-chip-count {
    color: #06060c;
    border-left-color: color-mix(in oklch, #06060c 30%, transparent);
}
.wire-chip--clear { color: var(--text-dim); border-style: dashed; }
.wire-chip--entity.is-active { background: var(--q-gradient); color: #06060c; border-color: transparent; font-weight: 600; }
.wire-chip--src { color: var(--text-secondary); }

.wire-srcrow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* Disclosure toggle */
.wire-more {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
    padding: 0.25rem 0.6rem 0.25rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.wire-more:hover { color: var(--text-primary); border-color: var(--border-glow); }
.wire-more:focus-visible { outline: 2px solid var(--q-cyan); outline-offset: 2px; }
.wire-more-ico { font-size: 0.8rem; line-height: 1; }

.wire-detail {
    position: relative;
    z-index: 2;
    margin-top: 0.7rem;
    padding-left: 0.9rem;
    border-left: 2px solid color-mix(in oklch, var(--q-violet) 45%, transparent);
}
/* ── The article extract ──────────────────────────────────────────
   This is the second read: the publisher's own opening paragraphs, set
   for reading rather than for scanning. Slightly larger and looser than
   the summary above it on purpose, so the switch from "what is this"
   to "I am reading this" is visible before you have read a word. */
.wire-read { margin: 0 0 0.7rem; }
.wire-read-p {
    font-size: 0.92rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    max-width: 68ch;
}
.wire-read-p:last-of-type { margin-bottom: 0.6rem; }
.wire-continue {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--q-cyan);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in oklch, var(--q-cyan) 35%, transparent);
    padding-bottom: 1px;
    transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.wire-continue:hover { color: var(--text-primary); border-color: var(--text-primary); }

/* Reading time on the toggle. It describes the ARTICLE, not the
   extract, because it exists to help you decide whether to follow the
   link, not how long the preview is. */
.wire-more-mins[hidden] { display: none; }
.wire-more-mins {
    margin-left: 0.45rem;
    padding-left: 0.45rem;
    border-left: 1px solid var(--border);
    color: var(--text-dim);
    opacity: 0.8;
}
.wire-by { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em;
           text-transform: uppercase; color: var(--text-dim); margin: 0 0 0.5rem; }
.wire-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.4rem; }
.wire-also-label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em;
                   text-transform: uppercase; color: var(--text-dim); }

.wire-row.is-open { background: var(--void-card); }

/* "In the news" strip */
.wire-strip {
    display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
    margin-bottom: 1rem;
}
/* An author `display` declaration overrides the UA's [hidden] rule, so
   without these the strip and the legend render even when hidden. */
.wire-strip[hidden] { display: none; }
.wire-strip-label {
    font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--text-dim); margin-right: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
    .wire-chip, .wire-more { transition: none; }
}

/* ── Mobile: the timestamp folds up into the content column ──────── */
@media (max-width: 560px) {
    .wire-row, .wire-skel { grid-template-columns: 1fr; gap: 0.4rem; padding: 1rem 1.1rem; }
    .wire-time { padding-top: 0; font-size: 0.72rem; }
    .wire-day { padding: 0.75rem 1.1rem; }
    .wire-tier-head { padding: 1rem 1.1rem 0.8rem; gap: 0.45rem 0.9rem; }
    .wire-tier-head h2 { font-size: 0.95rem; }
    /* The note is indented to the headline column on desktop. On a
       phone the row is a single column, so that indent would push it
       off the edge. */
    .wire-note { padding: 0 1.1rem 1rem; font-size: 0.88rem; }
    .wire-row--lead .wire-title { font-size: 1.04rem; }
    .page-hero--wire { padding: 118px 0 28px; }

    /* Four pills wanted 356px of a 311px row at 375px wide, so BUSINESS
       dropped to a line of its own. Tighter padding, tracking and gap
       bring the row to ~287px, which also clears a 360px Android
       viewport. Vertical padding goes UP at the same time so the tap
       target does not get shorter while the pill gets narrower. */
    .wire-tabs { gap: 0.4rem; }
    .wire-tab { padding: 0.55rem 0.6rem; letter-spacing: 0.1em; }

    /* The feed is the page. 4.5rem of section padding on top of the
       hero's own left ~200px of empty screen above the first headline
       on a phone. */
    .page-hero--wire + .page-section--tight { padding-top: 2.25rem; }
    .wire-bar { margin-bottom: 1rem; gap: 0.6rem 1rem; }

    /* Chips render 20px tall at desktop metrics, under the 24px floor
       WCAG 2.2 SC 2.5.8 sets for a touch target. Vertical padding only,
       so the row rhythm is unchanged. */
    .wire-chip { padding-top: 0.35rem; padding-bottom: 0.35rem; }
    .wire-more { padding-top: 0.45rem; padding-bottom: 0.45rem; }
}

/* Motion is decoration here; every animation above is optional. */
@media (prefers-reduced-motion: reduce) {
    .wire-live, .wire-dot, .wire-shimmer, .wire-row.is-new::before { animation: none; }
    .wire-live { opacity: 1; }
    .wire-row.is-new::before { opacity: 0; }
    .wire-tab, .wire-row, .wire-arrow, .wire-title a, .wire-retry { transition: none; }
    .wire-arrow { transform: none; }
}


/* ── "From the wire": the homepage band ──────────────────────────────────────
   The heading row and the band's own spacing. Everything inside the panel is
   the shared rendering above. This lives here rather than in a <style> block
   on index.html because index.html has never had one, and because the band is
   part of this component rather than part of the homepage.
   ────────────────────────────────────────────────────────────────────────── */
.home-wire { padding: 0 0 2rem; }
.home-wire-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.home-wire-head .section-title { margin: 0; }
.home-wire-more {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s var(--ease);
}
.home-wire-more::after { content: ' \2192'; }
.home-wire-more:hover { color: var(--text-primary); }

/* The band is authored empty and filled in only if the feeds answer. An empty
   bordered box reads as a broken component, so the section shows nothing until
   there is something in it: a homepage must not apologise for a wire the
   reader was never promised.

   COLLAPSED, NOT display:none. The fetch is triggered by an IntersectionObserver
   on the panel, and an element that is display:none never intersects anything,
   so hiding it that way meant it was never filled, which meant it was never
   shown: the band hid itself permanently. Zero height keeps it in the flow at
   the right point in the document, where it can still be observed, while
   occupying nothing and drawing nothing. news-wire.js adds .is-ready once it
   has rows. */
.home-wire:not(.is-ready) {
    /* 1px, NOT 0. An element whose bounding box is empty can never intersect
       anything, so IntersectionObserver never fires on it and the band stayed
       collapsed for ever. One pixel is a real box with a real area, invisible
       in a dark layout and inert in the flow. */
    height: 1px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
