/* ============================================================
   Atelier Sandkühler — styles.css
   ============================================================ */

/* ---------- Schriften (lokal gehostet, keine Verbindung zu Google) ---------- */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Farben */
  --bg:          #F5F1EA;   /* warmes Off-White */
  --bg-deep:     #EDE6D9;   /* leichter Tiefenton für Karten/Sektionen */
  --wood:        #8B6F4E;   /* Holzbraun */
  --clay:        #A89078;   /* Lehmton */
  --sage:        #7A8470;   /* Salbei */
  --forest:      #3D4A3A;   /* dunkles Waldgrün */
  --text:        #2A2622;   /* tiefes warmes Anthrazit */
  --text-muted:  #6B6259;
  --line:        #D9D0C2;

  /* Schriften */
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Maße */
  --measure: 38rem;        /* Lese-Breite */
  --measure-wide: 64rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 10vw, 8rem);
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }

/* ---------- Basis ---------- */

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.7;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- Typografie ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
h4 { font-size: 1.05rem; font-family: var(--sans); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

p { margin: 0 0 1.2em; }

p + p { margin-top: -0.2em; }

a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease, color 200ms ease;
}
a:hover { border-color: var(--forest); color: var(--forest); }

::selection { background: var(--clay); color: var(--bg); }

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.prose {
  max-width: var(--measure);
}

section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.divider {
  width: 3rem;
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 2.5rem 0;
}

/* ---------- Header ---------- */

.site-header {
  padding: 1.6rem var(--gutter);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.brand a {
  border: 0;
  display: block;
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--text);
}
.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 0.15rem;
}

.site-nav {
  display: flex;
  gap: 1.6rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  font-size: 0.9rem;
  border: 0;
  color: var(--text-muted);
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--forest); }

/* ---------- Mobil-Navigation ---------- */

.nav-toggle {
  display: none;
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 1rem;
  height: 1px;
  background: var(--text-muted);
  transition: transform 250ms ease, opacity 200ms ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 779px) {
  .site-header { align-items: center; }
  /* Knopf liegt über dem geöffneten Menü, damit es sich wieder schließen lässt */
  .nav-toggle { display: inline-flex; z-index: 110; background: var(--bg); }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms;
    z-index: 100;
  }
  .site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 300ms ease, transform 300ms ease, visibility 0s;
  }
  .site-nav a { font-size: 1.4rem; }

  @media (prefers-reduced-motion: reduce) {
    .site-nav { transition: opacity 200ms ease, visibility 0s linear 200ms; }
    .site-nav.open { transition: opacity 200ms ease, visibility 0s; }
  }
}

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

.hero {
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  max-width: 22ch;
}
.hero .lead {
  font-family: var(--sans);
  font-size: clamp(1.05rem, 1.6vw, 1.18rem);
  color: var(--text-muted);
  max-width: 38ch;
  line-height: 1.6;
  margin-top: 1.5rem;
}

/* Säulen-Hero: Hauptsatz + Untertitel */
.hero-split h1 { max-width: 24ch; }
.hero-split .sub {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 50ch;
  margin-top: 1.2rem;
  line-height: 1.6;
}

/* ---------- Säulen-Karten ---------- */

.pillars {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 780px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
}

.pillar {
  background: var(--bg-deep);
  padding: clamp(1.8rem, 3vw, 2.4rem);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 600ms cubic-bezier(.22,.61,.36,1), background 400ms ease;
}
.pillar:hover { background: #E8DFCE; }
.pillar h2 {
  font-size: 1.5rem;
  margin: 0;
}
.pillar p {
  font-size: 0.97rem;
  color: var(--text);
  margin: 0;
}
.pillar .more {
  margin-top: auto;
  padding-top: 1.4rem;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--forest);
  border: 0;
}
.pillar a.pillar-link {
  position: absolute; inset: 0;
  border: 0;
}
.pillar { position: relative; }

/* ---------- Teaser-Block (Über mich auf Startseite) ---------- */

.teaser {
  max-width: var(--measure);
  margin: 0 auto;
}
.teaser .signature {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.4rem;
}

/* ---------- Listen ---------- */

ul.formats {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.formats li {
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
ul.formats li:last-child { border-bottom: 1px solid var(--line); }

ul.plain {
  list-style: none;
  padding: 0;
}
ul.plain li {
  padding-left: 1.2rem;
  position: relative;
  margin-bottom: 0.4rem;
}
ul.plain li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--clay);
}

/* ---------- Kontakt-Block ---------- */

.cta-block {
  background: var(--bg-deep);
  padding: clamp(2.2rem, 4vw, 3.4rem);
  text-align: left;
  border-radius: 2px;
  max-width: var(--measure);
  margin: 0 auto;
}
.cta-block p { margin-bottom: 1.4rem; }

.cta-link {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--forest);
  border-bottom: 1px solid var(--sage);
}

/* ---------- Formular ---------- */

form.kontakt-form {
  max-width: var(--measure);
  display: grid;
  gap: 1.2rem;
}
form.kontakt-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.35rem;
}
form.kontakt-form input,
form.kontakt-form select,
form.kontakt-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  border-radius: 2px;
  transition: border-color 200ms ease;
}
form.kontakt-form input:focus,
form.kontakt-form select:focus,
form.kontakt-form textarea:focus {
  outline: none;
  border-color: var(--sage);
}
form.kontakt-form textarea { min-height: 9rem; resize: vertical; }
form.kontakt-form button {
  justify-self: start;
  padding: 0.85rem 1.6rem;
  background: var(--forest);
  color: var(--bg);
  border-radius: 2px;
  letter-spacing: 0.03em;
  transition: background 200ms ease;
}
form.kontakt-form button:hover { background: var(--text); }
form.kontakt-form button:disabled { opacity: 0.6; cursor: wait; }
form.kontakt-form[hidden] { display: none; }

/* Unsichtbares Feld gegen Spam-Bots */
.hp-feld {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Rückmeldung nach dem Absenden */
.form-status {
  max-width: var(--measure);
  padding: 1.2rem 1.4rem;
  margin: 0 0 1.6rem;
  border-left: 2px solid var(--sage);
  background: var(--bg-deep);
  border-radius: 2px;
}
.form-status:focus { outline: none; }
.form-status.is-fehler { border-left-color: var(--wood); }

/* ---------- Zurück-Navigation ---------- */

.back-nav {
  padding: 0 var(--gutter) 0.75rem;
}
.back-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 0;
}
.back-nav a:hover { color: var(--forest); }

/* ---------- Nach-oben-Button ---------- */

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms, border-color 200ms ease;
  z-index: 40;
}
.back-to-top:hover { border-color: var(--forest); color: var(--forest); }
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 300ms ease, transform 300ms ease, visibility 0s, border-color 200ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity 200ms ease, visibility 0s linear 200ms; transform: none; }
  .back-to-top.visible { transition: opacity 200ms ease, visibility 0s; transform: none; }
}

/* ---------- Bilder / Atmosphäre ---------- */

section.flush {
  padding-top: 0;
  padding-bottom: 0;
}

.atmosphere {
  width: 100%;
  margin: 0;
  overflow: hidden;
}
.atmosphere img {
  width: 100%;
  height: clamp(20rem, 46vw, 34rem);
  object-fit: cover;
  object-position: center;
}

/* Für Bilder mit abweichendem Format (z. B. 4:3 statt panoramisch):
   ganzer Raum sichtbar, kein hartes Beschneiden oben/unten. */
.atmosphere.framed {
  background: var(--bg-deep);
}
.atmosphere.framed img {
  height: clamp(24rem, 58vw, 44rem);
  object-fit: contain;
}

.portrait-figure {
  max-width: 22rem;
  margin: 0 0 clamp(2rem, 5vw, 3rem);
}
.portrait-figure img {
  border-radius: 2px;
}

.inset-figure {
  max-width: 19rem;
  margin: 0 0 clamp(2rem, 5vw, 3rem);
}
@media (min-width: 780px) {
  .inset-figure {
    float: right;
    margin: 0.3rem 0 1.5rem clamp(1.75rem, 3vw, 2.5rem);
  }
}
.inset-figure img { border-radius: 2px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem var(--gutter);
  margin-top: 5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer a { border: 0; }
.site-footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }

/* ---------- Schwellen-Übergang ---------- */

/* Standardmäßig sichtbar — JS schaltet auf "pending" um, wenn Übergang vorgesehen */
.threshold {
  opacity: 1;
  transform: none;
  filter: none;
}

.threshold.pending {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  filter: blur(6px);
}

.threshold.entering {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity 1200ms ease,
    transform 1400ms cubic-bezier(.22, .61, .36, 1),
    filter 1200ms ease;
}

/* Gestaffelte Verzögerung der Kinder, damit Elemente nacheinander erscheinen */
.threshold.entering > * { animation: fade-in 1200ms ease both; }
.threshold.entering > *:nth-child(1) { animation-delay: 120ms; }
.threshold.entering > *:nth-child(2) { animation-delay: 280ms; }
.threshold.entering > *:nth-child(3) { animation-delay: 440ms; }
.threshold.entering > *:nth-child(4) { animation-delay: 600ms; }
.threshold.entering > *:nth-child(5) { animation-delay: 760ms; }
.threshold.entering > *:nth-child(n+6) { animation-delay: 900ms; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduced Motion — Haltung: niemandem etwas aufzwingen */
@media (prefers-reduced-motion: reduce) {
  .threshold.pending {
    opacity: 0;
    transform: none;
    filter: none;
  }
  .threshold.entering {
    transition: opacity 400ms ease;
    transform: none;
    filter: none;
  }
  .threshold.entering > * { animation: none; }
  *, *::before, *::after {
    transition-duration: 200ms !important;
    animation-duration: 200ms !important;
  }
}
