:root {
  --paper: #f3ecdf;
  --paper-2: #e7decc;
  --ink: #16130f;
  --ink-soft: #4a433b;
  --moss: #1c4638;
  --moss-deep: #10281f;
  --stamp: #8d1a16;
  --stamp-deep: #5e0e0c;
  --cream: #fff8ee;
  --line: rgba(22, 19, 15, 0.16);
  --ui: "Familjen Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Palatino, serif;
  --rail: 3.4rem;
  --gutter: 1.75rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(var(--moss), var(--moss)) left top / var(--rail) 100% no-repeat,
    var(--paper);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    url("ground.svg?v=2"),
    radial-gradient(rgba(22, 19, 15, 0.05) 0.7px, transparent 0.8px);
  background-repeat: no-repeat, repeat;
  background-position: right center, 0 0;
  background-size: cover, 8px 8px;
}

img { max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 90;
  background: var(--cream);
  color: var(--ink);
  padding: 0.6rem 0.8rem;
}

.skip:focus { top: 0.6rem; }

.rail {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 35;
  width: var(--rail);
  height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  color: #d7c7a4;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--ui);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.shell {
  width: auto;
  margin-left: calc(var(--rail) + 1.35rem);
  margin-right: var(--gutter);
  position: relative;
  z-index: 1;
}

.sanitary {
  position: relative;
  z-index: 70;
  background: var(--stamp);
  color: var(--cream);
}

.sanitary__inner {
  width: auto;
  margin-left: calc(var(--rail) + 1.35rem);
  margin-right: var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 0.85rem 0 1rem;
}

.seal {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1.5px dashed #f0c7b2;
  border-radius: 50%;
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-align: center;
}

.seal small {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

.seal strong { font-size: 1.15rem; }

.sanitary p {
  margin: 0;
  font-family: var(--ui);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}

.sanitary a {
  color: var(--cream);
  white-space: nowrap;
}

.mast {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 1.15rem 0 0.4rem;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small { display: block; }

.brand strong {
  font-family: var(--ui);
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.brand small {
  color: var(--ink-soft);
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.nav-toggle__bars {
  position: relative;
  width: 0.95rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.mast.is-open .nav-toggle__bars {
  background: transparent;
  box-shadow: none;
}

.mast.is-open .nav-toggle__bars::before,
.mast.is-open .nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0.95rem;
  height: 2px;
  background: currentColor;
}

.mast.is-open .nav-toggle__bars::before { transform: rotate(45deg); }
.mast.is-open .nav-toggle__bars::after { transform: rotate(-45deg); }

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 0.9rem;
  font-family: var(--ui);
  font-size: 0.92rem;
  font-weight: 600;
}

.nav a { text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.nav a[aria-current="page"] { color: var(--stamp); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 34%);
  gap: 2.5rem;
  align-items: end;
  padding: 2.2rem 0 1.4rem;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 0.8rem;
  font-family: var(--ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--moss);
}

h1, h2, h3 { font-family: var(--ui); letter-spacing: -0.045em; line-height: 0.94; }

h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.3rem);
  font-weight: 700;
  max-width: 11ch;
}

.lede {
  max-width: 38rem;
  margin: 1.2rem 0 0;
  font-size: 1.22rem;
}

.hero__card {
  display: flex;
  flex-direction: column;
  align-self: end;
  background: var(--moss-deep);
  color: var(--cream);
  padding: 1.15rem 1.2rem 0.35rem;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.hero__card-kicker {
  margin: 0 0 0.55rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #d7c7a4;
}

.hero__card p { margin: 0.55rem 0 0; font-size: 0.98rem; }

.hero__card strong {
  font-family: var(--ui);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.hero__ledger {
  list-style: none;
  margin: 0.95rem 0 0;
  padding: 0;
  border-top: 1px solid rgba(255, 248, 238, 0.22);
}

.hero__ledger li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.48rem 0;
  border-bottom: 1px solid rgba(255, 248, 238, 0.14);
  font-family: var(--ui);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero__ledger b { font-variant-numeric: tabular-nums; }

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.principles li {
  padding: 1.15rem 1.1rem 1.2rem 0;
  margin-right: 1rem;
  border-top: 3px solid var(--ink);
}

.principles li:nth-child(2) { border-top-color: var(--stamp); }
.principles li:nth-child(3) { border-top-color: var(--moss); }

.principles h2 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.principles p { margin: 0; color: var(--ink-soft); }

.registry { padding: 2rem 0 1rem; }

.registry__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.registry h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); max-width: 14ch; }

.count {
  margin: 0;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-align: right;
}

.count span { display: block; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0.7rem;
}

.filters button {
  appearance: none;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.source {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: fiche;
}

.fiche {
  counter-increment: fiche;
  display: grid;
  grid-template-columns: 4.2rem minmax(14rem, 1.15fr) minmax(16rem, 1fr) auto minmax(9.5rem, auto);
  gap: 0.8rem 1.1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px dashed rgba(22, 19, 15, 0.35);
}

.fiche:last-child { border-bottom: 1px dashed rgba(22, 19, 15, 0.35); }

.fiche__index::before {
  content: counter(fiche, decimal-leading-zero);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: var(--stamp);
}

.fiche h3 { margin: 0; font-size: 1.65rem; }

.fiche__entity,
.fiche__note { margin: 0.15rem 0 0; }

.fiche__entity {
  font-family: var(--ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--moss);
}

.fiche__note { color: var(--ink-soft); font-size: 0.98rem; }

.fiche__licence {
  margin: 0;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.fiche__licence span {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--moss);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fiche__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fiche__cats li {
  font-family: var(--ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 0.28rem 0.4rem;
  background: rgba(255, 248, 238, 0.7);
}

.outbound {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.55rem 0.85rem;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: -0.02em;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.outbound:hover { background: var(--stamp); }

.minor-note {
  display: none;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--cream);
  border-left: 6px solid var(--stamp);
}

html.age-minor .minor-note { display: block; }
html.age-minor .ledger { display: none; }

.aside-block,
.help,
.prose {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.aside-block {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}

.aside-block h2,
.help h2,
.prose h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 0.6rem; }

.help {
  background: var(--cream);
  padding: 1.3rem 1.2rem 1.4rem;
  border-left: 8px solid var(--stamp);
}

.help a,
.prose a,
.colophon a { text-underline-offset: 0.18em; }

.help ul,
.prose ul { padding-left: 1.1rem; }

.reset {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--stamp-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.page-intro { padding: 1.6rem 0 0.2rem; }
.page-intro h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); max-width: 16ch; }

.prose h2 { margin-top: 1.6rem; }
.prose p, .prose li { max-width: 68ch; }

.identity { margin: 0.4rem 0 0; }
.identity div {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
}
.identity dt { font-family: var(--ui); font-weight: 700; }
.identity dd { margin: 0; }

.colophon { position: relative; z-index: 1; color: var(--cream); background: var(--ink); }
.colophon a { color: var(--cream); }

.declaration {
  background: var(--stamp-deep);
  padding: 2rem 0 2.1rem;
}

.declaration__kicker {
  margin: 0 0 0.7rem;
  font-family: var(--ui);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.declaration__statement {
  margin: 0;
  max-width: 46rem;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  font-weight: 600;
  line-height: 1.25;
  color: #fff6ea;
}

.declaration__warn {
  margin: 1.1rem 0 0;
  max-width: 46rem;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.4;
}

.colophon__bar { padding: 1.3rem 0 1.6rem; }

.colophon__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  font-family: var(--ui);
  font-weight: 600;
}

.colophon__meta { max-width: 70ch; color: #ddd2c2; }

.age-gate {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7.5rem 1rem 1.5rem calc(var(--rail) + 1rem);
  background: rgba(20, 16, 12, 0.46);
}

html.age-ok .age-gate,
html.age-minor .age-gate { display: none; }

html:not(.age-ok):not(.age-minor) { overflow: hidden; }

.age-card {
  width: min(36rem, 100%);
  background: var(--paper);
  color: var(--ink);
  padding: 1.4rem 1.3rem 1.3rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.age-card h2 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.age-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.age-actions button {
  appearance: none;
  border: 1px solid var(--ink);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
}

.age-actions .yes { background: var(--ink); color: var(--cream); }
.age-actions .no { background: transparent; color: var(--ink); }

@media (max-width: 980px) {
  .hero, .principles, .aside-block, .fiche, .identity div {
    grid-template-columns: 1fr;
  }
  .fiche__cats { justify-content: flex-start; }
  .principles li { margin-right: 0; }
  .registry__head { align-items: start; }
  .count { text-align: left; }
}

@media (max-width: 760px) {
  :root { --rail: 0px; }
  body {
    background: var(--paper);
    padding-bottom: 7.6rem;
  }
  body::before { background-position: center top, 0 0; }
  .rail { display: none; }
  .sanitary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 -10px 28px rgba(22, 19, 15, 0.2);
  }
  .sanitary__inner {
    gap: 0.6rem 0.7rem;
    align-items: start;
    margin-left: 0.8rem;
    margin-right: 0.8rem;
    padding: 0.55rem 0 calc(0.6rem + env(safe-area-inset-bottom));
  }
  .seal {
    width: 2.4rem;
    height: 2.4rem;
  }
  .seal small { font-size: 0.46rem; }
  .seal strong { font-size: 0.92rem; }
  .sanitary p { font-size: 0.78rem; line-height: 1.28; }
  .sanitary a { white-space: normal; }
  .shell { margin-left: 0.8rem; margin-right: 0.8rem; }
  .mast {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    z-index: 40;
  }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.2rem 0;
    background: var(--cream);
    border: 1px solid var(--ink);
    box-shadow: 0 16px 36px rgba(22, 19, 15, 0.14);
  }
  .mast.is-open .nav { display: flex; }
  .nav a {
    padding: 0.9rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"] {
    background: var(--ink);
    color: var(--cream);
  }
  .age-gate { padding: 1.1rem 0.8rem 8.4rem; }
  h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .age-gate, .rail, .filters, .reset, .nav-toggle { display: none !important; }
  .nav { display: flex !important; position: static; border: 0; box-shadow: none; }
  html { overflow: auto !important; }
  body { background: white; padding-bottom: 0; }
  .sanitary { position: static; box-shadow: none; }
  .outbound::after { content: " (" attr(href) ")"; font-weight: 400; }
}
