/* Optyma - site stylesheet. Self-hosted fonts, no external requests. */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../fonts/hanken-grotesk-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* Base palette */
  --fog: #F3F5F2;
  --mist: #E6ECE8;
  --ink: #16201C;
  --stone: #4F5F58;
  --pine: #1D4A3B;
  --pine-deep: #0F2B22;
  --alpenrose: #A13A57;          /* the one highlight color */
  --alpenrose-light: #EBA2B6;    /* highlight on dark surfaces */
  --lichen: #8FD1B0;

  /* Roles, light mode */
  --bg: var(--fog);
  --bg-alt: #FFFFFF;
  --text: var(--ink);
  --muted: var(--stone);
  --rule: rgba(22, 32, 28, 0.16);
  --accent: var(--alpenrose);
  --link: var(--pine);
  --btn-bg: var(--pine);
  --btn-text: #FFFFFF;

  --dark-bg: var(--pine-deep);
  --dark-text: #E6ECE8;
  --dark-muted: #B9C9C0;
  --dark-rule: rgba(230, 236, 232, 0.18);
  --dark-accent: var(--alpenrose-light);

  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --space: clamp(4rem, 9vw, 7rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121C18;
    --bg-alt: #17231E;
    --text: #E6ECE8;
    --muted: #A9B8B0;
    --rule: rgba(230, 236, 232, 0.16);
    --accent: var(--alpenrose-light);
    --link: var(--lichen);
    --btn-bg: var(--lichen);
    --btn-text: var(--pine-deep);
    --dark-bg: #0A1F18;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--bg-alt); color: var(--text); padding: 0.6rem 1rem;
}
.skip:focus { top: 1rem; }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 560;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 500; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(1.15rem, 1.8vw, 1.35rem); line-height: 1.5; max-width: var(--measure); }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }

/* Header */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  color: #FFFFFF;
}
.site-header.solid { position: relative; background: var(--dark-bg); }
.header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-top: 1.25rem; padding-bottom: 1.25rem;
}
.brand {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.01em;
  color: #FFFFFF; text-decoration: none;
}
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; }
.nav a {
  color: #FFFFFF; text-decoration: none; font-size: 0.98rem; padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--alpenrose-light); }
.nav .lang a { font-weight: 600; }
.menu-btn { display: none; }

.js .menu-btn {
  display: none;
}
@media (max-width: 960px) {
  .js .menu-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; color: #FFFFFF; border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px; padding: 0.45rem 1rem; font: inherit; font-size: 0.95rem; cursor: pointer;
  }
  .js .nav { display: none; }
  .js .site-header.open { background: var(--dark-bg); }
  .js .site-header.open .nav { display: block; padding-bottom: 1.5rem; }
  .js .site-header.open .header-bar { flex-wrap: wrap; }
  .js .site-header.open .nav { flex-basis: 100%; }
  .nav ul { flex-direction: column; gap: 0.2rem; }
  .nav a { display: inline-block; padding: 0.5rem 0; font-size: 1.1rem; }
  .header-bar { flex-wrap: wrap; }
}

/* Hero: image with integrated title */
.hero {
  position: relative; isolation: isolate;
  min-height: min(88vh, 54rem);
  display: flex; align-items: flex-end;
  background: var(--pine-deep);
  color: #FFFFFF;
  overflow: hidden;
}
.hero.page { min-height: min(68vh, 40rem); }
.hero.plain { min-height: 22rem; }
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--pos, 60% 50%);
  z-index: -2;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(9, 28, 21, 0.9) 0%, rgba(9, 28, 21, 0.72) 38%, rgba(9, 28, 21, 0.18) 75%, rgba(9, 28, 21, 0.04) 100%),
    linear-gradient(0deg, rgba(9, 28, 21, 0.75) 0%, rgba(9, 28, 21, 0) 45%);
}
.hero.plain::after {
  background: linear-gradient(135deg, #0F2B22 0%, #1D4A3B 100%);
}
.hero-text { padding-top: 8rem; padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero h1 { max-width: 17ch; margin-bottom: 0.45em; }
.hero.page h1 { max-width: 22ch; font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.hero .lead { color: #E6ECE8; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; margin-top: 1.75rem; }
.hero .btn { background: #FFFFFF; color: var(--pine-deep); }
.hero .text-link { color: #FFFFFF; }

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 1rem;
  background: var(--btn-bg); color: var(--btn-text);
  border: 0; border-radius: 999px; padding: 0.85rem 1.5rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.text-link { font-weight: 600; }

/* Sections */
.section { padding: var(--space) 0; }
.section:not(.dark):not(.alt) + .section:not(.dark):not(.alt) { padding-top: 0; }
.section.alt + .section.alt { padding-top: 0; }
.section.alt { background: var(--bg-alt); }
.section.dark {
  background: var(--dark-bg); color: var(--dark-text);
  --muted: var(--dark-muted); --rule: var(--dark-rule); --accent: var(--dark-accent); --link: var(--lichen);
  --btn-bg: #FFFFFF; --btn-text: var(--pine-deep);
}
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

/* Question rows (home) */
.questions { border-top: 1px solid var(--rule); }
.q-row {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem 3rem;
  padding: 2rem 0; border-bottom: 1px solid var(--rule);
}
.q-row .q { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; margin: 0; }
.q-row h3 { font-family: var(--sans); font-size: 1.1rem; font-weight: 700; letter-spacing: 0; margin: 0 0 0.35rem; }
.q-row h3 a { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--accent); }
.q-row p { margin: 0; color: var(--muted); }
.q-row p.q { color: var(--text); }
@media (max-width: 760px) { .q-row { grid-template-columns: 1fr; } }

/* Figures: the memorable element */
.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 3rem 3.5rem;
}
.fig { margin: 0; padding-left: 1.25rem; border-left: 2px solid var(--accent); }
.fig-num {
  font-family: var(--serif); font-optical-sizing: auto; font-weight: 300;
  font-size: clamp(3.4rem, 7.5vw, 5.75rem); line-height: 0.95; letter-spacing: -0.03em;
  font-variant-numeric: lining-nums;
  margin: 0 0 0.9rem; color: var(--accent);
}
.fig-num small { font-size: 0.42em; letter-spacing: 0; font-weight: 400; }
.fig-text { font-size: 1.05rem; margin: 0 0 0.9rem; }
.fig figcaption { font-size: 0.875rem; color: var(--muted); }
.fig figcaption a { color: inherit; }
.context-note { margin-top: 3rem; max-width: 46rem; font-size: 0.95rem; color: var(--muted); }

/* Steps: a true sequence, so numbers carry meaning */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem 2.5rem; }
.steps li { counter-increment: step; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.steps li::before {
  content: counter(step); display: block;
  font-family: var(--serif); font-size: 2.2rem; font-weight: 300; line-height: 1; color: var(--accent);
  margin-bottom: 0.75rem;
}
.steps h3 { font-family: var(--sans); font-size: 1.15rem; font-weight: 700; letter-spacing: 0; margin-bottom: 0.4rem; }
.steps p { color: var(--muted); margin: 0; }

/* Two-column text blocks */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem 4rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 0.75rem 0 0.75rem 1.6rem; border-bottom: 1px solid var(--rule); }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 1.3rem; width: 0.6rem; height: 0.6rem;
  border: 2px solid var(--accent); border-radius: 50%;
}

/* Service definitions */
.services { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.services > div {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 0.5rem 3rem;
  padding: 1.75rem 0; border-bottom: 1px solid var(--rule);
}
.services dt { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.2; font-weight: 560; }
.services dd { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .services > div { grid-template-columns: 1fr; } }

/* Safeguards */
.safeguards { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem 3rem; }
.safeguards li { border-top: 1px solid var(--rule); padding-top: 1rem; }
.safeguards strong { display: block; font-family: var(--serif); font-size: 1.3rem; font-weight: 560; margin-bottom: 0.35rem; }
.safeguards span { color: var(--muted); }

/* Image band */
.band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--dark-bg); color: var(--dark-text); }
.band-img { min-height: 24rem; position: relative; }
.band-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band-text { padding: var(--space) var(--gutter); max-width: 38rem; align-self: center;
  --muted: var(--dark-muted); --link: var(--lichen); }
.band-text .muted { color: var(--dark-muted); }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } .band-img { min-height: 16rem; } }

/* Person */
.person { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 2.5rem 4rem; align-items: start; }
.person img { border-radius: 4px; width: 100%; max-width: 18rem; }
@media (max-width: 760px) { .person { grid-template-columns: 1fr; } }

/* Callout */
.callout { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 2rem; }
.callout > div { max-width: 40rem; }

/* Forms */
.form { display: grid; gap: 1.25rem; max-width: 40rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field .hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-alt);
  border: 1px solid var(--muted); border-radius: 6px; padding: 0.75rem 0.85rem;
}
textarea { min-height: 10rem; resize: vertical; }
.check { display: flex; gap: 0.75rem; align-items: flex-start; }
.check input { margin-top: 0.35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--pine); flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { padding: 1rem 1.25rem; border-left: 3px solid var(--accent); background: var(--bg-alt); }
.status[hidden] { display: none; }

/* Self-check */
.selfcheck fieldset { border: 0; margin: 0 0 2.5rem; padding: 0; }
.selfcheck legend { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); font-weight: 560; margin-bottom: 0.5rem; padding: 0; }
.sc-q { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.sc-q:first-of-type { border-top: 1px solid var(--rule); }
.sc-q p { margin: 0 0 0.6rem; max-width: 46rem; }
.sc-opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sc-opts label {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.95rem;
}
.sc-opts input { accent-color: var(--pine); margin: 0; }
.sc-opts label:has(input:checked) { border-color: var(--text); background: var(--bg-alt); font-weight: 600; }
.sc-result { margin-top: 2rem; padding: 2rem; background: var(--dark-bg); color: var(--dark-text); border-radius: 6px; }
.sc-result[hidden] { display: none; }
.sc-result h3 { color: var(--alpenrose-light); }
.sc-result p { max-width: 42rem; }
.sc-result .btn { background: #FFFFFF; color: var(--pine-deep); }
.sc-missing { color: var(--accent); font-weight: 600; }

/* Legal */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.2rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--dark-rule); background: var(--dark-bg); color: var(--dark-muted); padding: 3.5rem 0 2.5rem; font-size: 0.95rem; }
.site-footer a { color: var(--dark-text); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.footer-grid p { margin: 0 0 0.4rem; }
.footer-brand { font-family: var(--serif); font-size: 1.4rem; color: var(--dark-text); margin-bottom: 0.5rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-note { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--dark-rule); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .hero-img, .site-footer, .hero-actions, .menu-btn { display: none !important; }
  .hero { min-height: 0; color: #000; background: none; }
  .hero::after { display: none; }
  .section.dark { background: none; color: #000; }
}
.sc-result .muted, .sc-result #sc-scores { color: var(--dark-muted); }
.section.dark + .section.dark { padding-top: 0; }
.section.dark + .section.dark .wrap { border-top: 1px solid var(--dark-rule); padding-top: var(--space); }
.fig { align-self: start; }
