/* ==========================================================================
   Tarne LCA Consulting – Styles
   Farbwelt "Burnt Sienna" aus dem Logo:
   Golden Taupe / Burnt Sienna / Lavender Fields (hell, warm)
   ========================================================================== */

:root {
  --font-display: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --dur-theme: 700ms;

  /* Layout */
  --gutter: clamp(16px, 4vw, 56px);
  --panel-left: 42vw;            /* wo der Inhalt beginnt, wenn der Baum links steht */
  --panel-max: 760px;
  --chapter-gap: 46vh;           /* je Seite eines Kapitels -> ~92vh Baum-Strecke dazwischen */
  --header-h: 72px;

  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;

  /* z-index Skala */
  --z-stage: 0;
  --z-content: 10;
  --z-header: 40;
  --z-skip: 100;
}

/* ---------- Farbwelt: Burnt Sienna ---------- */
:root {
  --bg: #F4A361;              /* Golden Taupe */
  --bg-deep: #EE9350;
  --bg-glow: #F8BE85;
  --ink: #2B1209;             /* 8.2:1 auf --bg */
  --ink-soft: #4A2112;        /* ~6:1 */
  --heading: #6E1D0B;         /* ~5.4:1 */
  --muted: #5E2B17;
  --accent: #E35336;          /* Burnt Sienna (Logo) */
  --accent-ink: #8E2A14;      /* für Text-Akzente */
  --cream: #F5F5DC;           /* Logo-Balken */
  --lavender: #B7A6E0;        /* Lavender Fields */
  --line: rgba(43, 18, 9, .22);
  --surface: rgba(255, 247, 233, .34);
  --surface-strong: rgba(255, 247, 233, .62);
  --btn-bg: #2B1209;
  --btn-ink: #FFF3E2;
  --btn-bg-hover: #6E1D0B;
  --focus: #2B1209;
  --input-bg: rgba(255, 249, 239, .55);
  --error: #7A0E0E;
  --success: #1F4A1A;

  /* Geflecht */
  --strand-a: #F5F5DC;        /* die zwei "Balken" */
  --strand-b: #FBEFD6;
  --strand-c: #E35336;        /* der umschlingende Trieb + Knospe */
  --strand-thin: #FFF8E8;
  --bud: #E35336;
  --bud-ring: #B7A6E0;

  --logo-a: #E35336;
  --logo-b: #F5F5DC;
  color-scheme: light;
}

/* ==========================================================================
   Basis
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 8px);
  background: var(--bg);
  transition: background-color var(--dur-theme) var(--ease-out);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(120vmax 90vmax at 50% 18%, var(--bg-glow) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  transition: color var(--dur-theme) var(--ease-out);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3, dt {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  color: var(--heading);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0;
  text-wrap: balance;
  transition: color var(--dur-theme) var(--ease-out);
}
h2 em, h1 em { font-style: italic; font-variation-settings: "SOFT" 100, "opsz" 144; }

p { margin: 0 0 1em; }

::selection { background: var(--lavender); color: #1C0B05; }

:focus-visible {
  outline: 3px solid var(--focus);
  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;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: var(--z-skip);
  padding: 10px 16px; border-radius: var(--radius-s);
  background: var(--btn-bg); color: var(--btn-ink); text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Bühne (Geflecht)
   ========================================================================== */
.stage {
  position: fixed;
  inset: 0;
  z-index: var(--z-stage);
  pointer-events: none;
}
.stage canvas { display: block; width: 100%; height: 100%; }

/* Pulsierender Ring um die Knospe (DOM-Overlay, wird per JS positioniert) */
.bud-ring {
  position: fixed;
  left: 0; top: 0;
  width: 0; height: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}
.bud-ring::before,
.bud-ring::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: var(--ring-size, 40px); height: var(--ring-size, 40px);
  margin: calc(var(--ring-size, 40px) / -2) 0 0 calc(var(--ring-size, 40px) / -2);
  border-radius: 50%;
  border: 1.5px solid var(--bud-ring);
  animation: bud-pulse 2.8s var(--ease-out) infinite;
}
.bud-ring::after { animation-delay: 1.4s; }
@keyframes bud-pulse {
  0%   { transform: scale(.7); opacity: .9; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
  min-height: 44px;
}
.brand-mark { width: 30px; height: 40px; flex: none; }
.brand-mark .lg-a { fill: var(--logo-a); transition: fill var(--dur-theme); }
.brand-mark .lg-b { fill: var(--logo-b); transition: fill var(--dur-theme); }
.brand-name {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "opsz" 36;
  font-size: 1.2rem;
  letter-spacing: -.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-name em { font-style: italic; color: var(--accent-ink); }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px;
}
.site-nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px;
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a[aria-current="true"] { color: var(--ink); background: var(--surface-strong); }


/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-body);
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .25s var(--ease-out), color .25s, border-color .25s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--btn-bg); color: var(--btn-ink);
  border: 1.5px solid var(--btn-bg);
}
.btn-primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; }
.btn[disabled] { opacity: .5; cursor: progress; }

/* ==========================================================================
   Hero
   ========================================================================== */
main { position: relative; z-index: var(--z-content); }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto auto;
  column-gap: 12vw;
  padding: calc(var(--header-h) + 4vh) var(--gutter) 6vh;
}
.hero-eyebrow {
  grid-column: 1 / -1;
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-title {
  grid-column: 1 / -1;
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12vw;
  font-size: clamp(3.2rem, 8.4vw, 9.5rem);
  line-height: .92;
  font-weight: 350;
  letter-spacing: -.035em;
}
.hero-line { display: block; text-shadow: 0 0 40px var(--bg); }
.hero-line-1 { grid-column: 1; justify-self: start; }
.hero-line-2 {
  grid-column: 2; justify-self: end; text-align: right;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  margin-top: .6em;
}
.hero-foot {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12vw;
  align-items: end;
}
.hero-lead {
  grid-column: 1;
  max-width: 34ch;
  font-size: clamp(1.05rem, 1rem + .35vw, 1.3rem);
  color: var(--ink-soft);
  margin: 0;
}
.hero-actions {
  grid-column: 2;
  justify-self: end;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.scroll-cue {
  grid-column: 1 / -1;
  justify-self: start;
  margin: 4vh 0 0;
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue span::after {
  content: "";
  display: block;
  width: 1px; height: 36px;
  margin: 10px auto 0;
  background: currentColor;
  transform-origin: top;
  animation: cue 2.2s var(--ease-out) infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  70% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* Hero-Intro */
.js .hero > * { animation: rise 1.1s var(--ease-out) both; }
.js .hero > :nth-child(2) { animation-delay: .15s; }
.js .hero > :nth-child(3) { animation-delay: .35s; }
.js .hero > :nth-child(4) { animation-delay: .6s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ==========================================================================
   Kapitel – Inhalte erscheinen rechts vom Baum
   ========================================================================== */
.chapter {
  position: relative;
  padding: var(--chapter-gap) var(--gutter);
  overflow-x: clip;               /* eingeschobene Inhalte erzeugen keinen Querscroll */
  scroll-margin-top: calc(48px - var(--chapter-gap));   /* Ankerlinks landen am Inhalt, nicht im Abstand */
}
.chapter:last-child { padding-bottom: 30vh; }

.panel {
  margin-left: var(--panel-left);
  max-width: var(--panel-max);
  padding-right: var(--gutter);
}

/* Scroll-Choreografie: --f (0..1) wird je Kapitel per JS gesetzt */
.js .panel > * {
  --p: clamp(0, calc(var(--f, 0) * 1.7 - var(--i, 0) * .16), 1);
  opacity: var(--p);
  transform: translate3d(calc((1 - var(--p)) * 56px), 0, 0);
  will-change: opacity, transform;
}
.js .panel > :nth-child(1) { --i: 0; }
.js .panel > :nth-child(2) { --i: 1; }
.js .panel > :nth-child(3) { --i: 2; }
.js .panel > :nth-child(4) { --i: 3; }
.js .panel > :nth-child(5) { --i: 4; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 20px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0;
  color: var(--accent-ink);
}
.eyebrow::after {
  content: ""; flex: 0 0 48px; height: 1px; background: var(--line);
}

.panel h2 {
  font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4.4rem);
  margin-bottom: 28px;
  max-width: 16ch;
}
.lead {
  font-size: clamp(1.15rem, 1.05rem + .45vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink);
  max-width: 38ch;
}
.panel p:not(.lead):not(.eyebrow) { max-width: 60ch; color: var(--ink-soft); }

/* Leistungsfelder */
.fields {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: field;
}
.field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 8px 32px;
  padding: 26px 28px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background-color .3s, border-color .3s, transform .3s var(--ease-out);
}
.field:hover { background: var(--surface-strong); transform: translateX(4px); }
.field h3 {
  font-size: clamp(1.35rem, 1.1rem + .8vw, 1.75rem);
  line-height: 1.1;
}
.field p { margin: 0; color: var(--ink-soft); }

/* Leistungsliste */
.services-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.services-list li {
  position: relative;
  padding: 20px 0 20px 30px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 60, "opsz" 36;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.4rem);
  line-height: 1.3;
  color: var(--ink);
}
.services-list li::before {
  content: "";
  position: absolute; left: 0; top: calc(20px + .45em);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}

/* Über mich */
.about {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 40px;
  align-items: start;
}
.portrait {
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.35);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.facts {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: grid; gap: 12px;
}
.facts li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
}
.facts li::before {
  content: "";
  position: absolute; left: 0; top: .55em;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}

/* Werte */
.values { margin: 0; display: grid; }
.value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 12px 40px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.value:last-child { border-bottom: 1px solid var(--line); }
.value dt {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  line-height: 1.1;
}
.value dd { margin: 0; color: var(--ink-soft); }

/* Kontakt */
.panel-contact h2 { max-width: 18ch; }
.panel-contact h2 em { color: var(--accent-ink); }
.contact-form { margin-top: 12px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label { font-weight: 500; font-size: .95rem; }
.req { color: var(--accent-ink); }
.opt { color: var(--muted); font-weight: 400; }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: 400 1rem/1.4 var(--font-body);
  color: var(--ink);
  background: var(--input-bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  transition: border-color .2s, background-color .2s;
}
.form-field textarea { resize: vertical; min-height: 140px; }
.form-field input:hover, .form-field textarea:hover { border-color: var(--ink-soft); }
.form-field input:focus-visible, .form-field textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink);
}
.form-field [aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 0; min-height: 0; font-size: .88rem; font-weight: 500; color: var(--error); }
.field-error:empty { display: none; }

.consent {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 4px 12px;
  align-items: start;
}
.consent input {
  width: 22px; height: 22px; margin: 2px 0 0;
  accent-color: var(--btn-bg);
}
.consent label { font-weight: 400; font-size: .9rem; color: var(--ink-soft); }
.consent .field-error { grid-column: 2; }

.form-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  margin-top: 24px;
}
.form-alt { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.form-status { margin: 16px 0 0; font-weight: 500; }
.form-status[data-state="error"] { color: var(--error); }
.form-status[data-state="success"] { color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Footer */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px 32px;
  padding: 28px var(--gutter) 36px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
}
.site-footer p { margin: 0; }
.site-footer ul { list-style: none; display: flex; gap: 4px 20px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-footer a { display: inline-flex; min-height: 44px; align-items: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  :root { --panel-left: 38vw; }
  .field { grid-template-columns: 1fr; }
  .site-nav a { padding: 0 10px; }
}

@media (max-width: 1023px) {
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; }
}

/* Mobil: Baum wandert an den linken Rand, Inhalt nimmt die Breite */
@media (max-width: 899px) {
  :root {
    --panel-left: 0px;
    --chapter-gap: 36vh;
    --header-h: 64px;
    --gutter: 16px;
  }
  .site-nav { display: none; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { width: 24px; height: 32px; }

  .panel { padding-left: 50px; padding-right: 0; }
  .panel h2 { margin-bottom: 20px; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    padding-top: calc(var(--header-h) + 3vh);
  }
  .hero-title { grid-template-columns: 1fr; font-size: clamp(2.9rem, 13.5vw, 5rem); }
  .hero-line-1, .hero-line-2 { grid-column: 1; }
  .hero-line-2 { margin-top: 1.4em; }
  .hero-foot { grid-template-columns: 1fr; row-gap: 22px; }
  .hero-lead, .hero-actions { grid-column: 1; justify-self: start; }
  .hero-lead { max-width: none; }
  .hero-actions .btn { flex: 1 1 auto; }

  .field { padding: 20px; }
  .value { grid-template-columns: 1fr; padding: 22px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 380px) {
  .brand-name { font-size: .95rem; }
}

/* ==========================================================================
   Reduzierte Bewegung
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hero > * { animation: none; }
  .js .panel > * { opacity: 1; transform: none; }
  .scroll-cue span::after, .bud-ring::before, .bud-ring::after { animation: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ==========================================================================
   Sprachumschalter
   ========================================================================== */
.lang-switch {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.lang-switch a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 36px; padding: 0 10px;
  border-radius: 999px;
  font: 600 .8rem/1 var(--font-body);
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background-color .25s, color .25s;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); }

@media (max-width: 899px) {
  .site-header { gap: 8px; }
  .lang-switch a { min-width: 34px; padding: 0 6px; }
}
/* Schmale Handys: Wortmarke ausblenden, Logo-Zeichen bleibt */
@media (max-width: 520px) {
  .brand-name { display: none; }
}
