/* Fonts are self-hosted so visitors' browsers never contact a font CDN. Both SIL OFL 1.1, see assets/fonts. */
@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;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-latin-soft-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f3ea;
  --bg-hero: #e7efdf;
  --surface: #fffdf8;
  --ink: #1c2a21;
  --muted: #56665b;
  --line: #e1dccd;
  --fern: #2f6b45;
  --fern-strong: #22533a;
  --fern-soft: #dfeadb;
  --sun: #f2bd45;
  --sun-soft: #fbefcf;
  --shadow: 0 1px 2px rgb(28 42 33 / 0.06), 0 8px 24px -12px rgb(28 42 33 / 0.18);
  --radius: 18px;
  --wrap: 1040px;
  --prose: 720px;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Fraunces", ui-serif, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111814;
    --bg-hero: #16241b;
    --surface: #18211b;
    --ink: #e6eee8;
    --muted: #9fb2a5;
    --line: #2a372f;
    --fern: #8fd19e;
    --fern-strong: #b4e6bf;
    --fern-soft: #1d3325;
    --sun: #f2bd45;
    --sun-soft: #3a3016;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 28px -14px rgb(0 0 0 / 0.6);
  }
  [style*="--accent"] { --accent: var(--accent-dark) !important; }
}

/* Language switching: only hide once the head script has picked a language, so no-JS visitors see both. */
:root[data-lang="de"] body [lang="en"],
:root[data-lang="en"] body [lang="de"] { display: none !important; }

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

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

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--fern); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--fern-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100;
  font-weight: 650;
  font-size: 1.2rem;
}
.brand:hover { color: var(--ink); }
.brand .logo { color: var(--fern); flex: none; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 0.85rem/1 var(--font-body);
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--fern); color: var(--surface); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 100% 0%, var(--sun-soft) 0%, transparent 70%),
    var(--bg-hero);
  border-bottom: 1px solid var(--line);
  padding: 72px 0 64px;
}
.hero::after {
  /* Large faint fiddlehead curl as decoration */
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 340px;
  height: 340px;
  background: var(--fern);
  opacity: 0.08;
  -webkit-mask: url("fiddlehead.svg") center / contain no-repeat;
  mask: url("fiddlehead.svg") center / contain no-repeat;
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--fern);
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  text-wrap: balance;
  font-weight: 600;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.pills li {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.92rem;
}
.pills li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--sun);
  vertical-align: 0.08em;
}

/* App cards */
.section-title {
  margin: 56px 0 20px;
  font-size: 1.9rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--accent);
}
.card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 18px 36px -18px color-mix(in srgb, var(--accent) 60%, transparent);
}
.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.card h3 {
  margin: 18px 0 4px;
  font-size: 1.45rem;
}
.card-tagline {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 650;
  line-height: 1.4;
}
.card-text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.6;
}
.card-platforms {
  margin: auto 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.card-platforms span::before { content: "◦ "; color: var(--accent); }

/* Prose pages */
.prose {
  max-width: calc(var(--prose) + 40px);
  padding-bottom: 72px;
}
.prose h1 {
  margin: 32px 0 8px;
  font-size: clamp(2rem, 4.5vw, 2.6rem);
}
.prose h2 {
  margin: 48px 0 16px;
  font-size: 1.6rem;
}
.prose p, .prose li { max-width: var(--prose); }
.prose strong { font-weight: 700; }
.prose .lead { font-size: 1.15rem; color: var(--ink); }

.home-prose { max-width: var(--wrap); }
.home-prose h2 { margin-top: 64px; font-size: 1.9rem; }
.home-prose > [lang] > p { max-width: var(--prose); }

/* Principles: small cards in a grid */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.principles li {
  max-width: none;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--fern-soft);
  color: var(--ink);
  line-height: 1.55;
}
.principles li strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-head);
  font-variation-settings: "SOFT" 100;
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--fern-strong);
}

/* Security */
.note {
  padding: 16px 20px;
  border-radius: 14px;
  border-left: 5px solid var(--sun);
  background: var(--sun-soft);
}
.steps {
  counter-reset: step;
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.steps li {
  counter-increment: step;
  position: relative;
  max-width: none;
  padding: 18px 20px 18px 72px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 20px;
  top: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fern);
  color: var(--surface);
  font: 700 1.05rem/1 var(--font-head);
}

/* App page */
.crumb { padding-top: 28px; }
.crumb + * { margin-top: 20px; }
.crumb a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  text-decoration: none;
}
.crumb a::before { content: "←"; }
.crumb img { border-radius: 6px; }

.app-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-top: 48px;
  padding-bottom: 8px;
  max-width: calc(var(--prose) + 40px);
}
.app-icon {
  flex: none;
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--accent) 85%, transparent);
}
.app-hero h1 { margin: 0 0 6px; font-size: clamp(2rem, 5vw, 2.8rem); }
.app-tagline { margin: 0 0 6px; font-size: 1.15rem; font-weight: 650; color: var(--accent); }
.app-hero .card-platforms { margin: 0; }

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--accent, var(--fern));
  color: var(--accent, var(--fern));
  font-weight: 650;
  text-decoration: none;
}
.button:hover {
  background: var(--accent, var(--fern));
  color: var(--surface);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 0.95rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.footer-row p { margin: 0; }

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 44px; }
  .hero::after { width: 220px; height: 220px; right: -50px; bottom: -50px; }
  .app-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 28px; }
  .app-icon { width: 88px; height: 88px; border-radius: 20px; }
  .steps li { padding-left: 64px; }
  .steps li::before { left: 16px; }
}

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