/* =========================================================
   Sinn & Substanz — stylesheet
   Design goals: modern, grounded, calm; large type and high
   contrast for older visitors; fast (system fonts, no libs).
   ========================================================= */

:root {
  /* Palette */
  --forest:      #2e3b2f;
  --forest-deep: #212b22;
  --sage:        #6f8262;
  --clay:        #a9542f;
  --sand:        #f4f1e9;
  --cream:       #fbf9f4;
  --ink:         #23281f;
  --muted:       #55604e;
  --line:        rgba(35, 40, 31, 0.14);
  --card-shadow: 0 1px 2px rgba(35,40,31,.05), 0 14px 34px -18px rgba(35,40,31,.28);

  /* Type */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans:  system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius:    18px;
  --radius-sm: 12px;
  --container: 1160px;
  --header-h:  74px;
}

/* Smooth cross-document page transitions (progressive enhancement;
   ignored by browsers without the View Transitions API). */
@view-transition { navigation: auto; }

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.24rem);
  line-height: 1.72;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--clay); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-serif); color: var(--forest); line-height: 1.14; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); letter-spacing: -0.01em; margin: 0 0 .6em; }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin: 0 0 .5em; }
p  { margin: 0 0 1.1em; }
:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}
.section { padding-block: clamp(3.5rem, 8vw, 6.75rem); }
.section__head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.lead {
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  color: var(--muted);
  line-height: 1.6;
}
.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sage);
  margin: 0 0 1rem;
}
.eyebrow--line { display: inline-flex; align-items: center; gap: .7rem; }
.eyebrow--line::before {
  content: ""; width: 34px; height: 2px; background: var(--clay); display: inline-block;
}
.section__head--center .eyebrow--line { justify-content: center; }
.eyebrow--light { color: #b9c6ac; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -100px;
  background: var(--forest); color: var(--cream);
  padding: .8rem 1.2rem; border-radius: 0 0 10px 10px;
  z-index: 200; text-decoration: none; font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3.35rem;
  padding: .85rem 1.7rem;
  font: inherit; font-weight: 600; font-size: 1.05rem;
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn--primary { background: var(--forest); color: var(--cream); box-shadow: 0 10px 24px -14px rgba(33,43,34,.9); }
.btn--primary:hover { background: var(--forest-deep); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn--ghost:hover { background: rgba(46,59,47,.08); transform: translateY(-2px); }
.btn--small { min-height: 2.9rem; padding: .55rem 1.25rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 241, 233, 0.86);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--forest); }
.brand__mark { color: var(--forest); display: inline-flex; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.01em; }
.brand__name--light { color: var(--cream); font-size: 1.55rem; }
.brand__tag { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.site-nav__list { list-style: none; display: flex; align-items: center; gap: clamp(1rem, 2vw, 2rem); margin: 0; padding: 0; }
.site-nav a:not(.btn) {
  text-decoration: none; color: var(--forest); font-weight: 600; font-size: 1.02rem;
  padding: .5rem .25rem; display: inline-block; position: relative;
}
.site-nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .1rem; height: 2px;
  background: var(--clay); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.site-nav a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; align-items: center; gap: .55rem;
  background: var(--forest); color: var(--cream); border: 0; cursor: pointer;
  padding: .6rem 1rem; border-radius: 999px; font: inherit; font-weight: 600; min-height: 2.9rem;
}
.nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--cream); position: relative;
}
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after  { position: absolute; top:  6px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero__inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center;
}
.hero .eyebrow {
  font-family: var(--font-serif); text-transform: none; letter-spacing: 0; font-style: italic;
  font-weight: 400; font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem); color: var(--clay);
}
.hero__intro { color: var(--muted); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.hero__media { position: relative; }
.hero__img {
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  outline: 1px solid var(--line);
}
.hero__media::after {
  content: ""; position: absolute; inset: auto -14px -14px auto; width: 62%; height: 62%;
  border: 2px solid var(--sage); border-radius: var(--radius); z-index: -1;
}

/* ---------- Ansatz ---------- */
.section--ansatz { background: var(--cream); border-block: 1px solid var(--line); }
.ansatz__grid {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center; margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.ansatz__media { margin: 0; }
.ansatz__media img {
  border-radius: var(--radius); box-shadow: var(--card-shadow);
  aspect-ratio: 1 / 1; object-fit: cover; filter: grayscale(100%) contrast(1.02);
}
.point { padding-left: 1.25rem; border-left: 3px solid var(--sage); margin-bottom: 1.75rem; }
.point:last-child { margin-bottom: 0; }
.point p { color: var(--muted); margin-bottom: 0; }

.values { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 3vw, 1.75rem); }
.value-card {
  background: var(--sand); border: 1px solid var(--line); border-top: 4px solid var(--sage);
  border-radius: var(--radius-sm); padding: clamp(1.5rem, 3vw, 2rem);
}
.value-card__title { margin-bottom: .35em; }
.value-card p { color: var(--muted); margin-bottom: 0; }

/* ---------- Schwerpunkte / services ---------- */
.services {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2rem);
}
.service {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(1.6rem, 3vw, 2.25rem);
  box-shadow: var(--card-shadow);
  transition: transform .18s ease, box-shadow .2s ease;
}
.service:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(35,40,31,.05), 0 24px 44px -20px rgba(35,40,31,.4); }
.service__icon {
  display: inline-block; width: 40px; height: 40px; margin-bottom: 1.1rem;
  background: var(--forest);
  -webkit-mask: var(--m) center / contain no-repeat;
          mask: var(--m) center / contain no-repeat;
}
.service p { color: var(--muted); margin-bottom: 0; }

/* ---------- Über mich ---------- */
.about__grid {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.75rem, 5vw, 4rem); align-items: center;
}
.about__media { margin: 0; }
.about__media img { border-radius: var(--radius); box-shadow: var(--card-shadow); aspect-ratio: 4 / 5; object-fit: cover; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 4vw, 2.75rem); margin: 2rem 0 0; padding: 0; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-serif); font-size: 1.9rem; color: var(--forest); line-height: 1; }
.stats span { font-size: .95rem; color: var(--muted); }

/* ---------- Kontakt ---------- */
.section--contact { background: var(--forest); color: var(--cream); }
.section--contact h2 { color: var(--cream); }
.section--contact .lead { color: #cdd6c4; }
.contact__grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact__direct h3, .contact__form h3 { color: var(--cream); }
.contact__form h3 { color: var(--forest); }
.contact__link {
  display: flex; flex-direction: column; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin-bottom: 1rem;
  color: var(--cream); transition: background-color .2s ease, border-color .2s ease;
}
.contact__link:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.contact__link-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: #b9c6ac; }
.contact__link-value { font-size: 1.2rem; font-weight: 600; }
.contact__note { color: #b9c6ac; font-size: .98rem; margin: .5rem 0 0; }

.contact__form { background: var(--cream); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--card-shadow); }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-weight: 600; color: var(--forest); margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(46,59,47,.15); }
.field textarea { resize: vertical; }
.contact__privacy { font-size: .92rem; color: var(--muted); margin: 1rem 0 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-deep); color: #cdd6c4; padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.site-footer__inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
  padding-bottom: 1.75rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.site-footer__brand p { margin: .5rem 0 0; max-width: 34ch; color: #a8b6a0; }
.site-footer h2 { color: var(--cream); }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.site-footer a { color: #cdd6c4; text-decoration: none; }
.site-footer a:hover { color: var(--cream); text-decoration: underline; }
.site-footer__copy { margin: 1.25rem 0 0; font-size: .92rem; color: #97a690; }

/* ---------- Legal / prose pages ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.legal .container { max-width: 800px; }
.prose { font-size: 1.08rem; }
.prose h1 { margin-bottom: .6em; }
.prose h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--clay); }
.placeholder {
  background: #fdf6ea; border: 1px dashed var(--clay); border-radius: 8px;
  padding: .1rem .45rem; color: #7a3c1f; font-style: italic; font-weight: 600;
}
.legal__back { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; text-decoration: none; color: var(--forest); }
.legal__back:hover { text-decoration: underline; }
.note-box {
  background: var(--cream); border: 1px solid var(--line); border-left: 4px solid var(--sage);
  border-radius: var(--radius-sm); padding: 1.1rem 1.4rem; margin: 1.5rem 0; color: var(--muted); font-size: .98rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  :root { --header-h: 66px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1.15rem, 4vw, 2.5rem) 1.25rem;
    box-shadow: 0 18px 30px -20px rgba(35,40,31,.5);
    display: none; opacity: 0; transform: translateY(-10px);
    transition: opacity .28s ease, transform .28s ease, display .28s allow-discrete;
  }
  .site-nav[data-open="true"] { display: block; opacity: 1; transform: none; }
  /* Animate in from the closed state (Baseline 2024) */
  @starting-style {
    .site-nav[data-open="true"] { opacity: 0; transform: translateY(-10px); }
  }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: .25rem; }
  .site-nav a:not(.btn) { padding: .85rem .25rem; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .site-nav a:not(.btn)::after { display: none; }
  .site-nav .btn { margin-top: .75rem; width: 100%; }

  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 420px; margin-inline: auto; }
  .hero__media::after { display: none; }
  .ansatz__grid, .about__grid, .contact__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 360px; }
  .services { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .services { grid-template-columns: 1fr 1fr; }
}

/* ---------- Motion & contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* Neutralise cross-document view transition animations */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
@media (prefers-contrast: more) {
  :root { --muted: #3c4636; --line: rgba(35,40,31,.35); }
  .btn--ghost { border-width: 3px; }
}

/* =========================================================
   Motion & animations
   Modern standards (2025/26): native CSS scroll-driven
   animations (animation-timeline), on-load entrance, page
   transitions and @starting-style — all gated behind
   prefers-reduced-motion + @supports, so content is always
   fully visible when unsupported. Only opacity/transform are
   animated (GPU-compositable, no layout thrash). The hero
   image is intentionally NOT faded, to protect LCP.
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {

  @keyframes ss-rise {
    from { opacity: 0; transform: translateY(26px); }
    to   { opacity: 1; transform: none; }
  }

  /* Hero: gentle staggered entrance on load (text only) */
  .hero__text > * { animation: ss-rise .8s cubic-bezier(.22, .68, .24, 1) both; }
  .hero .eyebrow { animation-delay: .05s; }
  #hero-titel    { animation-delay: .14s; }
  .hero .lead    { animation-delay: .24s; }
  .hero__intro   { animation-delay: .34s; }
  .hero__actions { animation-delay: .44s; }

  /* Scroll-driven reveals — only where natively supported */
  @supports (animation-timeline: view()) {
    .section__head,
    .ansatz__media,
    .point,
    .value-card,
    .service,
    .about__media,
    .about__text,
    .contact__direct,
    .contact__form {
      animation: ss-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 26%;
    }
    /* Subtle stagger so grid items don't all arrive at once */
    .services .service:nth-child(2)   { animation-range: entry 12% cover 30%; }
    .services .service:nth-child(3)   { animation-range: entry 18% cover 34%; }
    .values  .value-card:nth-child(2) { animation-range: entry 12% cover 30%; }
  }
}

/* Sticky header gains a soft elevation once the page is scrolled
   (scroll-progress timeline, no JS). Shadow only — safe for motion
   sensitivity, so not gated behind reduced-motion. */
@supports (animation-timeline: scroll()) {
  @keyframes ss-header-elevate {
    to { box-shadow: 0 8px 24px -16px rgba(35, 40, 31, .5); }
  }
  .site-header {
    animation: ss-header-elevate linear both;
    animation-timeline: scroll(root);
    animation-range: 0 130px;
  }
}

/* Micro-interactions (instant under reduced motion via the global rule) */
.btn:active { transform: translateY(0) scale(.985); }
.service__icon { transition: transform .25s ease; }
.service:hover .service__icon { transform: translateY(-2px) scale(1.08); }
.contact__link { transition: background-color .2s ease, border-color .2s ease, transform .2s ease; }
.contact__link:hover { transform: translateX(4px); }
.value-card { transition: transform .2s ease, border-top-color .2s ease; }
.value-card:hover { transform: translateY(-3px); border-top-color: var(--clay); }

