@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Vern landing tokens: apps/web-next/DESIGN.md and app/landing/landing.css. */
  --green: #16332b;
  --beige: #fff3e7;
  --beige-soft: rgb(255 243 231 / 85%);
  --gutter: clamp(24px, 6vw, 160px);
  /* Stacked logo height, shared by the masthead and the desktop centring math. */
  --logo-h: clamp(43px, 3vw, 72px);
  --masthead-top: clamp(48px, 3vw, 72px);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  color: var(--beige);
  background: var(--green);
  font-family: "Geist", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--green);
  background: var(--beige);
}

.defs {
  position: absolute;
}

/* ---------- Layout: stacked by default (phones, portrait tablets) ---------- */

.page {
  display: grid;
  grid-template-areas:
    "head"
    "photo"
    "main";
  /* minmax(0, 1fr): the photo's intrinsic width must never widen the column. */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  min-height: 100svh;
}

.masthead {
  grid-area: head;
  padding: 19px var(--gutter);
}

.logo {
  display: block;
  width: auto;
  color: var(--beige);
}

.logo-stacked {
  display: none;
  height: var(--logo-h);
}

.logo-horizontal {
  height: 26px;
}

.photo {
  grid-area: photo;
  display: block;
  aspect-ratio: 390 / 420;
  clip-path: url("#vern-swoosh-down-m");
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 30%;
}

.intro {
  grid-area: main;
  /* Container units let the headline fit its own column on every layout. */
  container-type: inline-size;
  /* Photo on top: a centred text box with a bounded measure. */
  justify-self: center;
  width: min(100%, calc(640px + 2 * var(--gutter)));
  /* Breathing room below the wave when the photo sits on top. */
  padding: clamp(32px, 6vw, 48px) var(--gutter) 56px;
  text-align: center;
}

h1 {
  margin: 0;
  color: var(--beige);
  /* Jacob 15.10: keep "Vern lanseres snart" on one line. The line is 8.54em
     wide in Geist 500; dividing by 8.9 leaves slack for rendering differences.
     96px up to ~1900px wide, then 5vw (max 140px) so very large screens keep proportion. */
  font-size: min(max(96px, 5vw), 140px, 100cqi / 8.9);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  max-width: 38ch;
  margin: 20px auto 32px;
  color: var(--beige-soft);
  font-size: clamp(18px, max(min(1.5vw, 22px), 1.15vw), 30px);
  line-height: 1.5;
  /* Centred text reads best with even lines; the left-aligned desktop uses pretty. */
  text-wrap: balance;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 3.3em;
  padding: 0 1.75em;
  border-radius: 999px;
  color: var(--green);
  background: var(--beige);
  font: 500 clamp(17px, 0.9vw, 22px)/1 "Geist", "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
  transition:
    opacity 150ms ease-out,
    transform 150ms ease-out;
}

.cta:hover {
  opacity: 0.9;
  transform: scale(0.99);
}

.cta:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.contact {
  margin: 24px 0 0;
  color: var(--beige-soft);
  font-size: clamp(16px, 0.8vw, 20px);
}

.contact a {
  color: var(--beige);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.contact a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--beige);
  outline-offset: 4px;
}

.cta:focus-visible {
  outline-offset: 3px;
}

/* ---------- Wider stacked screens: the landing's own desktop wave ---------- */

@media (min-width: 600px) {
  .masthead {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .photo {
    aspect-ratio: 1280 / 700;
    clip-path: url("#vern-swoosh-down");
  }

  .photo img {
    object-position: center 28%;
  }
}

/* ---------- Landscape desktop: text field left, photo right ---------- */

@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  .page {
    grid-template-areas:
      "head photo"
      "main photo";
    grid-template-rows: auto 1fr;
    /* The side mask is drawn for a 620x875 box; the column follows the
       viewport height so the wave never stretches. */
    grid-template-columns: minmax(0, 1fr) min(58vw, calc(max(100svh, 560px) * 620 / 875));
    height: 100svh;
    min-height: 560px;
  }

  .masthead {
    padding: var(--masthead-top) var(--gutter) 0;
  }

  .logo-stacked {
    display: block;
  }

  .logo-horizontal {
    display: none;
  }

  .photo {
    aspect-ratio: auto;
    height: 100%;
    clip-path: url("#vern-side-mask");
  }

  .photo img {
    object-position: 62% center;
  }

  .intro {
    justify-self: stretch;
    width: auto;
    text-align: left;
    align-self: center;
    /* Bottom padding mirrors the masthead so the text sits on the optical centre. */
    /* The wave already separates text from photo, so the right gutter is small. */
    padding: 0 32px calc(var(--masthead-top) + var(--logo-h)) var(--gutter);
  }

  .lead {
    margin: 24px 0 40px;
    text-wrap: pretty;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta {
    transition: none;
  }

  .cta:hover,
  .cta:active {
    transform: none;
  }
}
