/* =========================================================
   Holzverpackung Röttger GmbH – Web-Visitenkarte
   Reines CSS, keine externen Ressourcen.

   Farben aus dem Original-Logo und dem Firmengebäude:
   Grün #527545 (Schriftzug, Fensterrahmen) ist die einzige
   Akzentfarbe. Das Logo-Braun steckt nur im Logo selbst.
   Neutrale Töne leicht grünstichig, bewusst kein Creme/Beige.

   Formensprache: durchgehend eckig (Radius 0) – Kisten,
   Latten, Stapel. Keine Pills, keine abgerundeten Karten.

   Nur helles Farbschema: Das Logo (Braun #462e00) ist auf
   dunklem Grund nicht lesbar, ein Dark Mode würde die Marke
   verfälschen.
   ========================================================= */

/* Archivo (Omnibus-Type), SIL Open Font License 1.1, Lizenz: assets/fonts/OFL-Archivo.txt.
   Variable Schrift mit Strichstärke (100-900) und Laufweite (62-125 %), lateinische
   Teilmenge aus @fontsource-variable/archivo 5.3.0. Selbst gehostet, kein Netzabruf. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-wdth-normal.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 {
  color-scheme: light;

  --bg:        #f4f5f2;
  --surface:   #fbfbf9;
  --tint:      #e8ede5;
  --ink:       #1c231e;
  --ink-2:     #4b554e;
  --line:      #cfd6cc;

  --green:     #527545;   /* Logo-Schriftzug */
  --green-dk:  #3f5c35;
  --scrim:     27 36 29;  /* #1b241d als RGB für Verläufe */

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Laufweiten: Überschriften leicht breit gesetzt (erinnert an Kistenbeschriftung),
     Zahlen und Normbezeichnungen noch etwas breiter, Fließtext normal. */
  --stretch-head: 112%;
  --stretch-mark: 120%;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(4rem, 9vw, 7rem);
  --header-h: 72px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--green-dk); }

h1, h2, h3 {
  margin: 0; color: var(--ink); font-weight: 700; font-stretch: var(--stretch-head);
  overflow-wrap: break-word; hyphens: auto;
}
h1 { font-size: clamp(2.25rem, 5vw, 4.1rem); font-weight: 750; line-height: 1.02; letter-spacing: -.025em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); line-height: 1.08; letter-spacing: -.018em; }
h3 { font-size: 1.2rem; font-weight: 650; font-stretch: 104%; line-height: 1.25; letter-spacing: -.005em; }
p  { margin: 0; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.visually-hidden {
  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: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--ink); color: var(--surface); padding: 10px 16px;
}
.skip-link:focus { top: 12px; color: var(--surface); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  font: inherit; font-weight: 650; font-stretch: 106%; font-size: 1rem; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: var(--surface); }
.btn--primary:hover { background: var(--green-dk); color: var(--surface); }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--surface); }

/* ---------- Header ---------- */
/* Unsichtbarer Messpunkt: Sobald er aus dem Bild scrollt, bekommt der Header
   seine Linie (IntersectionObserver in main.js, kein Scroll-Listener). */
.header-sentinel { position: absolute; top: 0; height: 1px; width: 1px; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgb(244 245 242 / .94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  height: var(--header-h);
}
.brand { display: inline-flex; flex: none; }
.brand__logo { height: 46px; width: auto; }

.nav { display: flex; align-items: center; }
.nav__menu { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav__menu a:not(.btn) {
  display: inline-block; padding: .5rem .75rem;
  color: var(--ink); font-weight: 560; font-stretch: 104%; font-size: .98rem; text-decoration: none;
  background-image: linear-gradient(var(--green), var(--green));
  background-size: 0 2px; background-position: .75rem calc(100% - .3rem); background-repeat: no-repeat;
  transition: background-size .3s var(--ease), color .2s;
}
.nav__menu a:not(.btn):hover { color: var(--ink); background-size: calc(100% - 1.5rem) 2px; }
.nav__menu .btn { margin-left: .75rem; min-height: 44px; }
.nav__toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: min(calc(100dvh - var(--header-h)), 760px);
}
.hero__text {
  align-self: center;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 3vw, 3rem) clamp(3rem, 6vw, 5rem)
           max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
}
/* "Holzverpackungen" soll als Wort stehen und darf nie umbrechen. In Archivo bei
   112 % Laufweite ist das Wort 9,86 em breit. Die Obergrenze 3.15rem hält es bei
   ≥ 1280 px in der 512 px breiten Textspalte (497 px). */
.hero__title { font-size: clamp(2.1rem, 3.9vw, 3.15rem); hyphens: manual; }
.hero__lead { margin-top: 1.5rem; max-width: 38ch; font-size: clamp(1.08rem, 1.5vw, 1.25rem); color: var(--ink-2); }
.hero__actions { margin-top: 2.25rem; }
.hero__media { position: relative; overflow: hidden; background: var(--tint); }
.hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 28% 50%;
}

/* ---------- Abschnitte ---------- */
.section { padding-block: var(--section); }
.section--tint { background: var(--tint); }
.section__title { max-width: 20ch; }

/* ---------- Über uns ---------- */
.about__lead {
  margin-top: 1.75rem; max-width: 52ch;
  font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.5; color: var(--ink-2);
}
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; list-style: none;
}
.fact { border-top: 2px solid var(--ink); padding-top: 1rem; }
.fact__value { display: block; font-size: clamp(2.2rem, 4.4vw, 3.4rem); font-weight: 750; font-stretch: var(--stretch-mark); line-height: 1; letter-spacing: -.02em; }
.fact__label { display: block; margin-top: .6rem; color: var(--ink-2); max-width: 26ch; }

/* ---------- Leistungen (Bento) ---------- */
.bento {
  display: grid; gap: 10px; margin-top: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(270px, auto));
}
.tile { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; background: var(--ink); }
.tile--a { grid-column: 1 / 3; grid-row: 1 / 3; }
.tile--b { grid-column: 3 / 5; grid-row: 1; }
.tile--c { grid-column: 3; grid-row: 2; }
.tile--d { grid-column: 4; grid-row: 2; }

.tile__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease);
}
.tile:hover .tile__img { transform: scale(1.035); }
.tile--photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(var(--scrim) / .88) 0%, rgb(var(--scrim) / .55) 38%, rgb(var(--scrim) / 0) 68%);
}
/* Kleine Kacheln: Der Text nimmt mehr Höhe ein, der Verlauf muss höher reichen. */
.tile--b::after, .tile--d::after {
  background: linear-gradient(to top, rgb(var(--scrim) / .92) 0%, rgb(var(--scrim) / .75) 45%, rgb(var(--scrim) / .1) 88%);
}
.tile__body { position: relative; z-index: 1; padding: clamp(1.25rem, 2.4vw, 2rem); color: var(--surface); }
.tile__body h3 { color: var(--surface); }
.tile--a .tile__body h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); letter-spacing: -.02em; }
.tile__body p { margin-top: .5rem; max-width: 42ch; font-size: .98rem; color: rgb(251 251 249 / .88); }

.tile--solid { background: var(--green); justify-content: space-between; }
.tile__mark {
  position: relative; padding: clamp(1.25rem, 2.4vw, 2rem) clamp(1.25rem, 2.4vw, 2rem) 0;
  font-size: clamp(2.2rem, 3.6vw, 3rem); font-weight: 750; font-stretch: var(--stretch-mark); line-height: 1; letter-spacing: -.02em;
  color: rgb(251 251 249 / .95);
}

/* ---------- Zertifikate ---------- */
.certs-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.certs-wrap .note { margin-top: 1.25rem; color: var(--ink-2); max-width: 34ch; }
.certs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.cert { padding: 1.5rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--line); }
.cert:nth-child(odd) { border-right: 1px solid var(--line); }
.cert:nth-child(even) { padding-left: 1.5rem; }
.cert__name { display: block; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 750; font-stretch: var(--stretch-mark); line-height: 1.05; letter-spacing: -.015em; color: var(--green-dk); }
.cert__label { display: block; margin-top: .45rem; color: var(--ink-2); font-size: .98rem; }

/* ---------- Kontakt ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.contact__media { position: relative; min-height: 420px; overflow: hidden; }
.contact__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 18% 50%; }
.contact__body {
  padding: var(--section) max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)))
           var(--section) clamp(2rem, 5vw, 4.5rem);
}
.contact__intro { margin-top: 1.25rem; max-width: 40ch; color: var(--ink-2); }
.contact__phone {
  display: inline-block; margin-top: 1.75rem;
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 750; font-stretch: var(--stretch-mark); letter-spacing: -.02em; line-height: 1;
  color: var(--ink); text-decoration: none;
  background-image: linear-gradient(var(--green), var(--green));
  background-size: 100% 3px; background-position: 0 100%; background-repeat: no-repeat;
  padding-bottom: .35rem;
}
.contact__phone:hover { color: var(--green-dk); }
.contact__mail { display: inline-block; margin-top: 1rem; font-weight: 600; }

.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; margin: 2.5rem 0 0; }
.contact-list dt { font-size: .85rem; font-weight: 650; color: var(--ink-2); }
.contact-list dd { margin: .25rem 0 0; }
.contact-list a { display: inline-block; padding-block: .15rem; }
.contact__note { margin-top: 2.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .98rem; max-width: 46ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.site-footer .brand__logo { height: 38px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.footer-nav a { color: var(--ink); font-weight: 550; text-decoration: none; }
.footer-nav a:hover { color: var(--green); text-decoration: underline; }
.site-footer__legal { width: 100%; font-size: .9rem; color: var(--ink-2); }

/* ---------- Rechtstexte ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--section); }
.legal .container { max-width: 800px; }
.back-link { display: inline-block; margin-bottom: 2rem; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin-bottom: 2rem; }
.legal h2 { font-size: 1.25rem; letter-spacing: -.01em; margin: 2.5rem 0 .75rem; }
.legal p, .legal address { margin: 0 0 1rem; }
.legal address { font-style: normal; }
.legal .lead-legal {
  font-size: 1.1rem; color: var(--ink); background: var(--tint);
  border-left: 3px solid var(--green); padding: 1.1rem 1.3rem; margin-bottom: 2rem;
}
.legal-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.legal-list li { position: relative; padding-left: 1.25rem; }
.legal-list li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 2px; background: var(--green); }
.legal .note { color: var(--ink-2); font-size: .95rem; }

/* ---------- Bewegung ---------- */
/* Hero: das Bild setzt sich beim Laden kurz zurecht – lenkt den Blick auf
   den Stempel. Abschnitte blenden beim Scrollen einmal ein. */
@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: hero-settle 1.4s var(--ease) both; }
  .hero__text > * { animation: rise .8s var(--ease) both; }
  .hero__text > :nth-child(2) { animation-delay: .08s; }
  .hero__text > :nth-child(3) { animation-delay: .16s; }

  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@keyframes hero-settle { from { transform: scale(1.06); } to { transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

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

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav__menu a:not(.btn) { padding-inline: .55rem; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  /* Gestapelt: Schriftgröße an die volle Spaltenbreite koppeln (Wort = 9,86 em). */
  .hero__title { font-size: clamp(1.75rem, calc((100vw - 2 * var(--gutter)) / 10.2), 3.4rem); }
  .hero__text { padding: 2.75rem var(--gutter) 2.5rem; }
  .hero__media { aspect-ratio: 4 / 3; }

  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: minmax(260px, auto); }
  .tile--a { grid-column: 1 / 3; grid-row: auto; min-height: 380px; }
  .tile--b { grid-column: 1 / 3; grid-row: auto; }
  .tile--c, .tile--d { grid-column: auto; grid-row: auto; }

  .certs-wrap { grid-template-columns: 1fr; }

  .contact { grid-template-columns: 1fr; }
  .contact__media { min-height: 0; aspect-ratio: 3 / 2; }
  .contact__body { padding: 3rem var(--gutter) 3.5rem; }
}

@media (max-width: 860px) {
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin-right: -10px; background: transparent; border: 0; cursor: pointer; position: relative;
  }
  .nav__toggle-bar, .nav__toggle-bar::before, .nav__toggle-bar::after {
    content: ""; display: block; width: 24px; height: 2px; background: var(--ink);
    transition: transform .25s var(--ease), background-color .2s;
  }
  .nav__toggle-bar::before { position: absolute; transform: translateY(-7px); }
  .nav__toggle-bar::after  { position: absolute; transform: translateY(7px); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::before { transform: rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bar::after  { transform: rotate(-45deg); }

  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1.25rem;
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity .2s, transform .2s var(--ease), visibility 0s .2s;
  }
  .nav__menu.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s var(--ease); }
  .nav__menu a:not(.btn) { display: block; padding: .85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); background-image: none; }
  .nav__menu .btn { margin: 1rem 0 0; width: 100%; }
}

@media (max-width: 640px) {
  .facts { grid-template-columns: 1fr; gap: 1.5rem; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile--a, .tile--b, .tile--c, .tile--d { grid-column: auto; min-height: 300px; }
  .tile--c { min-height: 220px; }
  .certs { grid-template-columns: 1fr; }
  .cert:nth-child(odd) { border-right: 0; }
  .cert:nth-child(even) { padding-left: 0; }
  .contact-list { grid-template-columns: 1fr; }
  .brand__logo { height: 40px; }
}
