/* nicobecher.com — Stylesheet
   Tokens: Warm-Schwarz / Off-White / Gold. Fonts self-hosted (OFL). */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --ink: #0e0c0a;
  --ink-soft: #141210;
  --paper: #efe8dc;
  --paper-deep: #e6dccb;
  --gold: #c9a86a;
  --text: #2a2622;
  --muted: #635b4f; /* WCAG AA (>=4.9:1) auch auf paper-deep */
  --pill-bg: rgba(255, 255, 255, 0.93);
  --pill-shadow: 0 10px 28px rgba(20, 14, 6, 0.16);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.2, 0.5, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Hero ---------- */

.scene { position: relative; }

.hero {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: var(--ink);
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
  transform-origin: 50% 30%;
  will-change: transform, opacity;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
}
/* Vorab geblurte Kopie: Blur ist statisch, nur die Deckkraft wird animiert
   (keine Live-Blur-Animation -> laeuft auf der GPU sauber). */
.hero-media .blurred {
  position: absolute; inset: -20px;
  width: calc(100% + 40px); height: calc(100% + 40px);
  filter: blur(14px) brightness(0.8);
  opacity: 0;
}
.hero-vignette {
  position: absolute; inset: 0;
  box-shadow: inset 0 0 22vmin 6vmin rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.hero-fade {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 12, 10, 0) 0%,
    rgba(20, 18, 16, 0.35) 42%,
    rgba(239, 232, 220, 0.92) 88%,
    var(--paper) 100%
  );
}

.hero-name {
  position: absolute;
  left: 0; right: 0;
  bottom: 24svh;
  text-align: center;
  color: #faf6ef;
  z-index: 2;
}
.hero-name h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 9vw, 3.2rem);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 18px rgba(0, 0, 0, 0.5);
}
.hero-name .rule {
  width: 38px; height: 2px;
  background: var(--gold);
  margin: 0.9rem auto 0;
  border-radius: 2px;
}

.hero-legal {
  position: absolute;
  left: 1.25rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.4rem);
  z-index: 3;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.hero-legal {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 2px 10px rgba(0, 0, 0, 0.4);
}
.hero-legal a {
  color: rgba(250, 246, 239, 0.88);
  text-decoration: none;
}
.hero-legal a:hover { color: rgba(250, 246, 239, 0.95); }
.hero-legal .dot { color: rgba(250, 246, 239, 0.4); margin: 0 0.35em; }

.swipe-cue {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem);
  transform: translateX(-50%);
  z-index: 3;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: #faf6ef;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: cue-float 2.6s ease-in-out infinite;
}
.swipe-cue svg { width: 22px; height: 22px; }
@keyframes cue-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* Peek: der erste Pill ragt am unteren Hero-Rand an (Variante A, kein Gate) */
.peek {
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
}

/* ---------- Linkbereich ---------- */

.links {
  position: relative;
  z-index: 2;
  background: linear-gradient(to bottom, var(--paper) 0%, var(--paper-deep) 100%);
  padding: 3.2rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
  margin-top: -1px;
}
.links-inner {
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pill {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--pill-bg);
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  text-decoration: none;
  box-shadow: var(--pill-shadow);
  border: 0.5px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.45s var(--ease),
    transform 0.5s var(--spring),
    box-shadow 0.25s var(--ease);
}
.pill.in {
  opacity: 1;
  transform: translateY(0);
}
.pill:hover {
  box-shadow: 0 14px 34px rgba(20, 14, 6, 0.22);
  transform: translateY(-2px);
}
.pill:active { transform: translateY(0) scale(0.985); }

.pill .icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  color: #7a6a4a;
}
.pill .label {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.pill .label strong {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}
.pill .label small {
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- Projekte: aufklappbare Gruppe ---------- */

.pill-group { display: flex; flex-direction: column; }

.pill-toggle {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.pill-toggle .chev {
  width: 18px; height: 18px;
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.3s var(--spring);
}
.pill-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.pill-toggle[aria-expanded="true"] {
  box-shadow: 0 14px 34px rgba(20, 14, 6, 0.22);
}

.sub-links {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.4s var(--spring), visibility 0s linear 0.4s;
}
.sub-links.open {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.4s var(--spring);
}
.sub-links-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 0;
}
.sub-links .pill.sub {
  margin-left: 1.4rem;
  padding: 0.7rem 1.2rem;
  background: rgba(255, 255, 255, 0.78);
  opacity: 1;
  transform: none;
}
.sub-links .pill.sub:first-child { margin-top: 0.65rem; }
.sub-links .pill.sub .icon { width: 19px; height: 19px; }
.sub-links .pill.sub .label strong { font-size: 0.94rem; }
.sub-links .pill.sub .label small { font-size: 0.72rem; }

.ai-note {
  text-align: center;
  margin-top: 0.8rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.ai-note a { color: inherit; }

.links-legal {
  text-align: center;
  margin-top: 2.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.links-legal a { color: var(--muted); text-decoration: none; }
.links-legal a:hover { color: var(--text); text-decoration: underline; }
.links-legal .dot { margin: 0 0.4em; opacity: 0.6; }

/* ---------- Netzwerk-FAB + Popover ---------- */

.fab {
  position: fixed;
  right: 1.1rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 1.1rem);
  z-index: 20;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,0.34); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 22px; height: 22px; }

.popover {
  position: fixed;
  right: 1.1rem;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4.9rem);
  z-index: 21;
  width: 196px;
  background: #fdfbf6;
  border-radius: 18px;
  padding: 0.4rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.32);
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.25s var(--spring);
}
.popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.popover a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text);
}
.popover a:hover, .popover a:focus-visible { background: #f0ebe1; }
.popover a svg { width: 20px; height: 20px; flex: 0 0 auto; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(10, 9, 8, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.scrim.open { opacity: 1; pointer-events: auto; }

/* ---------- Unterseiten (Impressum / Datenschutz) ---------- */

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}
.page header { margin-bottom: 2.5rem; }
.page h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.page h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.25rem;
  margin: 2.2rem 0 0.6rem;
}
.page p, .page address { margin-bottom: 0.9rem; font-style: normal; }
.page a { color: #8a6a2e; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--muted) !important;
  margin-bottom: 2rem;
}
.back:hover { color: var(--text) !important; }
.page footer {
  margin-top: 4rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.page footer a { color: var(--muted); }

/* ---------- Tablet / Desktop: Split-Komposition, kein Gate ---------- */

@media (min-width: 900px) {
  .scene { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

  .hero {
    position: relative;
    height: 100vh;
    grid-column: 1;
  }
  .hero-fade {
    background: linear-gradient(
      to right,
      rgba(14, 12, 10, 0) 55%,
      rgba(239, 232, 220, 0.55) 88%,
      var(--paper) 100%
    );
    opacity: 1 !important;
  }
  .hero-name {
    text-align: left;
    left: clamp(2.5rem, 6vw, 5rem);
    right: auto;
    bottom: clamp(3rem, 9vh, 6rem);
  }
  .hero-name .rule { margin-left: 0; }
  .swipe-cue, .peek { display: none; }
  .hero-legal { left: clamp(2.5rem, 6vw, 5rem); bottom: 1.5rem; }

  .links {
    grid-column: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, var(--paper) 0%, var(--paper-deep) 100%);
    padding: 4rem clamp(2.5rem, 6vw, 6rem);
  }
  .links-inner { width: 100%; max-width: 440px; gap: 1rem; }
  .pill { opacity: 1; transform: none; }
  .pill { padding: 1rem 1.6rem; }

  .fab { right: 2rem; bottom: 2rem; }
  .popover { right: 2rem; bottom: 5.9rem; }
}

/* ---------- Reduced Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .swipe-cue { animation: none; }
  .pill, .popover, .fab, .scrim, .hero-media, .hero-fade, .peek {
    transition: none !important;
  }
  .pill { opacity: 1; transform: none; }
}
