@font-face {
  font-family: "IM Fell English";
  src: url("/fonts/im_fell_english.ttf") format("truetype");
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("/fonts/im_fell_english_italic.ttf") format("truetype");
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/fonts/familjen_grotesk.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm_plex_mono_regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* Palette of the "Historisch" skin: vellum, iron-gall ink, Karmin, Preußischblau, Sepia. */
:root {
  --vellum: #F0E6C8;
  --paper: #E8DAB6;
  --edge: #C9B996;
  --ink: #2A1C10;
  --ink-2: #5C4B32;
  --ink-3: #8E7B5A;
  --karmin: #B3262E;
  --blue: #1F3F6E;
  --sepia: #7A5930;
  --serif: "IM Fell English", Georgia, serif;
  --sans: "Familjen Grotesk", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.04; margin: 0 0 .45em; }
h1 { font-size: clamp(2.5rem, 4.8vw, 4.1rem); }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: .85rem; color: var(--ink-2); }

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(20px, 5vw, 64px);
  background: rgba(240, 230, 200, .94);
  border-bottom: 1.5px solid var(--ink);
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-family: var(--serif); font-size: 1.6rem; }
.top nav { display: flex; gap: 24px; align-items: center; font-size: .95rem; }
.top nav a:not(.btn) { text-decoration: none; color: var(--ink-2); }
.top nav a:not(.btn):hover { color: var(--karmin); }
@media (max-width: 640px) { .top nav a:not(.btn) { display: none; } }

.btn {
  display: inline-block;
  background: var(--karmin); color: var(--vellum);
  border: 1.5px solid var(--ink);
  padding: 13px 22px;
  font-weight: 700; text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-small { padding: 7px 14px; font-size: .9rem; box-shadow: 2px 2px 0 var(--ink); }
.link { text-decoration: none; font-weight: 600; color: var(--ink-2); }
.link:hover { color: var(--karmin); }
.cta { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; margin-top: 24px; }

main > section { padding: clamp(56px, 9vw, 120px) clamp(20px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }

/* Hero: the map under the fog fills the whole section; the text sits in a map cartouche. */
main > .hero {
  position: relative; max-width: none; padding: 0;
  height: clamp(620px, 86vh, 900px);
  overflow: hidden;
  background: #C9C0AE;
  border-bottom: 1.5px solid var(--ink);
  touch-action: pan-y;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#fog-canvas { cursor: crosshair; }
.hero-inner {
  position: relative; z-index: 2; height: 100%;
  max-width: 1240px; margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px);
  display: flex; align-items: center;
  pointer-events: none;
}
.cartouche {
  pointer-events: auto;
  max-width: 540px; margin: 6px;
  background: rgba(240, 230, 200, .96);
  border: 1.5px solid var(--ink);
  outline: 1px solid var(--ink); outline-offset: 5px;
  padding: 34px 40px 22px;
  box-shadow: 0 24px 50px -24px rgba(42, 28, 16, .55);
}
.kicker { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--karmin); margin-bottom: .6em; }
.lead { font-size: 1.12rem; color: var(--ink-2); }
#try { color: var(--ink); }
.tally {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 22px 0 0; padding-top: 12px; border-top: 1px solid var(--edge);
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink-2);
}
.tally b { font-family: var(--mono); font-style: normal; font-weight: 400; color: var(--karmin); }
.tally button { font: inherit; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; }
.tally button:hover { color: var(--karmin); }
.hint {
  position: absolute; z-index: 2; right: clamp(20px, 5vw, 64px); bottom: 28px; margin: 0;
  background: var(--ink); color: var(--vellum);
  font-family: var(--serif); font-style: italic; font-size: 1.1rem;
  padding: 8px 16px; pointer-events: none;
  opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease;
}
.hint.show { opacity: 1; transform: none; }
@media (max-width: 760px) {
  main > .hero { height: auto; }
  .hero-inner { height: auto; align-items: flex-start; padding-bottom: 420px; }
  .cartouche { padding: 24px 22px 16px; }
  .hint { left: 20px; right: auto; }
}

.steps ol { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.steps li { padding: 24px 28px 8px 0; border-top: 1.5px solid var(--ink); margin-right: 28px; }
.steps .num { font-family: var(--serif); font-size: 1.8rem; color: var(--karmin); display: block; margin-bottom: 6px; }
.steps p { color: var(--ink-2); }
@media (max-width: 800px) { .steps ol { grid-template-columns: 1fr; } .steps li { margin-right: 0; } }

main > .modes {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center;
  background: var(--paper); max-width: none;
  border-block: 1.5px solid var(--ink);
}
.modes > * { max-width: 560px; }
.modes > div { justify-self: end; }
.modes p { color: var(--ink-2); }
.mode-list { list-style: none; margin: 0; padding: 0; }
.mode-list li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--edge); }
.mode-list b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.mode-list i { width: 22px; height: 24px; background: var(--c); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
@media (max-width: 800px) { main > .modes { grid-template-columns: 1fr; } .modes > div { justify-self: start; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.features article { border-left: 1.5px solid var(--edge); padding-left: 22px; }
.features p { color: var(--ink-2); }
@media (max-width: 800px) { .features { grid-template-columns: 1fr; } }

.perks { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.perks li { position: relative; padding-left: 22px; font-weight: 700; }
.perks li::before { content: ""; position: absolute; left: 0; top: .32em; width: 12px; height: 14px; background: var(--karmin); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

.selling { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; padding-bottom: 0 !important; }
.selling article { border: 1.5px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -6px; padding: 30px 28px 18px; background: var(--paper); }
.selling .seal {
  display: grid; place-items: center; width: 58px; height: 64px; margin-bottom: 14px;
  background: var(--karmin); color: var(--vellum); font-family: var(--serif); font-size: 1.5rem;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.selling p { color: var(--ink-2); }
@media (max-width: 800px) { .selling { grid-template-columns: 1fr; } }
.fine { font-size: .9rem; color: var(--ink-2); }

main > .download { background: var(--ink); color: var(--vellum); max-width: none; }
.download > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.download p, .download .mono { color: #CDBB98; }
.download .btn { background: var(--vellum); color: var(--ink); border-color: var(--vellum); box-shadow: 3px 3px 0 var(--karmin); }
.download details { margin-top: 32px; border-top: 1px solid #4A3826; padding-top: 18px; }
.download summary { cursor: pointer; font-family: var(--serif); font-size: 1.25rem; }
.download details ol { color: #E1D3B2; padding-left: 1.2em; }
.download details li { margin: 8px 0; }

footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding: 28px clamp(20px, 5vw, 64px); font-size: .9rem; color: var(--ink-2);
}
footer nav { display: flex; gap: 20px; }

.legal { max-width: 760px; margin: 0 auto; padding: 56px 24px 80px; }
.legal h1 { font-size: 3rem; }
.legal h2 { font-size: 1.5rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-2); }
.legal strong { color: var(--ink); }

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