/* ==========================================================================
   EnduRoMania — Design System
   Rugged / outdoor / archival. Dark-first.
   ========================================================================== */

:root {
  /* Surfaces */
  --ink-900: #0c0e0f;
  --ink-850: #111416;
  --ink-800: #16191c;
  --ink-750: #1c2024;
  --ink-700: #23282d;
  --ink-600: #2e353a;

  /* Ink on dark */
  --bone:    #f2efe8;
  --bone-2:  #b6b1a7;
  --bone-3:  #878279;

  /* Accents */
  --clay:    #e2561d;   /* dust road / rust */
  --clay-lo: #a63d12;
  --clay-hi: #ff7b43;
  --moss:    #86a357;   /* forest */
  --sky:     #74a9c9;   /* sky / video */
  --amber:   #e3b23c;   /* data / maps */

  --line:    rgba(242, 239, 232, 0.12);
  --line-2:  rgba(242, 239, 232, 0.07);

  /* Type */
  --font-display: "Barlow Condensed", "Oswald", Impact, sans-serif;
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  /* Metrics */
  --wrap: 1180px;
  --gutter: 24px;
  --header-h: 68px;
  --radius: 3px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--ink-900);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: .005em; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Bilingual visibility (DE default, works without JS) ---------- */
/* Scoped to descendants of <body> on purpose: an unscoped [lang="en"] also
   matches <html lang="en"> and hides the entire document. Only ever hide the
   inactive language, never un-hide — that way the active one keeps whatever
   display value it already has (flex, grid, list-item...). */
html[data-lang="de"] body [lang="en"] { display: none; }
html[data-lang="en"] body [lang="de"] { display: none; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: clamp(56px, 8vw, 104px) 0; position: relative; }
.section--tight { padding: clamp(40px, 5vw, 64px) 0; }
.section--alt { background: var(--ink-850); border-block: 1px solid var(--line-2); }

/* Topographic texture overlay */
.topo::before {
  content: "";
  position: absolute; inset: 0;
  background: url("../img/topo.svg") center / 900px repeat;
  opacity: .05; pointer-events: none;
}
.topo > * { position: relative; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(12, 14, 15, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-2);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; height: 100%; }
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand img { height: 38px; width: auto; }
.brand__text { font-family: var(--font-display); font-size: 23px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand__text em { font-style: normal; color: var(--clay); }
.brand__sub { display: block; font-family: var(--font-body); font-size: 9.5px; letter-spacing: .26em; color: var(--bone-3); text-transform: uppercase; margin-top: 3px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  font-family: var(--font-display); font-size: 16.5px; text-transform: uppercase;
  letter-spacing: .045em; color: var(--bone-2); padding: 8px 11px; border-radius: var(--radius);
  transition: color .18s var(--ease), background .18s var(--ease); white-space: nowrap;
}
.nav a:hover { color: var(--bone); background: rgba(242,239,232,.06); }
.nav a[aria-current="page"] { color: var(--clay-hi); }
.nav a[aria-current="page"]::after { content: ""; display: block; height: 2px; background: var(--clay); margin-top: 3px; }

.lang { display: flex; align-items: center; margin-left: 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; flex: 0 0 auto; }
.lang button { font-family: var(--font-display); font-size: 14px; letter-spacing: .09em; padding: 5px 9px; color: var(--bone-3); transition: .18s var(--ease); }
.lang button[aria-pressed="true"] { background: var(--clay); color: #fff; }
.lang button:hover:not([aria-pressed="true"]) { color: var(--bone); background: rgba(242,239,232,.07); }

.burger { display: none; margin-left: 8px; padding: 8px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--bone); margin: 4px 0; transition: .22s var(--ease); }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line-2); }
.hero__bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: grayscale(.72) contrast(1.08) brightness(.52); transform: scale(1.04); }
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 18% 100%, rgba(226,86,29,.22), transparent 58%),
    linear-gradient(to top, var(--ink-900) 2%, rgba(12,14,15,.80) 42%, rgba(12,14,15,.42) 100%);
}
.hero__inner { position: relative; width: 100%; padding-block: clamp(44px, 7vw, 86px); }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 11px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--clay-hi); font-weight: 600; margin-bottom: 20px; }
.hero__eyebrow::before { content: ""; width: 40px; height: 1px; background: var(--clay); }
.hero h1 { font-size: clamp(46px, 9.2vw, 112px); text-transform: uppercase; letter-spacing: -.012em; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--clay-hi); }
.hero__lead { font-size: clamp(17px, 2vw, 21px); color: var(--bone-2); max-width: 62ch; margin-top: 22px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 28px 44px; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }
.hero__meta div { min-width: 90px; }
.hero__meta dt { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--bone-3); margin-bottom: 4px; }
.hero__meta dd { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1; }

/* Page header (interior pages) */
.pagehead { position: relative; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.pagehead__bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: grayscale(.8) brightness(.34); }
.pagehead__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--ink-900), rgba(12,14,15,.72)); }
.pagehead__inner { position: relative; padding-block: clamp(44px, 6.5vw, 86px); }
.pagehead h1 { font-size: clamp(36px, 6vw, 68px); text-transform: uppercase; max-width: 20ch; }
.pagehead p { color: var(--bone-2); max-width: 66ch; margin-top: 16px; font-size: 18px; }

/* Breadcrumb */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-3); margin-bottom: 18px; }
.crumbs a:hover { color: var(--clay-hi); }
.crumbs span { opacity: .45; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-size: 17px; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 22px; border-radius: var(--radius); border: 1px solid transparent;
  transition: .2s var(--ease);
}
.btn--primary { background: var(--clay); color: #fff; }
.btn--primary:hover { background: var(--clay-hi); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line); color: var(--bone); }
.btn--ghost:hover { border-color: var(--clay); color: var(--clay-hi); background: rgba(226,86,29,.07); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Section headings ---------- */
.eyebrow { display: flex; align-items: center; gap: 12px; font-size: 11.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--clay-hi); font-weight: 600; margin-bottom: 16px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--clay); flex: 0 0 auto; }
.section h2 { font-size: clamp(30px, 4.4vw, 50px); text-transform: uppercase; max-width: 22ch; }
.section h3 { font-size: clamp(21px, 2.4vw, 27px); text-transform: uppercase; letter-spacing: .01em; }
.lead { font-size: 19px; color: var(--bone-2); max-width: 68ch; margin-top: 18px; }
.prose { max-width: 70ch; color: var(--bone-2); }
.prose h3 { color: var(--bone); margin: 34px 0 12px; }
.prose strong { color: var(--bone); font-weight: 600; }
.prose a { color: var(--clay-hi); border-bottom: 1px solid rgba(226,86,29,.38); }
.prose a:hover { border-color: var(--clay-hi); }
.prose ul { margin: 0 0 1em; }
.prose ul li { position: relative; padding-left: 22px; margin-bottom: 9px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border: 1px solid var(--clay); transform: rotate(45deg); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.split { display: grid; gap: clamp(28px, 5vw, 64px); grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }

/* ---------- Cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--ink-800); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 26px 24px; transition: .22s var(--ease); overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--clay); transform: scaleY(0); transform-origin: top; transition: transform .28s var(--ease); }
a.card:hover, .card--link:hover { border-color: var(--line); background: var(--ink-750); transform: translateY(-2px); }
a.card:hover::before, .card--link:hover::before { transform: scaleY(1); }
.card__num { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--clay); margin-bottom: 12px; }
.card h3 { font-size: 23px; text-transform: uppercase; margin-bottom: 9px; }
.card p { color: var(--bone-2); font-size: 15.5px; margin: 0; }
.card__foot { margin-top: auto; padding-top: 18px; font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: .07em; color: var(--clay-hi); display: flex; align-items: center; gap: 7px; }
.card__foot svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
a.card:hover .card__foot svg { transform: translateX(4px); }

/* Stat */
.stat { text-align: left; padding: 22px 0; border-top: 2px solid var(--clay); }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(40px, 6vw, 62px); line-height: .95; }
.stat span { display: block; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3); margin-top: 8px; }

/* Notice / callout */
.notice { border: 1px solid var(--line); border-left: 3px solid var(--clay); background: linear-gradient(90deg, rgba(226,86,29,.09), transparent 60%); padding: 22px 24px; border-radius: var(--radius); }
.notice h3 { font-size: 21px; text-transform: uppercase; margin-bottom: 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice--moss { border-left-color: var(--moss); background: linear-gradient(90deg, rgba(134,163,87,.1), transparent 60%); }

/* ---------- Document list ---------- */
.docs { display: grid; gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.doc {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink-800); padding: 13px 16px; transition: background .16s var(--ease);
}
.doc:hover { background: var(--ink-700); }
.doc__ext {
  flex: 0 0 auto; width: 46px; text-align: center; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; padding: 5px 0; border-radius: 2px;
  background: var(--ink-600); color: var(--bone-2);
}
.doc__ext[data-ext="pdf"] { background: rgba(226,86,29,.16); color: var(--clay-hi); }
.doc__ext[data-ext="mp4"] { background: rgba(116,169,201,.16); color: var(--sky); }
.doc__ext[data-ext="xlsx"], .doc__ext[data-ext="xls"] { background: rgba(134,163,87,.16); color: var(--moss); }
.doc__ext[data-ext="gpx"], .doc__ext[data-ext="gdb"], .doc__ext[data-ext="zip"] { background: rgba(227,178,60,.15); color: var(--amber); }
.doc__name { flex: 1 1 auto; min-width: 0; font-size: 15.5px; overflow-wrap: anywhere; }
.doc:hover .doc__name { color: var(--clay-hi); }
.doc__size { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--bone-3); }
.doc__path { display: block; font-size: 11.5px; letter-spacing: .04em; color: var(--bone-3); text-transform: uppercase; margin-top: 2px; }
.docs__empty { background: var(--ink-800); padding: 18px; color: var(--bone-3); font-size: 15px; }

.docgroup { margin-bottom: 30px; }
.docgroup > h4 { font-family: var(--font-display); font-size: 19px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 11px; color: var(--bone); }

/* ---------- Guest houses ---------- */
.place { background: var(--ink-800); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; transition: .22s var(--ease); }
.place:hover { border-color: var(--line); background: var(--ink-750); }
.place__tag { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); border: 1px solid rgba(226,86,29,.4); padding: 2px 8px; border-radius: 2px; margin-bottom: 13px; }
.place h3 { font-size: 24px; text-transform: uppercase; margin-bottom: 7px; }
.place__meta { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--bone-3); margin-bottom: 12px; }
.place p { color: var(--bone-2); font-size: 15.5px; }
.place .docs { margin-top: 16px; }

/* ---------- Press timeline ---------- */
.years { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 34px; }
.years button {
  font-family: var(--font-mono); font-size: 13px; padding: 6px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius); color: var(--bone-2); transition: .16s var(--ease);
}
.years button:hover { border-color: var(--clay); color: var(--clay-hi); }
.years button[aria-pressed="true"] { background: var(--clay); border-color: var(--clay); color: #fff; }

.era { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-top: 1px solid var(--line-2); }
.era__year { font-family: var(--font-display); font-size: 38px; line-height: 1; color: var(--clay); position: sticky; top: calc(var(--header-h) + 18px); align-self: start; }
.era__year small { display: block; font-family: var(--font-body); font-size: 11px; letter-spacing: .16em; color: var(--bone-3); margin-top: 5px; }

/* ---------- Contacts ---------- */
.person { background: var(--ink-800); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; }
.person__role { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--clay); margin-bottom: 9px; }
.person h3 { font-size: 22px; margin-bottom: 4px; text-transform: none; letter-spacing: 0; }
.person__loc { font-size: 14px; color: var(--bone-3); margin-bottom: 14px; }
.person ul li { margin-bottom: 7px; font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.person ul li svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--bone-3); transform: translateY(2px); }
.person a:hover { color: var(--clay-hi); }

/* ---------- Library browser ---------- */
.lib__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 26px; }
.lib__search { position: relative; flex: 1 1 320px; }
.lib__search input {
  width: 100%; background: var(--ink-800); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--bone); padding: 12px 14px 12px 42px; font: inherit; font-size: 16px;
}
.lib__search input:focus { outline: none; border-color: var(--clay); }
.lib__search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--bone-3); }
.lib__count { font-family: var(--font-mono); font-size: 12.5px; color: var(--bone-3); }

.tree { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.tree details { border-top: 1px solid var(--line-2); }
.tree > details:first-child { border-top: 0; }
.tree summary {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px; cursor: pointer; list-style: none;
  background: var(--ink-800); transition: background .16s var(--ease); user-select: none;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--ink-700); }
.tree summary .chev { width: 13px; height: 13px; color: var(--clay); transition: transform .2s var(--ease); flex: 0 0 auto; }
.tree details[open] > summary .chev { transform: rotate(90deg); }
.tree summary .name { font-family: var(--font-display); font-size: 18px; text-transform: uppercase; letter-spacing: .035em; flex: 1 1 auto; }
.tree summary .count { font-family: var(--font-mono); font-size: 11px; color: var(--bone-3); }
.tree .body { padding: 4px 0 10px 28px; background: var(--ink-850); }
.tree .body .doc { background: transparent; padding: 9px 16px; }
.tree .body .doc:hover { background: rgba(242,239,232,.04); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-850); border-top: 1px solid var(--line-2); padding-top: 56px; }
.site-footer h4 { font-family: var(--font-display); font-size: 17px; text-transform: uppercase; letter-spacing: .09em; color: var(--bone); margin-bottom: 14px; }
.site-footer ul li { margin-bottom: 8px; font-size: 15px; color: var(--bone-2); }
.site-footer a:hover { color: var(--clay-hi); }
.site-footer__grid { display: grid; gap: 34px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding-bottom: 44px; }
.site-footer__bar { border-top: 1px solid var(--line-2); padding: 20px 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; color: var(--bone-3); }

/* ---------- Reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
html.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--ink-850); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 20px;
    gap: 0; transform: translateY(-120%); transition: transform .3s var(--ease); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.is-open { transform: none; }
  .nav a { padding: 13px 4px; font-size: 20px; border-bottom: 1px solid var(--line-2); }
  .nav a[aria-current="page"]::after { display: none; }
  .burger { display: block; order: 3; }
  .lang { margin-left: auto; order: 2; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --gutter: 18px; }
  .brand__text { font-size: 20px; }
  .brand img { height: 32px; }
  .era { grid-template-columns: 1fr; gap: 12px; }
  .era__year { position: static; font-size: 30px; }
  .hero__meta { gap: 20px 30px; }
  .hero__meta dd { font-size: 24px; }
  .doc__size { display: none; }
}

/* ---------- Price table ---------- */
.ptable { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.prow {
  display: flex; align-items: baseline; gap: 16px; justify-content: space-between;
  padding: 14px 18px; background: var(--ink-800); border-top: 1px solid var(--line-2);
}
.prow:first-child { border-top: 0; }
.prow:nth-child(even) { background: var(--ink-850); }
.prow span { font-size: 15.5px; color: var(--bone-2); }
.prow b { font-family: var(--font-display); font-size: 25px; color: var(--clay-hi); white-space: nowrap; line-height: 1; }
.prow b span { font-size: inherit; color: inherit; font-family: inherit; }

/* person list used standalone (e.g. inside a card) */
.card > ul.person li { margin-bottom: 7px; font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.card > ul.person li svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--bone-3); transform: translateY(2px); }
.card > ul.person a:hover { color: var(--clay-hi); }
