/* ---------- Colors and themes ---------- */
:root {
  --bg: rgb(244, 239, 235);
  --surface: rgb(234, 227, 221);
  --text: #1f1d1b;
  --text-2: #57524d;
  --muted: #8f8880;
  --line: rgba(31, 29, 27, 0.14);
  --line-strong: #1f1d1b;
  --accent: #2b59a6;        /* blue in the light theme */
  --accent-hover: #234b8e;
  --on-accent: #ffffff;

  --font-display: "Unbounded", system-ui, sans-serif;
  --font-body: "Onest", system-ui, sans-serif;

  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(56px, 9vw, 120px);

  color-scheme: light dark;
}

/* Dark theme: chosen manually, or from the system unless light was chosen manually */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1f1f;
  --surface: #2a2a29;
  --text: #edeae6;
  --text-2: #b6b1ab;
  --muted: #85807a;
  --line: rgba(237, 234, 230, 0.14);
  --line-strong: #edeae6;
  --accent: #e9c46a;
  --accent-hover: #f1d27f;
  --on-accent: #1f1f1f;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1f1f;           /* dark gray, not black */
    --surface: #2a2a29;
    --text: #edeae6;
    --text-2: #b6b1ab;
    --muted: #85807a;
    --line: rgba(237, 234, 230, 0.14);
    --line-strong: #edeae6;
    --accent: #e9c46a;       /* yellow in the dark theme */
    --accent-hover: #f1d27f;
    --on-accent: #1f1f1f;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* hide the page while the script picks a language, to avoid a flash */
html.i18n-pending body { opacity: 0; }
body { transition: opacity .25s ease, background-color .3s ease, color .3s ease; }

h1, h2, h3, p, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--accent); color: var(--on-accent); }

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

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

.muted { color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 24px;
  font-size: 14px;
}

.brand { font-weight: 500; letter-spacing: .01em; }

.controls { display: flex; align-items: center; gap: 20px; }

.theme { display: flex; gap: 2px; }
.theme button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s, background .2s;
}
.theme button svg { width: 16px; height: 16px; }
.theme button:hover { color: var(--text); }
.theme button[aria-pressed="true"] { color: var(--text); background: var(--line); }

.lang { display: flex; align-items: center; gap: 6px; color: var(--muted); }

.lang button {
  font: inherit;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--text); }
.lang button:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(32px, 8vw, 96px); padding-bottom: var(--section); }

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 7vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-bottom: clamp(36px, 6vw, 72px);
}
.hero__title span { display: block; }

.hero__body {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
}

.hero__photo {
  aspect-ratio: 403 / 520;
  overflow: hidden;
  background: var(--surface);
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  filter: grayscale(1) contrast(1.02);
}

.hero__info { max-width: 520px; }

.hero__lead {
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
  margin-bottom: 12px;
}

.hero__meta {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 28px;
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.98); }
.btn__icon { width: 16px; height: 16px; transition: transform .2s ease; }
.btn:hover .btn__icon { transform: translate(2px, -2px); }

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section);
  position: relative;
}
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  border-top: 1px solid var(--line);
}

.kicker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(24px, 3vw, 40px);
}

/* Hello */
.hello__text p { color: var(--text-2); max-width: 760px; }
.hello__text p + p { margin-top: 20px; }

.big {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.5;
  color: var(--text) !important;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px) clamp(24px, 4vw, 64px);
}

.card {
  border-top: 2px solid var(--line-strong);
  padding-top: 18px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.3;
  margin-bottom: 10px;
}
.card p { color: var(--text-2); font-size: 16px; }

.note {
  margin-top: clamp(32px, 4vw, 48px);
  font-size: 15px;
  color: var(--muted);
}

/* Result */
.self {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(72px, 15vw, 200px);
  line-height: .95;
  letter-spacing: -0.03em;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.result__text {
  max-width: 620px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-2);
}

/* Call to action */
.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}
.cta__text {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.2;
  max-width: 640px;
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.footer__links { display: flex; gap: 24px; }
.footer a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.footer a:hover { color: var(--text); border-color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  body, .btn, .btn__icon { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero__body { grid-template-columns: 1fr; align-items: start; }
  .hero__photo { max-width: 260px; width: 100%; margin-inline: auto; }
  .hero__info { max-width: none; }
  .hero__info .btn { display: flex; width: fit-content; margin-inline: auto; }
  .cards { grid-template-columns: 1fr; }
}
