/* Bauunternehmung Karl Baur
   Direction "Baur baut": the Rohbau as a construction drawing in Baur red, on white. Baur navy
   for type; the logo red is the brand's second voice: the hero line, the calls, the crane and
   the Pritsche. Rules in DESIGN.md. 4px grid, one font (Archivo). */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/archivo-latin.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;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@view-transition { navigation: auto; }

/* ---------- Tokens ---------- */
:root {
  /* The page is the white of the Bauschild: the logo colours are at home on it */
  --bg: #ffffff;
  --bg-rgb: 255, 255, 255;
  --surface: #ffffff;
  --line: rgba(0, 43, 70, 0.12);
  --line-strong: rgba(0, 43, 70, 0.24);

  /* Baur navy from the logo, and two quieter steps of it */
  --ink: #002b46;
  --text-2: #3a4b59;
  --muted: #5d6b78;

  /* The logo red: the hero line and the calls. On white it reaches 4.9:1, as does white on it. */
  --red: #e2011b;
  --red-deep: #c20018;
  --call: var(--red);
  --call-hover: var(--red-deep);

  /* Brick: the month bricks */
  --brick: #c27a50;

  /* The navy ground under the Bauschild and the footer */
  --navy: #002b46;
  --navy-2: #00223a;
  --on-navy: #eef3f7;
  --on-navy-2: #a9bccb;

  /* The Bauschild: a white sign with navy lettering */
  --sign: #ffffff;
  --sign-muted: #5a6875;
  --sign-line: rgba(0, 43, 70, 0.14);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --condensed: 75%;

  --wrap: 1320px;
  --gutter: 20px;
  --edge: max(var(--gutter), calc((100vw - var(--wrap)) / 2));
  --section: 96px;
  --radius: 8px;
  --plate: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 160ms;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; --section: 160px; }
}

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

html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }

a { color: var(--ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--plate); }
::selection { background: var(--ink); color: #fff; }

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Type ---------- */
h1, h2, h3 { color: var(--ink); font-weight: 500; text-wrap: balance; }

.display {
  font-size: clamp(2.5rem, 1rem + 5vw, 6.5rem);
  font-stretch: var(--condensed);
  font-weight: 500;
  line-height: 0.96;
  letter-spacing: -0.025em;
}
.display--m { font-size: clamp(2.25rem, 1rem + 3.4vw, 4.75rem); line-height: 1; }

.kicker {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn--lg { height: 56px; padding-inline: 28px; font-size: 1.125rem; }
.btn--lg .icon { width: 20px; height: 20px; }
.btn--icon { width: 44px; padding: 0; }

.btn--call { background: var(--call); color: #fff; }
.btn--call:hover { background: var(--call-hover); }

.btn--ghost { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.6); }
.btn--ghost:hover { background: #fff; border-color: var(--ink); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.link-arrow .icon { transition: transform var(--fast) var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* ---------- Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease), transform 400ms var(--ease);
}
.header.is-solid { border-bottom-color: var(--line); }
.header.is-hidden { transform: translateY(-100%); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 88px;
  padding-inline: var(--edge);
}

.brand { display: block; flex: none; border-radius: var(--plate); }
.brand img { width: auto; height: 56px; }

.nav { display: flex; align-items: center; gap: 32px; }

.nav__link {
  padding-block: 8px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.nav__link:hover { color: var(--ink); }

/* The header call stays quiet while the hero shows its own red button */
.nav__call { border-color: var(--line-strong); }
.nav__call:hover { background: #fff; border-color: var(--ink); }
.header.is-past .nav__call { background: var(--call); border-color: transparent; color: #fff; }
.header.is-past .nav__call:hover { background: var(--call-hover); }

.header__mobile { display: none; gap: 8px; }
.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--open { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: block; }

@media (max-width: 767px) {
  .header__inner { height: 64px; }
  .brand img { height: 40px; }
  .header__mobile { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav__link { padding-block: 16px; font-size: 1.25rem; color: var(--ink); border-bottom: 1px solid var(--line); }
  .nav .nav__call { margin-top: 16px; height: 52px; font-size: 1.125rem; background: var(--call); border-color: transparent; color: #fff; }
}

/* ---------- Bauschild caption (signature) ---------- */
.bauschild {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 4px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
}
.bauschild__label {
  padding-right: 12px;
  border-right: 1px solid var(--line-strong);
  color: var(--muted);
}

/* ---------- Scene: the Rohbau as a drawing in Baur red, the chapters scroll past it ---------- */
.scene { position: relative; }

.scene__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
}

.scene__fallback, .scene__canvas, .scene__notes { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene__fallback { object-fit: cover; object-position: 70% 50%; }
.scene__canvas { display: block; touch-action: pan-y; cursor: grab; }
.scene__canvas.is-grabbing { cursor: grabbing; }
.scene__notes { pointer-events: none; }
.scene:not(.has-3d) .scene__canvas,
.scene:not(.has-3d) .scene__notes,
.scene:not(.has-3d) .scene__sheet,
.scene:not(.has-3d) .schriftfeld,
.scene:not(.has-3d) .scene__meta { display: none; }
.scene.has-3d .scene__fallback { display: none; }

/* The sheet: a drawing frame in pen red, inset from the paper's edge */
.scene__sheet {
  position: absolute;
  inset: 84px 16px 16px;
  border: 1px solid rgba(226, 1, 27, 0.55);
  pointer-events: none;
}

/* Page-coloured scrim behind the chapters, so they read */
.scene__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to right, rgba(var(--bg-rgb), 0.96) 0%, rgba(var(--bg-rgb), 0.82) 34%, rgba(var(--bg-rgb), 0) 62%);
}
.scene.has-3d .scene__stage::after {
  background: linear-gradient(to right, rgba(var(--bg-rgb), 0.94) 0%, rgba(var(--bg-rgb), 0.9) 32%, rgba(var(--bg-rgb), 0.5) 42%, rgba(var(--bg-rgb), 0) 52%);
}

/* Bottom left, under the chapters */
.scene__meta {
  position: absolute;
  left: var(--edge);
  bottom: 40px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}
.scene__meta.is-covered { opacity: 0; }
.scene__hint { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--red); }

/* The Schriftfeld, bottom right in the frame, as on every plan: what is being built, right now */
.schriftfeld {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 336px;
  background: #fff;
  border-top: 1px solid rgba(226, 1, 27, 0.55);
  border-left: 1px solid rgba(226, 1, 27, 0.55);
  color: var(--red);
  font-size: 0.8125rem;
  line-height: 1.3;
  pointer-events: none;
}
.schriftfeld div { padding: 6px 10px 7px; border-right: 1px solid rgba(226, 1, 27, 0.3); border-bottom: 1px solid rgba(226, 1, 27, 0.3); }
.schriftfeld div:nth-child(2n) { border-right: 0; }
.schriftfeld .schriftfeld__wide { grid-column: 1 / -1; border-right: 0; }
.schriftfeld div:last-child { border-bottom: 0; }
.schriftfeld dt { font-size: 0.6875rem; color: var(--red-deep); }
.schriftfeld dd { font-weight: 500; font-stretch: var(--condensed); font-size: 1rem; }

/* Chapters: they pull themselves up over the stage, so the stage never sticks past the section */
.scene__chapters { position: relative; z-index: 1; margin-top: -100svh; pointer-events: none; }

.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: 120px var(--edge) 96px;
}
.chapter__inner { max-width: 600px; pointer-events: auto; }
.chapter--hero .chapter__inner { max-width: 760px; }

.hero__title {
  font-size: clamp(3.5rem, 1rem + 5.8vw, 7rem);
  font-stretch: var(--condensed);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.03em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .line > span { display: block; }
.hero__title .line--red { color: var(--red); }

.hero__lead { max-width: 26em; margin-top: 32px; font-size: 1.1875rem; line-height: 1.55; color: var(--text-2); }
.nobr { white-space: nowrap; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.chapter__text { max-width: 26em; margin-top: 24px; font-size: 1.1875rem; line-height: 1.55; color: var(--text-2); }

.values { display: grid; gap: 4px; margin-top: 16px; }
.values li {
  font-size: clamp(2.25rem, 1rem + 3.6vw, 5rem);
  font-stretch: var(--condensed);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* The twelve months as one course of bricks */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 560px; margin-top: 40px; }
.months li {
  padding-top: 12px;
  border-top: 20px solid var(--brick);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
}

/* The one entrance: the headline rises with the first courses */
.js .hero__title .line > span { transform: translateY(110%); transition: transform 1100ms var(--ease); }
.js .hero__title .line:nth-child(2) > span { transition-delay: 90ms; }
.js .hero__lead, .js .hero__actions { opacity: 0; transform: translateY(12px); transition: opacity 800ms var(--ease) 360ms, transform 800ms var(--ease) 360ms; }
.js .is-loaded .hero__title .line > span { transform: none; }
.js .is-loaded .hero__lead, .js .is-loaded .hero__actions { opacity: 1; transform: none; }

/* Phones: the drawing fills the screen; each chapter slides up over it as a plan slip, a white
   card with a red rule, and between the slips the house is seen growing */
@media (max-width: 767px) {
  .scene__stage::after { display: none; }
  .scene__sheet { inset: 72px 8px 8px; }
  .scene__meta { display: none; }

  /* Only the Bauabschnitt, in the sheet's top right corner, where no slip covers it */
  .schriftfeld {
    top: 72px;
    right: 8px;
    bottom: auto;
    width: auto;
    grid-template-columns: auto;
    border-top: 0;
    border-bottom: 1px solid rgba(226, 1, 27, 0.55);
  }
  .schriftfeld div:not(:nth-child(2)) { display: none; }
  .schriftfeld div:nth-child(2) { display: flex; align-items: baseline; gap: 10px; border: 0; padding: 6px 10px; }
  .schriftfeld dd { min-width: 8.5em; }

  .chapter { justify-content: flex-end; padding: 96px 16px 16px; }
  .chapter__inner {
    padding: 20px 20px 24px;
    background: #fff;
    border: 1px solid rgba(226, 1, 27, 0.55);
    box-shadow: 0 12px 32px -16px rgba(0, 43, 70, 0.18);
  }
  .hero__title { font-size: clamp(2.5rem, 0.4rem + 11.2vw, 3.5rem); }
  .hero__lead { margin-top: 14px; font-size: 1.0625rem; line-height: 1.5; }
  .hero__actions { flex-wrap: nowrap; gap: 8px; margin-top: 20px; }
  .hero__actions .btn--lg { flex: 1 1 0; height: 52px; padding-inline: 10px; font-size: 1rem; white-space: nowrap; }
  .chapter .display { font-size: 2.5rem; }
  .chapter__text { margin-top: 14px; font-size: 1.0625rem; line-height: 1.5; }
  .values { margin-top: 10px; }
  .values li { font-size: 2.125rem; }
  .months { margin-top: 20px; }
  .months li { font-size: 0; }
  .months li::first-letter { font-size: 0.75rem; }
}

/* ---------- Types: three Rohbau models ---------- */
.types { padding-block: var(--section); border-top: 1px solid var(--line); }
.types__hint { margin-top: 16px; color: var(--muted); }

.models { position: relative; margin-top: 48px; }
.models__canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.models:not(.has-3d) .models__canvas { display: none; }
.models:not(.has-3d) ~ .types__hint, .types:not(:has(.has-3d)) .types__hint { display: none; }

.models__list { position: relative; display: grid; gap: 48px 24px; }
.model__stage { position: relative; height: clamp(320px, 30vw, 440px); border-radius: var(--radius); }
.model__photo { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.models.has-3d .model__photo { visibility: hidden; }
.models.has-3d .model__stage { cursor: grab; touch-action: pan-y; }
.models.has-3d .model__stage.is-grabbing { cursor: grabbing; }

.model__name {
  margin-top: 16px;
  font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.75rem);
  font-stretch: var(--condensed);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.model__note { margin-top: 4px; color: var(--muted); }

@media (min-width: 768px) {
  .models__list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Projects strip ---------- */
.projects { padding-block: var(--section); border-top: 1px solid var(--line); }

.projects__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}
.projects__nav { display: flex; gap: 8px; }

.strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  padding-inline: var(--edge);
  padding-bottom: 8px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.strip::-webkit-scrollbar { display: none; }
.strip:focus-visible { outline-offset: -2px; }

.strip__item { flex: 0 0 clamp(280px, 84vw, 640px); scroll-snap-align: start; }
.strip__item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface);
}
.strip__item .bauschild { margin-top: 12px; }

.projects .link-arrow { margin-top: 40px; }

@media (max-width: 767px) {
  .projects__nav { display: none; }
}

/* ---------- Finale: the Bauschild on Baur navy ---------- */
.finale { padding-block: var(--section) 0; background: var(--navy); color: var(--on-navy-2); }
.finale__title { color: var(--on-navy); }
.finale :focus-visible { outline-color: var(--on-navy); }

.sign { margin-top: 48px; }

.sign__panel {
  display: grid;
  gap: 32px;
  padding: clamp(24px, 4vw, 56px);
  background: var(--sign);
  border-radius: var(--plate);
  color: var(--ink);
}
.sign :focus-visible { outline-color: var(--ink); }

.sign__logo { width: auto; height: clamp(72px, 8vw, 112px); }

.sign__row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-block: 16px;
  border-top: 1px solid var(--sign-line);
}
.sign__row dt { font-size: 0.9375rem; color: var(--sign-muted); }
.sign__row dd { font-size: 1.125rem; color: var(--ink); }
.sign a { color: var(--ink); }

.sign__phone {
  display: block;
  width: fit-content;
  font-size: clamp(3.25rem, 0.5rem + 11vw, 11rem);
  font-stretch: var(--condensed);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.sign__phone:hover { color: var(--call); }

/* Two posts carry the sign down to the ground */
.sign__posts { display: flex; justify-content: space-between; padding-inline: 12%; }
.sign__posts span { width: 16px; height: 96px; background: #2c4c66; }

.finale__signoff { padding-block: 24px 64px; color: var(--on-navy-2); }

@media (max-width: 767px) {
  .sign__row { grid-template-columns: 1fr; gap: 4px; }
  .sign__posts span { width: 12px; height: 64px; }
}

/* ---------- Footer ---------- */
.footer { background: var(--navy-2); font-size: 0.875rem; color: var(--on-navy-2); }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 32px;
}
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__nav a { color: var(--on-navy); text-decoration: none; }
.footer__nav a:hover { text-decoration: underline; }
.footer :focus-visible { outline-color: var(--on-navy); }

/* ---------- Reduced motion: static and complete ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .js .hero__title .line > span, .js .hero__lead, .js .hero__actions { opacity: 1; transform: none; }
}
