@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --paper: #f5efe7;
  --paper-2: #fbf8f3;
  --line: rgba(18, 16, 14, 0.12);
  --line-strong: rgba(18, 16, 14, 0.22);
  --ink: #12100e;
  --muted: #69625b;
  --soft: #8d857e;
  --accent: #b84e3a;
  --midnight: #0f1620;
  --olive: #223228;
  --sand: #e8dccd;
  --shadow: 0 18px 40px rgba(18, 16, 14, 0.06);
}

html[data-theme="dark"] {
  --paper: #161515;
  --paper-2: #1d1b1b;
  --line: rgba(245, 239, 231, 0.12);
  --line-strong: rgba(245, 239, 231, 0.24);
  --ink: #f5efe7;
  --muted: #cbc2b8;
  --soft: #9c938a;
  --accent: #d26a53;
  --midnight: #0b1017;
  --olive: #1d2a21;
  --sand: #302922;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", "Inter", sans-serif;
  background: linear-gradient(180deg, #f8f4ee 0%, #efe7dc 100%);
}

a {
  color: inherit;
  text-decoration-color: rgba(18, 16, 14, 0.25);
  text-underline-offset: 0.14em;
}

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

.page {
  width: min(1540px, calc(100% - 28px));
  margin: 14px auto 24px;
  background: rgba(251, 248, 243, 0.96);
  border: 1px solid rgba(18, 16, 14, 0.08);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .page,
html[data-theme="dark"] .article-page {
  background: rgba(24, 22, 22, 0.96);
}

.header {
  display: grid;
  grid-template-columns: 1.4fr 0.85fr 1.6fr 1.15fr;
  gap: 22px;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: grid;
  gap: 6px;
}

.brand h1,
.card-title,
.rail-card h2,
.story-title,
.section-title,
.quote-card blockquote,
.article-standfirst,
.article-pull {
  margin: 0;
  font-family: "Manrope", "Inter", sans-serif;
}

.brand h1 {
  font-size: clamp(2.15rem, 3vw, 3.55rem);
  line-height: 0.9;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.brand p,
.card-kicker,
.card-summary,
.meta-line,
.header-note,
.footer,
.article-meta,
.article-copy p,
.article-angle,
.caption {
  margin: 0;
  color: var(--muted);
}

.brand p,
.date-block span,
.nav a,
.rail-eyebrow,
.card-tag,
.footer,
.article-back,
.caption,
.source-list strong {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.date-block {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.date-block strong {
  font-size: 1.28rem;
  line-height: 1.1;
}

.header-tools {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.theme-toggle,
.archive-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  padding: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  width: fit-content;
}

.theme-button,
.archive-menu summary {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font: inherit;
}

.theme-button {
  min-width: 74px;
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.theme-button[data-active="true"] {
  background: var(--ink);
  color: var(--paper-2);
  border-color: var(--ink);
}

.archive-menu {
  position: relative;
}

.archive-menu summary {
  list-style: none;
  min-width: 148px;
  padding: 10px 36px 10px 14px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.archive-menu summary::-webkit-details-marker {
  display: none;
}

.archive-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  width: min(420px, calc(100vw - 48px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  background: #fbf8f3;
  box-shadow: var(--shadow);
}

.archive-kicker,
.archive-month {
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 700;
}

.archive-group {
  display: grid;
  gap: 8px;
}

.archive-link {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.archive-date {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--soft);
}

.archive-title {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 1.02rem;
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink);
}

.archive-link:hover .archive-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.header-note {
  text-align: right;
  font-size: 0.95rem;
  line-height: 1.5;
  font-style: italic;
}

.edition {
  display: grid;
  grid-template-columns: minmax(0, 4.45fr) minmax(290px, 1.1fr);
  gap: 14px;
  padding: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.story-card {
  display: grid;
  gap: 14px;
  min-height: 268px;
  padding: 16px;
  border: 1px solid rgba(18, 16, 14, 0.09);
  background: var(--paper-2);
  text-decoration: none;
  overflow: hidden;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.span-6 {
  grid-column: span 6;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-number {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(3.1rem, 4.7vw, 5rem);
  line-height: 0.86;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.card-tag {
  color: var(--soft);
}

.card-title {
  font-size: clamp(1.65rem, 2.5vw, 2.75rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 800;
  max-width: 11ch;
}

.span-6 .card-title {
  max-width: 14ch;
}

.card-summary {
  font-size: 0.98rem;
  line-height: 1.45;
  max-width: 34ch;
}

.card-chip {
  display: inline-flex;
  width: fit-content;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
}

.card-media {
  position: relative;
  min-height: 170px;
  border: 1px solid rgba(18, 16, 14, 0.12);
  background: #f0ebe4;
  overflow: hidden;
}

.card-media img,
.article-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 44%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.22));
  pointer-events: none;
}

.card-body {
  display: grid;
  gap: 10px;
}

.card-dark {
  color: #f5efe7;
  background: var(--midnight);
}

.card-dark .card-summary,
.card-dark .card-tag,
.card-dark .meta-line {
  color: rgba(245, 239, 231, 0.78);
}

.card-dark .card-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe7;
  border-color: rgba(255, 255, 255, 0.16);
}

.card-rose {
  background: #fff2ee;
}

.card-terminal {
  background: #07110d;
  color: #d2ffbf;
}

.card-terminal .card-summary,
.card-terminal .card-tag,
.card-terminal .meta-line {
  color: rgba(210, 255, 191, 0.82);
}

.card-terminal .card-chip {
  background: rgba(0, 0, 0, 0.28);
  color: #d2ffbf;
  border-color: rgba(210, 255, 191, 0.16);
}

.card-terminal .workflow-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(210, 255, 191, 0.14);
}

.card-terminal .workflow-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #d2ffbf;
}

.card-navy {
  background: #111d31;
  color: #f5efe7;
}

.card-navy .card-summary,
.card-navy .card-tag,
.card-navy .meta-line {
  color: rgba(245, 239, 231, 0.8);
}

.card-navy .card-chip {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe7;
  border-color: rgba(255, 255, 255, 0.18);
}

.card-navy .quote-card,
.card-navy .stat-card,
.card-navy .workflow-card,
.card-navy .chart-card {
  background: rgba(255, 250, 244, 0.96);
  border-color: rgba(18, 16, 14, 0.12);
  color: var(--ink);
}

.card-navy .quote-card blockquote,
.card-navy .workflow-pill,
.card-navy .stat-value,
.card-navy .chart-label,
.card-navy .card-summary {
  color: var(--ink);
}

.card-mono .card-media img {
  filter: grayscale(1);
}

.card-stat .card-title {
  max-width: none;
}

.quote-card,
.stat-card,
.chart-card,
.workflow-card {
  display: grid;
  gap: 12px;
  min-height: 170px;
  padding: 16px;
  border: 1px solid rgba(18, 16, 14, 0.12);
  background: #f8f4ee;
}

.quote-card blockquote {
  font-size: clamp(1.6rem, 2.2vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.stat-value {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(3.6rem, 4.6vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.workflow-steps,
.chart-rows {
  display: grid;
  gap: 10px;
}

.workflow-step,
.chart-row {
  display: grid;
  gap: 6px;
}

.workflow-pill {
  display: inline-flex;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(18, 16, 14, 0.06);
  font-size: 0.88rem;
  font-weight: 700;
}

.chart-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.chart-bar {
  height: 10px;
  background: rgba(18, 16, 14, 0.08);
  overflow: hidden;
}

.chart-fill {
  height: 100%;
  background: var(--ink);
}

.chart-fill.soft {
  background: var(--soft);
}

.rail {
  display: grid;
  gap: 14px;
  align-content: start;
}

.rail-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(18, 16, 14, 0.09);
  background: var(--paper-2);
}

.rail-card h2,
.section-title {
  font-size: clamp(1.25rem, 1.8vw, 1.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.opportunity-list,
.inspo-list {
  display: grid;
  gap: 15px;
}

.opportunity {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: start;
}

.opportunity-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 1rem;
}

.opportunity h3,
.inspo-list h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.35;
}

.rail-image {
  border: 1px solid rgba(18, 16, 14, 0.1);
  overflow: hidden;
  min-height: 148px;
}

.rail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 20px 18px;
}

.footer::before,
.footer::after {
  content: "";
  width: 56px;
  height: 1px;
  align-self: center;
  background: var(--line-strong);
}

.article-page {
  width: min(1080px, calc(100% - 24px));
  margin: 18px auto 28px;
  background: rgba(251, 248, 243, 0.98);
  border: 1px solid rgba(18, 16, 14, 0.08);
  box-shadow: var(--shadow);
}

.article-shell {
  display: grid;
  gap: 24px;
  padding: 22px;
}

.article-back {
  text-decoration: none;
  color: var(--ink);
}

.article-header {
  display: grid;
  gap: 12px;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(250px, 0.72fr);
  gap: 24px;
  align-items: start;
}

.article-kicker {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.article-number {
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(3.1rem, 4.7vw, 5rem);
  line-height: 0.86;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.story-title {
  font-size: clamp(2.25rem, 4.6vw, 4.35rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 800;
  max-width: 12ch;
}

.article-standfirst {
  font-size: clamp(1.12rem, 1.8vw, 1.48rem);
  line-height: 1.38;
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 32ch;
}

.article-meta {
  font-size: 0.94rem;
  line-height: 1.6;
}

.article-copy {
  display: grid;
  gap: 18px;
}

.article-copy h2,
.article-side h2 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.article-copy p {
  font-size: 1rem;
  line-height: 1.72;
}

.article-angle,
.article-side-card,
.source-list {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fffdfa;
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .theme-button,
html[data-theme="dark"] .archive-menu summary,
html[data-theme="dark"] .archive-panel,
html[data-theme="dark"] .card-chip,
html[data-theme="dark"] .quote-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .workflow-card,
html[data-theme="dark"] .rail-card,
html[data-theme="dark"] .article-angle,
html[data-theme="dark"] .article-side-card,
html[data-theme="dark"] .source-list {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .card-media,
html[data-theme="dark"] .article-hero {
  background: #262222;
}

html[data-theme="dark"] .theme-button[data-active="true"] {
  background: #f5efe7;
  color: #161515;
  border-color: #f5efe7;
}

html[data-theme="dark"] .archive-panel {
  background: #211f1f;
}

html[data-theme="dark"] .archive-kicker,
html[data-theme="dark"] .archive-month,
html[data-theme="dark"] .archive-date {
  color: var(--muted);
}

html[data-theme="dark"] .archive-link {
  border-top-color: var(--line);
}

html[data-theme="dark"] .archive-title {
  color: var(--ink);
}

.article-side {
  display: grid;
  gap: 16px;
}

.article-hero {
  border: 1px solid rgba(18, 16, 14, 0.12);
  min-height: 240px;
  overflow: hidden;
  background: #f0ebe4;
}

.article-pull {
  font-size: clamp(1.45rem, 2.1vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.source-list ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.source-list li + li {
  margin-top: 8px;
}

@media (max-width: 1260px) {
  .header {
    grid-template-columns: 1fr 1fr;
  }

  .header-note {
    text-align: left;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .edition {
    grid-template-columns: 1fr;
  }

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

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

  .span-4 {
    grid-column: span 6;
  }

  .span-3 {
    grid-column: span 3;
  }

  .span-6 {
    grid-column: span 6;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .rail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page,
  .article-page {
    width: min(100% - 12px, 1540px);
  }

  .header {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .date-block {
    padding-left: 0;
    border-left: 0;
  }

  .theme-toggle {
    width: auto;
  }

  .theme-button,
  .archive-menu,
  .archive-menu summary {
    width: auto;
  }

  .archive-panel {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 36px));
  }

  .edition,
  .card-grid,
  .article-shell {
    padding: 12px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-3,
  .span-6 {
    grid-column: span 1;
  }

  .story-card {
    min-height: auto;
  }

  .story-title,
  .card-title {
    max-width: none;
  }
}
