/* Page structure: container, notice, header, footer, hero and text/image rows. */

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

main {
  flex-grow: 1;
}

/* ---------- Notice (closures etc., set in _data/notice.json) ---------- */

.notice {
  padding: var(--space-3) var(--gutter);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: var(--leading-normal);
  text-align: center;
  color: var(--cream);
  background: var(--brown);
}

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

/* The header always takes up --header-height, so the page below never moves.
   Only the bar inside shrinks on scroll; the strip it leaves is see-through
   and lets clicks pass to the page.
   Every item has a fixed height (logo and nav 56px, WhatsApp 48px), so the bar
   is exactly padding + 56px. On scroll the items shrink with transform, which
   doesn't change their layout size, and only the padding goes down. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: var(--header-height);
  pointer-events: none;
}
/* On short screens (landscape phones, 400% zoom) a sticky header would cover
   a third of the page or more, so there it scrolls away with the page. */
@media (max-height: 480px) {
  html {
    scroll-padding-top: 0;
  }
  .site-header {
    position: relative;
  }
}
.site-header__bar {
  background: var(--cream);
  transition:
    background-color var(--ease),
    box-shadow var(--ease);
  pointer-events: auto;
}
.is-scrolled .site-header__bar {
  background: var(--brown);
  box-shadow: var(--shadow-header);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-6);
  padding-block: var(--space-4);
  transition: padding var(--ease);
}
.is-scrolled .site-header__inner {
  padding-block: var(--space-1); /* 4 + 56 + 4 = 64px */
}

.site-header__logo {
  display: flex;
  flex-shrink: 0;
  transform-origin: left center;
  transition: transform var(--ease);
}
.site-header__logo img {
  display: block;
  width: auto;
  height: 56px;
}
.is-scrolled .site-header__logo {
  transform: scale(calc(40 / 56));
}
/* Brown logo on cream, cream logo on brown. */
.logo--light,
.is-scrolled .logo--dark {
  display: none;
}
.is-scrolled .logo--light {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  margin-left: auto;
  transform-origin: right center;
  transition: transform var(--ease);
}
.is-scrolled .site-nav {
  transform: scale(calc(20 / 24)); /* text 24 → 20px */
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-14);
  padding-inline: var(--space-1);
  font-family: var(--font-caps);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  text-decoration: none;
  color: var(--brown);
  transition: color var(--ease);
}
.is-scrolled .site-nav a {
  color: var(--cream);
}
/* Current page and hover are shown with the same underline, not text colour:
   coral text on cream is only readable from 24px, and the nav goes down to 18px.
   The current page's line is coral and stays coral on hover. */
.site-nav a[aria-current="page"],
.site-nav a:hover,
.lang-switch:hover {
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: var(--space-1);
}
.site-nav a[aria-current="page"] {
  text-decoration-color: var(--coral);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.lang-switch {
  padding: var(--space-3) var(--space-2);
  font-family: var(--font-caps);
  font-size: var(--text-sm);
  text-decoration: none;
  color: var(--brown);
  opacity: 0.8;
  transition:
    color var(--ease),
    opacity var(--ease-fast);
}
.is-scrolled .lang-switch {
  color: var(--cream);
}
.lang-switch:hover {
  opacity: 1;
}

.whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  text-decoration: none;
  color: var(--cream);
  background: var(--brown);
  border-radius: var(--radius-pill);
  transition:
    background-color var(--ease),
    color var(--ease),
    transform var(--ease);
}
.is-scrolled .whatsapp {
  color: var(--brown);
  background: var(--cream);
  transform: scale(calc(40 / 48));
}
.whatsapp:hover {
  color: var(--cream);
  background: var(--coral);
}

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

.site-footer {
  color: var(--cream);
  background: var(--brown);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-10) var(--space-6);
}
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6) var(--space-12);
}
.site-footer__address {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}
.site-footer__address img {
  width: 64px;
}
.site-footer__address address {
  font-size: var(--text-sm);
  font-style: normal;
  line-height: var(--leading-normal);
}
.site-footer__social {
  display: flex;
  gap: var(--space-3);
}
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  font-family: var(--font-caps);
  font-size: var(--text-xs);
  color: var(--cream-muted);
}
.site-footer__bottom > span,
.site-footer__bottom a {
  padding-block: var(--space-2);
  text-decoration: none;
}
.site-footer__bottom a:hover {
  text-decoration: underline;
  color: var(--cream);
}
.site-footer__bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-7);
}

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

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  max-width: 1200px;
  padding-block: var(--space-28);
  text-align: center;
}
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: var(--leading-none);
  letter-spacing: -0.035em;
}
.hero h1 span {
  display: block;
  text-wrap: balance;
}
.hero__tagline {
  margin-top: var(--space-3);
  font-size: var(--text-tagline);
  color: var(--brown-light);
}
.hero__lead {
  max-width: 680px;
  margin-top: var(--space-2);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* ---------- Text + image rows ---------- */

/* Side by side until the tablet breakpoint, whatever the image size: the text
   never goes under 420px and the image shrinks to fit. Below it, all rows stack. */
.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-14) var(--space-24);
  padding-block: var(--space-18);
}
.feature__text {
  display: flex;
  flex: 1 0 420px;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 600px;
}
.feature__text p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}
.feature__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.feature__title {
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
}
.feature__subtitle {
  font-size: var(--text-script);
  line-height: var(--leading-snug);
}
/* Set --media-width on the element to size the picture. */
.feature__media {
  display: flex;
  flex: 0 1 var(--media-width, 380px);
  justify-content: center;
  min-width: 0;
}
.feature__media img {
  width: var(--media-width, 380px);
  max-width: 100%;
}

/* ---------- Preorder ---------- */

.preorder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: var(--space-18);
}

.preorder__text {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  max-width: 600px;
  text-align: center;
}
.preorder__text p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}
.preorder__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.preorder__title {
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
}
.preorder__subtitle {
  font-size: var(--text-script);
  line-height: var(--leading-snug);
}
.preorder__note {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  text-align: center;
  color: var(--brown-light);
}

/* ---------- Tablet ---------- */

/* Feature rows stack below this width (420px text + 96px gap + 340px image + gutters). */
@media (max-width: 920px) {
  .feature {
    flex-wrap: wrap;
  }
  .feature__text,
  .feature__media {
    flex-basis: 100%;
  }
  .feature__media {
    order: 2;
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  /* One row: mark (instead of the full logo, see header.njk), nav, buttons.
     Every item is 40px tall: 12 + 40 + 12 = 64px (--header-height), scrolled 56px.
     It needs 352px with the German nav; narrower screens get two rows, below. */
  .site-header__inner {
    column-gap: var(--space-2);
    padding-block: var(--space-3);
  }
  .is-scrolled .site-header__inner {
    padding-block: var(--space-2);
  }
  .site-header__logo img {
    height: 40px;
  }
  .is-scrolled .site-header__logo,
  .is-scrolled .site-nav,
  .is-scrolled .whatsapp {
    transform: none;
  }
  .site-nav {
    gap: var(--space-4);
    margin-inline: auto;
  }
  .site-nav a {
    min-height: var(--space-10);
    padding-inline: 0;
    font-size: var(--text-sm);
  }
  .site-header__actions {
    gap: var(--space-2);
  }
  .lang-switch {
    padding: var(--space-2) var(--space-1);
  }
  .whatsapp {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding-block: var(--space-14);
  }
  .hero__lead {
    font-size: var(--text-md);
  }

  .feature {
    gap: var(--space-8);
    padding-block: var(--space-10);
  }
  .feature__media img {
    width: auto;
    max-height: 280px;
  }

  .preorder {
    padding-block: var(--space-10);
  }
}

/* Two header rows on the narrowest phones: mark and buttons, then the nav.
   12 + 40 + 8 + 40 + 12 = 112px (--header-height), scrolled 104px.
   In em, so it also kicks in when the visitor sets a larger browser font size. */
@media (width < 22.5em) {
  .site-header__inner {
    row-gap: var(--space-2);
  }
  .site-header__actions {
    margin-left: auto;
  }
  .site-nav {
    order: 3;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-inline: 0;
  }
}
