@font-face {
  font-family: "Noi Grotesk Markthalle";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/NoiGroteskMarkthalle-Medium.woff2) format("woff2"),
       url(/fonts/NoiGroteskMarkthalle-Medium.woff) format("woff");
}

:root {
  --ink: #000;
  --paper: #f6f3ec;
  --accent: #be6e5e;
  --muted: #5c5a55;
  --line: var(--accent); /* page grid rules, rust red per corporate design */
  --rule: 2px;
  --pad: 0.75rem;
  --edge: 12px; /* outer margin around the page frame */
  --font: "Noi Grotesk Markthalle", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--edge) + 4.5rem); /* clears the sticky header */
}

/* Type scale and line heights follow markthalle-luzern.ch. The Markthalle cut
   of Noi Grotesk has tight vertical metrics (ascent+descent = 0.9em), hence
   the near-solid leading. */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; font-weight: 400; }
p + p { margin-top: 0.75em; }

/* Links stay black and turn rust red on hover, as on markthalle-luzern.ch */
a { color: inherit; text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 0.12em; transition: color 0.15s; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.text-2xl { font-size: 48px; line-height: 0.9583; letter-spacing: -0.01em; }
.text-xl  { font-size: 42px; line-height: 0.9523; }
.text-lg  { font-size: 32px; line-height: 1; }
.label    { display: block; font-size: 14px; line-height: 1.0714; }

@media (min-width: 700px) {
  body { font-size: 24px; line-height: 1.0416; }
  .text-2xl { font-size: 72px; line-height: 0.9375; }
  .text-xl  { font-size: 48px; line-height: 0.9583; }
  .text-lg  { font-size: 42px; line-height: 0.9523; }
  :root { --pad: 1rem; --edge: 24px; }
  html { scroll-padding-top: calc(var(--edge) + 6.5rem); }
}
@media (min-width: 1000px) {
  .text-2xl { font-size: 96px; line-height: 0.9375; }
}
@media (min-width: 1440px) {
  .hero__title { font-size: 128px; line-height: 0.9375; }
}

.skiplink { position: absolute; left: -9999px; }
.skiplink:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--paper); padding: 0.5rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Ruled box grid: gaps on a black background draw the 2px rules ---- */
.page {
  max-width: 1680px;
  margin: var(--edge);
  border: var(--rule) solid var(--line);
  background: var(--line);
  display: grid;
  gap: var(--rule);
}
@media (min-width: 1728px) { .page { margin: var(--edge) auto; } }

main, main > section:not(.box) { display: grid; gap: var(--rule); background: var(--line); }

.box {
  background: var(--paper);
  padding: var(--pad);
  min-width: 0;
}
.box--head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.grid { display: grid; gap: var(--rule); background: var(--line); }
@media (min-width: 700px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--values { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .grid--values { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1440px) {
  .grid--values { grid-template-columns: repeat(5, 1fr); }
}

/* Header row: the wordmark sits in its own box, as on markthalle-luzern.ch */
/* Pinned while scrolling, as on markthalle-luzern.ch. The shadow redraws the
   frame's top rule once that has scrolled away, and ::before blanks out the
   margin above so content doesn't show through it. */
.site-head {
  position: sticky;
  top: var(--edge);
  z-index: 5;
  grid-template-columns: auto 1fr;
  box-shadow: 0 0 0 var(--rule) var(--line);
}
.site-head::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--rule));
  right: calc(-1 * var(--rule));
  bottom: calc(100% + var(--rule));
  height: var(--edge);
  background: var(--paper);
}
.site-head .box { display: flex; align-items: center; }
.wordmark { font-size: 24px; line-height: 1.0416; color: var(--accent); }
a.wordmark:hover { color: var(--ink); }
.kicker { font-size: inherit; }
@media (min-width: 700px) {
  .wordmark { font-size: 42px; line-height: 0.9523; }
  .site-head { grid-template-columns: 1fr 1fr; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: calc(104px + 1.5rem); /* clears the badge */
  padding-bottom: 1.5rem;
}
/* Slogan: the same three lines on every screen size. On small screens the
   type scales with the viewport so the longest line fills the width. */
.hero__title span { display: block; white-space: nowrap; }
@media (max-width: 999px) {
  .hero__title { font-size: calc((100vw - 52px) / 8.6); line-height: 0.9375; }
}
@media (min-width: 700px) and (max-width: 999px) {
  .hero__title { font-size: calc((100vw - 84px) / 8.6); }
}

.badge {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  transform: rotate(8deg);
}
.badge svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--accent); }
.badge span { position: relative; color: var(--paper); font-size: 14px; line-height: 1; text-align: center; }
@media (min-width: 700px) {
  .badge { width: 150px; height: 150px; top: 1.5rem; right: 1.5rem; }
  .badge span { font-size: 20px; }
  .hero { padding-top: calc(150px + 3rem); }
}

/* Lead text across the full width, sized as on markthalle-luzern.ch */
.intro { padding-bottom: 1.5rem; }
.intro p { font-size: 28px; line-height: 1.0714; }
@media (min-width: 700px) { .intro p { font-size: 48px; line-height: 0.9583; } }

/* ---- Link tiles ---- */
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 3.5rem;
  padding-bottom: 1.25rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
/* Rust red with white text, as on markthalle-luzern.ch. The rules are grid
   gaps, so the shadow paints the tile's edge over them in the same colour. */
.tile:hover { z-index: 1; background: var(--accent); color: #fff; box-shadow: 0 0 0 var(--rule) var(--accent); }
.tile__text { max-width: 40ch; margin-top: 0.5rem; }
.tile .arrow {
  position: absolute;
  right: var(--pad);
  bottom: var(--pad);
  width: 32px;
  transition: transform 0.15s;
}
.tile:hover .arrow { transform: translateX(4px); }
@media (min-width: 700px) {
  .tile { min-height: 15rem; padding-right: 5rem; }
  .tile .arrow { width: 44px; }
}
.tile--accent { color: var(--accent); }
.tile--row { min-height: 0; flex-direction: column; }
@media (min-width: 700px) {
  .tile--row { min-height: 0; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 2rem; }
  .tile--row .arrow { bottom: 50%; transform: translateY(50%); width: 36px; }
  .tile--row:hover .arrow { transform: translate(4px, 50%); }
  .tile--row .label { white-space: nowrap; }
}

/* ---- Subpages ---- */
.page-intro { display: flex; flex-direction: column; gap: 1.5rem; padding-bottom: 1.5rem; }
.page-intro h1 { max-width: 16ch; padding-top: 2rem; }
.page-intro .lead { max-width: 40ch; }
.page-intro--tall { min-height: 50vh; justify-content: flex-end; }

.value { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 1.5rem; }
.value__title { font-size: 32px; line-height: 1; }
@media (min-width: 700px) { .value__title { font-size: 42px; line-height: 0.9523; } }

/* Arrow icons: drawn with a 2px stroke to match the rules */
.arrow { display: block; height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; }
.arrow--inline { display: inline-block; width: 0.6em; vertical-align: -0.02em; }

.contact { display: flex; align-items: flex-start; gap: 1rem; }
.contact__photo { flex: none; width: 112px; height: 112px; border-radius: 50%; object-fit: cover; }
@media (min-width: 700px) {
  .contact { gap: 1.5rem; }
  .contact__photo { width: 160px; height: 160px; }
}
.contact p + p { margin-top: 0.25em; }
.box > h2.text-lg + p { margin-top: 1rem; }
.contact .text-lg { margin-top: 0.5rem; margin-bottom: 0.25rem; }

/* ---- Buttons ---- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  align-self: flex-start;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 0.5em 0.75em 0.45em;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .button--dark:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--dark { background: var(--ink); color: var(--paper); }
.button--submit { justify-self: start; font-size: 32px; line-height: 1; padding: 0.4em 0.9em 0.35em; }
@media (min-width: 700px) { .button--submit { font-size: 42px; } }

/* ---- Form ---- */
.form-section { display: grid; gap: 1.5rem; padding-bottom: 1.5rem; }
.form { display: grid; gap: 1.25rem; max-width: 960px; }
.form__row { display: grid; gap: 1.25rem; }
@media (min-width: 700px) { .form__row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 0.4rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label:not(.dropzone):not(.choice), .field legend { font-size: 14px; line-height: 1.0714; padding: 0; margin-bottom: 0.4rem; }
.field legend { float: left; width: 100%; }
.field legend + * { clear: both; }
.hint { color: var(--muted); font-size: 14px; }

input[type="text"], input[type="email"], input[type="tel"], textarea {
  width: 100%;
  border: var(--rule) solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 24px;
  line-height: 1.0416;
  padding: 0.55em 0.5em 0.45em;
  -webkit-appearance: none;
  appearance: none;
}
textarea { resize: vertical; min-height: 8em; line-height: 1.15; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choices--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
@media (min-width: 700px) { .choices--grid { grid-template-columns: repeat(4, 1fr); } }

.choice { position: relative; display: flex; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices .choice span {
  flex: 1;
  border: var(--rule) solid var(--ink);
  background: #fff;
  padding: 0.55em 0.6em 0.45em;
  font-size: 20px;
  line-height: 1;
}
.choices .choice input:checked + span { background: var(--ink); color: var(--paper); }
.choices .choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.choices .choice:hover span { background: var(--accent); border-color: var(--accent); color: #fff; }

.choice--consent { gap: 0.75rem; align-items: flex-start; font-size: 20px; line-height: 1.1; }
.choice--consent input { position: static; opacity: 1; width: auto; height: auto; }
.choice--consent input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  border: var(--rule) solid var(--ink);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.choice--consent input:checked::after { content: "✓"; font-size: 1.1rem; line-height: 1; }
/* In running text the link needs its underline to be recognisable */
.choice--consent a { text-decoration: underline; }

.dropzone {
  display: grid;
  gap: 0.5rem;
  border: var(--rule) dashed var(--ink);
  background: #fff;
  padding: 1.25rem 1rem;
  cursor: pointer;
  text-align: center;
  font-size: 20px;
  line-height: 1.1;
}
.dropzone__hint { font-size: 14px; line-height: 1.2; color: var(--muted); max-width: 52ch; margin: 0 auto; }
.dropzone__file:empty { display: none; }
.dropzone__file { color: var(--accent); }
.dropzone.is-over { border-color: var(--accent); background: #fbf2ef; }
#f-datei:focus-visible + * , .dropzone:focus-within { outline: 3px solid var(--accent); }

.field--error input, .field--error textarea, .field--error .choice span, .field--error .dropzone { border-color: var(--accent); }
.form-error { color: var(--accent); font-size: 14px; line-height: 1.0714; }
.form-alert { border: var(--rule) solid var(--accent); color: var(--ink); background: #fbf2ef; padding: 0.75rem; font-size: 20px; line-height: 1.1; }

.hp { position: absolute !important; left: -9999px; }

.form__submit { display: grid; gap: 1rem; }
.button--submit[disabled] { cursor: progress; background: var(--ink); color: var(--paper); }
.submit-status { display: grid; gap: 0.5rem; max-width: 30rem; }
.submit-status[hidden] { display: none; }
.submit-status p { font-size: 20px; line-height: 1.1; }
.progress { height: 10px; border: var(--rule) solid var(--ink); background: #fff; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
/* Indeterminate stripe while the server stores the submission */
.progress.is-waiting span {
  width: 100%;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, #d99a8d 12px 24px);
  background-size: 34px 100%;
  animation: progress-stripes 0.8s linear infinite;
}
@keyframes progress-stripes { to { background-position: 34px 0; } }

/* ---- Prose (Impressum) ---- */
.prose { max-width: none; padding-bottom: 2rem; }
.prose > * { max-width: 48rem; }
.prose h2 { margin-bottom: 1.25rem; }
.prose h3 { font-size: 24px; line-height: 1.0416; margin-top: 1.75rem; margin-bottom: 0.5rem; }
.prose p, .prose li { font-size: 18px; line-height: 1.25; }
.prose ul { margin: 0.5em 0 0; padding-left: 1.2em; }
.prose li + li { margin-top: 0.25em; }
.prose ul + p { margin-top: 0.75em; }
.prose .label { font-size: 14px; margin-bottom: 1rem; }
@media (min-width: 700px) { .prose p, .prose li { font-size: 20px; } }

/* ---- Footer ---- */
.footer .box { display: flex; flex-direction: column; gap: 0.35rem; padding-bottom: 1.25rem; }

/* Footer "Cookie-Einstellungen": a button that looks like the links around it */
.link-button { align-self: flex-start; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-underline-offset: 0.12em; text-decoration-thickness: 1px; }
.link-button:hover { color: var(--accent); }
.link-button[hidden] { display: none; }

/* ---- Cookie consent ---- */
.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 20;
  max-width: 44rem;
  border: var(--rule) solid var(--line);
  background: var(--paper);
  padding: var(--pad);
  display: grid;
  gap: 1rem;
  font-size: 18px;
  line-height: 1.25;
}
.consent[hidden] { display: none; }
.consent a { text-decoration: underline; }
.consent__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.consent .button { font-size: 20px; }
@media (min-width: 700px) {
  .consent { left: 24px; bottom: 24px; right: auto; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
