/* ----- Tischlerei Berghoff · Beispielprojekt von Holterhaus Automation ----- */

:root {
  --paper: #FAF8F5;
  --paper-2: #F3EFE8;
  --ink: #1C1917;
  --oak: #B08D57;
  --muted: rgba(28, 25, 23, 0.64);
  --line: rgba(28, 25, 23, 0.12);
  --paper-dim: rgba(250, 248, 245, 0.6);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 400 1.05rem/1.75 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* height:auto ist Pflicht, sonst behält das Bild die im HTML gesetzte Pixel-Höhe,
   während max-width die Breite staucht, das Bild wird verzerrt. */
img { display: block; max-width: 100%; height: auto; }

::selection { background: var(--oak); color: var(--paper); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 380;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); }
h3 { font-size: clamp(1.55rem, 2.4vw, 2rem); font-weight: 400; }

.container {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}
.container.narrow { max-width: 900px; }

.label {
  font: 500 0.72rem/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--oak);
  margin: 0 0 1.3rem;
}

section { padding-block: clamp(5.5rem, 11vw, 9.5rem); }
section[id] { scroll-margin-top: 80px; }

.section-head { margin-bottom: clamp(3.2rem, 7vw, 5.5rem); }
.section-sub {
  margin: 1.2rem 0 0;
  color: var(--muted);
  max-width: 46ch;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.2rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ----- Reveal & Ken Burns ----- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in-view { opacity: 1; transform: none; }

.kb { overflow: hidden; }
.kb img {
  transform: scale(1.08);
  transition: transform 6.5s var(--ease);
}
.kb.in-view img { transform: scale(1); }

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

.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 60;
  color: var(--paper);
  padding-block: 1.35rem;
  transition: background 0.45s ease, color 0.45s ease, padding 0.45s ease, box-shadow 0.45s ease;
}
.header-inner {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.wordmark {
  font: 400 1.22rem/1 var(--serif);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav { display: flex; gap: 2.1rem; }
.main-nav a {
  font: 500 0.76rem/1 var(--sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.3s;
}
.main-nav a:hover { opacity: 1; }

.site-header.scrolled {
  background: rgba(250, 248, 245, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--ink);
  padding-block: 0.85rem;
  box-shadow: 0 1px 0 var(--line);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 80;
  color: inherit;
}
.burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  margin-inline: auto;
  background: currentColor;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
.burger.open span:first-child { transform: translateY(4.25px) rotate(45deg); }
.burger.open span:last-child { transform: translateY(-4.25px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
/* Schließen-Button im Overlay: der Burger liegt im Header-Stacking-Context (z-index 60)
   und damit unter dem Menü (65), er ist im geöffneten Zustand nicht klickbar.
   Dieses X gehört zum Overlay selbst und funktioniert deshalb immer. */
.menu-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: 1rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.25s ease;
}
.menu-close:hover, .menu-close:focus-visible { opacity: 1; }
.menu-close svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
}
.mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.mobile-menu a {
  font: 380 clamp(2rem, 8vw, 2.8rem)/1.1 var(--serif);
  text-decoration: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.mobile-menu .menu-foot {
  font: 500 0.72rem/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--oak);
  margin: 0;
}
body.menu-open { overflow: hidden; }
body.menu-open .mobile-menu { opacity: 1; visibility: visible; }
body.menu-open .mobile-menu a { opacity: 1; transform: none; }
body.menu-open .mobile-menu a:nth-child(1) { transition-delay: 0.1s; }
body.menu-open .mobile-menu a:nth-child(2) { transition-delay: 0.17s; }
body.menu-open .mobile-menu a:nth-child(3) { transition-delay: 0.24s; }
body.menu-open .mobile-menu a:nth-child(4) { transition-delay: 0.31s; }
body.menu-open .mobile-menu a:nth-child(5) { transition-delay: 0.38s; }
body.menu-open .site-header { background: transparent; color: var(--paper); box-shadow: none; }

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

.hero {
  position: relative;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: var(--ink);
  padding: 0;
}
.hero-media {
  position: absolute;
  inset: 0;
  will-change: transform;
}
.hero-media img {
  position: absolute;
  top: -14%;
  left: 0;
  width: 100%;
  height: 128%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 7s var(--ease);
}
.hero.loaded .hero-media img { transform: scale(1); }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 15, 13, 0.62) 0%, rgba(18, 15, 13, 0.16) 45%, rgba(18, 15, 13, 0.32) 100%);
}
.hero-inner {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  color: var(--paper);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
  padding-bottom: clamp(3.5rem, 9vh, 6.5rem);
}
.hero h1 {
  font-size: clamp(3.3rem, 9.5vw, 7.8rem);
  font-weight: 340;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0.3em 0 0.55em;
  max-width: 12ch;
}
.hero h1 em { font-style: italic; font-weight: 330; }
.hero-label { color: rgba(250, 248, 245, 0.85); }
.hero-label, .hero h1, .hero .cta {
  opacity: 0;
  animation: hero-in 1.3s var(--ease) forwards;
}
.hero h1 { animation-delay: 0.25s; }
.hero .cta { animation-delay: 0.5s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 1px;
  height: 68px;
  background: linear-gradient(to bottom, transparent, rgba(250, 248, 245, 0.75));
  animation: cue 2.6s ease-in-out infinite;
  transform-origin: top;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.35); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ----- CTA ----- */

.cta {
  display: inline-flex;
  align-items: center;
  padding: 1.05rem 2.1rem;
  border-radius: 999px;
  border: 1px solid;
  font: 500 0.76rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.4s, color 0.4s, border-color 0.4s;
}
.cta-light { color: var(--paper); border-color: rgba(250, 248, 245, 0.45); }
.cta-light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta-dark { color: var(--ink); border-color: rgba(28, 25, 23, 0.35); }
.cta-dark:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ----- Manifest ----- */

.manifest { padding-block: clamp(6.5rem, 14vw, 11rem); }
.manifest-text p {
  font: 350 clamp(1.5rem, 3vw, 2.3rem)/1.45 var(--serif);
  letter-spacing: -0.005em;
  margin: 0 0 1em;
  max-width: 30ch;
}
.manifest-text p:last-child { margin-bottom: 0; }

/* ----- Leistungen ----- */

.service {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-block: clamp(4.5rem, 10vw, 8.5rem);
}
.service:first-of-type { margin-top: 0; }
.service:last-of-type { margin-bottom: 0; }
.service figure { margin: 0; aspect-ratio: 3 / 4; }
.service figure img { width: 100%; height: 100%; object-fit: cover; }
.service:nth-of-type(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.service:nth-of-type(even) figure { order: 2; }
.service:nth-of-type(even) .service-text { order: 1; }

.num {
  display: block;
  font: 350 1rem/1 var(--serif);
  color: var(--oak);
  margin-bottom: 1.4rem;
}
.num::after {
  content: "";
  display: inline-block;
  width: 46px;
  height: 1px;
  background: var(--line);
  margin-left: 14px;
  vertical-align: middle;
}
.service-text h3 { margin-bottom: 1rem; }
.service-text p { color: var(--muted); max-width: 42ch; margin: 0; }

/* ----- Referenzen ----- */

.gallery { background: var(--paper-2); }
.masonry { columns: 3; column-gap: 1.4rem; }
.masonry figure {
  break-inside: avoid;
  margin: 0 0 1.4rem;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}
.masonry img {
  width: 100%;
  transition: transform 1.2s var(--ease);
}
.masonry figure::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 15, 13, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s;
}
.masonry figcaption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.1rem 1.25rem;
  color: var(--paper);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s 0.05s, transform 0.5s 0.05s;
}
.masonry figure:hover img { transform: scale(1.05); }
.masonry figure:hover::after { opacity: 1; }
.masonry figure:hover figcaption { opacity: 1; transform: none; }

/* ----- Werkstatt ----- */

.workshop { background: var(--ink); color: var(--paper); }
.numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: clamp(4rem, 8vw, 6.5rem);
}
.number { border-top: 1px solid rgba(250, 248, 245, 0.16); padding-top: 1.6rem; }
.count {
  font: 350 clamp(2.5rem, 5vw, 4.1rem)/1 var(--serif);
  font-variant-numeric: tabular-nums;
}
.number small {
  display: block;
  margin-top: 0.7rem;
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.workshop-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}
.workshop-grid .portrait { margin: 0; }
.workshop-grid .portrait img { width: 100%; height: auto; }
.workshop-grid .portrait figcaption {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--paper-dim);
}
.workshop-text p {
  font-size: 1.07rem;
  line-height: 1.85;
  color: rgba(250, 248, 245, 0.82);
  max-width: 54ch;
  margin: 0 0 1.4em;
}
.workshop-text blockquote {
  margin: 2.4rem 0 0;
  padding-left: 1.6rem;
  border-left: 1px solid var(--oak);
}
.workshop-text blockquote p {
  font: italic 350 clamp(1.35rem, 2.4vw, 1.75rem)/1.45 var(--serif);
  color: var(--paper);
  margin: 0;
}
.workshop-text cite {
  display: block;
  margin-top: 1.1rem;
  font: 500 0.72rem/1 var(--sans);
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oak);
}

/* ----- Ablauf ----- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.6rem, 3vw, 2.6rem);
}
.steps li { border-top: 1px solid var(--line); padding-top: 1.8rem; }
.steps h3 { font-size: 1.22rem; margin: 0.9rem 0 0.7rem; }
.steps p { font-size: 0.94rem; line-height: 1.7; color: var(--muted); margin: 0; }
.steps .num { margin-bottom: 0; }
.steps .num::after { content: none; }

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

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(3rem, 7vw, 6rem);
  margin-bottom: clamp(3.5rem, 6vw, 5rem);
}
.contact-info address {
  font: 350 1.45rem/1.5 var(--serif);
  font-style: normal;
  margin: 0 0 1.7rem;
}
.contact-links { margin: 0 0 2.2rem; line-height: 2.1; }
.contact-links a {
  text-decoration: none;
  border-bottom: 1px solid rgba(176, 141, 87, 0.45);
  transition: color 0.3s, border-color 0.3s;
}
.contact-links a:hover { color: var(--oak); border-color: var(--oak); }
.hours { margin: 0; max-width: 340px; }
.hours div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.hours dt { color: var(--muted); }
.hours dd { margin: 0; }

.field { margin-bottom: 1.9rem; }
.field label {
  display: block;
  font: 500 0.7rem/1 var(--sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.field input,
.field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(28, 25, 23, 0.28);
  border-radius: 0;
  background: transparent;
  padding: 0.5rem 0 0.8rem;
  font: 400 1.05rem/1.5 var(--sans);
  color: var(--ink);
  transition: border-color 0.3s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--oak); }
.form-note { font-size: 0.82rem; color: var(--muted); margin: 1.1rem 0 0; }
.form-success {
  padding: 1.8rem 2rem;
  border: 1px solid rgba(176, 141, 87, 0.45);
  background: rgba(176, 141, 87, 0.07);
}
.form-success p { margin: 0; }

.map { margin: 0; }
.map iframe {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  border: 0;
  filter: grayscale(1) sepia(0.14) contrast(0.92) opacity(0.9);
  pointer-events: none;
}
.map figcaption { font-size: 0.72rem; color: var(--muted); margin-top: 0.6rem; }
.map figcaption a { color: inherit; }

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

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: clamp(4rem, 8vw, 6rem) 2.6rem;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
  padding-bottom: 2.8rem;
  border-bottom: 1px solid rgba(250, 248, 245, 0.12);
  margin-bottom: 2.4rem;
}
.site-footer .wordmark { font-size: 1.45rem; }
.footer-nav { display: flex; gap: 1.9rem; flex-wrap: wrap; }
.footer-nav a {
  font: 500 0.74rem/1 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(250, 248, 245, 0.65);
  transition: color 0.3s;
}
.footer-nav a:hover { color: var(--paper); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.demo-note {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(250, 248, 245, 0.55);
  max-width: 60ch;
  margin: 0;
}
.demo-note a { color: var(--oak); }
.legal { font-size: 0.8rem; color: rgba(250, 248, 245, 0.45); margin: 0; }
.legal a { color: rgba(250, 248, 245, 0.65); text-decoration: none; }
.legal a:hover { color: var(--paper); text-decoration: underline; }

/* ----- Lightbox ----- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 10, 0.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }
.lightbox figure {
  margin: 0;
  text-align: center;
  transform: scale(0.965);
  transition: transform 0.5s var(--ease);
}
.lightbox.open figure { transform: scale(1); }
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  margin-inline: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lightbox figcaption {
  margin-top: 1.1rem;
  color: rgba(250, 248, 245, 0.75);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}
.lightbox button {
  position: fixed;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(250, 248, 245, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lightbox button:hover { background: rgba(250, 248, 245, 0.14); }
.lb-close { top: 1.2rem; right: 1.4rem; }
.lb-prev { left: 1.4rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.4rem; top: 50%; transform: translateY(-50%); }

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

@media (max-width: 1020px) {
  .masonry { columns: 2; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .burger { display: flex; }
  .service,
  .service:nth-of-type(even) { grid-template-columns: 1fr; gap: 1.8rem; }
  .service:nth-of-type(even) figure { order: 0; }
  .service:nth-of-type(even) .service-text { order: 1; }
  .service figure { aspect-ratio: 4 / 3; }
  .workshop-grid { grid-template-columns: 1fr; }
  .workshop-grid .portrait { max-width: 480px; }
  .numbers { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; gap: 3.5rem; }
  .map iframe { aspect-ratio: 16 / 10; }
}

@media (max-width: 560px) {
  .masonry { columns: 1; }
  .steps { grid-template-columns: 1fr; }
  .hero { min-height: 560px; }
  .hero h1 { font-size: clamp(2.9rem, 13vw, 4rem); }
  .footer-top, .footer-bottom { flex-direction: column; align-items: flex-start; }
  .lightbox button { width: 44px; height: 44px; }
  .lb-prev { left: 0.7rem; }
  .lb-next { right: 0.7rem; }
  .lb-close { right: 0.7rem; }
}

/* ----- Reduced Motion ----- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .kb img { transform: none; transition: none; }
  .hero-media img { transform: none; transition: none; }
  .hero-label, .hero h1, .hero .cta { animation: none; opacity: 1; }
  .scroll-cue { animation: none; }
  .masonry img { transition: none; }
  .mobile-menu, .mobile-menu a { transition: none; }
}
