/* Klappkollen — "julkatalogen": catalog paper, one marker red for your own marks. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #F3F4EF;
  --ink: #1B2A24;
  --red: #D62839;
  --pine: #1F5A45;
  --gold: #B8901C;
  --muted: #5E6B64;
  --rule: #D7DCD3;
  --wash: #E7EAE2;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 46ch;
  --pad: clamp(1.1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
body.home { padding-bottom: 5.5rem; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--pine); }
:focus-visible { outline: 3px solid var(--pine); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- masthead & footer ---------- */
.masthead {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem;
  padding: 1.1rem var(--pad);
  max-width: 1360px; margin: 0 auto;
}
.logo { font-weight: 850; font-stretch: 125%; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.01em; }
.masthead nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .95rem; }
.masthead nav a { text-decoration: none; color: var(--muted); }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }

.site-foot {
  max-width: 1360px; margin: 4rem auto 0; padding: 2rem var(--pad) 3rem;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: .9rem;
}
.site-foot p { max-width: 70ch; margin: 0 0 .6rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.9rem; padding: .65rem 1.25rem;
  font: 700 1rem/1 var(--font); font-stretch: 100%;
  color: var(--ink); background: transparent;
  border: 2px solid var(--ink); border-radius: 6px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--wash); color: var(--ink); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: #B81F2F; border-color: #B81F2F; color: #fff; }

/* ---------- hero ---------- */
.hero { max-width: 1360px; margin: 0 auto; padding: clamp(1.5rem, 6vw, 4.5rem) var(--pad) 2rem; }
@media (min-width: 1040px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 4rem; align-items: center; }
  .hero > :not(.hero-grid) { grid-column: 1; }
  .hero-grid { grid-column: 2; grid-row: 1 / span 4; }
}
.hero-grid { display: none; }
@media (min-width: 1040px) {
  .hero-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.1rem .4rem; justify-items: center; padding: 1.5rem; border: 2px solid var(--ink); border-radius: 6px; background: #fff; }
  .hero-grid .mark { width: 3.3rem; height: 2.6rem; }
  .hero-grid .mark .emoji { font-size: 1.85rem; }
  .hero-grid .is-on .ring path { animation: draw .5s cubic-bezier(.45, .05, .3, 1) both; }
  .hero-grid .is-on:nth-of-type(2) .ring path { animation-delay: .5s; }
  .hero-grid .is-on .ring path { animation-delay: var(--delay, .3s); }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.hero h1 {
  margin: 0 0 1.1rem; max-width: 15ch;
  font-weight: 850; font-stretch: 125%;
  font-size: clamp(2.3rem, 7.4vw, 5.4rem); line-height: .96; letter-spacing: -0.025em;
}
.lede { max-width: 52ch; margin: 0 0 .8rem; font-size: clamp(1.08rem, 2.2vw, 1.3rem); }
.countdown { margin: 0 0 1.6rem; color: var(--pine); font-weight: 650; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.section-title {
  margin: 0 0 .6rem;
  font-weight: 850; font-stretch: 125%;
  font-size: clamp(1.7rem, 4.5vw, 2.8rem); line-height: 1; letter-spacing: -0.02em;
}

/* ---------- the marker ring (the one memorable thing) ---------- */
.mark { position: relative; display: grid; place-items: center; width: 4.6rem; height: 3.6rem; flex: none; }
.mark .emoji { font-size: 2.4rem; line-height: 1; }
.ring {
  position: absolute; left: -0.75rem; top: -0.6rem;
  width: calc(100% + 1.5rem); height: calc(100% + 1.2rem);
  transform: rotate(var(--tilt, -2deg)); overflow: visible; pointer-events: none;
}
.ring path {
  fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset .42s cubic-bezier(.45, .05, .3, 1);
}
[aria-pressed="true"] .ring path, .mark.is-on .ring path { stroke-dashoffset: 0; opacity: 1; }

/* ---------- catalog ---------- */
.catalog { max-width: 1360px; margin: 0 auto; padding: 1.5rem var(--pad) 0; }
.howto { margin: 0 0 2rem; color: var(--muted); max-width: 60ch; }
.decade { margin: 0 0 2.5rem; }
.decade-title {
  margin: 0 0 1rem; padding-bottom: .35rem; border-bottom: 3px solid var(--ink);
  font-weight: 800; font-stretch: 62%; font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1; color: var(--pine);
}
.items { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0 2.5rem; }
@media (min-width: 680px) { .items { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .items { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1360px) { .items { grid-template-columns: repeat(4, 1fr); } }

.item { padding: 1.1rem 0 1.25rem; border-bottom: 1px dashed var(--rule); scroll-margin-top: 1rem; }
.pick {
  display: flex; align-items: center; gap: 1.1rem; width: 100%;
  margin: 0; padding: .3rem 0; background: none; border: 0; color: inherit; text-align: left;
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.label { display: flex; flex-direction: column; min-width: 0; }
.year { font-weight: 800; font-stretch: 62%; font-size: 2.1rem; line-height: .95; letter-spacing: .01em; transition: color .2s; }
.name { font-weight: 680; font-size: 1.15rem; line-height: 1.2; }
.pick[aria-pressed="true"] .year { color: var(--red); }
.pick:hover .ring path { stroke-dashoffset: .82; opacity: 1; }
.pick[aria-pressed="true"]:hover .ring path { stroke-dashoffset: 0; }
.why { margin: .55rem 0 0 5.7rem; max-width: var(--measure); color: var(--muted); font-size: .95rem; line-height: 1.45; }
.fact { margin: .45rem 0 0 5.7rem; max-width: var(--measure); color: var(--pine); font-size: .9rem; font-weight: 650; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: .6rem 0 0 5.7rem; font-size: .9rem; }
.more { color: var(--muted); }
.buy { font-weight: 700; }
.buy-wrap { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; }
.ad { font-size: .75rem; color: var(--muted); }

.keep {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 2.2rem; padding: .2rem .65rem .2rem .45rem;
  font: 650 .9rem/1 var(--font); color: var(--ink);
  background: none; border: 1.5px solid var(--rule); border-radius: 4px; cursor: pointer;
}
.keep .star { width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linejoin: round; }
.keep[aria-pressed="true"] { border-color: var(--gold); background: #F7EFD6; }
.keep[aria-pressed="true"] .star { fill: var(--gold); }
.badge-new { display: inline-block; margin-left: .4rem; padding: .1rem .35rem; font-size: .7rem; font-weight: 800; color: #fff; background: var(--pine); border-radius: 3px; vertical-align: middle; }

/* ---------- sticky tally ---------- */
.tally {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--pad) calc(.75rem + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--paper);
}
.tally p { margin: 0; font-weight: 650; }
.tally #tally-count { font-weight: 800; font-stretch: 62%; font-size: 1.6rem; color: #FF6B78; vertical-align: -0.1em; }
.tally .btn-primary { min-height: 2.6rem; }

/* ---------- result ---------- */
.result, .stats, .poll { max-width: 1360px; margin: 0 auto; padding: 3rem var(--pad) 1rem; }
.result { border-top: 3px solid var(--ink); }
.score { margin: .5rem 0 .2rem; font-weight: 800; font-stretch: 62%; font-size: clamp(4.5rem, 20vw, 10rem); line-height: .9; }
.score #score-had { color: var(--red); }
.score-title { margin: 0 0 1rem; font-weight: 850; font-stretch: 125%; font-size: clamp(1.4rem, 4vw, 2.2rem); line-height: 1.05; }
.score-line { margin: 0 0 .4rem; font-size: 1.1rem; max-width: 52ch; }
.share-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.toast { min-height: 1.5em; margin: .8rem 0 0; color: var(--pine); font-weight: 650; }

/* ---------- stats ---------- */
.stats-note { color: var(--muted); margin: 0 0 1.5rem; }
.stat-lists { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .stat-lists { grid-template-columns: repeat(3, 1fr); } }
.stat-lists h3 { margin: 0 0 .6rem; font-size: 1.15rem; font-weight: 800; }
.stat-lists ol { list-style: none; margin: 0; padding: 0; }
.stat-lists li { display: grid; grid-template-columns: 2rem 1fr auto; align-items: baseline; gap: .5rem; padding: .45rem 0; border-bottom: 1px dashed var(--rule); }
.stat-lists .s-emoji { font-size: 1.3rem; }
.stat-lists .s-pct { font-weight: 800; font-stretch: 62%; font-size: 1.35rem; }

/* ---------- poll ---------- */
.poll-intro { max-width: 60ch; margin: 0 0 1.5rem; }
.poll-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .poll-options { grid-template-columns: repeat(2, 1fr); } }
.poll-option {
  position: relative; display: grid; grid-template-columns: 4.6rem 1fr auto; align-items: center; gap: .4rem 1.1rem;
  width: 100%; padding: 1rem 0; margin: 0;
  background: none; border: 0; border-bottom: 1px dashed var(--rule); color: inherit; text-align: left; font: inherit; cursor: pointer;
}
.poll-option .mark { --tilt: 2deg; grid-row: 1 / 3; }
.poll-text { display: flex; flex-direction: column; }
.poll-label { font-weight: 700; font-size: 1.1rem; }
.poll-hint { color: var(--muted); font-size: .92rem; }
.poll-pct { grid-column: 3; grid-row: 1; font-weight: 800; font-stretch: 62%; font-size: 1.6rem; min-width: 3ch; text-align: right; }
.poll-bar { grid-column: 2 / 4; grid-row: 2; height: .45rem; background: var(--wash); border-radius: 2px; overflow: hidden; }
.poll-bar span { display: block; height: 100%; width: var(--pct, 0%); background: var(--ink); transition: width .5s ease-out; }
.poll-option[aria-pressed="true"] .poll-bar span { background: var(--red); }
.poll:not(.has-results) .poll-bar, .poll:not(.has-results) .poll-pct { display: none; }
.poll-option.is-winner .poll-label::after { content: " – HUI:s val"; color: var(--pine); }
.poll-option:disabled { cursor: default; }
.poll-status { min-height: 1.5em; margin: 1rem 0 .3rem; font-weight: 650; color: var(--pine); }
.poll-note { color: var(--muted); font-size: .9rem; margin: 0; }

/* ---------- inner pages ---------- */
.gift-page, .article, .article-list { max-width: 760px; margin: 0 auto; padding: 1.5rem var(--pad) 1rem; }
.crumbs { margin: 0 0 1.5rem; font-size: .95rem; }
.crumbs a { color: var(--muted); }
.gift-head { display: flex; align-items: center; gap: 1.6rem; margin-bottom: 1.4rem; }
.gift-head .mark { width: 6.5rem; height: 5rem; }
.gift-head .mark .emoji { font-size: 3.4rem; }
.gift-head h1, .article h1, .article-list h1 {
  margin: 0; font-weight: 850; font-stretch: 125%; font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1; letter-spacing: -0.02em;
}
.gift-head h1 { overflow-wrap: anywhere; }
@media (max-width: 520px) { .gift-head { gap: 1rem; } .gift-head h1 { font-stretch: 100%; font-size: clamp(1.7rem, 8vw, 2.3rem); } .gift-head .mark { width: 5rem; height: 4rem; } .gift-head .mark .emoji { font-size: 2.6rem; } }
.gift-head h1 .year { display: block; font-stretch: 62%; font-weight: 800; color: var(--red); font-size: 1.15em; }
.gift-lede { font-size: 1.25rem; max-width: 52ch; }
.gift-page .fact { margin-left: 0; font-size: 1rem; }
.source { font-weight: 400; color: var(--muted); }
.gift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 2rem 0; }
.gift-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1rem; border-top: 3px solid var(--ink); }
.gift-nav a { display: flex; flex-direction: column; text-decoration: none; font-weight: 700; }
.gift-nav a span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.gift-nav .next { text-align: right; }
.prose { max-width: 66ch; font-size: 1.08rem; line-height: 1.62; }
.prose h2 { font-weight: 800; font-size: 1.45rem; margin: 2rem 0 .5rem; line-height: 1.15; }
.prose a { color: var(--pine); }
.date { color: var(--muted); margin: .6rem 0 1.5rem; }
.article-cta { margin: 2rem 0; }
.article-list ul { list-style: none; padding: 0; margin: 1.5rem 0 3rem; }
.article-list li a { display: flex; flex-direction: column; padding: .9rem 0; border-bottom: 1px dashed var(--rule); text-decoration: none; }
.a-title { font-weight: 750; font-size: 1.2rem; }
.a-desc { color: var(--muted); }
.article-list h2 { font-weight: 850; font-stretch: 125%; font-size: 1.5rem; }
.gift-index { columns: 2 14rem; column-gap: 2rem; }
.gift-index li a { flex-direction: row; gap: .6rem; align-items: baseline; padding: .4rem 0; }
.gift-index .year { font-size: 1.3rem; color: var(--pine); }

@media (max-width: 520px) {
  .why, .fact, .item-foot { margin-left: 0; }
  .mark { width: 4rem; height: 3.2rem; }
  .mark .emoji { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-grid .is-on .ring path { animation: none; }
  .ring path, .poll-bar span, .year { transition: none; }
}
