/* Poppins, self-hosted (latin subset). Licence: fonts/OFL.txt */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/poppins-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-latin-600-normal.woff2") format("woff2");
}

/* Base ------------------------------------------------------------------ */

:root {
  --green: #4f934b; /* "SDH Mid Green" in Figma */
  --card-bg: #e5f3e5;
  --card-bg-hover: #dbeedb;
  --card-text: #102410;
  --content-width: 1024px;
  --gutter: 25px;
}

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

body {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: "Poppins", sans-serif;
  font-size: 1.125rem; /* 18px */
  line-height: 1.3;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Designer's note in Figma: "Links allgemein: Underline on Hover" */
a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Links with a ">" in front. The ">" is decorative, so screen readers skip it.
   The first declaration is a fallback for browsers without alt text in content. */
.arrow-link::before {
  content: ">\00a0";
  content: ">\00a0" / "";
  display: inline-block; /* keeps the ">" out of the hover underline */
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Layout -----------------------------------------------------------------
   Fluid sizes interpolate between the two Figma frames, mobile (402px wide)
   and desktop (1512px wide): clamp(mobile value, intercept + slope, desktop value). */

/* The green low-poly band scales with the viewport width, as between the two frames. */
.artwork {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: auto;
}

.page,
.footer__inner {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}

/* 140px → 200px. Beyond 1512px the artwork keeps growing, so the space above
   the logo grows with it (200px / 1512px = 13.23vw). */
.page {
  padding-top: max(clamp(140px, 118.27px + 5.405vw, 200px), 13.23vw);
}

/* Intro ----------------------------------------------------------------- */

/* 100px → 126.85px tall */
.intro__logo,
.footer__logo {
  width: auto;
  height: clamp(100px, 90.28px + 2.419vw, 126.85px);
}

/* Right-aligned, 60px → 70px above the headline */
.intro__logo {
  margin: 0 0 clamp(60px, 56.38px + 0.901vw, 70px) auto;
}

/* 24px → 60px */
.intro__title {
  margin: 0;
  font-size: clamp(1.5rem, 0.685rem + 3.243vw, 3.75rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.03em; /* em values inherit as fixed lengths, so set it here, relative to this size */
}

/* Even line lengths give the designer's breaks on mobile ("Gemeinsam für die /
   digitale Zukunft / des Wohneigentums.") and keep the two desktop lines. */
h1.intro__title {
  text-wrap: balance;
}

/* 12px → 25px below the German line */
.intro__title--fr {
  margin-top: clamp(12px, 7.29px + 1.171vw, 25px);
  color: var(--green);
}

/* Cards ----------------------------------------------------------------- */

/* 70px → 100px below the headline */
.cards {
  display: grid;
  gap: 25px;
  margin-top: clamp(70px, 59.14px + 2.703vw, 100px);
}

.card {
  --logo-height: clamp(75px, 65.95px + 2.252vw, 100px); /* 75px → 100px */
  position: relative;
  display: grid;
  /* Domain, logo, press link. The last row keeps its height when a card has
     no press link, so the logo sits at the same height in every card. */
  grid-template-rows: auto 1fr minmax(1.3em, auto);
  row-gap: 65px;
  justify-items: start;
  padding: 25px;
  border-radius: 2px;
  background: url("images/card-pattern.svg") center / cover no-repeat var(--card-bg);
  color: var(--card-text);
  letter-spacing: 0.015em;
  transition: background-color 150ms ease;
}

.card:has(.card__domain:hover) {
  background-color: var(--card-bg-hover);
}

.card__domain {
  font-weight: 600;
}

/* Stretched link: the domain link's click area covers the whole card. */
.card__domain::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
}

.card__domain:focus-visible {
  outline: none;
}

.card__domain:focus-visible::after {
  outline: 2px solid var(--card-text);
  outline-offset: 3px;
}

.card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  align-self: center;
  height: var(--logo-height);
}

.card__logo img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* In Figma the hausinfo artwork is 98.35px tall inside its 100px slot. */
.card__logo--hausinfo img {
  height: 98.35%;
}

.card__press {
  position: relative; /* sits above the stretched domain link */
  z-index: 1;
  grid-row: 3;
}

@media (min-width: 48em) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
  }

  .card {
    aspect-ratio: 1;
    letter-spacing: 0.03em;
  }
}

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

/* 70px → 140px below the cards */
.footer {
  margin-top: clamp(70px, 44.65px + 6.306vw, 140px);
  background: #000;
  color: #fff;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* stops the logo from stretching to full width */
  gap: 70px;
  padding: 70px 0 100px;
}

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-style: normal;
  white-space: nowrap;
}

.footer__contact p {
  margin: 0;
}

.footer__links {
  display: grid;
  row-gap: 3px; /* keeps the two links' tap areas from overlapping (WCAG 2.5.8) */
  color: var(--green);
}

@media (min-width: 48em) {
  .footer__inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}
