:root {
  color-scheme: light;
  --bg: #f5f2eb;
  --paper: #fffefa;
  --ink: #20231f;
  --muted: #696f68;
  --line: #dddcd3;
  --accent: #d94e32;
  --accent-dark: #a93623;
  --null: #d8d9d2;
  --map-border: #fffefa;
  --seq-0: #f6dcb8;
  --seq-1: #e99652;
  --seq-2: #b73d2a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; line-height: 1.5; }
button { font: inherit; }
.page { max-width: 1480px; margin: auto; padding: 0 clamp(18px, 4vw, 64px); }

.masthead { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font: 800 14px/1 "Manrope", sans-serif; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white; font-size: 18px; }
.masthead-date { color: var(--muted); font-size: 12px; letter-spacing: .02em; }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: clamp(28px, 5vw, 90px); align-items: stretch; padding: clamp(40px, 5.5vw, 88px) 0 clamp(38px, 4vw, 58px); }
.hero-copy { align-self: center; }
.eyebrow, .section-index { margin: 0; font: 800 11px/1.3 "Manrope", sans-serif; text-transform: uppercase; letter-spacing: .16em; color: var(--accent-dark); }
.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow-line { width: 23px; height: 2px; background: var(--accent); }
h1, h2, p { overflow-wrap: break-word; }
h1, h2 { font-family: "Manrope", system-ui, sans-serif; letter-spacing: -.055em; }
h1 { max-width: 780px; margin: 23px 0 22px; font-size: clamp(43px, 5vw, 76px); font-weight: 800; line-height: 1.085; }
h1 em { color: var(--accent); font-style: normal; }
.lede { max-width: 590px; margin: 0; color: #555b54; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.65; }
.controls { display: inline-flex; gap: 4px; padding: 4px; margin-top: 32px; border: 1px solid var(--line); border-radius: 100px; background: #eae7de; }
.toggle { min-width: 112px; min-height: 44px; padding: 9px 20px; border: 0; border-radius: 100px; background: transparent; color: #5f645d; cursor: pointer; font-weight: 700; font-size: 14px; transition: background .2s, color .2s, box-shadow .2s; }
.toggle:hover { color: var(--ink); }
.toggle.is-active { background: var(--ink); color: white; box-shadow: 0 2px 7px #1b21172b; }
.toggle:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.hero-feature { position: relative; min-height: 340px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(25px, 3vw, 42px); border-radius: 5px; background: #20342e; color: #f8f6ec; isolation: isolate; }
.hero-feature::before, .hero-feature::after { content: ""; position: absolute; border: 1px solid #ffffff24; border-radius: 50%; z-index: -1; }
.hero-feature::before { width: 400px; height: 400px; right: -135px; top: 22px; }
.hero-feature::after { width: 270px; height: 270px; right: -70px; top: 87px; }
.feature-top, .feature-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feature-top { font: 700 16px "Manrope", sans-serif; }
.feature-symbol { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #ffffff55; border-radius: 50%; font-size: 11px; letter-spacing: .04em; }
.feature-number { display: flex; align-items: baseline; gap: 15px; }
.feature-number strong { font: 800 clamp(70px, 8.5vw, 130px)/1 "Manrope", sans-serif; letter-spacing: -.09em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feature-number span { color: #c6d2ca; font-size: 13px; line-height: 1.4; }
.feature-bottom { padding-top: 20px; border-top: 1px solid #ffffff43; color: #d4dfd5; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

.extremes { display: grid; grid-template-columns: 1fr 1fr minmax(160px, .9fr); gap: 14px; padding-bottom: clamp(42px, 5vw, 76px); }
.extreme { display: flex; align-items: flex-start; gap: 18px; min-height: 130px; padding: 22px 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.extreme-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: #f9e5d7; color: var(--accent-dark); font-size: 21px; line-height: 1; }
.extreme:nth-child(2) .extreme-icon { background: #e2e9e0; color: #315549; }
.extreme > div { display: flex; flex-direction: column; align-items: flex-start; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.extreme strong { margin-top: 5px; font: 800 30px/1.15 "Manrope", sans-serif; letter-spacing: -.065em; font-variant-numeric: tabular-nums; }
.stat-country { margin-top: 3px; font-size: 13px; font-weight: 700; }
.extremes-note { align-self: center; margin: 0; padding: 12px 0 12px clamp(14px, 2vw, 34px); border-left: 2px solid var(--accent); font: 700 14px/1.5 "Manrope", sans-serif; }
.extremes-note span { color: var(--muted); font: 400 12px/1.5 "DM Sans", sans-serif; }

.visuals { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.panel { min-width: 0; padding: clamp(20px, 2.5vw, 34px); border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.panel-head { display: flex; justify-content: space-between; gap: 20px; }
.panel-head h2, .notes h2 { margin: 12px 0 5px; font-size: clamp(25px, 2.4vw, 34px); font-weight: 800; line-height: 1.15; }
.panel-head p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.panel-mark { display: grid; place-items: center; align-self: flex-start; width: 37px; height: 37px; border: 1px solid var(--line); border-radius: 50%; color: var(--accent-dark); font-size: 22px; }
#map { width: 100%; height: 570px; margin-top: 10px; }
.map-error { display: grid; place-items: center; height: 100%; margin: 0; padding: 24px; color: var(--muted); text-align: center; font-size: 14px; }
.map-footnote { margin: 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.ranking-guide { display: flex; justify-content: space-between; margin: 22px 0 7px; color: var(--muted); font-size: 11px; }
.ranking { height: 565px; overflow-y: auto; overscroll-behavior: contain; list-style: none; margin: 0; padding: 0 6px 0 0; scrollbar-color: #bbbeb4 transparent; scrollbar-width: thin; }
.rank-item { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 45px; border-top: 1px solid #e9e8e2; font-size: 13px; }
.rank-item.is-norway { color: var(--accent-dark); font-weight: 800; }
.rank-number { color: #93978e; font-size: 11px; font-variant-numeric: tabular-nums; }
.rank-main { min-width: 0; }
.rank-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rank-track { display: block; width: 100%; height: 4px; margin-top: 4px; border-radius: 5px; background: #eeeae1; }
.rank-fill { display: block; height: 100%; border-radius: inherit; background: #db8b5c; }
.is-norway .rank-fill { background: var(--accent); }
.rank-value { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.notes { display: grid; grid-template-columns: minmax(210px, .75fr) minmax(0, 1.25fr); gap: clamp(30px, 8vw, 120px); margin-top: clamp(56px, 7vw, 106px); padding: 44px 0 70px; border-top: 1px solid var(--ink); }
.notes-heading > p:last-child { max-width: 300px; color: var(--muted); font-size: 14px; }
.notes-body { color: #4e554e; font-size: 14px; line-height: 1.7; }
.formula { margin: 0 0 18px; padding: 17px 20px; border-left: 3px solid var(--accent); background: #eae8df; color: var(--ink); font-weight: 700; }
.notes ul { margin: 0; padding-left: 19px; }
.notes li { margin-bottom: 10px; padding-left: 4px; }
.notes li::marker { color: var(--accent); }
.sources { margin: 24px 0 0; font-size: 13px; }
a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 21px 0 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer span:first-child { color: var(--ink); font-weight: 800; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr); gap: 25px; }
  h1 { font-size: clamp(42px, 5.6vw, 62px); }
  .feature-number { display: block; }
  .feature-number span { display: block; margin-top: 4px; }
  .visuals { grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); }
  .extremes { grid-template-columns: 1fr 1fr; }
  .extremes-note { grid-column: 1 / -1; padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 760px) {
  .page { padding: 0 20px; }
  .masthead { min-height: 65px; }
  .hero { grid-template-columns: 1fr; padding: 42px 0 24px; gap: 30px; }
  h1 { margin: 18px 0; font-size: clamp(40px, 9vw, 65px); }
  .lede { font-size: 16px; line-height: 1.55; }
  .controls { margin-top: 24px; }
  .hero-feature { min-height: 240px; padding: 23px 26px; }
  .feature-number { display: flex; }
  .feature-number strong { font-size: clamp(66px, 17vw, 105px); }
  .feature-number span { margin: 0; }
  .extremes { padding-bottom: 48px; }
  .visuals { grid-template-columns: 1fr; }
  #map { height: 430px; }
  .ranking { height: auto; overflow: visible; }
  .notes { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 480px) {
  .page { padding: 0 16px; }
  .masthead-date { max-width: 120px; text-align: right; line-height: 1.3; }
  h1 { font-size: clamp(39px, 10.5vw, 49px); }
  .hero-feature { min-height: 220px; }
  .feature-number strong { font-size: clamp(60px, 17vw, 78px); }
  .feature-number span { font-size: 11px; }
  .extremes { gap: 9px; }
  .extreme { min-height: 125px; padding: 15px 9px; gap: 6px; }
  .extreme-icon { width: 26px; height: 26px; font-size: 17px; }
  .stat-label { font-size: 10px; line-height: 1.2; }
  .extreme strong { font-size: 21px; white-space: nowrap; }
  .stat-country { font-size: 11px; }
  .extremes-note { font-size: 13px; }
  .panel { padding: 19px 14px; }
  #map { height: 330px; margin: 8px 0; }
  .map-footnote { font-size: 11px; }
  .notes { margin-top: 60px; padding-top: 30px; }
  .footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toggle { transition: none; }
}
