@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #121417;
  --bg-2: #1a1d22;
  --fg: #f2ede4;
  --muted: #9a978f;
  --accent: #3d5afe;
  --accent-ink: #ffffff;
  --line: rgba(242, 237, 228, 0.14);
  --gutter: clamp(16px, 5vw, 72px);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin: 0; }
p { margin: 0; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
svg polyline { fill: none; stroke: currentColor; stroke-width: 14; stroke-linecap: square; stroke-linejoin: miter; }

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

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.9rem var(--gutter);
  background: linear-gradient(to bottom, rgba(18, 20, 23, 0.92), rgba(18, 20, 23, 0));
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-mark { display: block; width: 28px; height: 28px; color: var(--fg); }
.nav-mark svg { display: block; width: 100%; height: 100%; }
.nav-links { display: flex; gap: 1.25rem; margin-left: auto; font-size: 0.95rem; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--fg); }
.cart-button {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.9rem; cursor: pointer; font-size: 0.95rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.cart-button:hover { border-color: var(--fg); }
.cart-count {
  min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; font-weight: 600;
  display: inline-grid; place-items: center;
}
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: grid; align-items: end;
  padding: 7rem var(--gutter) clamp(2rem, 6vh, 5rem);
}
.hero-z {
  position: absolute; right: -6vw; top: 50%; transform: translateY(-54%);
  width: min(78vh, 62vw); height: auto; color: var(--fg); opacity: 0.95;
}
.hero-z polyline { stroke-width: 11; }
@media (max-width: 720px) {
  .hero-z { right: -20vw; width: 110vw; top: 38%; opacity: 0.35; }
}
.hero-text { position: relative; max-width: 42rem; display: grid; gap: 1.5rem; }
.hero h1 { font-size: clamp(2.6rem, 7.2vw, 6.4rem); font-weight: 600; letter-spacing: -0.045em; line-height: 0.96; }
.lede { font-size: clamp(1.05rem, 1.4vw, 1.3rem); color: var(--muted); max-width: 36rem; font-weight: 300; }

.button {
  display: inline-block; width: fit-content;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: 999px; padding: 0.85rem 1.5rem;
  font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.12); }
.button:disabled { opacity: 0.5; cursor: wait; }

/* Das Z zeichnet sich beim Laden einmal. Danach bleibt alles still. */
@media (prefers-reduced-motion: no-preference) {
  .hero-z polyline { stroke-dasharray: 360; stroke-dashoffset: 360; animation: draw 1.6s cubic-bezier(.6,0,.2,1) 0.2s forwards; }
  .hero-text { opacity: 0; transform: translateY(12px); animation: rise 0.8s ease 1.2s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---------- Sektionen ---------- */
.section {
  padding: clamp(4rem, 10vh, 8rem) var(--gutter);
  border-top: 1px solid var(--line);
  display: grid; gap: 2.5rem 4rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .section { grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); }
  .section-head { position: sticky; top: 6rem; align-self: start; }
}
.section-head { display: grid; gap: 1rem; }
.section h2 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); }
.section-head p { color: var(--muted); max-width: 26rem; }

/* Leistungen: eine Liste mit grossen Titeln, getrennt durch Linien */
.services li { padding: 1.75rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.services li:first-child { border-top: 0; padding-top: 0; }
.services h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); font-weight: 500; }
.services p { color: var(--muted); max-width: 40rem; }

/* Team */
.team { display: grid; gap: 2.5rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.team li { display: grid; gap: 0.9rem; align-content: start; min-width: 0; }
.avatar {
  aspect-ratio: 4 / 5; display: grid; place-items: center;
  background: var(--bg-2); color: var(--fg);
  font-size: 2.4rem; font-weight: 600; letter-spacing: -0.04em;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 82% 100%, 0 100%);
  overflow: hidden;
}
.avatar > * { grid-area: 1 / 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.75); }
.avatar:has(img:not([data-missing])) span { display: none; }
.team li:nth-child(2n) .avatar { background: var(--accent); color: var(--accent-ink); }
.team h3 { font-size: 1.25rem; font-weight: 500; }
.team .role { color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }
.team .bio { font-size: 0.98rem; hyphens: auto; }

/* Arbeitsweise: aufklappbar */
.practices details { border-top: 1px solid var(--line); }
.practices details:last-child { border-bottom: 1px solid var(--line); }
.practices summary {
  list-style: none; cursor: pointer; padding: 1.3rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em;
}
.practices summary::-webkit-details-marker { display: none; }
.practices summary::after {
  content: ""; flex: none; width: 0.9rem; height: 0.9rem;
  background:
    linear-gradient(var(--fg), var(--fg)) center / 100% 2px no-repeat,
    linear-gradient(var(--fg), var(--fg)) center / 2px 100% no-repeat;
  transition: transform 0.25s ease;
}
.practices details[open] summary::after { transform: rotate(45deg); }
.practices details p { color: var(--muted); max-width: 40rem; padding: 0 0 1.5rem; }

/* Shop */
.products { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.product { display: grid; gap: 0.75rem; align-content: start; }
.product-art { aspect-ratio: 1; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.product-art img { grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.product-art svg { grid-area: 1 / 1; }
.product-art:has(img:not([data-missing])) svg { display: none; }
.product-art svg { width: 62%; height: 62%; color: var(--fg); }
.product-art svg path, .product-art svg rect, .product-art svg circle, .product-art svg polyline, .product-art svg line {
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter;
}
.product-art svg .z { stroke: var(--accent); stroke-width: 3.5; }
.product h3 { font-size: 1.15rem; font-weight: 500; }
.product .variant { color: var(--muted); font-size: 0.92rem; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.25rem; }
.price { font-weight: 500; font-variant-numeric: tabular-nums; }
.add {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.45rem 0.9rem; cursor: pointer; font-size: 0.92rem;
}
.add:hover { border-color: var(--fg); }
.add.added { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Formulare */
.form { display: grid; gap: 1.5rem; max-width: 36rem; }
.form label { display: grid; gap: 0.4rem; font-size: 0.92rem; color: var(--muted); }
.form input, .form textarea {
  font: inherit; color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 0.6rem 0; resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--accent); }
.form :user-invalid { border-bottom-color: #ff6b6b; }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-status { font-size: 0.95rem; color: var(--muted); }
.form-status.ok { color: var(--fg); }
.form-status.error { color: #ff8a80; }
.small { font-size: 0.85rem; color: var(--muted); }

/* Footer */
.footer {
  padding: 4rem var(--gutter) 3rem; border-top: 1px solid var(--line);
  display: grid; gap: 1rem; color: var(--muted); font-size: 0.95rem;
}
.footer-z { width: 36px; height: 36px; color: var(--fg); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.footer-note { font-size: 0.85rem; opacity: 0.7; }

/* Warenkorb-Panel */
.cart-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.55); }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31;
  width: min(28rem, 100vw); overflow-y: auto;
  background: var(--bg-2); border-left: 1px solid var(--line);
  padding: 1.5rem var(--gutter) 2rem 1.5rem;
  display: grid; gap: 1.5rem; align-content: start;
}
@media (min-width: 720px) { .cart { padding: 1.5rem; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; }
.cart h2 { font-size: 1.6rem; }
.cart h3 { font-size: 1.2rem; font-weight: 500; }
.cart-close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0.25rem 0.5rem; }
.cart-items li { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.cart-items .name { font-weight: 500; }
.cart-items .variant { color: var(--muted); font-size: 0.9rem; grid-column: 1; }
.cart-items .line { grid-column: 2; grid-row: 1; font-variant-numeric: tabular-nums; }
.qty { grid-column: 2; grid-row: 2; display: inline-flex; align-items: center; gap: 0.5rem; justify-self: end; }
.qty button { width: 1.7rem; height: 1.7rem; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; }
.qty button:hover { border-color: var(--fg); }
.cart-empty { color: var(--muted); }
.cart-total { display: flex; justify-content: space-between; padding-top: 0.9rem; border-top: 1px solid var(--fg); font-size: 1.1rem; }
.cart-form { max-width: none; }
.cart-done { display: grid; gap: 1rem; }
