/* ---------- theme tokens: light ---------- */
:root {
  --bg: #F1F4EF;            /* morning light */
  --surface: #FFFFFF;
  --surface-2: #E6ECE2;
  --fg: #1B241A;            /* field shadow */
  --muted: #55614F;
  --line: #CBD3C5;
  --accent: #2F6A35;        /* links, buttons */
  --on-accent: #FFFFFF;
  --accent-soft: #DCE9D6;
  --focus: #2F6A35;
  --petal: #F4B81C;         /* sunflower yellow: services */
  --petal-tip: #FFD75A;
  --petal-base: #E09A12;
  --amber: #D98A2E;         /* harvest amber: regulations */
  --amber-tip: #EFAE52;
  --amber-base: #C27420;
  --petal-ink: #2A1808;
  --stria: #2A1808;         /* striations on the regulation petals */
  --sepal: #5E9A3E;         /* calyx behind the petals */
  --sepal-deep: #3E7A32;
  --seed-dark: #2E1A0A;
  --seed: #4A2D12;
  --seed-light: #8A5A24;
  --seed-edge: #C08A44;     /* light rim on every seed: makes the spiral visible */
  --pollen: #E8B23C;
  --ray: #3A2410;           /* competence ray outside the flower head */
  --ray-head: #2A1808;      /* competence ray across the petals */
  --stem: #3B7332;
  --stem-light: #6AA64E;
  --stem-ink: #F4F7EE;
  --leaf: #7CB45A;
  --leaf-mid: #70AA50;
  --leaf-deep: #649F45;
  --leaf-edge: #3E7A32;
  --leaf-ink: #122A10;
  --vein: #2F5E27;
  --sheen: #FFFFFF;
  --shadow: rgba(60, 40, 10, .28);
  --swatch-edge: rgba(0, 0, 0, .22);
  --avatar: #F4B81C;
  color-scheme: light;
}
/* ---------- theme tokens: dark (system preference) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141C16;          /* night field */
    --surface: #1C2720;
    --surface-2: #243127;
    --fg: #E9EEE4;
    --muted: #A7B3A0;
    --line: #33412F;
    --accent: #8CC57A;
    --on-accent: #0F1A10;
    --accent-soft: #223826;
    --focus: #8CC57A;
    --petal: #F2B623;
    --petal-tip: #FFD35C;
    --petal-base: #D99A14;
    --amber: #D4842B;
    --amber-tip: #EDA94E;
    --amber-base: #BD701E;
    --petal-ink: #2A1808;
    --stria: #2A1808;
    --sepal: #5E9A3E;
    --sepal-deep: #37692C;
    --seed-dark: #241406;
    --seed: #3A2210;
    --seed-light: #9A6A2E;
    --seed-edge: #C9955A;
    --pollen: #E8B23C;
    --ray: #D9B27A;
    --ray-head: #2A1808;
    --stem: #3B7332;
    --stem-light: #6AA64E;
    --stem-ink: #F4F7EE;
    --leaf: #7CB45A;
    --leaf-mid: #70AA50;
    --leaf-deep: #649F45;
    --leaf-edge: #2F5E27;
    --leaf-ink: #122A10;
    --vein: #2F5E27;
    --sheen: #FFFFFF;
    --shadow: rgba(0, 0, 0, .45);
    --swatch-edge: rgba(255, 255, 255, .35);
    --avatar: #D4842B;
    color-scheme: dark;
  }
}
/* ---------- theme tokens: dark (explicit) ---------- */
:root[data-theme="dark"] {
  --bg: #141C16;
  --surface: #1C2720;
  --surface-2: #243127;
  --fg: #E9EEE4;
  --muted: #A7B3A0;
  --line: #33412F;
  --accent: #8CC57A;
  --on-accent: #0F1A10;
  --accent-soft: #223826;
  --focus: #8CC57A;
  --petal: #F2B623;
  --petal-tip: #FFD35C;
  --petal-base: #D99A14;
  --amber: #D4842B;
  --amber-tip: #EDA94E;
  --amber-base: #BD701E;
  --petal-ink: #2A1808;
  --stria: #2A1808;
  --sepal: #5E9A3E;
  --sepal-deep: #37692C;
  --seed-dark: #241406;
  --seed: #3A2210;
  --seed-light: #9A6A2E;
  --seed-edge: #C9955A;
  --pollen: #E8B23C;
  --ray: #D9B27A;
  --ray-head: #2A1808;
  --stem: #3B7332;
  --stem-light: #6AA64E;
  --stem-ink: #F4F7EE;
  --leaf: #7CB45A;
  --leaf-mid: #70AA50;
  --leaf-deep: #649F45;
  --leaf-edge: #2F5E27;
  --leaf-ink: #122A10;
  --vein: #2F5E27;
  --sheen: #FFFFFF;
  --shadow: rgba(0, 0, 0, .45);
  --swatch-edge: rgba(255, 255, 255, .35);
  --avatar: #D4842B;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.55 "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.wrap {
  max-width: 1400px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--muted); }
button { font: inherit; }
noscript p { padding: 12px 16px; background: var(--surface-2); }

/* ---------- header ---------- */
/* band above the sticky header on phones with a top inset */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; }
.brand svg { width: 30px; height: 30px; display: block; }
.brand b { font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.arge { color: var(--muted); font-size: 14px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--fg); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 15px; }
.nav a:hover { background: var(--surface-2); }
.theme-btn {
  margin-left: 8px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); cursor: pointer; font-size: 14px;
}
.theme-btn:hover { background: var(--surface-2); }

/* ---------- hero ---------- */
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "flower copy" "flower side";
  gap: 24px 40px;
  padding-block: 12px 20px;
}
.hero-flower { grid-area: flower; min-width: 0; }
.hero-copy { grid-area: copy; }
.hero-side { grid-area: side; align-self: start; position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); }
.claim-de {
  font: 500 32px/1.25 "IBM Plex Serif", Georgia, "Times New Roman", serif;
  letter-spacing: -.01em;
  margin: 12px 0 16px;
}
.claim-en {
  display: inline-block;
  font: italic 500 20px/1.3 "IBM Plex Serif", Georgia, "Times New Roman", serif;
  background: var(--petal);
  color: var(--petal-ink);
  padding: 8px 14px 9px;
  border-radius: 4px;
  margin-bottom: 18px;
}
.lead { max-width: 46ch; }

.flower { display: block; width: 100%; height: auto; overflow: visible; }
.flower text { font-family: inherit; pointer-events: none; user-select: none; }
.flower .lbl { font-size: 20px; font-weight: 500; fill: var(--petal-ink); }
.flower .lbl-reg { paint-order: stroke; stroke: var(--amber); stroke-width: 5px; stroke-linejoin: round; }
.flower .title { font-size: 22px; font-weight: 600; fill: var(--fg); }
.flower .leaf-lbl { font-size: 19px; font-weight: 500; fill: var(--leaf-ink); paint-order: stroke; stroke: var(--leaf-mid); stroke-width: 5px; stroke-linejoin: round; }
.flower .stem-lbl { font-size: 28px; font-weight: 600; fill: var(--stem-ink); letter-spacing: 2px; }
.flower .ray { stroke-width: 3; stroke-linecap: round; }
.flower .ray-disc { stroke: var(--pollen); }
.flower .ray-head { stroke: var(--ray-head); }
.flower .ray-out { stroke: var(--ray); }
.flower .ray-start { fill: var(--pollen); stroke: var(--seed-dark); stroke-width: 1; }
.flower .ray-end { fill: var(--ray); }
.flower .hit { stroke: transparent; stroke-width: 18; fill: none; }
.flower .gloss { fill: var(--sheen); opacity: .16; }
.flower .part { cursor: pointer; outline: none; transition: opacity .18s ease; }
.flower.has-active .part:not(.is-active) { opacity: .7; }
.flower .sheen { fill: var(--sheen); opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.flower .part.is-active .sheen { opacity: .34; }
.flower .part.is-active .ray { stroke-width: 5; }
.flower .part.is-active .ray-end { r: 6; }
.flower .outline { fill: none; stroke: none; pointer-events: none; }
.flower .part:focus-visible .outline { stroke: var(--focus); stroke-width: 4; }
.flower .part:focus-visible .ray { stroke: var(--focus); stroke-width: 5; }
.flower .sepal { pointer-events: none; }
.flower.sweep .petal-g .sheen { animation: sweep 1s ease-out both; animation-delay: calc(var(--i) * 45ms); }
@keyframes sweep { 0% { opacity: 0; } 35% { opacity: .45; } 100% { opacity: 0; } }

/* sheet line under the figure */
.sheet {
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 4px 18px;
}

/* legend with glyphs */
.legend h2 { font-size: 16px; margin-bottom: 6px; }
.legend-sys { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.legend li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; line-height: 1.4; }
.legend li svg { width: 26px; height: 26px; display: block; }

/* readout panel */
.readout {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--petal);
  border-radius: 10px;
  padding: 14px 18px 16px;
}
.readout-kind { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-height: 22px; }
.readout-name { font-size: 21px; font-weight: 600; margin: 2px 0 2px; min-height: 28px; }
.readout-official { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.readout-text { min-height: 50px; }
.readout-ours { margin-top: 8px; font-size: 15px; }
.readout-ours b { font-weight: 600; }
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; box-shadow: inset 0 0 0 1px var(--swatch-edge); }
.swatch.service { background: var(--petal); }
.swatch.regulation { background: var(--amber); }
.swatch.competence { background: var(--seed-light); }
.swatch.stem { background: var(--stem); }
.swatch.leaf { background: var(--leaf); }
.swatch.core { background: var(--seed-light); }

/* mobile chip list (hidden on wide screens) */
.parts { display: none; margin-top: 20px; }
.parts h3 { font-size: 15px; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.parts h3 span { color: var(--muted); font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- sections ---------- */
.section { border-top: 1px solid var(--line); }
.section .wrap { padding-block: 36px 36px; }
.section h2 { margin-bottom: 8px; }
.intro { max-width: 72ch; color: var(--muted); margin-bottom: 24px; }

.partners { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.partner { padding: 4px 28px 4px 28px; border-left: 1px solid var(--line); }
.partner:first-child { border-left: 0; padding-left: 0; }
.partner h3 { font-size: 20px; margin-bottom: 2px; }
.partner-meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.partner-text { margin-bottom: 12px; max-width: 48ch; }
.partner-brings { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.partner-brings span { color: var(--fg); }

.chat-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 40px; align-items: start; }
.login { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login h3 { margin-bottom: 4px; }
.login .hint { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.login label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.login input {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); margin-bottom: 14px;
}
.btn { display: block; width: 100%; padding: 11px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 1px solid transparent; margin-bottom: 8px; }
.btn-secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.chat-preview { position: relative; }
.chat-note { font-size: 14px; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.chat-note svg { width: 16px; height: 16px; flex: none; }
.msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.msgs li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--avatar); color: var(--petal-ink);
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
}
.msg-head { font-size: 14px; color: var(--muted); }
.msg-head b { color: var(--fg); font-weight: 600; margin-right: 8px; }
.msg-body { background: var(--surface); border: 1px solid var(--line); border-radius: 0 12px 12px 12px; padding: 10px 14px; margin-top: 4px; max-width: 56ch; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.footer .wrap { padding-block: 28px 20px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer h2 { font-size: 20px; margin-bottom: 8px; }
.footer p { font-size: 15px; }
.footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 24px; }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  /* tablets: one column, the flower keeps its full width and its labels */
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "copy" "flower" "side"; gap: 20px; padding-block: 20px 40px; }
  .hero-side { position: static; }
  .hero-copy { max-width: 70ch; }
}
@media (max-width: 899px) {
  /* phones: the flower is scaled to the width, lettering (except the stem word) moves to the chip list */
  .parts { display: block; }
  .flower .lbl, .flower .leaf-lbl, .flower .ray-g { display: none; }
  .claim-de { font-size: 27px; }
  .claim-en { font-size: 19px; }
}
@media (max-width: 760px) {
  .partners { grid-template-columns: minmax(0, 1fr); }
  .partner { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0; }
  .partner:first-child { border-top: 0; padding-top: 0; }
  .chat-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .footer .wrap { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section .wrap { padding-block: 40px 44px; }
  h2 { font-size: 23px; }
}
@media (max-width: 560px) {
  .topbar .wrap { padding-block: 10px; }
  .nav { margin-left: 0; flex-basis: 100%; flex-wrap: wrap; }
  .nav a { padding: 6px 10px; }
  .arge { flex-basis: 100%; font-size: 13px; order: 3; }
  .claim-de { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
