/* ============================================================================
   etastrat — Quiet Luxury Pure
   Brand-Tokens, Type-Scale, Layout — all in one file (≈400 lines, no build).
   See docs/brand/README.md for the canonical brand specification.
   ============================================================================ */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2-variations'),
       url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable-Italic.woff2') format('woff2-variations'),
       url('../fonts/InterVariable-Italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand colors */
  --brand-forest:   #243422;
  --brand-amber:    #C49544;
  --brand-cream:    #D9D4C6;
  --brand-paper:    #EFEBE0;     /* zwischen Offwhite und Cream — warmer Section-Tone */
  --brand-offwhite: #F6F4EE;
  --brand-stone:    #8A8F8C;
  --brand-hairline: rgb(36 52 34 / 14%);
  --brand-edge:     rgb(36 52 34 / 8%);

  /* Body color w/ opacity ramp */
  --text-strong: var(--brand-forest);
  --text-body:   rgb(36 52 34 / 72%);
  --text-muted:  rgb(36 52 34 / 50%);

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  16px;
  --space-4:  24px;
  --space-5:  32px;
  --space-6:  48px;
  --space-7:  64px;
  --space-8:  96px;
  --space-9:  128px;

  /* Type scale — clamp-based responsive */
  --text-hero:    clamp(3.25rem, 2.2rem + 5vw, 6.5rem);
  --text-h2:      clamp(2.5rem, 1.7rem + 4vw, 5rem);
  --text-tagline: clamp(1.125rem, 1rem + 0.75vw, 1.625rem);
  --text-body-size: clamp(0.9375rem, 0.9rem + 0.25vw, 1.0625rem);
  --text-meta:   0.6875rem;
  --text-mini:   0.625rem;

  /* Layout */
  --sidebar-width: 40px;
  --content-pad:   clamp(1.5rem, 4vw, 6rem);
  --content-max:   84rem;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-norm: 300ms;
  --duration-slow: 600ms;
}

/* ----------------------------------------------------------------------------
   Reset + Base
   ---------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--text-body-size);
  line-height: 1.58;
  letter-spacing: -0.005em;
  background-color: var(--brand-offwhite);
  color: var(--brand-forest);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
  font-feature-settings: "ss01" 1, "cv11" 1;
  position: relative;
}

/* Lift content layers consistently above body background. */
.brand-sidebar,
.top-bar,
main,
.site-footer {
  position: relative;
  z-index: 2;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

a:focus-visible {
  outline: 2px solid var(--brand-amber);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ----------------------------------------------------------------------------
   Brand Sidebar (left edge, full height)
   ---------------------------------------------------------------------------- */

.brand-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background-color: var(--brand-forest);
  z-index: 10;
}

/* ----------------------------------------------------------------------------
   Top Bar — wordmark + heritage marker
   ---------------------------------------------------------------------------- */

.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  padding: var(--space-4) var(--content-pad);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background-color: var(--brand-offwhite);
  z-index: 9;
}

.top-right {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-4);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--brand-stone);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
  position: relative;
  top: 1px;
}

.lang-toggle:hover {
  color: var(--brand-amber);
}

.lang-toggle__globe {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.lang-toggle__code {
  display: inline-block;
}

/* ----------------------------------------------------------------------------
   Section-Indicator — Vertikale Pagination rechts, sehr dezent.
   Zeigt aktuelle Section + Hinweis dass weitere folgen.
   ---------------------------------------------------------------------------- */

.section-nav {
  position: fixed;
  right: var(--content-pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 8;
  pointer-events: none;
}

.section-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-end;
}

.section-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-mini);
  color: var(--brand-stone);
  letter-spacing: 0.1em;
  text-decoration: none;
  opacity: 0.38;
  transition: opacity var(--duration-norm) var(--ease-out-expo),
              color var(--duration-norm) var(--ease-out-expo);
  pointer-events: auto;
}

.section-nav__link:hover {
  opacity: 0.8;
}

.section-nav__link.is-current {
  opacity: 1;
  color: var(--brand-amber);
}

.section-nav__dash {
  display: inline-block;
  width: 16px;
  height: 1px;
  background-color: currentColor;
  transition: width var(--duration-norm) var(--ease-out-expo);
}

.section-nav__link.is-current .section-nav__dash {
  width: 28px;
}

.wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
}

.wordmark__eta  { color: var(--brand-amber); }
.wordmark__name { color: var(--brand-forest); }

.top-marker {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--text-meta);
  color: var(--brand-stone);
  letter-spacing: 0.08em;
  display: inline-flex;
  gap: 0.5em;
  align-items: baseline;
}

.top-marker__dot  { color: var(--brand-stone); }
.top-marker__anno { color: var(--brand-amber); }

/* ----------------------------------------------------------------------------
   Sections (Hero / Approach / Contact)
   ---------------------------------------------------------------------------- */

main {
  padding-top: 88px; /* top-bar clearance */
}

.section {
  min-height: calc(100vh - 88px);
  padding: var(--space-9) var(--content-pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Scroll-Cue ist immer absolut am unteren Rand jeder Section verankert.
   Heading sitzt damit konsistent oben über alle Sections, unabhängig
   davon, wie viel Content darunter folgt. */
.section .hero-cta {
  position: absolute;
  left: var(--content-pad);
  bottom: var(--space-6);
  margin-top: 0;
  z-index: 2;
}

/* Contact-Section: füllt eigene viewport-Höhe MIT integrierter Footer-Meta.
   Content oben (flex-start), Footer-Block unten via natural flow. */
.section--contact {
  justify-content: flex-start;
}

.section--contact > .contact-block {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Inner reading-width constraint — Children atmen, Section bleibt voll-breit. */
.section > * {
  max-width: var(--content-max);
  width: 100%;
  position: relative;
  z-index: 2;
}

/* ----------------------------------------------------------------------------
   Hero backdrop η — massiv großes Watermark als atmosphärische Tiefe.
   Brand-DNA visualisiert, ohne neuen Text einzuführen.
   ---------------------------------------------------------------------------- */

.hero-backdrop {
  position: absolute;
  top: 50%;
  right: -4%;
  transform: translateY(-50%);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(22rem, 48vw, 56rem);
  line-height: 0.72;
  color: var(--brand-amber);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  letter-spacing: -0.05em;
  max-width: none;
  width: auto;
}

/* ----------------------------------------------------------------------------
   Approach Loss-Curve — Konvergenz-Linien im Hintergrund.
   Visualisiert „from hypothesis to convergence" ohne weitere Worte.
   ---------------------------------------------------------------------------- */

.approach-curve {
  position: absolute;
  inset: 0;
  background-image: url('../brand/loss-curve.svg');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  max-width: none;
  width: 100%;
}

/* Architektonische Section-Trennlinien — sichtbar, aber leise. */
.section + .section {
  border-top: 1px solid var(--brand-edge);
}

.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-meta);
  color: var(--brand-amber);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

h1, h2 {
  font-weight: 700;
  color: var(--brand-forest);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-6);
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-h2);   }

.tagline {
  font-size: var(--text-tagline);
  color: var(--brand-amber);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-5);
  max-width: 32rem;
  text-wrap: balance;
}

.tagline--muted {
  color: var(--text-body);
}

.body {
  max-width: 47rem;
  color: var(--text-body);
  margin-bottom: var(--space-8);
  text-wrap: pretty;
}

/* Greek glyph fallback — self-hosted JetBrains Mono ist subsetted ohne
   Griechisch (U+0370–03FF); Inter rendert η, Δ, Θ korrekt. */
.greek {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: inherit;
}

/* ----------------------------------------------------------------------------
   Hero CTA (scroll-cue)
   ---------------------------------------------------------------------------- */

.hero-cta {
  align-self: flex-start;
  margin-top: auto;
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-2);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-mini);
  color: var(--brand-stone);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero-cta__arrow {
  font-size: 1.5rem;
  color: var(--brand-amber);
  letter-spacing: 0;
  transition: transform var(--duration-norm) var(--ease-out-expo);
}

.hero-cta:hover .hero-cta__arrow {
  transform: translateY(4px);
}

/* ----------------------------------------------------------------------------
   Approach — 3-Box Pipeline + Metric Line
   ---------------------------------------------------------------------------- */

.approach-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-block: var(--space-7);
}

.approach-box {
  border: 1px solid rgb(36 52 34 / 50%);
  background-color: rgb(217 212 198 / 45%);
  padding: var(--space-3);
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 240px;
}

.approach-box__num {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-mini);
  color: var(--brand-amber);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
}

.approach-box__title {
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--brand-forest);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
}

.approach-box__caption {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-mini);
  color: rgb(36 52 34 / 60%);
  line-height: 1.4;
}

.approach-arrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--brand-amber);
  font-size: 1rem;
}

.metric-line {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.metric-line__gap {
  width: var(--space-5);
}

/* ----------------------------------------------------------------------------
   Contact
   ---------------------------------------------------------------------------- */

.contact-link {
  font-weight: 600;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  color: var(--brand-forest);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  display: inline-block;
}

.contact-link:hover {
  color: var(--brand-amber);
}

.contact-meta {
  font-size: 0.875rem;
  color: rgb(36 52 34 / 55%);
}

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

.site-footer {
  padding: var(--space-2) 0 0;
  margin-top: var(--space-6);
}

.site-footer > * {
  max-width: var(--content-max);
}

.hairline {
  border: none;
  height: 1px;
  background-color: var(--brand-hairline);
  margin-bottom: var(--space-4);
}

.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-mini);
  color: var(--brand-stone);
  gap: var(--space-3);
  flex-wrap: wrap;
}

.site-footer__right {
  display: inline-flex;
  gap: 0.5em;
}

.site-footer__row a:hover {
  color: var(--brand-amber);
}

/* ----------------------------------------------------------------------------
   Sub-Pages — Impressum, Datenschutz, etc.
   Single-Section-Layout, kein Snap, schmaler Content-Container.
   ---------------------------------------------------------------------------- */

body.subpage {
  min-height: 100vh;
}

html:has(body.subpage),
body.subpage {
  scroll-snap-type: none;
}

.subpage main {
  padding-top: 120px;
  padding-bottom: var(--space-7);
  min-height: calc(100vh - 88px);
}

.subpage-content {
  max-width: 720px;
  margin-inline: auto;
  padding: 0 var(--content-pad) var(--space-8);
  position: relative;
  z-index: 2;
}

.subpage-content .eyebrow {
  margin-bottom: var(--space-4);
}

.subpage-content h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}

.subpage-content h2 {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 600;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.subpage-content p {
  margin-bottom: var(--space-3);
  color: var(--text-body);
}

.subpage-content a {
  color: var(--brand-forest);
  border-bottom: 1px solid var(--brand-edge);
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.subpage-content a:hover {
  color: var(--brand-amber);
  border-bottom-color: var(--brand-amber);
}

.subpage-content dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-5);
  font-size: 0.9375rem;
}

.subpage-content dt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-meta);
  color: var(--brand-stone);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.25em;
}

.subpage-content dd {
  color: var(--brand-forest);
}

.subpage-content .disclaimer {
  margin-top: var(--space-7);
  padding: var(--space-3) var(--space-4);
  background-color: var(--brand-cream);
  border-left: 2px solid var(--brand-amber);
  font-size: 0.875rem;
  color: var(--text-body);
}

.subpage-content .back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-7);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--text-meta);
  letter-spacing: 0.12em;
  color: var(--brand-stone);
  text-transform: uppercase;
  border-bottom: none;
}

.subpage-content .back-link:hover {
  color: var(--brand-amber);
}

/* ----------------------------------------------------------------------------
   Scroll-Reveal (subtle, optional)
   ---------------------------------------------------------------------------- */

.section--approach,
.section--contact {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

.section.is-visible {
  opacity: 1;
  transform: none;
}

/* ----------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------------- */

@media (max-width: 768px) {
  /* Scroll-Snap auf Mobile deaktivieren — Touch-Scrolling-UX wird durch
     mandatory snap zu rigide. */
  html {
    scroll-snap-type: none;
  }

  .section-nav {
    display: none;
  }

  body {
    padding-left: 0;
  }

  .brand-sidebar {
    width: 6px;
  }

  .top-bar {
    left: 0;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .top-marker {
    font-size: 0.625rem;
    flex-wrap: wrap;
  }

  main {
    padding-top: 96px;
  }

  .section {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    padding-block: var(--space-6);
  }

  .approach-row {
    flex-direction: column;
    align-items: stretch;
  }

  .approach-box {
    max-width: none;
    flex: 0 0 auto;        /* nicht mehr aus Flex-Row-Kontext aufblähen */
    min-height: auto;
  }

  .approach-arrow {
    align-self: center;
    transform: rotate(90deg);
  }

  /* Loss-Curve auf Mobile ausblenden — verzerrt im Portrait-Aspect,
     trägt visuell ohnehin am wenigsten auf schmaler Breite. */
  .approach-curve {
    display: none;
  }

  .site-footer__row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

/* ----------------------------------------------------------------------------
   Accessibility — reduced motion
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .section--approach,
  .section--contact {
    opacity: 1;
    transform: none;
  }
}
