/* ==========================================================================
   oekogrips – Kreislaufoase Ripshausen
   Farben & Typo gemäss Brandbook v1 (kumpáan GmbH)
   Mobile-first; Referenz-Design: 390px Breite
   ========================================================================== */

@font-face {
  font-family: "Aptly";
  src: url("../fonts/Aptly_Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aptly";
  src: url("../fonts/Aptly_Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aptly";
  src: url("../fonts/Aptly_Regular_Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Aptly";
  src: url("../fonts/Aptly_Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Aptly";
  src: url("../fonts/Aptly_Bold_Italic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Farben */
  --yellow: #f0c56a;
  --cream: #edebd7;
  --green: #435d4a;

  /* Abstände */
  --edge: clamp(22px, 1.2vw + 17px, 56px);      /* Header/Footer: volle Breite */
  --gutter: clamp(36px, 4.5vw + 18px, 120px);   /* Inhalt */
  --footer-x: clamp(48px, 5vw + 28px, 160px);   /* Footer links/rechts */
  --maxw: 1920px;
  --textw: 40rem;
  --section-gap: clamp(120px, 8vw + 90px, 240px);
  --col-gap: clamp(48px, 6vw, 140px);

  /* Typografie – Werte bei 390px entsprechen dem Screen-Design */
  --fs-body: clamp(20px, 0.38vw + 18.5px, 24px);
  --fs-small: clamp(20px, 0.2vw + 19.2px, 22px);
  --fs-lead: clamp(22px, 0.75vw + 19px, 32px);
  --fs-lead-xl: clamp(22px, 1.5vw + 16px, 42px);
  --fs-h2: clamp(42px, 2.9vw + 31px, 88px);
  --fs-quote: clamp(42px, 2.4vw + 33px, 76px);
  /* Hero: wächst mit der Breite, wird aber zusätzlich durch die Höhe begrenzt
     (max. 4 Zeilen + Header + Pfeil passen in 100svh) */
  --fs-hero: clamp(56px, min(20.7vw, 7vw + 53px, 25svh - 95px), 210px);
  --fs-hero-sub: clamp(48px, min(17.4vw, 5.8vw + 45px, 25svh - 95px), 176px);
  --fs-btn: clamp(22px, 0.4vw + 20.5px, 27px);
  --fs-btn-lg: clamp(28px, 0.9vw + 25px, 40px);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--green);
  font-family: "Aptly", "Arial Narrow", sans-serif;
  font-weight: 300; /* Fliesstext: Aptly Light gemäss Brandbook */
  font-size: var(--fs-body);
  line-height: 1.25;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p {
  margin: 0 0 1.25em;
  hyphens: auto;
  -webkit-hyphens: auto;
}

p:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

figure,
blockquote {
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--green);
  color: var(--yellow);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

/* --------------------------------------------------------------------------
   Header – volle Breite
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--cream);
  transition: transform 0.4s var(--ease);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.header-bar,
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: clamp(18px, 0.8vw + 15px, 32px) var(--edge) clamp(14px, 0.6vw + 12px, 26px);
}

.logo {
  display: block;
  width: clamp(112px, 5.5vw + 90px, 210px);
}

.logo img {
  width: 100%;
  height: auto;
}

.menu-toggle,
.nav-close {
  display: grid;
  place-content: center;
  width: clamp(48px, 1.2vw + 43px, 64px);
  height: clamp(48px, 1.2vw + 43px, 64px);
  margin-right: -6px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--green);
  cursor: pointer;
}

.menu-toggle {
  gap: clamp(5px, 0.2vw + 4px, 8px);
}

.menu-toggle span {
  display: block;
  width: clamp(38px, 1vw + 34px, 52px);
  height: 4px;
  border-radius: 4px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}

.menu-toggle:hover span:nth-child(1) {
  transform: translateX(-4px);
}
.menu-toggle:hover span:nth-child(3) {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Navigation (Overlay)
   -------------------------------------------------------------------------- */

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: clamp(48px, 6vh, 90px);
  background: var(--cream);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.4s var(--ease), visibility 0s linear 0.4s;
}

.nav-overlay.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.4s var(--ease), visibility 0s;
}

.nav-bar {
  justify-content: flex-end;
}

.nav-close svg {
  width: clamp(30px, 0.8vw + 27px, 42px);
  height: clamp(30px, 0.8vw + 27px, 42px);
  transition: transform 0.4s var(--ease);
}

.nav-close:hover svg {
  transform: rotate(90deg);
}

.nav-main {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 0.4vw + 8px, 16px);
  width: clamp(222px, 12vw + 175px, 400px);
  margin-top: clamp(40px, 10vh, 130px);
}

.nav-legal {
  margin: clamp(60px, 11vh, 140px) 0 0;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: var(--fs-small);
}

.nav-legal a {
  color: var(--yellow);
  text-decoration: none;
  line-height: 1.2;
}

.nav-legal a:hover,
.nav-legal a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-logo {
  width: clamp(190px, 8vw + 160px, 300px);
  margin-top: auto;
  padding-top: 60px;
}

.nav-overlay [data-nav-item] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.nav-overlay.is-open [data-nav-item] {
  opacity: 1;
  transform: none;
  transition-delay: calc(0.08s + var(--i, 0) * 0.07s);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(232px, 6vw + 210px, 320px);
  min-height: clamp(74px, 1.6vw + 68px, 96px);
  padding: 10px clamp(30px, 1vw + 26px, 44px);
  border: 3px solid var(--green);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 700;
  font-size: var(--fs-btn);
  line-height: 1.14;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s var(--ease);
}

.btn:hover {
  background: var(--green);
  color: var(--yellow);
}

.btn:active {
  transform: scale(0.97);
}

.btn--nav {
  width: 100%;
  min-width: 0;
  min-height: clamp(63px, 1.8vw + 56px, 92px);
  font-size: var(--fs-btn-lg);
  line-height: 1;
}

.btn--nav[aria-current="page"] {
  background: var(--green);
  color: var(--yellow);
}

.btn--yellow {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn--yellow:hover {
  background: var(--yellow);
  color: var(--green);
}

.btn--yellow-solid {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--green);
}

.btn--yellow-solid:hover {
  background: transparent;
  color: var(--yellow);
}

.btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

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

.hero {
  min-height: calc(100svh - var(--header-h, 84px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(24px, 6svh, 110px);
  padding-bottom: clamp(32px, 5svh, 100px);
}

.hero h1 {
  color: var(--yellow);
  font-size: var(--fs-hero);
  line-height: 1;
  letter-spacing: -0.005em;
  max-width: 9ch;
  hyphens: manual;
}

.hero--sub h1 {
  font-size: var(--fs-hero-sub);
  max-width: 11ch;
}

.hero-down,
.scroll-down {
  align-self: center;
  margin-top: 48px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  color: var(--green);
}

.hero-down svg,
.scroll-down svg {
  width: clamp(31px, 0.6vw + 29px, 42px);
  height: auto;
}

/* Pfeil unter «Ich will es herausfinden!» */
.scroll-down {
  grid-column: 1 / -1;
  margin: clamp(64px, 3vw + 52px, 120px) auto 0;
}

/* --------------------------------------------------------------------------
   Inhalte
   -------------------------------------------------------------------------- */

.lead {
  font-weight: 700;
  font-size: var(--fs-lead);
  line-height: 1.14;
  hyphens: manual;
}

.lead--xl {
  font-size: var(--fs-lead-xl);
}

.text {
  max-width: var(--textw);
}

.section {
  padding-bottom: var(--section-gap);
}

.section-title {
  color: var(--yellow);
  font-size: var(--fs-h2);
  line-height: 1;
  margin-bottom: clamp(48px, 2vw + 40px, 80px);
  hyphens: manual;
}

.block + .block {
  margin-top: clamp(72px, 3vw + 60px, 120px);
}

.block h3,
.block-title {
  font-size: var(--fs-lead);
  line-height: 1.14;
  margin-bottom: 1.1em;
}

.intro {
  padding-top: clamp(60px, 5vw + 40px, 140px);
  padding-bottom: var(--section-gap);
}

.intro .lead + .lead {
  margin-top: 1.14em;
}

/* Pfeiler: Energie / Wasser / Nahrung */
.pillars {
  display: grid;
  gap: clamp(110px, 4vw + 95px, 160px);
  padding-bottom: var(--section-gap);
}

.pillar-icon {
  height: clamp(100px, 2vw + 92px, 130px);
  margin: 0 auto 32px;
  color: var(--green);
}

.pillar-icon svg {
  height: 100%;
  width: auto;
  margin-inline: auto;
}

.pillar h3 {
  font-size: var(--fs-lead);
  line-height: 1.14;
}

.story .btn-stack {
  margin-top: clamp(72px, 3vw + 60px, 120px);
}

/* Bild Kreislaufoase */
.figure {
  margin: clamp(48px, 2.5vw + 38px, 110px) calc(var(--gutter) * -1);
  border-radius: clamp(40px, 2vw + 32px, 64px);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #cfd6c4;
}

.figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Porträt */
.portrait {
  width: min(220px, 60vw);
  margin: 0 auto clamp(56px, 2vw + 48px, 80px);
  border-radius: 26px;
  overflow: hidden;
  aspect-ratio: 220 / 285;
  background: #3d3a36;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about .text > div + div {
  margin-top: 1.25em;
}

.quote {
  margin: 0.4em 0 1.6em;
  color: var(--yellow);
  font-weight: 700;
  font-size: var(--fs-quote);
  line-height: 1;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.quote:last-child {
  margin-bottom: 0;
}

.cta {
  padding-bottom: var(--section-gap);
}

/* Rechtstexte */
.legal {
  padding-top: clamp(40px, 3vw + 28px, 110px);
  padding-bottom: var(--section-gap);
}

.legal .section-title {
  margin-bottom: clamp(40px, 2vw + 32px, 64px);
}

.legal .text > h2 {
  color: var(--yellow);
  font-size: var(--fs-h2);
  line-height: 1;
  margin: clamp(80px, 3vw + 68px, 130px) 0 clamp(36px, 1.5vw + 30px, 60px);
  hyphens: manual;
}

.legal h3 {
  font-size: var(--fs-lead);
  line-height: 1.14;
  margin: 2.2em 0 0.3em;
}

.legal .lead + h3,
.legal h2 + h3 {
  margin-top: 0;
}

.legal ul {
  margin: 0 0 1.25em;
  padding-left: 1.1em;
}

.legal li {
  margin-bottom: 0.6em;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.legal-list {
  display: grid;
  gap: clamp(56px, 2vw + 48px, 90px);
}

.legal-list h2 {
  font-size: var(--fs-lead);
  line-height: 1.14;
}

.legal-list p {
  margin-bottom: 0;
}

.legal a {
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Footer & Cookie-Banner
   Grüne Fläche mit grosser Rundung, die seitlich über den Rand hinausläuft
   (wie im Screen-Design) – per Pseudo-Element, damit nichts horizontal scrollt.
   -------------------------------------------------------------------------- */

.site-footer,
.cookie-banner {
  isolation: isolate;
  overflow: hidden;
  color: var(--yellow);
}

.site-footer::before,
.cookie-banner::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -27px -130px;
  border-radius: clamp(77px, 3vw + 65px, 130px);
  background: var(--green);
}

.site-footer {
  position: relative;
  font-size: var(--fs-small);
}

.footer-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  width: 100%;
  padding: 26px var(--footer-x) 40px;
}

.site-footer address {
  font-style: normal;
}

.site-footer strong {
  font-weight: 700;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 102px;
}

.footer-links a,
.footer-links button {
  color: inherit;
  text-decoration: none;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 1.25;
}

.footer-links a:hover,
.footer-links button:hover,
.footer-mail a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-mail {
  grid-column: 1 / -1;
  margin-top: 1.25em;
}

.footer-mail a {
  text-decoration: none;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  filter: drop-shadow(0 -8px 30px rgba(30, 45, 34, 0.2));
  transform: translateY(105%);
  transition: transform 0.7s var(--ease);
}

.cookie-banner.is-visible {
  transform: none;
}

.cookie-banner .container {
  padding-top: clamp(26px, 1vw + 22px, 44px);
  padding-bottom: clamp(32px, 1vw + 28px, 48px);
}

.cookie-banner h2 {
  font-size: var(--fs-lead);
  line-height: 1.14;
}

.cookie-banner p {
  margin: 0.2em 0 0;
}

.cookie-banner a {
  text-underline-offset: 4px;
}

.cookie-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 40px;
}

.cookie-actions .btn {
  min-width: clamp(225px, 3vw + 213px, 280px);
  min-height: clamp(64px, 1vw + 60px, 80px);
  font-size: var(--fs-btn-lg);
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Eingangsanimationen
   -------------------------------------------------------------------------- */

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(0.35em);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.js .header-bar {
  animation: fade-down 0.8s var(--ease) both;
}

.js [data-split] .word {
  display: inline-block;
  animation: word-in 0.9s var(--ease) both;
  animation-delay: calc(0.15s + var(--i) * 0.09s);
}

.js .hero-down {
  animation: fade-in 0.8s ease both;
  animation-delay: var(--down-delay, 1s);
}

.js .hero-down svg {
  animation: nudge 2.2s ease-in-out infinite;
  animation-delay: calc(var(--down-delay, 1s) + 0.8s);
}

.js .scroll-down.is-visible svg {
  animation: nudge 2.2s ease-in-out 0.9s infinite;
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}

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

.js .pillar-icon {
  opacity: 0;
  transition: opacity 0.8s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--delay, 0s) + 0.1s);
}

.js .pillar-icon--sun {
  transform: rotate(-60deg) scale(0.7);
}

.js .pillar-icon--drops {
  transform: translateY(-36px);
}

.js .pillar-icon--plant {
  transform: scaleY(0.4);
  transform-origin: 50% 100%;
}

.js .pillar.is-visible .pillar-icon {
  opacity: 1;
  transform: none;
}

.js .figure.reveal img,
.js .portrait.reveal img {
  transform: scale(1.12);
  transition: transform 1.6s var(--ease);
}

.js .figure.reveal.is-visible img,
.js .portrait.reveal.is-visible img {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}

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

@media (min-width: 700px) {
  .cookie-actions {
    flex-direction: row;
  }

  .figure {
    margin-inline: 0;
  }

  .legal-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }

  .legal-list.text {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Desktop
   -------------------------------------------------------------------------- */

@media (min-width: 1000px) {
  .hero h1 {
    max-width: 14ch;
  }

  .hero--sub h1 {
    max-width: 13ch;
  }

  /* Zweispaltiges Raster: Titel links, Inhalt rechts */
  .split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--col-gap);
    align-items: start;
  }

  .split-aside {
    grid-column: 1;
  }

  .split-main {
    grid-column: 2;
  }

  .split-main--end {
    align-self: end;
  }

  .split-full {
    grid-column: 1 / -1;
  }

  .split > .section-title {
    margin-bottom: 0;
  }

  .is-sticky {
    position: sticky;
    top: clamp(110px, 8vw, 160px);
  }

  .split-main .block-title {
    margin-bottom: 0;
  }

  /* Startseite */
  .intro .lead {
    font-size: var(--fs-lead-xl);
    max-width: 24ch;
  }

  .pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--col-gap);
  }

  .pillar-icon {
    margin-left: 0;
  }

  .pillar-icon svg {
    margin-inline: 0;
  }

  .pillar:nth-child(2) {
    --delay: 0.12s;
  }
  .pillar:nth-child(3) {
    --delay: 0.24s;
  }

  .story {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--col-gap);
    align-items: end;
  }

  .story .btn-stack {
    margin-top: 0;
    align-items: flex-start;
  }

  /* Mehr davon – Textblöcke abwechselnd links / rechts versetzt */
  .stagger {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(20px, 2vw, 40px);
  }

  .stagger > * {
    grid-column: 1 / -1;
  }

  .stagger > .section-title {
    grid-column: 1 / span 6;
    grid-row: 1;
    margin-bottom: clamp(56px, 4vw, 96px);
  }

  .stagger > .stagger-sub {
    grid-column: 7 / -1;
    grid-row: 1;
    align-self: end;
    margin-bottom: clamp(56px, 4vw, 96px);
  }

  .stagger > .figure {
    margin-top: 0;
  }

  .stagger > .block:nth-of-type(odd) {
    grid-column: 1 / span 6;
  }

  .stagger > .block:nth-of-type(even) {
    grid-column: 6 / span 6;
  }

  .stagger > .block + .block {
    margin-top: clamp(56px, 3vw + 24px, 100px);
  }

  .figure {
    aspect-ratio: 21 / 9;
  }

  .cta .btn-stack {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
  }

  /* oekogrips */
  .lead--xl {
    max-width: 28ch;
  }

  .about .section-title {
    margin-bottom: clamp(40px, 3vw, 64px);
  }

  .about .portrait {
    width: min(100%, 340px);
    margin: 0;
  }

  .about .split-main {
    padding-top: clamp(120px, 10vw, 200px);
  }

  /* Rechtstexte */
  .legal-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Footer – volle Breite, an Logo-Kante ausgerichtet */
  .footer-bar {
    padding: clamp(40px, 2vw + 20px, 64px) var(--footer-x) clamp(48px, 2vw + 28px, 72px);
  }

  .footer-mail {
    grid-column: 1;
  }

  .cookie-banner .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 40px;
  }

  .cookie-actions {
    margin-top: 0;
  }
}
