/* ============================================================
   Cosmatae — Design System
   Premium · Warm · Minimal · Editorial
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Palette */
  --cream:        #F5EFF5;
  --off-white:    #FBF8FC;
  --paper:        #FFFFFF;
  --champagne:    #7E5890;
  --champagne-dk: #5E3A6E;
  --copper:       #4C3A59;
  --rose:         #C9A2D4;
  --ink:          #2A2230;
  --surface-dark: #4E3C5E;
  --ink-soft:     #5B5266;
  --line:         #E6D9EA;
  --line-soft:    #F0E6F3;

  /* Type */
  --serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --sans:  "DM Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale */
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-sm: 6px;
  --radius:    14px;
  --radius-lg: 22px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(42, 34, 48, 0.05), 0 2px 8px rgba(42, 34, 48, 0.05);
  --shadow:    0 4px 12px rgba(42, 34, 48, 0.07), 0 18px 40px -12px rgba(42, 34, 48, 0.12);
  --shadow-lg: 0 30px 80px -20px rgba(42, 34, 48, 0.20);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font: inherit; color: inherit; }

/* Subtle paper grain for warmth */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16 0 0 0 0 0.14 0 0 0 0 0.12 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h4 { font-size: 1.2rem; }
p  { margin: 0; text-wrap: pretty; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}
.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 60ch;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}
section { position: relative; }
.section-pad { padding-block: clamp(64px, 9vw, 130px); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: transform .35s var(--ease), background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
  white-space: nowrap;
}
.btn .arrow {
  width: 16px; height: 16px;
  transition: transform .35s var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  background: var(--surface-dark);
  color: var(--off-white);
}
.btn-primary:hover {
  background: var(--copper);
  box-shadow: 0 12px 30px -10px rgba(76, 58, 89, 0.5);
}
.btn-ghost {
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 13px 25px;
}
.btn-ghost:hover { background: var(--surface-dark); color: var(--off-white); }
.btn-soft {
  background: var(--off-white);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-soft:hover { border-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(78, 60, 94, 0.94);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: rgba(255, 255, 255, 0.14); background: rgba(70, 53, 86, 0.97); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
  gap: 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--off-white);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.brand .mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
}
.brand .mark svg { width: 100%; height: 100%; }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0.92rem;
}
.nav-links a {
  position: relative;
  padding-block: 6px;
  color: rgba(255, 255, 255, 0.78);
  transition: color .25s var(--ease);
}
.nav-links a:hover { color: #fff; }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.85);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links a[aria-current="page"]::after { background: var(--rose); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hamburger {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  align-items: center;
  justify-content: center;
}
.hamburger svg { width: 18px; height: 18px; }

/* Header-scoped overrides (dark plum bar) */
.site-header .btn-primary {
  background: transparent;
  color: var(--off-white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}
.site-header .btn-primary:hover {
  background: var(--off-white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--off-white);
}
.site-header .hamburger {
  color: var(--off-white);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 60;
  transform: translateY(-100%);
  /* Robust hide: even if a renderer ignores the transform (some embedded
     webviews / preview panes), visibility + pointer-events keep the panel
     hidden and non-interactive until it is opened. */
  visibility: hidden;
  pointer-events: none;
  transition: transform .5s var(--ease), visibility .5s var(--ease);
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 40px;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; pointer-events: auto; }
.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  filter: brightness(0) invert(0.96);
}
.mobile-menu .brand-logo { filter: none; }
.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
}
.mobile-menu nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  margin-block: 40px;
}
.mobile-menu nav a {
  font-family: var(--serif);
  font-size: 2.2rem;
  padding-block: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-menu nav a span:last-child {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--champagne-dk);
  letter-spacing: 0.1em;
}
.mobile-menu-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.close-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
}

@media (max-width: 880px) {
  .nav-links, .nav-cta .btn { display: none; }
  .hamburger { display: inline-flex; }
}

/* ---------- Image placeholders ---------- */
.ph {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #9A78AC 0%, #6E4E7E 45%, #4C3A59 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  color: var(--ink);
  isolation: isolate;
}
.ph > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.ph:has(> img)::before,
.ph:has(> img)::after { display: none; }
.ph::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0,
    rgba(255,255,255,0.06) 2px,
    transparent 2px,
    transparent 16px
  );
  z-index: 1;
}
.ph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 25%, rgba(255,255,255,0.4) 0%, transparent 55%);
  z-index: 1;
}
.ph-label {
  position: relative;
  z-index: 2;
  margin: 14px;
  padding: 6px 12px;
  background: rgba(42, 34, 48, 0.78);
  color: var(--off-white);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  display: inline-block;
  white-space: nowrap;
}
.ph.tone-rose { background: linear-gradient(135deg, #E9D4EF 0%, #C9A2D4 60%, #A77FB8 100%); }
.ph.tone-ink  { background: linear-gradient(135deg, #4C3A59 0%, #2A2230 100%); color: var(--off-white); }
.ph.tone-cream{ background: linear-gradient(135deg, #F7F0F8 0%, #E6D9EA 100%); }

/* ---------- Cards ---------- */
.card {
  background: var(--off-white);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--champagne);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface-dark);
  color: var(--off-white);
  padding-block: 52px 32px;
  position: relative;
  z-index: 1;
}
.site-footer .container { display: grid; gap: 60px; }
/* CTA-Banner und Footer teilen dieselbe dunkle Farbe — doppeltes Padding kollabieren,
   wenn das CTA-Banner die letzte Sektion vor dem Footer ist */
main:has(> .cta-banner:last-child) ~ .site-footer { padding-top: 0; }
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: baseline;
  padding-top: 48px;
  border-top: 1px solid rgba(255,255,255,0.16);
}
body[data-page="startseite"] .footer-top,
body[data-page="kontakt"] .footer-top {
  padding-top: 0;
  border-top: none;
}
.footer-top h4 {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 18px;
  font-weight: 500;
}
.footer-top p, .footer-top a, .footer-top li {
  color: #C8BAD4;
  font-size: 0.92rem;
  line-height: 1.8;
}
.footer-top a:hover { color: var(--rose); }
.footer-top ul { list-style: none; padding: 0; margin: 0; }
.footer-brand .brand-block {
  font-family: var(--serif);
  font-size: 1.8rem;
  letter-spacing: 0.28em;
  color: var(--off-white);
  margin-bottom: 18px;
}
.footer-logo {
  display: block;
  width: 188px;
  height: auto;
  margin-bottom: 22px;
  filter: brightness(0) invert(0.96);
}
.footer-brand p { max-width: 32ch; }
.socials { display: flex; gap: 12px; margin-top: 22px; }
.socials a {
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.socials a:hover { background: var(--rose); border-color: var(--rose); color: var(--ink); }
.socials svg { width: 16px; height: 16px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  color: #9A938A;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom .legal { display: flex; gap: 24px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 18px;
  left: 18px;
  right: 18px;
  max-width: 480px;
  margin-inline: auto;
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateY(140%);
  transition: transform .6s var(--ease);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { font-size: 0.85rem; line-height: 1.55; }
.cookie-banner .row { display: flex; gap: 10px; }
.cookie-banner .btn { padding: 10px 18px; font-size: 0.82rem; flex: 1; justify-content: center; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.field input,
.field textarea,
.field select {
  background: var(--off-white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  outline: none;
  transition: border-color .25s var(--ease), background .25s var(--ease);
  font-size: 0.98rem;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--copper);
  background: var(--paper);
}
.field textarea { resize: vertical; min-height: 130px; }
.field .err {
  color: #B0492A;
  font-size: 0.8rem;
  margin-top: 2px;
  display: none;
}
.field.invalid input,
.field.invalid textarea,
.field.invalid select { border-color: #B0492A; }
.field.invalid .err { display: block; }

/* ---------- Utility ---------- */
.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}
.muted { color: var(--ink-soft); }
.spacer-lg { height: clamp(40px, 6vw, 80px); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(196, 168, 130, 0.16);
  color: var(--copper);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-weight: 500;
}

@media (max-width: 880px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
