/* Twote — cast / web feed page (T2.5). Design width 1280px (cast/TV target);
   see docs/design/handoff-t2/README.md §9 for the contract this recreates.
   Mobile-first per web-structure: base styles are the small-viewport styles,
   media queries only ADD width back for the cast/TV target. */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--fontUI);
  overflow-x: hidden; /* belt-and-braces; layout below must never need this */
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 100;
  border: 1px solid var(--outline);
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--swiftGreenBright);
  outline-offset: 2px;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: underline;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 16px 28px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  flex: none;
}
.tagline {
  font-family: var(--fontUI);
  font-size: 13px;
  font-weight: 500;
  color: var(--moss);
  line-height: 1;
  letter-spacing: 0.01em;
  padding-left: 0.1em;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-family: var(--fontUI);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
  flex: none;
}
/* The O: a bold green ring, centred on the letters, matching the brand mark
   (design/ds/Twote Handoff-selection.png). Static/solid green for general use;
   the pulse-echo animation is reserved for the app's "listening active" state. */
.wordmark .ring-o {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin: 0 0.02em;
  border-radius: 50%;
  border: 0.15em solid var(--swiftGreenBright);
  box-sizing: border-box;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  color: var(--fog);
  font-size: 14px;
  flex: 1 1 240px;
  min-width: 0;
}
.header-meta .dot-sep::before {
  content: '·';
  margin: 0 6px;
  color: var(--moss);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tally {
  color: var(--fog);
  font-size: 14px;
  white-space: nowrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--swiftCobalt);
  color: var(--cobaltMist);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--swiftGreenBright);
  position: relative;
  flex: none;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--swiftGreenBright);
  animation: live-pulse 2.4s ease-out infinite;
}
@keyframes live-pulse {
  0% { opacity: 0.9; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.6); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { animation: none; opacity: 0.35; }
}
.live-pill a {
  color: inherit;
}

/* ---------- Layout: three columns ---------- */
main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  main {
    grid-template-columns: 1fr 1fr;
  }
  .col-session {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  main {
    grid-template-columns: minmax(320px, 1.55fr) minmax(280px, 1fr) minmax(220px, 0.72fr);
  }
  .col-session {
    grid-column: auto;
  }
}

.column-heading {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: var(--moss);
  margin: 0 0 14px;
}

.empty-note {
  color: var(--fog);
  font-size: 14px;
  margin: 0;
}

/* ---------- (a) Featured latest detection ---------- */
.col-featured {
  display: flex;
  flex-direction: column;
}
#featured {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.featured-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--outline);
}
.featured-lockup {
  padding-top: 16px;
}
.featured-name {
  font-family: var(--fontUI);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--text);
}
@media (min-width: 1024px) {
  .featured-name { font-size: 46px; }
}
.featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.featured-sci {
  font-size: 22px;
  margin: 0;
}
.latest-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: var(--fog);
  font-weight: 600;
}

/* ---------- Tier chips (shared) ---------- */
.tier-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  padding: 4px 12px;
  white-space: nowrap;
}
.tier-chip--compact {
  padding: 3px 10px;
}

/* ---------- (b) Recent detections rail ---------- */
.col-recent {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.recent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 8px 12px;
}
.recent-art {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  flex: none;
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
}
@media (min-width: 640px) {
  .recent-art { width: 80px; height: 80px; }
}
.recent-body {
  flex: 1;
  min-width: 0;
}
.recent-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 2px;
  color: var(--text);
  overflow-wrap: break-word;
}
.recent-sci {
  font-size: 12px;
  margin: 0;
}
.recent-ago {
  color: var(--fog);
  font-size: 13px;
  flex: none;
  white-space: nowrap;
}

/* QR + follow-along card, pinned to the bottom of the This-session column. The styled QR SVG
   carries its own light rounded panel, so the holder needs no background of its own. */
.session-qr-card {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 16px;
  padding: 16px;
}
#qr-holder {
  flex: none;
  width: 116px;
  height: 116px;
}
#qr-holder svg {
  display: block;
  width: 100%;
  height: 100%;
}
.rail-follow {
  min-width: 0;
}
.rail-follow p {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--fog);
}
.rail-follow a {
  font-family: monospace, ui-monospace, SFMono-Regular, Menlo, Consolas;
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* ---------- (c) This session tally ---------- */
.col-session {
  display: flex;
  flex-direction: column;
}
#session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.session-name {
  font-weight: 500;
  font-size: 17px;
  color: var(--text);
}
.count-pill {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fog);
  flex: none;
}

/* ---------- Detection-arrival animation (A2) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .recent-card,
  #featured {
    animation: feed-arrive 180ms ease-out;
  }
}
@keyframes feed-arrive {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
