@font-face {
  font-family: "Young Serif";
  src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --gutter: clamp(1rem, 4vw, 2rem);

  --sky-top: #cfe2ee;
  --sky-bottom: #f5efea;
  --cloud: #ffffff;
  --cloud-shade: #e3ecf4;
  --sky-cloud-o: 0.55;
  --ground: #36432f;
  --ground-ink: #eef0e4;

  --ink: #1e3346;
  --ink-soft: #46596a;
  --wolk: #b5cdd1;
  --wolk-gezicht: #4a3b30;

  --chip: rgba(255, 255, 255, 0.55);
  --chip-hover: rgba(255, 255, 255, 0.85);
  --flag-edge: rgba(30, 51, 70, 0.28);
  --menu-bg: #ffffff;
  --menu-edge: rgba(30, 51, 70, 0.14);
  --menu-shadow: rgba(30, 51, 70, 0.22);
  --field-bg: rgba(255, 255, 255, 0.88);
  --field-border: #6f8496;
  --btn-bg: #2c5d7b;
  --btn-bg-hover: #234c66;
  --btn-fg: #ffffff;
  --focus: #1e3346;
  --error: #a8231b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #101c27;
    --sky-bottom: #263b4d;
    --sky-cloud-o: 0.14;
    --cloud-shade: #b7c8d6;
    --cloud: #e9f1f7;
    --ground: #17211a;

    --ink: #e8f0f5;
    --ink-soft: #b6c8d5;
    --wolk-gezicht: #3a3348;

    --chip: rgba(233, 241, 247, 0.14);
    --chip-hover: rgba(233, 241, 247, 0.24);
    --flag-edge: rgba(233, 241, 247, 0.32);
    --menu-bg: #1a2a38;
    --menu-edge: rgba(233, 241, 247, 0.18);
    --menu-shadow: rgba(0, 0, 0, 0.5);
    --field-bg: rgba(16, 28, 39, 0.72);
    --field-border: #8aa1b3;
    --btn-bg: #a9cde6;
    --btn-bg-hover: #c0dcef;
    --btn-fg: #10202d;
    --focus: #e8f0f5;
    --error: #ffb4ab;
  }
}

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

html {
  background: var(--sky-top);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 72%);
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nb {
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Sky */

.c-body { fill: var(--cloud); }
.c-shade { fill: var(--cloud-shade); }

.sky-cloud {
  position: absolute;
  z-index: 0;
  opacity: var(--sky-cloud-o);
  pointer-events: none;
}

.sky-cloud-b {
  top: 11%;
  right: 9%;
  width: clamp(90px, 10vw, 150px);
}

/* Header */

.top {
  position: relative;
  z-index: 5; /* above .content, so the language menu opens over the page */
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem; /* padding + the 2.75rem picker: no jump when the picker appears */
  padding-top: 1.25rem;
}

.wordmark {
  font-family: "Young Serif", Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1;
}

/* Language picker: flag + code, and a dropdown with the other languages. */

.lang {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.8rem 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--chip);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.lang-toggle:hover,
.lang-toggle[aria-expanded="true"] {
  background: var(--chip-hover);
}

.flag {
  flex: none;
  width: 1.5rem;
  height: 1rem;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--flag-edge);
}

.chev {
  flex: none;
  width: 0.7rem;
  height: 0.5rem;
  transition: transform 0.15s ease;
}

.lang-toggle[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 1;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  color: var(--ink);
  background: var(--menu-bg);
  border-radius: 1rem;
  box-shadow: 0 0 0 1px var(--menu-edge), 0 12px 32px var(--menu-shadow);
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.975rem;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  cursor: pointer;
}

.lang-menu button:hover {
  background: var(--chip-hover);
}

.lang-menu button:focus-visible {
  background: var(--chip-hover);
  outline-offset: -3px;
}

[hidden] {
  display: none !important;
}

/* Content */

.content {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  align-content: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(1rem, 3.5vh, 2.5rem) clamp(1rem, 2.5vh, 2rem);
}

h1 {
  margin: 0;
  font-family: "Young Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(2.75rem, 1.6rem + 4.6vw, 4.6rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  max-width: 32rem;
  margin: 1.25rem 0 0;
  font-size: 1.2rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.signup {
  max-width: 34rem;
  margin-top: 2rem;
}

.signup label[for="email"] {
  display: block;
  margin: 0 0 0.5rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.row {
  display: flex;
  gap: 0.6rem;
}

.signup input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 3.4rem;
  padding: 0.95rem 1.3rem;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: 999px;
  appearance: none;
}

.signup input[type="email"]::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

.signup input[type="email"][aria-invalid="true"] {
  border-color: var(--error);
}

.btn {
  min-height: 3.4rem;
  padding: 0 1.6rem;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: progress; }

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  min-height: 1.5em;
  margin: 0.75rem 0.5rem 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.status:focus { outline: none; }
.status.error { color: var(--error); font-weight: 600; }

.signup[data-state="done"] label[for="email"],
.signup[data-state="done"] .row {
  display: none;
}

.signup[data-state="done"] .status {
  margin: 0;
  font-family: "Young Serif", Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
}

.fine {
  max-width: 38rem;
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.fine a,
.foot a {
  color: inherit;
  text-underline-offset: 0.2em;
}

/* Mascot: het wolkje uit de app (src/components/cloud.tsx), zelfde tekening en zelfde beweging:
   zweven op en neer (2 x 1750 ms), knipperen elke 3,7 s, en bij een tik of aanmelding
   even opkijken (ogen iets groter en hoger, 1,2 s) met één keer knipperen. */

.mascot {
  --w: clamp(10rem, 22vw, 17rem);
  justify-self: center;
  width: var(--w);
}

.mascot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  animation: drift 3.5s ease-in-out infinite;
}

.wolk-lijn { fill: #000000; }
.wolk-romp { fill: var(--wolk); }
.face { fill: var(--wolk-gezicht); }

.face .mouth {
  fill: none;
  stroke: var(--wolk-gezicht);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.look,
.blink {
  transform-box: fill-box;
  transform-origin: center;
}

.blink { animation: knipper 3.7s ease-in-out infinite; }

.kijkt .look { animation: kijk 1.2s ease-out 1; }
.kijkt .blink { animation: knipper-een 1.2s ease-in-out 1, knipper 3.7s ease-in-out 1.2s infinite; }

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(var(--w) * -0.11)); }
}

@keyframes knipper {
  0%, 91.9% { transform: scaleY(1); }
  94.3% { transform: scaleY(0.087); }
  100% { transform: scaleY(1); }
}

@keyframes knipper-een {
  0%, 40% { transform: scaleY(1); }
  47.5% { transform: scaleY(0.09); }
  65%, 100% { transform: scaleY(1); }
}

@keyframes kijk {
  0%, 100% { transform: translateY(0) scaleY(1); }
  21.7%, 75% { transform: translateY(-1.5px) scaleY(1.26); }
}

/* The path: a picture of the Australian garden from the app. Its top melts into the sky
   and its bottom into the ground colour of the footer, so it has no visible edges. */

.pad {
  position: relative;
  z-index: 1;
  flex: none;
  height: clamp(280px, 44vw, 640px);
  margin-block: calc(-1 * clamp(0.75rem, 3vw, 2.5rem)) -1px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 20%);
}

.pad img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}

.pad::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, var(--ground));
}

@media (prefers-color-scheme: dark) {
  /* Same picture, at dusk: darker and a little bluer, so it sits in the night sky. */
  .pad img { filter: brightness(0.58) saturate(0.8) contrast(1.05); }

  .pad::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(38, 59, 77, 0.85), rgba(38, 59, 77, 0.28) 60%, transparent);
  }
}

/* Footer */

.foot {
  position: relative;
  z-index: 1;
  padding-block: 0.75rem 1.5rem;
  color: var(--ground-ink);
  background: var(--ground);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.foot nav {
  display: flex;
  gap: 1.5rem;
}

.care {
  max-width: 44rem;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Small screens */

@media (max-width: 820px) {
  .content {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .mascot {
    --w: 9.5rem;
    order: -1;
    justify-self: start;
  }

  .sky-cloud-b { display: none; }
}

@media (max-width: 560px) {
  .row { flex-direction: column; }
  .btn { width: 100%; }
}

/* Tall, wide viewports (9:16 at 1080x1920, a tablet or a rotated monitor): stack like a phone, but larger. */

@media (orientation: portrait) and (min-width: 821px) {
  html { font-size: 125%; }

  .content {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .mascot {
    --w: 12rem;
    order: -1;
    justify-self: start;
  }

  .pad { height: clamp(300px, 46vw, 620px); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot svg,
  .blink,
  .kijkt .look,
  .kijkt .blink { animation: none; }
  .btn,
  .lang-toggle,
  .chev { transition: none; }
}
