:root {
  --bg: #f3efe6;
  --bg-elev: #fffdf8;
  --ink: #1c1412;
  --muted: #6b6158;
  --line: rgba(28, 20, 18, 0.12);
  --accent: #8b1e2d;
  --accent-soft: #f3d7d4;
  --navy: #1e3a4c;
  --live: #c23b22;
  --shadow: 0 18px 50px rgba(28, 20, 18, 0.08);
  --radius: 18px;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --max: 1180px;
}

html[data-theme="dark"] {
  --bg: #121417;
  --bg-elev: #1b1f24;
  --ink: #f3eee6;
  --muted: #a79c91;
  --line: rgba(243, 238, 230, 0.12);
  --accent: #e15d5d;
  --accent-soft: #3a2326;
  --navy: #9ec9dc;
  --live: #ff6b4a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
    var(--bg);
  font-family: var(--font-ui);
  line-height: 1.5;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elev) 86%, transparent);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__inner,
.masthead__inner,
.ticker__inner,
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.topbar__inner {
  min-height: 48px;
  font-size: 0.86rem;
}

.topbar__meta,
.topbar__weather {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
}

.topbar__clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.topbar__tz,
.kicker,
.brand__tag,
.section__head p,
.panel__head p,
.footer__note {
  color: var(--muted);
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.icon-moon {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: block;
}

html[data-theme="dark"] .icon-sun {
  display: none;
}

.masthead {
  padding: 1.4rem 0 1.1rem;
  border-bottom: 3px double var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fffdf8;
  border-radius: 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
}

.brand__name {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  word-break: break-word;
}

.brand__tag {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--accent);
}

.ticker {
  border-block: 1px solid var(--line);
  background: var(--bg-elev);
  overflow: hidden;
}

.ticker__inner {
  min-height: 44px;
  gap: 1rem;
}

.ticker__live {
  flex: none;
  background: var(--live);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    filter: brightness(1.15);
  }
}

.ticker__track {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.ticker__track span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 42s linear infinite;
}

@keyframes marquee {
  to {
    transform: translateX(-100%);
  }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  padding: 1.6rem 0 3rem;
}

.hero__story,
.panel,
.story-item,
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero__story {
  padding: 0;
  overflow: hidden;
}

.hero__story a {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.7rem;
  padding: 1.15rem 1.3rem 1.2rem;
  overflow: hidden;
  text-decoration: none;
}

.hero__body,
.card__body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.hero__split {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}

.hero__bajada {
  flex: 1 1 auto;
  min-width: 0;
}

.story-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(145deg, hsl(var(--tone, 348) 42% 44%), hsl(calc(var(--tone, 348) + 38) 28% 16%));
}

.story-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s ease;
}

.card:hover .story-media img {
  transform: scale(1.04);
}

.story-media--hero {
  flex: 0 0 auto;
  width: auto;
  max-width: 168px;
  min-width: 0;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
  align-self: flex-start;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elev));
}

.story-media--hero:not(:has(img)) {
  width: 168px;
  height: 112px;
}

.story-media--hero img {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  max-width: 168px;
  max-height: 120px;
  object-fit: contain;
  transform: none;
}

.story-media--thumb {
  aspect-ratio: 4 / 3;
  width: 92px;
  min-height: 70px;
  border-radius: 10px;
  flex: none;
}

.kicker {
  margin: 0 0 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero__story h1,
.card h3,
.story-item h3,
.section__head h2,
.panel__head h2 {
  font-family: var(--font-serif);
  margin: 0;
}

.hero__story a .kicker {
  margin-bottom: 0.15rem;
}

.hero__story h1 {
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  line-height: 1.15;
  font-weight: 700;
  width: 100%;
}

.lede,
.card p,
.story-item p,
.efemeride p,
.empty {
  color: var(--muted);
}

.lede {
  font-size: 1.02rem;
  max-width: 62ch;
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.hero__grid,
.cards {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.story-item {
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card {
  display: flex;
  flex-direction: column;
}

.card:hover,
.story-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.hero__story a:hover h1 {
  color: var(--accent);
}

.section {
  margin-top: 2rem;
}

.section__head,
.panel__head {
  margin-bottom: 0.9rem;
}

.section__head h2,
.panel__head h2 {
  font-size: 1.4rem;
}

.section__head h2 {
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.section__head p,
.panel__head p {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
}

.story-list,
.markets,
.quakes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.story-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem;
}

.story-item__num {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
  margin-bottom: 0.15rem;
}

.panel {
  padding: 1.1rem 1.15rem 1.2rem;
  margin-bottom: 1rem;
}

.weather__now {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.weather__icon {
  width: 72px;
  height: 72px;
  flex: none;
  color: var(--navy);
}

.weather__temp {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.weather__unit {
  font-size: 1.3rem;
  color: var(--muted);
}

.weather__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.stat,
.market,
.quake {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elev));
}

.stat small,
.market small,
.quake small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.forecast {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 1rem;
}

.forecast div {
  text-align: center;
  font-size: 0.75rem;
  padding: 0.5rem 0.2rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elev));
}

.forecast strong {
  display: block;
  margin-top: 0.15rem;
}

.market,
.quake {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
}

.market b,
.quake b {
  font-variant-numeric: tabular-nums;
}

.hero__story a,
.efemeride a {
  text-decoration: none;
}

.theme-toggle:focus-visible,
.nav a:focus-visible,
.card:focus-visible,
.story-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.4rem;
}

.footer p {
  margin: 0.35rem 0 0;
  max-width: 52ch;
}

.skeleton {
  background: linear-gradient(90deg, var(--line), transparent, var(--line));
  background-size: 200% 100%;
  animation: shine 1.4s linear infinite;
  border-radius: 10px;
}

.skeleton--hero {
  min-height: 180px;
}

.skeleton--row,
.skeleton--card,
.skeleton--block,
.skeleton--weather {
  min-height: 72px;
}

.skeleton--inline {
  width: 140px;
  height: 12px;
  display: inline-block;
}

@keyframes shine {
  to {
    background-position: -200% 0;
  }
}

.empty {
  margin: 0;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .layout,
  .hero__grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .hero__split {
    flex-direction: column;
  }

  .story-media--hero,
  .story-media--hero img {
    max-width: min(220px, 100%);
    max-height: 140px;
    width: auto;
    height: auto;
    flex: none;
  }

  .topbar__weather,
  .theme-toggle__label {
    display: none;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
  }

  .nav a {
    flex: none;
  }

  .masthead__inner,
  .footer__inner,
  .topbar__inner {
    flex-wrap: wrap;
  }

  .forecast {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .weather__temp {
    font-size: 2.5rem;
  }

  .hero__story,
  .panel,
  .card,
  .story-item {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .ticker__track span {
    padding-left: 0;
    white-space: normal;
  }
}
