/* ---------- Basic reset and colour variables ---------- */

:root {
  --paper: #f7f4ed;
  --paper-dark: #e8e2d6;
  --ink: #1c2024;
  --muted-ink: #5d6268;
  --line: #c8c0b3;
  --red: #a92f36;
  --blue: #2e587c;
  --yellow: #d6aa35;
  --green: #38665b;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.04;
}

h2,
h3 {
  letter-spacing: -0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: -60px;
  left: 16px;
  padding: 10px 14px;
  color: white;
  background: var(--ink);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header and editorial structure ---------- */

.top-disclaimer {
  padding: 10px 20px;
  color: #fff;
  background: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.site-header,
main,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  color: var(--muted-ink);
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.utility-bar p {
  margin: 0;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--red);
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 30px 0 24px;
}

.section-label {
  margin-bottom: 7px;
  color: var(--red);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.masthead h1 {
  margin-bottom: 4px;
  font-size: clamp(3.1rem, 8vw, 6.4rem);
  font-weight: 700;
  letter-spacing: -0.07em;
}

.tagline {
  margin-bottom: 0;
  color: var(--muted-ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  font-style: italic;
}

.activate-button,
.stop-button {
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease;
}

.activate-button:hover,
.stop-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.activate-button {
  max-width: 265px;
  padding: 13px 16px;
  color: white;
  background: var(--red);
  font-size: 0.88rem;
  line-height: 1.25;
  text-align: left;
}

.activate-button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--paper-dark);
}

.main-navigation {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  overflow-x: auto;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.main-navigation a {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.main-navigation a:hover {
  color: var(--red);
}

.breaking-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.breaking-bar p {
  flex: 1;
  margin: 0;
  font-family: var(--serif);
}

.breaking-label,
.live-badge {
  padding: 3px 7px;
  color: white;
  background: var(--red);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-badge {
  background: var(--ink);
}

/* ---------- Main editorial page ---------- */

main {
  padding: 34px 0 52px;
}

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(270px, 0.9fr);
  gap: 34px;
}

.lead-story {
  padding-right: 34px;
  border-right: 1px solid var(--line);
}

.article-meta {
  margin-bottom: 10px;
  color: var(--muted-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead-story h2 {
  margin-bottom: 16px;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
}

.lead-summary {
  max-width: 680px;
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 1.24rem;
  line-height: 1.35;
}

.image-placeholder {
  position: relative;
  display: flex;
  align-items: end;
  min-height: 260px;
  margin-bottom: 18px;
  padding: 14px;
  overflow: hidden;
  color: white;
  background: #48535c;
}

.image-placeholder::before,
.image-placeholder::after {
  position: absolute;
  content: "";
}

.cloud-image::before {
  top: 45px;
  left: 16%;
  width: 220px;
  height: 72px;
  border-radius: 100px;
  background: #dfe2e0;
  box-shadow:
    75px -25px 0 15px #dfe2e0,
    165px 3px 0 3px #dfe2e0,
    -35px 13px 0 2px #dfe2e0;
}

.cloud-image::after {
  right: -20px;
  bottom: -15px;
  left: -20px;
  height: 110px;
  background:
    repeating-linear-gradient(
      90deg,
      #28333a 0,
      #28333a 26px,
      #3d4549 27px,
      #3d4549 42px
    );
}

.image-placeholder span {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.article-body {
  max-width: 720px;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.read-link {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.read-link:hover {
  text-decoration: underline;
}

.side-story {
  padding-bottom: 23px;
}

.side-story h3 {
  margin-bottom: 10px;
  font-size: 1.65rem;
}

.side-story p:not(.article-meta) {
  color: var(--muted-ink);
  font-family: var(--serif);
}

.border-top {
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.signal-panel {
  margin-top: 4px;
  padding: 20px;
  color: white;
  background: var(--ink);
}

.signal-panel .section-label {
  color: #e1bb55;
}

.monitor-number {
  margin-bottom: 3px;
  font-family: var(--serif);
  font-size: 4.3rem;
  line-height: 1;
}

.signal-panel > p:not(.section-label):not(.monitor-number) {
  color: #d3d6d6;
  font-size: 0.86rem;
}

.stop-button {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  color: white;
  border-color: white;
  background: transparent;
}

.stop-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.latest-section {
  margin-top: 48px;
  padding-top: 21px;
  border-top: 3px solid var(--ink);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 2.3rem;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted-ink);
  font-family: var(--serif);
  font-style: italic;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.article-card {
  min-height: 230px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.article-card:first-child {
  padding-left: 0;
}

.article-card:last-child {
  padding-right: 0;
  border-right: 0;
}

.article-card h3 {
  margin-bottom: 12px;
  font-size: 1.43rem;
}

.article-card p:not(.article-meta) {
  color: var(--muted-ink);
  font-family: var(--serif);
}

.concept-note {
  max-width: 820px;
  margin: 52px auto 0;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.concept-note h2 {
  margin-bottom: 14px;
  font-size: 2.2rem;
}

.concept-note > p:last-child {
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 24px 0 36px;
  color: var(--muted-ink);
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.site-footer p {
  max-width: 530px;
  margin-bottom: 0;
}

/* ---------- Fictional pop-up avalanche ---------- */

.popup-layer {
  position: fixed;
  z-index: 500;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.news-popup {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: var(--popup-width, 280px);
  min-height: 175px;
  padding: 14px;
  overflow: hidden;
  color: var(--ink);
  border: 2px solid var(--popup-accent, var(--red));
  box-shadow: 7px 8px 0 rgba(20, 23, 25, 0.22);
  background: #fffdf8;
  pointer-events: auto;
  transform: rotate(var(--popup-rotation, 0deg));
  animation: arrive 0.35s ease-out both;
}

.news-popup::after {
  position: absolute;
  right: -12px;
  bottom: -18px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  content: "";
  background: var(--popup-accent, var(--red));
  opacity: 0.1;
}

.popup-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #cfc9be;
}

.popup-source {
  color: var(--popup-accent, var(--red));
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.popup-close {
  display: grid;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: transparent;
  font-size: 1.12rem;
  line-height: 1;
  place-items: center;
}

.popup-close:hover {
  color: white;
  background: var(--ink);
}

.popup-label {
  display: inline-block;
  align-self: flex-start;
  margin-top: 12px;
  padding: 3px 6px;
  color: white;
  background: var(--popup-accent, var(--red));
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.popup-headline {
  position: relative;
  z-index: 1;
  margin: 9px 0 7px;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.38rem);
  line-height: 1.04;
}

.popup-detail {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: #52585c;
  font-size: 0.78rem;
  line-height: 1.3;
}

.popup-ticker {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 10px;
  color: var(--popup-accent, var(--red));
  border-top: 1px solid #cfc9be;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.avalanche-active .site-header,
.avalanche-active main,
.avalanche-active .site-footer {
  filter: contrast(0.97);
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.94) rotate(var(--popup-rotation, 0deg));
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--popup-rotation, 0deg));
  }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 820px) {
  .masthead,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .masthead {
    gap: 20px;
  }

  .activate-button {
    max-width: none;
    width: 100%;
    text-align: center;
  }

  .lead-grid {
    grid-template-columns: 1fr;
  }

  .lead-story {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding-top: 22px;
  }

  .signal-panel {
    grid-column: 1 / -1;
  }

  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-card:nth-child(2) {
    border-right: 0;
  }

  .article-card:nth-child(3) {
    padding-left: 0;
    border-top: 1px solid var(--line);
  }

  .article-card:nth-child(4) {
    padding-right: 0;
    border-top: 1px solid var(--line);
    border-right: 0;
  }
}

@media (max-width: 540px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1180px);
  }

  .top-disclaimer {
    padding: 9px 14px;
    font-size: 0.67rem;
  }

  .utility-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .main-navigation {
    gap: 18px;
  }

  .breaking-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .live-badge {
    margin-left: auto;
  }

  .side-column,
  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card,
  .article-card:first-child,
  .article-card:last-child,
  .article-card:nth-child(2),
  .article-card:nth-child(3),
  .article-card:nth-child(4) {
    min-height: auto;
    padding: 20px 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .article-card:first-child {
    border-top: 0;
  }

  .section-heading {
    gap: 8px;
  }

  .news-popup {
    width: min(var(--popup-width, 280px), calc(100vw - 26px));
  }
}

/* Keep the artwork calmer for visitors who request reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .news-popup {
    animation: none;
  }
}