/* Bionic Builders — bionicbuilders.ch
 * Eigene Marke, bewusst NICHT die Bionic-OS-Skins (Spec E3).
 * Leitbild: die Landeskarte. Papier, Kartentinte, Seeblau, Signalrot nur für
 * Zähler und Hauptaktion. Schrift: Archivo mit Breitenachse. */

:root {
  --paper: #fbfbf8;
  --paper-2: #f0f2ed;
  --ink: #1d232b;
  --ink-2: #4a535c;
  --line: #d7dbd4;
  --land: #e4e8e1;
  --land-has: #c9d3c4;
  --land-hover: #b5c2ae;
  --lake: #b9d3e6;
  --red: #d8141d;
  --red-ink: #ffffff;
  --focus: #1f6fd1;
  --radius: 6px;
  --wrap: 1160px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181d;
    --paper-2: #1b2027;
    --ink: #eef1ec;
    --ink-2: #a9b2ab;
    --line: #2f3740;
    --land: #262d35;
    --land-has: #34403f;
    --land-hover: #42524f;
    --lake: #22394b;
    --red: #ff4141;
    --red-ink: #14181d;
    --focus: #6aa8ff;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--ink-2); }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* --- Typografie --- */
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.01em; }
h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  font-weight: 800;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.025em;
}
h2 { font-size: 1.55rem; font-weight: 700; font-variation-settings: 'wdth' 108; }
h3 { font-size: 1.12rem; font-weight: 700; }
.lead { font-size: 1.18rem; color: var(--ink-2); max-width: 60ch; margin: 18px 0 0; }
.kicker { margin: 0 0 18px; font-weight: 600; color: var(--ink-2); }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1.05em; }
.prose h2 { margin: 1.6em 0 0.6em; }

/* --- Kopf --- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.15rem; font-weight: 500; font-variation-settings: 'wdth' 110; letter-spacing: -0.01em; }
.wordmark b { font-weight: 800; }
.wordmark-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); flex: none; }
.wordmark-small { font-size: 1rem; }
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; }
.nav a:not(.btn) { text-decoration: none; color: var(--ink-2); font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:not(.btn):hover, .nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--ink); }
.lang-note { border-top: 1px solid var(--line); background: var(--paper-2); font-size: 0.86rem; color: var(--ink-2); }
.lang-note .wrap { display: flex; align-items: center; gap: 10px; padding-top: 6px; padding-bottom: 6px; }
.tag { display: inline-block; border: 1px solid var(--ink-2); border-radius: 3px; padding: 0 5px; font-size: 0.75rem; font-weight: 700; line-height: 1.5; color: var(--ink); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 11px 20px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--red); border-color: var(--red); color: var(--red-ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-small { padding: 6px 14px; font-size: 0.92rem; }
.btn-large { padding: 14px 28px; font-size: 1.08rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* --- Hero + Karte --- */
.hero { padding: 48px 0 40px; border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; }
.hero h1 { white-space: normal; }
.stats { margin: 22px 0 0; font-weight: 600; }
.map { margin: 0; }
.map svg { width: 100%; height: auto; display: block; overflow: visible; }
.map figcaption { font-size: 0.88rem; margin-top: 6px; text-align: right; }
.canton path { fill: var(--land); stroke: var(--paper); stroke-width: 1.4; stroke-linejoin: round; transition: fill .12s ease; }
.canton.has path { fill: var(--land-has); }
.canton:hover path, .canton:focus-visible path, .canton.is-hot path { fill: var(--land-hover); }
.canton:focus-visible { outline: none; }
.canton:focus-visible path { stroke: var(--focus); stroke-width: 3; }
.lakes { fill: var(--lake); pointer-events: none; }
.badges { pointer-events: none; }
.badge { transform: var(--t); }
.badge circle { fill: var(--red); stroke: var(--paper); stroke-width: 3; }
.badge text { fill: var(--red-ink); font: 800 22px var(--font); text-anchor: middle; }
@media (prefers-reduced-motion: no-preference) {
  .badge { animation: pin .45s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i, 0) * 50ms + 150ms); }
  @keyframes pin { from { opacity: 0; transform: var(--t) scale(.2); } to { opacity: 1; transform: var(--t) scale(1); } }
}

/* --- Abschnitte --- */
.section { padding: 48px 0; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.page-head { padding: 52px 0 8px; }
.page-head.message { padding-bottom: 72px; }
.page-head .lead { margin-bottom: 0; }
.plate-big {
  display: inline-block; margin: 0 0 18px; padding: 2px 12px;
  border: 2px solid var(--ink); border-radius: 6px;
  font-size: 1.6rem; font-weight: 800; font-variation-settings: 'wdth' 118; letter-spacing: .04em;
}

/* --- Projekt-Raster --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px 28px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-media { display: block; text-decoration: none; aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-body { padding-top: 14px; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-color: var(--red); }
.card-tagline { margin: 6px 0 12px; color: var(--ink-2); font-size: 0.97rem; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.card-by { overflow-wrap: anywhere; }
.card-featured .card-media { border: 2px solid var(--ink); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: hsl(var(--ph-h) 30% 86%); }
.ph span { font-size: 3.6rem; font-weight: 800; font-variation-settings: 'wdth' 120; color: hsl(var(--ph-h) 35% 32%); }
@media (prefers-color-scheme: dark) {
  .ph { background: hsl(var(--ph-h) 18% 24%); }
  .ph span { color: hsl(var(--ph-h) 40% 78%); }
}

/* Kantons-Plakette, angelehnt ans Kennzeichen */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px 1px 3px;
  text-decoration: none; font-size: 0.86rem; font-weight: 600; background: var(--paper);
}
.chip:hover { border-color: var(--ink); text-decoration: none; }
.chip-code {
  display: inline-block; min-width: 26px; text-align: center;
  border: 1.5px solid var(--ink); border-radius: 3px; padding: 0 3px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; line-height: 1.45;
}
.tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tools li { border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 0.86rem; }

/* Kantonsliste */
.canton-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 24px; }
.canton-list a { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-2); }
.canton-list a.has { color: var(--ink); font-weight: 600; }
.canton-list a:hover { color: var(--ink); }
.canton-list .count { margin-left: auto; font-variant-numeric: tabular-nums; }
.canton-list a.has .count { color: var(--red); font-weight: 800; }

/* Leere Zustände */
.empty { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 40px 24px; text-align: center; }
.empty p { max-width: 46ch; margin: 10px auto 22px; }

/* --- Projektseite --- */
.project { padding: 32px 0 48px; }
.back { display: inline-block; margin-bottom: 28px; font-size: 0.95rem; }
.project-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: start; }
.facts { margin: 0; border-top: 2px solid var(--ink); }
.facts > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 0.85rem; color: var(--ink-2); margin-bottom: 4px; }
.facts dd { margin: 0; font-weight: 600; }
.shot-main { margin: 40px 0 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.shot-main img { width: 100%; }
.project-body { margin-top: 36px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.shots figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.note { margin-top: 24px; max-width: 68ch; padding: 14px 16px; border-left: 3px solid var(--red); background: var(--paper-2); }

/* --- Formular --- */
.form fieldset { border: 0; margin: 0 0 36px; padding: 0; min-width: 0; }
.form legend { font-size: 1.3rem; font-weight: 700; font-variation-settings: 'wdth' 108; margin-bottom: 14px; padding: 0; }
.field { margin-bottom: 20px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 6px; }
.form input[type='text'], .form input[type='url'], .form input[type='email'], .form select, .form textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
}
.form textarea { resize: vertical; min-height: 150px; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 35%, transparent); }
.form input[type='file'] { font: inherit; max-width: 100%; }
.hint { margin: 6px 0 0; font-size: 0.88rem; color: var(--ink-2); }
.error { margin: 6px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--red); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red) !important; }
.form-alert { padding: 12px 16px; border-left: 3px solid var(--red); background: var(--paper-2); font-weight: 600; margin: 0 0 28px; }
.mode { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 36px !important; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 10px 18px; border: 1.5px solid var(--ink); font-weight: 600; cursor: pointer; }
.seg:first-of-type span { border-radius: var(--radius) 0 0 var(--radius); }
.seg:last-of-type span { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks .check span { display: inline-block; padding: 5px 12px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 0.93rem; }
.checks .check input { position: absolute; opacity: 0; }
.checks .check input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.checks .check input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.radios { display: grid; gap: 8px; }
.radios .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.radios input { margin-top: 5px; accent-color: var(--ink); }
.previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.previews img { width: 120px; height: 75px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }

/* --- Fuss --- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 0.93rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 24px; align-items: start; }
.site-footer p { margin: 8px 0 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-meta { display: grid; gap: 6px; margin: 0 !important; }

/* --- Mobil --- */
@media (max-width: 860px) {
  .hero-inner, .project-head { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .footer-inner { grid-template-columns: 1fr; }
  .map figcaption { text-align: left; }
}
@media (max-width: 768px) {
  body { font-size: 16px; }
  .nav { gap: 2px 14px; }
  .nav a:not(.btn) { font-size: 0.95rem; }
  .header-inner { min-height: 0; }
  .section { padding: 36px 0; }
  .grid { grid-template-columns: 1fr; gap: 32px; }
  .seg span { padding: 9px 12px; font-size: 0.93rem; }
}
@media (max-width: 420px) {
  .nav .btn-small { width: 100%; }
}
