/* ==========================================================================
   Pulse — a signal board for live news and numbers.
   Palette is content-driven: news red for live, brass for gold, jade for
   rising markets, petrol ink on cool mineral paper.
   ========================================================================== */

:root {
  --ink:      #0b1113;
  --ink-soft: #93a3a9;
  --paper:    #161d21;
  --card:     #1e262b;
  --rule:     #2e383d;
  --text:     #eaefee;
  --signal:   #e23854;
  --jade:     #24b491;
  --brass:    #d0a13f;

  --shell: 1220px;
  --gap: 22px;
  --radius: 4px;

  --step-0: 1rem;
  --step-1: 1.18rem;
  --step-2: 1.6rem;
  --step-3: 2.3rem;
  --step-4: clamp(2.4rem, 5.2vw, 4rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: var(--step-0);
  line-height: 1.6;
}

h1, h2, h3, .wordmark, .gauge__value, .sky__temp, .rank__num, button, .gauge__label {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

a { color: inherit; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 20px;
}

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

/* ---------- Ticker: the only ambient motion on the page ---------- */
.ticker {
  background: var(--ink);
  color: #f2f6f5;
  overflow: hidden;
  border-bottom: 1px solid #0a151b;
}
.ticker__track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  padding: 7px 0;
  font-family: "Archivo", sans-serif;
  font-size: .82rem;
  letter-spacing: .01em;
  animation: drift 48s linear infinite;
}
.ticker__track span { opacity: .82; }
.ticker__track b { font-weight: 600; color: #ffd9dd; }
@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; white-space: normal; flex-wrap: wrap; }
}

/* ---------- Masthead ---------- */
.masthead {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 20;
}
.masthead__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-block: 12px;
}
.wordmark {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.035em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.wordmark__dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 0 rgba(36, 180, 145, .55);
  animation: beat 2.6s ease-out infinite;
}
@keyframes beat {
  0%   { box-shadow: 0 0 0 0 rgba(36,180,145,.55); }
  70%  { box-shadow: 0 0 0 12px rgba(36,180,145,0); }
  100% { box-shadow: 0 0 0 0 rgba(36,180,145,0); }
}
@media (prefers-reduced-motion: reduce) { .wordmark__dot { animation: none; } }

.places { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.place, .beat {
  font: 500 .86rem/1 "Archivo", sans-serif;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  color: var(--ink-soft);
}
.place:hover, .beat:hover { color: var(--text); border-color: var(--rule); }
.place.is-on, .beat.is-on {
  background: #2c383e;
  color: #fff;
  border-color: #2c383e;
}
.stamp { margin: 0; font-size: .8rem; color: var(--ink-soft); }

/* ---------- Notice ---------- */
.notice {
  margin-top: var(--gap);
  padding: 14px 16px;
  background: #331319;
  border-left: 4px solid var(--signal);
  font-size: .92rem;
}
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85em;
  background: #4a1c23;
  padding: 1px 5px;
}

/* ---------- Front page: lead + instrument rail ---------- */
.frontpage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--gap);
  margin-block: var(--gap);
  align-items: start;
}

.lead {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.lead__media {
  aspect-ratio: 16 / 8.5;
  background-size: cover;
  background-position: center;
  background-color: #262f34;
  border-bottom: 1px solid var(--rule);
}
.lead__text { padding: 24px 26px 28px; }
.lead__meta {
  margin: 0 0 10px;
  font: 600 .78rem/1 "Archivo", sans-serif;
  color: var(--signal);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.lead__meta .sep { color: var(--rule); }
.lead__meta .outlet { color: var(--ink-soft); font-weight: 500; }
.lead__title {
  margin: 0;
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -.032em;
  max-width: 20ch;
}
.lead__standfirst {
  margin: 14px 0 0;
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 58ch;
}
.lead__link {
  display: inline-block;
  margin-top: 18px;
  font: 600 .88rem/1 "Archivo", sans-serif;
  color: var(--text);
  text-decoration-color: var(--signal);
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

/* Instrument rail */
.rail { display: grid; gap: 12px; position: sticky; top: 74px; }
.gauge {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 15px 17px;
  border-left-width: 3px;
}
.gauge--gold { border-left-color: var(--brass); }
.gauge--fx   { border-left-color: var(--jade); }
.gauge--sky  { border-left-color: #2f6f9e; }
.gauge--bat  { border-left-color: var(--signal); }

.gauge__label {
  margin: 0 0 6px;
  font: 500 .74rem/1 "Archivo", sans-serif;
  color: var(--ink-soft);
}
.gauge__value {
  margin: 0;
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.gauge__foot { margin: 4px 0 0; font-size: .76rem; color: var(--ink-soft); }

.fx { list-style: none; margin: 0; padding: 0; }
.fx__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dotted var(--rule);
  font-size: .93rem;
}
.fx__row:last-child { border-bottom: 0; }
.fx__row b { font-weight: 600; font-variant-numeric: tabular-nums; }

.sky__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.citypick { display: flex; gap: 4px; }
.citypick input {
  width: 88px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 4px 7px;
  font: 400 .8rem/1.3 "Archivo", sans-serif;
  background: var(--paper);
  color: var(--text);
}
.citypick button {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--text);
  border-radius: 3px;
  padding: 4px 9px;
  font-size: .78rem;
  cursor: pointer;
}
.sky__temp {
  margin: 6px 0 0;
  font-size: var(--step-3);
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.sky__where { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.sky__days {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
  font-size: .75rem;
}
.sky__days li { border-top: 1px solid var(--rule); padding-top: 6px; color: var(--ink-soft); }
.sky__days b { display: block; color: var(--text); font-variant-numeric: tabular-nums; }

.matches { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.matches li { padding: 6px 0; border-bottom: 1px dotted var(--rule); }
.matches li:last-child { border-bottom: 0; }
.matches a { text-decoration: none; }
.matches a:hover { text-decoration: underline; }
.matches small { display: block; color: var(--ink-soft); font-size: .8rem; }

/* ---------- Ranked list ---------- */
.ranked { margin-block: 38px; }
.ranked__head { border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 4px; }
.ranked__head h2, .desk__head h2, .searches h2, .cricketnews h2 {
  margin: 0;
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -.03em;
}
.ranked__hint { margin: 3px 0 0; font-size: .85rem; color: var(--ink-soft); }

.ranked__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
  columns: 2;
  column-gap: 44px;
}
.rank {
  break-inside: avoid;
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.rank__num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  min-width: 1.7ch;
}
.rank__body { min-width: 0; }
.rank__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.35;
}
.rank__title a { text-decoration: none; }
.rank__title a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.rank__meta { margin: 4px 0 0; font-size: .8rem; color: var(--ink-soft); }
.tag-outlets {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 1px 8px;
  font-family: "Archivo", sans-serif;
  font-size: .72rem;
  margin-right: 7px;
}

/* ---------- Story grid ---------- */
.desk { margin-block: 38px; }
.desk__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
  margin-bottom: 18px;
}
.beats { display: flex; gap: 3px; flex-wrap: wrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: var(--gap);
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card__media {
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #262f34;
  border-bottom: 1px solid var(--rule);
}
.card__body { padding: 14px 16px 17px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card__title { margin: 0; font-size: 1.05rem; font-weight: 500; line-height: 1.34; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.card__meta { margin: 0; font-size: .78rem; color: var(--ink-soft); margin-top: auto; }

/* ---------- Search chips ---------- */
.searches { margin-block: 38px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 16px 0 0; }
.chips a {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 7px 14px;
  font: 500 .88rem/1 "Archivo", sans-serif;
  text-decoration: none;
}
.chips a:hover { border-color: var(--ink); }
.chips .hot { color: var(--signal); font-variant-numeric: tabular-nums; }

/* ---------- Cricket wire ---------- */
.cricketnews { margin-block: 38px; }
.wire { list-style: none; padding: 0; margin: 16px 0 0; }
.wire li { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.wire a { text-decoration: none; font-size: 1.02rem; }
.wire a:hover { text-decoration: underline; text-decoration-color: var(--signal); }
.wire small { display: block; color: var(--ink-soft); font-size: .79rem; margin-top: 3px; }

/* ---------- Footer ---------- */
.foot {
  background: var(--ink);
  color: #b9c7cc;
  margin-top: 48px;
  padding-block: 30px 22px;
  font-size: .85rem;
}
.foot p { margin: 0 0 6px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid #24313688;
}
.foot__brand {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.foot__head {
  margin: 0 0 10px;
  font: 600 .78rem/1 "Archivo", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7f929a;
}
.foot__links { display: flex; flex-direction: column; gap: 8px; }
address { font-style: normal; }
.foot__bottom { padding-top: 18px; }
@media (max-width: 620px) {
  .foot__grid { grid-template-columns: 1fr; }
}

/* ---------- Legal / info pages ---------- */
.legal {
  max-width: 72ch;
  margin: 0 auto;
  padding-block: 40px 60px;
}
.legal a { color: var(--jade); }
.legal h1 { font-size: var(--step-3); margin: 0 0 6px; }
.legal .legal__updated { color: var(--ink-soft); font-size: .85rem; margin: 0 0 30px; }
.legal h2 { font-size: var(--step-1); margin: 32px 0 10px; }
.legal p, .legal li { color: var(--text); line-height: 1.7; }
.legal ul { padding-left: 22px; }
.legal .back { display: inline-block; margin-bottom: 20px; font: 500 .85rem/1 "Archivo", sans-serif; color: var(--ink-soft); text-decoration: none; }
.legal .back:hover { color: var(--text); }

/* ---------- Loading placeholders ---------- */
.skeleton, .skeleton-line { background: linear-gradient(90deg, #212a2f, #2c373d, #212a2f); background-size: 200% 100%; animation: sweep 1.4s linear infinite; }
.skeleton-line { height: 13px; border-radius: 3px; margin: 8px 0; list-style: none; }
@keyframes sweep { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .skeleton-line { animation: none; } }

.empty { color: var(--ink-soft); font-size: .92rem; padding: 10px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .frontpage { grid-template-columns: 1fr; }
  .rail { position: static; grid-template-columns: repeat(2, 1fr); }
  .ranked__list { columns: 1; }
}
@media (max-width: 620px) {
  .rail { grid-template-columns: 1fr; }
  .lead__text { padding: 18px 18px 22px; }
  .lead__title { max-width: none; }
  .masthead__inner { gap: 10px; }
  .stamp { width: 100%; }
  .places { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .place { white-space: nowrap; }
}
