/* ============================================================
   Matthias Brandstetter — personal site
   Restructured from the bundled export; visual result unchanged.
   One content element per viewport, big gaps, bilingual EN/DE,
   light/dark palette, scroll-aware chrome. Framework-free.
   Palette tokens live in CSS custom properties, switched via the
   data-palette attribute on .root; the background is additionally
   tinted by scroll progress in js/main.js.
   ============================================================ */

/* Work Sans, self-hosted (SIL OFL 1.1 — see fonts/LICENSE-OFL.txt) — avoids a
   render-blocking third-party request and a Google Fonts IP transfer. Latin
   subset (U+0000-00FF) covers German umlauts/ß. */
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/work-sans-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/work-sans-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Work Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/work-sans-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* buttons styled as text links inherit type + reset chrome */
button {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

::selection { background: #c65b2e; color: #fff; }

/* visible keyboard focus (mouse users unaffected) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- palette tokens (default B = light) ------------------------------ */
.root,
.root[data-palette="B"] {
  --bg: #F6F6F5;  --bg-a: rgba(246,246,245,0.72);
  --tile: #EDEDEB; --ink: #1F1E1C; --muted: #6E6C68; --faint: #ADACA7;
  --line: #DEDEDA; --accent: #A64D28;
  --serif: 'Work Sans', sans-serif;
  --sans:  'Work Sans', sans-serif;
}
.root[data-palette="A"] {
  --bg: #FAFAF8;  --bg-a: rgba(250,250,248,0.72);
  --tile: #F2F1ED; --ink: #26231F; --muted: #6B655D; --faint: #ADA89F;
  --line: #E3E1DB; --accent: #B4552D;
}
.root[data-palette="C"] {
  --bg: #1C1916;  --bg-a: rgba(28,25,22,0.72);
  --tile: #26221E; --ink: #F2EDE6; --muted: #B6AFA4; --faint: #8A8279;
  --line: #3A342E; --accent: #D8724A;
}

.root {
  font-family: var(--sans);
  overflow-x: hidden;
}
.page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  transition: color .3s;
}

/* ---- header ---------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: transform .4s cubic-bezier(.22,.61,.36,1),
              background .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled {
  background: var(--bg-a);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--line);
}
.site-header.is-hidden { transform: translateY(-100%); }

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.monogram {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color .2s;
}
.monogram:hover { color: var(--ink); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.header-controls .sep { color: var(--faint); }
.text-btn {
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.text-btn:hover { color: var(--ink); }

/* ---- layout ---------------------------------------------------------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
}
section { scroll-margin-top: 6rem; }

.moment-name {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0;
}
.name-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
}
.subline {
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 1.75rem 0 0;
}

.moment-about {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: clamp(9rem, 18vh, 15rem) 0;
}
.about-text {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  max-width: 55ch;
  text-wrap: pretty;
}

/* ---- photos ---------------------------------------------------------- */
.moment-photos { padding: clamp(9rem, 18vh, 15rem) 0; }
.photos-lead {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 clamp(4rem, 10vh, 8rem);
}
.gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(120px, 18vh, 180px);
}
.gallery figure {
  margin: 0;
  max-width: 100%;
}
.gallery img {
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--tile);
}
.provenance {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--faint);
  margin: clamp(4rem, 9vh, 7rem) 0 0;
}

/* mobile: photos go full width (matches the export's isMobile branch) */
@media (max-width: 640px) {
  .gallery figure { width: 100% !important; align-self: stretch !important; }
}

/* ---- contact --------------------------------------------------------- */
.moment-contact {
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: clamp(9rem, 18vh, 15rem) 0;
}
.contact-inner {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.contact-lead {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}
.contact-link {
  font-family: var(--sans);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--accent);
  width: fit-content;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color .2s;
}
.contact-link:hover { border-bottom-color: var(--accent); }

/* ---- footer ---------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.footer-inner .copyright { color: var(--faint); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--muted); cursor: pointer; transition: color .2s; }
.footer-links a:hover { color: var(--ink); }

/* ---- legal overlay --------------------------------------------------- */
.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
}
.legal-overlay[hidden] { display: none; }
.legal-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) clamp(1.5rem, 5vw, 3rem) 6rem;
}
.legal-back {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}
.legal-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.01em;
  margin: 2.5rem 0 2rem;
  color: var(--ink);
}
.legal-blocks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 55ch;
}
.legal-blocks h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.legal-blocks p {
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  white-space: pre-line;
}
.legal-blocks img { display: block; }

/* ---- consent banner -------------------------------------------------- */
.consent {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--tile);
  border-top: 1px solid var(--line);
}
.consent[hidden] { display: none; }
.consent-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.consent-text {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}
.consent-text .link { color: var(--accent); cursor: pointer; }
.consent-actions {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
}
.consent-actions .decline { color: var(--muted); cursor: pointer; transition: color .2s; }
.consent-actions .decline:hover { color: var(--ink); }
.consent-actions .accept {
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
}

/* ---- reduced motion -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
