/* Page colors are derived tokens; registering them
   as <color> lets them animate. */
@property --bg {
  syntax: '<color>';
  inherits: true;
  initial-value: #fbfaf7;
}

@property --bg-elev {
  syntax: '<color>';
  inherits: true;
  initial-value: #ffffff;
}

@property --rule {
  syntax: '<color>';
  inherits: true;
  initial-value: #dcd9cf;
}

@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #b5545e;
}

:root {
  --paper: #fbfaf7;
  --paper-elev: #ffffff;
  --line: #dcd9cf;
  --signal: #b5545e;
  --ink: #121210;
  --ink-2: #3a3935;
  --muted: #74726a;
  --rule-strong: #121210;
  --cat-novidades: #2d55f5;
  --cat-mercado: #0b8a5d;
  --cat-achados: #7c3aed;
  --skeleton: #e7e4db;
  --skeleton-shine: #f3f1ea;
  /* How a selected AI (app.js sets --ai-color) shows up in this theme. */
  --ai-accent: color-mix(in oklab, var(--ai-color, #b5545e) 88%, #000);

  --bg: var(--paper);
  --bg-elev: var(--paper-elev);
  --rule: var(--line);
  --accent: var(--signal);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);

  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 32px;
  --topbar: 56px;
  color-scheme: light;
  transition:
    --bg 0.7s ease,
    --bg-elev 0.7s ease,
    --rule 0.7s ease,
    --accent 0.7s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #0d0d0c;
    --paper-elev: #161614;
    --line: #2b2a27;
    --signal: #d27a83;
    --ink: #efeee9;
    --ink-2: #c8c6bf;
    --muted: #8e8c84;
    --rule-strong: #efeee9;
    --cat-novidades: #7f97ff;
    --cat-mercado: #3fcf98;
    --cat-achados: #b596ff;
    --skeleton: #1d1d1b;
    --skeleton-shine: #292926;
    --ai-accent: color-mix(in oklab, var(--ai-color, #d27a83) 78%, #fff);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --paper: #0d0d0c;
  --paper-elev: #161614;
  --line: #2b2a27;
  --signal: #d27a83;
  --ink: #efeee9;
  --ink-2: #c8c6bf;
  --muted: #8e8c84;
  --rule-strong: #efeee9;
  --cat-novidades: #7f97ff;
  --cat-mercado: #3fcf98;
  --cat-achados: #b596ff;
  --skeleton: #1d1d1b;
  --skeleton-shine: #292926;
  --ai-accent: color-mix(in oklab, var(--ai-color, #d27a83) 78%, #fff);
  color-scheme: dark;
}

/* A selected AI leaves the page in the brand colors and tints only the details of the stories
   it shows: top rule, number, "Por que importa" and the "Novo" badge. */
:root[data-ai] :is(.story, .quick__item) {
  --accent: var(--ai-accent);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  border-top-color: var(--accent);
}

:root[data-ai] .story__index {
  color: var(--accent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar) + 72px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: color 0.4s ease;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(1240px, 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.dot {
  color: var(--accent);
}

/* ---------- Scroll progress ---------- */

.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.topbar.is-scrolled {
  border-bottom-color: var(--rule);
}

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font: 400 24px/1 var(--serif);
  text-decoration: none;
  letter-spacing: -0.01em;
  animation: fade 0.6s var(--ease-out) both;
}

/* Symbol: masthead rule over three columns of nodes wired like a network; the output node is the accent. */
.brand__mark {
  flex: none;
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.brand__links {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.6;
  stroke-linecap: round;
}

.brand__mark .brand__node {
  fill: var(--accent);
}

.status {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 12px/1.2 var(--mono);
  color: var(--muted);
  letter-spacing: 0.02em;
  min-width: 0;
}

#status-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status__pulse {
  position: relative;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.status__pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}

.status.is-stale .status__pulse,
.status.is-stale .status__pulse::after {
  background: var(--muted);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

.icon-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.4s var(--ease-out);
}

.icon-button:hover {
  border-color: var(--ink);
  transform: rotate(-20deg);
}

.icon-button svg {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition:
    opacity 0.3s ease,
    transform 0.5s var(--ease-out);
}

.icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

:root[data-theme='dark'] .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

:root[data-theme='dark'] .icon-moon {
  opacity: 1;
  transform: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
  }
  :root:not([data-theme='light']) .icon-moon {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Masthead ---------- */

.masthead {
  padding-top: 28px;
}

.masthead__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  animation: fade 0.8s var(--ease-out) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Section tabs ---------- */

.niches {
  min-height: 35px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.niches::-webkit-scrollbar {
  display: none;
}

.niches__list {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.niches__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 7px;
  border-bottom: 2px solid transparent;
  font: 500 12px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.niches__tab:hover {
  color: var(--ink);
}

.niches__tab[aria-current='page'] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.niches__soon {
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}

/* On phones the four tabs fit in one row without the pills; screen readers still hear "em breve". */
@media (max-width: 560px) {
  .niches__list {
    gap: 22px;
  }

  .niches__soon {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ---------- "Em breve" page of a section without an edition yet ---------- */

.soon {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 56px;
  margin-top: 40px;
  padding-bottom: 72px;
}

.soon__kicker {
  margin: 0;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.soon__title {
  margin: 14px 0 0;
  font: 400 clamp(3rem, 7vw, 6rem) / 0.95 var(--serif);
  letter-spacing: -0.03em;
  animation: rise 1s var(--ease-out) both;
}

.soon__pitch {
  margin: 24px 0 0;
  max-width: 58ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.soon__main .soon__label {
  margin-top: 48px;
}

.waitlist {
  align-self: start;
  padding: 26px 28px 28px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 4px 4px 12px 12px;
  background: var(--bg-elev);
}

.waitlist__title {
  margin: 0;
  font: 400 1.9rem/1.1 var(--serif);
}

.waitlist__closed {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

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

.waitlist__form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.waitlist__field {
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.waitlist__row {
  display: flex;
  gap: 8px;
}

.waitlist__row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
}

.waitlist__submit {
  flex: none;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  /* White on the light accent, near-black on the lighter dark-theme accent: both pass AA. */
  color: var(--paper-elev);
  font-weight: 600;
  cursor: pointer;
}

.waitlist__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.waitlist__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-2);
}

.waitlist__consent input {
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.waitlist__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.waitlist__privacy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.waitlist__privacy a {
  color: inherit;
}

.waitlist__status {
  margin: 0;
  min-height: 1.4em;
  font-size: 14px;
}

.waitlist__status[data-state='done'] {
  color: var(--cat-mercado);
}

.waitlist__status[data-state='error'] {
  color: var(--accent);
}

@media (max-width: 860px) {
  .soon {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
}

/* ---------- Archive banner ---------- */

.archive-banner {
  margin: 28px 0 0;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg-elev);
  font-size: 14px;
  color: var(--ink-2);
}

.archive-banner a {
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Ticker ---------- */

.ticker {
  margin-top: 36px;
  padding: 12px 0;
  border-block: 1px solid var(--rule);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  animation: fade 1s var(--ease-out) 0.6s both;
}

.ticker__track {
  display: flex;
  width: max-content;
  font: 400 12.5px/1.4 var(--mono);
  color: var(--ink-2);
  white-space: nowrap;
  animation: marquee var(--ticker-duration, 90s) linear infinite;
}

.ticker:hover .ticker__track {
  animation-play-state: paused;
}

.ticker__item {
  padding-inline: 22px;
}

.ticker__item::before {
  content: '✦';
  margin-right: 22px;
  color: var(--accent);
}

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

/* ---------- Editorial ---------- */

.editorial {
  margin: 48px auto 0;
  max-width: 62ch;
  text-align: center;
  font: 400 clamp(1.35rem, 2.4vw, 1.9rem) / 1.35 var(--serif);
  font-style: italic;
  color: var(--ink);
  text-wrap: balance;
}

/* ---------- Hoje na edição ---------- */

.overview {
  margin-top: 48px;
}

.overview__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0 32px;
}

.overview__list li {
  display: flex;
}

.overview__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px 0 12px;
  border: 0;
  border-top: 1px solid var(--rule);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.overview__item:hover {
  border-top-color: var(--ink);
}

.overview__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.overview__num {
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
}

.overview__text {
  font: 400 1.15rem/1.3 var(--serif);
  text-wrap: pretty;
}

.overview__item:hover .overview__text {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---------- Front: lead + trends ---------- */

.section-label {
  margin: 0 0 18px;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.front {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 56px;
  margin-top: 32px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}

/* The lead story is the front page: a big headline, then the picture. */
.lead__title {
  margin: 14px 0 0;
  font: 400 clamp(2.6rem, 5.4vw, 5rem) / 0.98 var(--serif);
  letter-spacing: -0.025em;
  text-wrap: balance;
  animation: rise 1s var(--ease-out) both;
}

.lead__media {
  margin: 26px 0 0;
}

.lead__media a {
  display: block;
  overflow: hidden;
  border-radius: 3px;
  background: var(--skeleton);
}

.lead__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}

.lead__media a:hover img {
  transform: scale(1.02);
}

.lead__media figcaption {
  margin-top: 8px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.skeleton--media {
  aspect-ratio: 16 / 9;
  margin-top: 26px;
}

.lead__title a,
.story__title a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 0.5s var(--ease-out);
}

.lead__title a:hover,
.story__title a:hover,
.lead__title a:focus-visible,
.story__title a:focus-visible {
  background-size: 100% 1px;
}

.lead__summary {
  margin: 22px 0 0;
  max-width: 62ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.lead .story__why {
  font-size: 1rem;
}

.lead .sources {
  margin-top: 22px;
}

.trends {
  padding-left: 32px;
  border-left: 1px solid var(--rule);
}

.trends__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: trend;
}

.trends__item {
  counter-increment: trend;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  transition: transform 0.4s var(--ease-out);
}

.trends__item:first-child {
  border-top: 0;
  padding-top: 0;
}

.trends__item:hover {
  transform: translateX(4px);
}

.trends__item::before {
  content: counter(trend, decimal-leading-zero);
  grid-row: span 2;
  font: 400 28px/1 var(--serif);
  color: var(--accent);
}

.trends__label {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
}

.trends__note {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- AI filter ---------- */

.ai-filter {
  margin-top: 40px;
}

.ai-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-card {
  --ai: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--bg-elev);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.4s var(--ease-out),
    border-color 0.25s ease,
    background-color 0.25s ease,
    opacity 0.3s ease,
    box-shadow 0.25s ease;
}

.ai-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ai) 60%, var(--rule));
}

.ai-card:active {
  transform: translateY(0) scale(0.98);
}

.logo-mask {
  display: block;
  flex: none;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.ai-card__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ai);
  color: #fff;
  font: 500 14px/1 var(--mono);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12);
  transition: transform 0.5s var(--ease-out);
}

.ai-card__mark .logo-mask {
  width: 19px;
  height: 19px;
}

.ai-card:hover .ai-card__mark {
  transform: rotate(-8deg) scale(1.06);
}

.ai-card__text {
  display: grid;
  line-height: 1.2;
}

.ai-card__name {
  font-size: 14px;
  font-weight: 600;
}

.ai-card__maker {
  font: 400 11px/1.3 var(--mono);
  color: var(--muted);
}

.ai-card__count {
  margin-left: 6px;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  font: 500 11px/1.4 var(--mono);
  text-align: center;
  color: var(--ink-2);
}

.ai-cards.has-active .ai-card:not([aria-pressed='true']) {
  opacity: 0.5;
}

.ai-cards.has-active .ai-card:not([aria-pressed='true']):hover {
  opacity: 1;
}

.ai-card[aria-pressed='true'] {
  border-color: var(--ai);
  background: color-mix(in srgb, var(--ai) 12%, var(--bg-elev));
  box-shadow: 0 0 0 1px var(--ai) inset;
}

.ai-card[aria-pressed='true'] .ai-card__count {
  background: var(--ai);
  color: #fff;
}

.ai-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.ai-badge {
  --ai: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 7px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ai) 13%, transparent);
  font: 500 11.5px/1.5 var(--mono);
  color: var(--ink);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.3s var(--ease-out);
}

.ai-badge__icon {
  width: 12px;
  height: 12px;
  color: var(--ai);
}

.ai-badge__icon:not(.logo-mask) {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ai);
}

.ai-badge:hover {
  background: color-mix(in srgb, var(--ai) 24%, transparent);
  transform: translateY(-1px);
}

.ai-badge[aria-pressed='true'] {
  background: var(--ai);
  color: #fff;
}

.ai-badge[aria-pressed='true'] .ai-badge__icon {
  color: #fff;
  background-color: #fff;
}

.active-ai {
  --ai: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--ai);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ai) 12%, var(--bg-elev));
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  animation: pop 0.45s var(--ease-out);
}

.active-ai__icon {
  width: 16px;
  height: 16px;
  color: var(--ai);
}

.active-ai__icon:not(.logo-mask) {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--ai);
}

.active-ai__close {
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.3s var(--ease-out);
}

.active-ai:hover .active-ai__close {
  color: var(--ink);
  transform: rotate(90deg);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* ---------- Controls ---------- */

.controls {
  position: sticky;
  top: var(--topbar);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.filters {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  position: relative;
  z-index: 1;
  flex: none;
  white-space: nowrap;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s ease;
}

.filter:hover {
  color: var(--ink);
}

.filter[aria-pressed='true'] {
  color: var(--bg);
}

.filter sup,
.only-new sup {
  margin-left: 2px;
  font: 500 10px/1 var(--mono);
  opacity: 0.75;
}

.filters__indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(var(--x, 4px));
  width: var(--width, 0);
  transition:
    transform 0.5s var(--ease-out),
    width 0.5s var(--ease-out),
    background-color 0.4s ease;
}

.only-new {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.only-new input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--rule);
  transition: background-color 0.3s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-elev);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition: transform 0.4s var(--ease-out);
}

.only-new input:checked + .switch {
  background: var(--accent);
}

.only-new input:checked + .switch::after {
  transform: translateX(14px);
}

.only-new input:focus-visible + .switch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Story grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 44px;
  margin-top: 12px;
}

.story {
  display: flex;
  flex-direction: column;
  padding: 22px 0 44px;
  border-top: 1px solid var(--rule);
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

.story__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.story__index {
  color: var(--ink);
}

.cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cat-color, var(--muted));
}

.cat::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cat--novidades {
  --cat-color: var(--cat-novidades);
}

.cat--mercado {
  --cat-color: var(--cat-mercado);
}

.cat--achados {
  --cat-color: var(--cat-achados);
}

.badge-new {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.story__time {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0.02em;
}

.story__title {
  margin: 14px 0 0;
  font: 400 clamp(1.5rem, 2.1vw, 1.75rem) / 1.15 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.story__summary {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

.story__summary:empty {
  display: none;
}

.story__why {
  margin: 14px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.story__why > span:first-child {
  display: block;
  margin-bottom: 2px;
  font: 500 10.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.sources {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 18px 0 0;
}

.sources a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

.sources a:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--bg-elev);
}

.sources svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform 0.35s var(--ease-out);
}

.sources a:hover svg {
  transform: translate(2px, -2px);
}

.empty {
  padding: 60px 0;
  text-align: center;
  font: italic 400 1.4rem/1.4 var(--serif);
  color: var(--muted);
}

.notice {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
}

.notice h2 {
  margin: 0;
  font: 400 2.2rem/1.1 var(--serif);
}

.notice p {
  margin: 12px auto 0;
  max-width: 48ch;
  color: var(--muted);
}

/* ---------- Model launches ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.launch-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand, var(--accent)) 16%, transparent);
  color: color-mix(in oklab, var(--brand, var(--accent)) 72%, var(--ink));
}

.launch__model {
  display: flex;
  align-items: center;
  gap: 0.3em;
  margin: 18px 0 0;
  font: 400 clamp(2.2rem, 3.8vw, 3.1rem) / 1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.launch__logo {
  width: 0.7em;
  height: 0.7em;
  color: var(--brand, var(--accent));
}

.launch__logo:not(.logo-mask) {
  flex: none;
  width: 0.3em;
  height: 0.3em;
  border-radius: 50%;
  background: var(--brand, var(--accent));
}

.lead--launch {
  padding-top: 20px;
  border-top: 3px solid var(--brand, var(--accent));
}

.lead .launch__model {
  font-size: clamp(1.7rem, 2.8vw, 2.4rem);
}

.story--launch {
  --card-bg: color-mix(in srgb, var(--brand, var(--accent)) 5%, var(--bg-elev));
  grid-column: 1 / -1;
  margin: 12px 0 32px;
  padding: 24px 28px 30px;
  border-top: 3px solid var(--brand, var(--accent));
  background: var(--card-bg);
}

.story--launch.has-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px 56px;
  align-items: start;
}

.launch__body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.story--launch .story__title {
  font-size: clamp(1.6rem, 2.4vw, 2.05rem);
}

.story--launch .story__summary,
.story--launch .story__why {
  max-width: 62ch;
}

.compare {
  min-width: 0;
  margin: 0;
}

.lead .compare {
  margin-top: 28px;
}

.compare__scroll {
  overflow-x: auto;
}

.compare table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.compare__title {
  margin: 0 0 10px;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.compare th,
.compare td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--rule);
}

.compare thead th {
  padding-top: 4px;
  border-top: 0;
  vertical-align: bottom;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-2);
}

/* The metric names stay put while a narrow table scrolls sideways. */
.compare tbody th,
.compare thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card-bg, var(--bg));
}

.compare tbody th {
  min-width: 8.5rem;
  padding-left: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}

.compare td {
  min-width: 5.5rem;
  white-space: nowrap;
  color: var(--ink-2);
}

.compare .is-new {
  background: color-mix(in srgb, var(--brand, var(--accent)) 10%, transparent);
  color: var(--ink);
}

.compare .is-best .compare__value {
  font-weight: 600;
  color: var(--ink);
}

.compare .is-best .compare__value::after {
  content: ' ★';
  font-size: 0.7em;
  vertical-align: 0.15em;
  color: var(--muted);
}

.compare__bar {
  display: block;
  height: 5px;
  margin-top: 7px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}

.compare__bar::after {
  content: '';
  display: block;
  width: calc(var(--value, 0) * 100%);
  height: 100%;
  border-radius: 0 3px 3px 0;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
}

.compare .is-new .compare__bar::after {
  background: var(--brand, var(--accent));
}

.compare__note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

.compare__note a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: var(--ink-2);
  text-underline-offset: 2px;
}

.compare__note svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

@media (max-width: 1024px) {
  .story--launch.has-compare {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .story--launch {
    margin-inline: calc(-1 * var(--gutter));
    padding: 22px var(--gutter) 28px;
  }
  .compare th,
  .compare td {
    padding: 9px 8px;
  }
  .compare tbody th {
    min-width: 7.5rem;
  }
  .compare td {
    min-width: 4.5rem;
  }
}

/* ---------- Skeletons ---------- */

.skeleton {
  height: 14px;
  margin-top: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.skeleton--label {
  width: 120px;
  height: 10px;
}

.skeleton--headline {
  height: 52px;
  margin-top: 18px;
}

.skeleton--title {
  height: 28px;
  margin-top: 16px;
}

.skeleton.short {
  width: 60%;
}

.skeleton-card {
  padding: 22px 0 44px;
  border-top: 1px solid var(--rule);
}

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

/* ---------- Rápidas ---------- */

.quick {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 2px solid var(--rule-strong);
}

.quick__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin-bottom: 18px;
}

.quick__head .section-label {
  margin: 0;
}

.quick__hint {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.quick__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 44px;
}

.quick__item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-content: start;
  gap: 4px 16px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--rule);
}

.quick__item .cat {
  grid-row: span 2;
  align-self: start;
  padding-top: 6px;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quick__title {
  margin: 0;
  font: 400 1.2rem/1.3 var(--serif);
  text-wrap: pretty;
}

.quick__title a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size 0.5s var(--ease-out);
}

.quick__title a:hover,
.quick__title a:focus-visible {
  background-size: 100% 1px;
}

.quick__title svg {
  width: 9px;
  height: 9px;
  margin-left: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  opacity: 0.45;
}

.quick__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.quick__meta time::before {
  content: '·';
  margin-right: 10px;
}

/* ---------- Em alta: trending repos, models and posts ---------- */

.hot {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 2px solid var(--rule-strong);
}

.hot__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
}

.hot__head .section-label {
  margin: 0;
}

.hot__hint {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.hot__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 44px;
  margin-top: 24px;
}

.hot__col {
  position: relative;
}

/* Column rule centered in the gap; skips hidden (empty) columns. */
.hot__col:not([hidden]) ~ .hot__col::before {
  content: '';
  position: absolute;
  inset-block: 0;
  left: -22px;
  border-left: 1px solid var(--rule);
}

.hot__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
  font: 400 1.75rem/1.1 var(--serif);
  letter-spacing: -0.01em;
}

.hot__title span {
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hot__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: hot;
}

.hot__item {
  counter-increment: hot;
  position: relative;
  padding: 16px 0 16px 40px;
  border-top: 1px solid var(--rule);
}

.hot__item:first-child {
  border-top: 0;
}

.hot__item::before {
  content: counter(hot, decimal-leading-zero);
  position: absolute;
  top: 16px;
  left: 0;
  font: 400 22px/1 var(--serif);
  color: var(--accent);
}

.hot__link {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.hot__link svg {
  flex: none;
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  opacity: 0.45;
  transition:
    transform 0.35s var(--ease-out),
    opacity 0.2s ease;
}

.hot__link:hover svg,
.hot__link:focus-visible svg {
  opacity: 1;
  transform: translate(2px, -2px);
}

.hot__link:hover .hot__name,
.hot__link:focus-visible .hot__name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hot__owner {
  font-weight: 400;
  color: var(--muted);
}

.hot__handle {
  font: 400 12px/1.4 var(--mono);
  color: var(--muted);
}

.hot__quote {
  display: -webkit-box;
  margin: 8px 0 0;
  font: italic 400 1.1rem/1.35 var(--serif);
  overflow-wrap: anywhere;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot__note {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}

.hot__quote + .hot__note {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--accent);
}

.hot__note--raw {
  display: -webkit-box;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot__meta {
  margin: 8px 0 0;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Archive ---------- */

.archive {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 2px solid var(--rule-strong);
}

.archive__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 32px;
}

.archive__list a {
  display: block;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  transition: transform 0.4s var(--ease-out);
}

.archive__list a:hover {
  transform: translateX(4px);
}

.archive__list a[aria-current='page'] .archive__when {
  color: var(--accent);
}

.archive__when {
  display: block;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.archive__headline {
  display: -webkit-box;
  margin-top: 6px;
  font: 400 1.15rem/1.25 var(--serif);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 80px;
  padding: 40px 0 56px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}

.footer__inner {
  display: grid;
  gap: 12px;
  max-width: 820px;
}

.footer p {
  margin: 0;
}

.footer__about {
  font: italic 400 1.25rem/1.4 var(--serif);
  color: var(--ink-2);
}

.footer__fine a {
  margin-left: 8px;
  color: var(--ink);
}

/* ---------- View transitions (filtering) ---------- */

::view-transition-group(*) {
  animation-duration: 0.5s;
  animation-timing-function: var(--ease-out);
}

::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 0.3s;
}

/* ---------- Effects (see site/fx) ---------- */

html {
  overflow-x: clip;
}

.masthead {
  position: relative;
  isolation: isolate;
}

.fx-neural {
  position: absolute;
  z-index: -1;
  top: calc(-1 * var(--topbar) - 28px);
  left: calc(50% - 50vw);
  width: 100vw;
  height: calc(100% + var(--topbar) + 120px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.fx-neural.is-ready {
  opacity: 1;
}

/* Depth: cards tilt and lift. */
.with-depth .grid {
  perspective: 1400px;
}

html.with-depth .grid > .story,
html.with-depth .grid > .story.reveal.is-in {
  position: relative;
  isolation: isolate;
  rotate: var(--tilt, 0 1 0 0deg);
  transition:
    opacity 0.8s var(--ease-out),
    transform 0.8s var(--ease-out),
    rotate 0.6s var(--ease-out),
    translate 0.5s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms), calc(var(--i, 0) * 70ms), 0s, 0s;
}

html.with-depth .grid > .story::before {
  content: '';
  position: absolute;
  inset: 8px -18px -8px;
  z-index: -1;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background:
    radial-gradient(420px circle at var(--glare-x, 50%) var(--glare-y, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%),
    var(--bg-elev);
  box-shadow: 0 30px 60px -34px rgb(0 0 0 / 0.35);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

html.with-depth .grid > .story:hover {
  translate: 0 -6px;
}

html.with-depth .grid > .story:hover::before {
  opacity: 1;
}

/* Mapa do dia: the edition as a glowing neural network, in its own card. The --nm-* tokens feed
   both the CSS and the WebGL scene (site/fx/map3d.js), so the map follows the theme. */
.fx-map {
  /* Light: the site's own paper, no tinted glow; the brain is drawn like ink. */
  --nm-card: #fbfaf7;
  --nm-ink: #121210;
  --nm-muted: #5c5a53;
  --nm-edge: rgb(18 18 16 / 0.1);
  --nm-glass: rgb(255 255 255 / 0.88);
  --nm-wash-a: transparent;
  --nm-wash-b: transparent;
  --nm-novidades: #3558f0;
  --nm-mercado: #087a59;
  --nm-achados: #8b3cf6;
  --nm-link: #b8175c;
  --nm-pulse: #a8104f;
  --nm-synapse: #5f48b8;
  --nm-star: #9c98a8;
  --nm-glow-a: #fbfaf7;
  --nm-glow-b: #fbfaf7;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: 48px;
  padding: 30px 32px 24px;
  border: 1px solid var(--nm-edge);
  border-radius: 24px;
  background:
    radial-gradient(55% 60% at 100% 0%, var(--nm-wash-a), transparent 70%),
    radial-gradient(45% 55% at 0% 100%, var(--nm-wash-b), transparent 70%),
    var(--nm-card);
  color: var(--nm-ink);
  animation: fade 0.9s var(--ease-out) both;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .fx-map {
    --nm-card: #0b0912;
    --nm-ink: #f4f1ff;
    --nm-muted: #aaa3c0;
    --nm-edge: rgb(255 255 255 / 0.09);
    --nm-glass: rgb(16 12 26 / 0.8);
    --nm-wash-a: rgb(255 63 164 / 0.16);
    --nm-wash-b: rgb(111 149 255 / 0.12);
    --nm-novidades: #6f95ff;
    --nm-mercado: #3ee8b5;
    --nm-achados: #b77bff;
    --nm-link: #ff3fa4;
    --nm-pulse: #ff8ccb;
    --nm-synapse: #7d5cff;
    --nm-star: #cbbcff;
    --nm-glow-a: #ff2d95;
    --nm-glow-b: #3d5bff;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] .fx-map {
  --nm-card: #0b0912;
  --nm-ink: #f4f1ff;
  --nm-muted: #aaa3c0;
  --nm-edge: rgb(255 255 255 / 0.09);
  --nm-glass: rgb(16 12 26 / 0.8);
  --nm-wash-a: rgb(255 63 164 / 0.16);
  --nm-wash-b: rgb(111 149 255 / 0.12);
  --nm-novidades: #6f95ff;
  --nm-mercado: #3ee8b5;
  --nm-achados: #b77bff;
  --nm-link: #ff3fa4;
  --nm-pulse: #ff8ccb;
  --nm-synapse: #7d5cff;
  --nm-star: #cbbcff;
  --nm-glow-a: #ff2d95;
  --nm-glow-b: #3d5bff;
  color-scheme: dark;
}

.fx-map__head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 680px;
}

.fx-map__pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d6287f, #a8105f);
  color: #fff;
  font: 600 11.5px/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow:
    0 0 24px color-mix(in srgb, var(--nm-link) 45%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.25);
}

.fx-map__title {
  margin: 0;
  font: 500 clamp(1.35rem, 2.3vw, 1.9rem) / 1.15 var(--sans);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-wrap: balance;
}

.fx-map__hint {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--nm-muted);
}

.fx-map__stage {
  position: relative;
  height: clamp(380px, 50vw, 600px);
  margin: 8px -32px 0;
}

.fx-map__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  /* Fades into the card at the top and bottom, where the card's own glow shows. */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 88%, transparent);
}

.fx-map__stage canvas:active {
  cursor: grabbing;
}

.fx-map__labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fx-map__label {
  --ai: var(--muted);
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid color-mix(in srgb, var(--ai) 55%, transparent);
  border-radius: 999px;
  background: var(--nm-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 18px color-mix(in srgb, var(--ai) 30%, transparent);
  color: var(--nm-ink);
  font: 500 11.5px/1.2 var(--mono);
  white-space: nowrap;
  translate: -50% calc(-100% - 16px);
  transition: opacity 0.3s ease;
}

.fx-map__label .logo-mask {
  width: 14px;
  height: 14px;
  /* Lifted toward the text color so dark logos stay visible on the dark card. */
  color: color-mix(in oklab, var(--ai) 70%, var(--nm-ink));
}

.fx-map__dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--ai);
}

.fx-map__tip {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid var(--nm-edge);
  border-radius: 12px;
  background: var(--nm-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--nm-ink);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  translate: 14px 14px;
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.45);
}

.fx-map__tip b {
  display: block;
  margin-bottom: 4px;
  font: 500 10.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nm-link);
}

.fx-map__legend {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 6px;
  font: 500 11px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.fx-map .cat--novidades {
  --cat-color: var(--nm-novidades);
}

.fx-map .cat--mercado {
  --cat-color: var(--nm-mercado);
}

.fx-map .cat--achados {
  --cat-color: var(--nm-achados);
}

.fx-map__legend-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nm-muted);
}

.fx-map__legend-hub::before {
  content: '';
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 2px solid var(--nm-link);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--nm-link);
}

@media (max-width: 760px) {
  .fx-map {
    padding: 22px 18px 18px;
    border-radius: 20px;
  }
  .fx-map__stage {
    margin-inline: -18px;
  }
  /* Hubs sit close together on a phone: logos only, the tooltip has the name and count. */
  .fx-map__label {
    gap: 0;
    padding: 5px;
    font-size: 0;
  }
  .fx-map__label .logo-mask,
  .fx-map__label .fx-map__dot {
    width: 16px;
    height: 16px;
  }
}

.fx-flash {
  border-radius: 14px;
  animation: flash 1.6s var(--ease-out);
}

@keyframes flash {
  0%,
  35% {
    background: color-mix(in srgb, var(--accent) 14%, transparent);
  }
  100% {
    background: transparent;
  }
}

/* 3D logo of the selected AI. */
.fx-logo {
  position: fixed;
  z-index: 0;
  top: var(--topbar);
  right: -10vw;
  width: min(58vw, 860px);
  height: calc(100vh - var(--topbar));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  -webkit-mask-image: linear-gradient(to left, #000 45%, transparent 95%);
  mask-image: linear-gradient(to left, #000 45%, transparent 95%);
}

.fx-logo.is-active {
  opacity: 0.28;
}

:root[data-theme='dark'] .fx-logo.is-active {
  opacity: 0.38;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .fx-logo.is-active {
    opacity: 0.38;
  }
}

.fx-logo ~ main,
.fx-logo ~ .footer {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .fx-logo {
    top: auto;
    bottom: 0;
    right: -10vw;
    width: 90vw;
    height: 50vh;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archive__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hot__cols {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hot__col:not([hidden]) ~ .hot__col::before {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --gutter: 16px;
  }
  .front {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .trends {
    padding-left: 0;
    padding-top: 32px;
    border-left: 0;
    border-top: 1px solid var(--rule);
  }
  .grid,
  .quick__list,
  .archive__list {
    grid-template-columns: 1fr;
  }
  .overview__item {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
  }
  .quick__item {
    grid-template-columns: 1fr;
  }
  .quick__item .cat {
    grid-row: auto;
    padding-top: 0;
  }
  .masthead__meta {
    justify-content: center;
    text-align: center;
  }
  #edition-number {
    display: none;
  }
  .controls {
    gap: 10px;
    padding: 10px 0;
  }
  .filters {
    display: flex;
    flex: 1 1 100%;
  }
  .filter {
    flex: 1 1 auto;
    padding: 7px 8px;
    font-size: 13.5px;
  }
  .active-ai {
    padding: 5px 10px;
    font-size: 13px;
  }
  .ai-cards {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--gutter));
    padding: 2px var(--gutter) 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .ai-cards::-webkit-scrollbar {
    display: none;
  }
  .ai-card {
    flex: none;
    scroll-snap-align: start;
  }
  .story__time {
    margin-left: 0;
  }
  .status {
    font-size: 11px;
  }
}

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .ticker__track {
    animation: none !important;
  }
  .ticker {
    overflow-x: auto;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
