/* FLEXOPTIX Onboarding – Tokens und Regeln nach brand.flexoptix.org (DESIGN.md, Stand 2026-10). */
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --fo-black: #000000;
  --fo-black-80: #090F11;
  --fo-black-60: #121718;
  --fo-black-40: #1B1E1F;
  --fo-black-20: #242626;
  --fo-black-10: #2D2D2D;
  --fo-white: #FFFFFF;
  --fo-white-80: #F0F0F0;
  --fo-white-60: #D9D9D9;
  --fo-white-40: #B8B8B8;
  --fo-white-20: #999999;
  --fo-white-10: #737373;
  --fo-orange: #FF6B00;
  --fo-orange-80: #FF8933;
  --fo-orange-20: #FFE1CC;
  --fo-success: #22C55E;
  --fo-warning: #FACC15;
  --fo-error: #EF4444;
  --fo-info: #3B82F6;

  --s-xs: 8px; --s-sm: 16px; --s-md: 24px; --s-lg: 32px; --s-xl: 48px; --s-2xl: 64px; --s-3xl: 96px;
  --radius-card: 40px;
  --measure: 68ch;
  --page: 1200px;
  --font: "Inter Variable", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fo-black); color: var(--fo-white);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.75; font-weight: 400;
  font-feature-settings: "cv11", "ss01";
}
.grain { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.03; z-index: 9999; }

a { color: var(--fo-orange); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--fo-orange-80); }
:focus-visible { outline: 2px solid var(--fo-orange); outline-offset: 2px; }
::selection { background: var(--fo-orange); color: var(--fo-black); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--fo-black-10); border-radius: 2px; }

/* Typografie */
h1, h2, h3, .eyebrow, .label, .btn, th { text-transform: uppercase; }
h1 { font-size: 2.5rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--s-md); }
h1.display { font-size: 4rem; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 600; margin: var(--s-2xl) 0 var(--s-md); }
h3 { font-size: 0.8125rem; line-height: 1.2; font-weight: 600; letter-spacing: 0.1em; margin: var(--s-lg) 0 var(--s-xs); }
p, ul, ol { max-width: var(--measure); margin: 0 0 var(--s-sm); }
li { margin-bottom: var(--s-xs); }
strong { font-weight: 600; }
.eyebrow { display: block; font-size: 0.625rem; font-weight: 600; letter-spacing: 0.32em; color: var(--fo-orange); margin-bottom: var(--s-sm); }
.label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; color: var(--fo-white-40); }
.lead { font-size: 1.0625rem; color: var(--fo-white-80); }
.muted { color: var(--fo-white-40); }
.small { font-size: 0.875rem; line-height: 1.6; }
code, kbd, pre { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
code { background: var(--fo-black-60); padding: 2px 6px; }
pre { background: var(--fo-black-60); border: 1px solid var(--fo-black-40); padding: var(--s-md); overflow-x: auto; line-height: 1.5; white-space: pre; max-width: 100%; }
pre .hl { color: var(--fo-orange); }

/* Rahmen */
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s-lg); }
.site-header { border-bottom: 1px solid var(--fo-black-40); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s-md); min-height: 72px; }
.brand { display: inline-flex; align-items: center; }
.brand img { height: 24px; width: auto; display: block; }
.site-nav { display: flex; gap: var(--s-md); align-items: center; flex-wrap: wrap; }
.site-nav a, .site-nav button { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fo-white); text-decoration: none; background: none; border: 0; padding: var(--s-xs) 0; cursor: pointer; font-family: var(--font); }
.site-nav form { display: inline; margin: 0; }
.site-nav a:hover, .site-nav button:hover, .site-nav a[aria-current="page"] { color: var(--fo-orange); }
main { padding: var(--s-2xl) 0 var(--s-3xl); }
.site-footer { border-top: 1px solid var(--fo-black-40); padding: var(--s-lg) 0; color: var(--fo-white-40); font-size: 0.875rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--s-md); flex-wrap: wrap; align-items: center; }
.slogan { width: 160px; height: auto; display: block; }
hr, .divider { border: 0; border-top: 1px solid var(--fo-black-40); margin: var(--s-xl) 0; }

/* Komponenten */
.card { background: var(--fo-black-80); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); padding: var(--s-lg); }
.card.elevated { background: var(--fo-black-60); }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: var(--s-md); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: var(--s-md); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-xs); min-height: 48px; padding: 0 var(--s-md); font-family: var(--font); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.1em; text-decoration: none; border-radius: 0; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--fo-orange); color: var(--fo-black); }
.btn-primary:hover { background: var(--fo-orange-80); color: var(--fo-black); }
.btn-secondary { background: transparent; color: var(--fo-white); border-color: var(--fo-white); }
.btn-secondary:hover { border-color: var(--fo-orange); color: var(--fo-orange); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--fo-black-40); color: var(--fo-white-20); border-color: var(--fo-black-40); cursor: not-allowed; }
.actions { display: flex; gap: var(--s-sm); flex-wrap: wrap; align-items: center; margin-top: var(--s-md); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); background: var(--fo-black); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fo-white-40); white-space: nowrap; }
.badge.today { color: var(--fo-orange); }
.badge.done, .badge.pass { color: var(--fo-success); }
.badge.fail, .badge.alert { color: var(--fo-error); }
.badge.check { color: var(--fo-warning); }
.badge.info { color: var(--fo-info); }

.progress { height: 8px; background: var(--fo-black-40); position: relative; overflow: hidden; }
.progress > span { position: absolute; inset: 0 auto 0 0; background: var(--fo-orange); }

/* Formulare */
label.field { display: block; margin-bottom: var(--s-md); }
label.field > span { display: block; margin-bottom: var(--s-xs); }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; min-height: 48px; padding: 12px var(--s-sm); background: var(--fo-black); color: var(--fo-white);
  border: 1px solid var(--fo-white-10); border-radius: 0; font: inherit; font-size: 1rem;
}
input:focus, textarea:focus, select:focus { border-color: var(--fo-orange); outline: none; }
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.check-row { display: flex; gap: var(--s-sm); align-items: flex-start; max-width: var(--measure); }
.check-row input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--fo-orange); flex: none; }
.notice { border-left: 2px solid var(--fo-orange); padding: var(--s-xs) 0 var(--s-xs) var(--s-md); max-width: var(--measure); }
.error-text { color: var(--fo-error); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: var(--s-md) 0; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; line-height: 1.5; }
th { font-size: 0.6875rem; letter-spacing: 0.1em; font-weight: 600; color: var(--fo-white-40); text-align: left; }
th, td { padding: 12px var(--s-sm) 12px 0; border-bottom: 1px solid var(--fo-black-40); vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Lernpfad */
.hero { padding: var(--s-xl) 0 var(--s-2xl); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-xl); align-items: end; }
.hero .lead { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-md); }
.stat b { display: block; font-size: 2.5rem; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.week { margin-top: var(--s-2xl); }
.week-head { display: flex; justify-content: space-between; gap: var(--s-md); align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--fo-black-40); padding-bottom: var(--s-sm); margin-bottom: var(--s-md); }
.week-head h2 { margin: 0; }
.days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-sm); }
.day-card { display: flex; flex-direction: column; gap: var(--s-xs); min-height: 232px; padding: var(--s-md); background: var(--fo-black-80); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); text-decoration: none; color: var(--fo-white); }
.day-card:hover { border-color: var(--fo-orange); color: var(--fo-white); }
.day-card.locked { background: var(--fo-black); color: var(--fo-white-20); }
.day-card.locked:hover { border-color: var(--fo-black-40); color: var(--fo-white-20); }
.day-card.today { border-color: var(--fo-orange); }
.day-card .num { font-size: 2.5rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.day-card .title { font-weight: 600; font-size: 0.9375rem; line-height: 1.4; flex: 1; }
.day-card .meta { display: flex; justify-content: space-between; align-items: center; gap: var(--s-xs); flex-wrap: wrap; }

/* Lektion */
.lesson-head { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--s-xl); align-items: end; padding-bottom: var(--s-xl); border-bottom: 1px solid var(--fo-black-40); }
.goals { list-style: none; padding: 0; margin: 0; }
.goals li { padding-left: var(--s-md); position: relative; }
.goals li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 8px; height: 2px; background: var(--fo-orange); }
.lesson { max-width: 1040px; }
.lesson section { margin-top: var(--s-2xl); }
.lesson section:first-child { margin-top: var(--s-xl); }
.bridge { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; background: var(--fo-black-60); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); overflow: hidden; margin: var(--s-lg) 0; }
.bridge > div { padding: var(--s-lg); }
.bridge > div + div { border-left: 1px solid var(--fo-black-40); }
.bridge .eyebrow { margin-bottom: var(--s-xs); }
.bridge p:last-child, .bridge ul:last-child { margin-bottom: 0; }
.bridge-title { grid-column: 1 / -1; padding: var(--s-md) var(--s-lg) 0; }
.keypoint { border-left: 2px solid var(--fo-orange); padding: var(--s-xs) 0 var(--s-xs) var(--s-md); margin: var(--s-lg) 0; max-width: var(--measure); font-weight: 600; }
.portfolio { background: var(--fo-black-60); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); padding: var(--s-lg); margin: var(--s-lg) 0; }
.portfolio ul { margin-bottom: var(--s-sm); }
.portfolio code { white-space: nowrap; }
.task { background: var(--fo-black-80); border: 1px solid var(--fo-orange); border-radius: var(--radius-card); padding: var(--s-lg); margin: var(--s-lg) 0; }
.task ol, .task ul { margin-bottom: 0; }
figure { margin: var(--s-lg) 0; }
figure .canvas { background: var(--fo-black-80); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); padding: var(--s-md); overflow-x: auto; }
figure svg { display: block; width: 100%; height: auto; min-width: 560px; font-family: var(--font); }
figure.compact svg { min-width: 0; }
figcaption { margin-top: var(--s-xs); font-size: 0.875rem; color: var(--fo-white-40); max-width: var(--measure); }
details.selfcheck { border-top: 1px solid var(--fo-black-40); padding: var(--s-sm) 0; max-width: var(--measure); }
details.selfcheck summary { cursor: pointer; font-weight: 600; }
details.selfcheck[open] summary { color: var(--fo-orange); margin-bottom: var(--s-xs); }
.sources { font-size: 0.875rem; color: var(--fo-white-40); }
.sources a { word-break: break-word; }
.lesson-foot { margin-top: var(--s-2xl); padding-top: var(--s-xl); border-top: 1px solid var(--fo-black-40); }
.pager { display: flex; justify-content: space-between; gap: var(--s-md); flex-wrap: wrap; margin-top: var(--s-xl); }

/* Werkzeuge (Rechner, Decoder) */
.icon { display: block; width: 50px; height: 35px; color: var(--fo-white); }
.tool { background: var(--fo-black-60); border: 1px solid var(--fo-black-40); border-radius: var(--radius-card); padding: var(--s-lg); margin: var(--s-lg) 0; }
.tool .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-sm); align-items: end; }
.tool output { display: block; margin-top: var(--s-md); font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tool .result-line { margin-top: var(--s-xs); }

/* Prüfung */
.exam-shell { max-width: 880px; }
.exam-bar { display: flex; justify-content: space-between; gap: var(--s-md); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-md); }
.timer { height: 8px; background: var(--fo-black-40); position: relative; overflow: hidden; margin-bottom: var(--s-lg); }
.timer > span { position: absolute; inset: 0 auto 0 0; background: var(--fo-orange); transition: width 1s linear; }
.question { -webkit-user-select: none; user-select: none; }
.question .stem { font-size: 1.25rem; line-height: 1.5; font-weight: 600; max-width: var(--measure); margin-bottom: var(--s-lg); }
.options { display: grid; gap: var(--s-sm); }
.option { display: flex; align-items: center; gap: var(--s-sm); width: 100%; min-height: 56px; padding: 12px var(--s-md); text-align: left; background: var(--fo-black); color: var(--fo-white); border: 1px solid var(--fo-white-10); border-radius: 0; font: inherit; font-size: 1rem; line-height: 1.5; cursor: pointer; }
.option:hover { border-color: var(--fo-white); }
.option[aria-pressed="true"] { border-color: var(--fo-orange); box-shadow: inset 4px 0 0 var(--fo-orange); }
.option .key { flex: none; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--fo-white-10); font-size: 0.8125rem; font-weight: 600; }
.option[aria-pressed="true"] .key { background: var(--fo-orange); color: var(--fo-black); border-color: var(--fo-orange); }
.watermark { font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fo-white-40); }
/* Für Menschen unsichtbar, für mitlesende KI-Werkzeuge im DOM vorhanden. */
.ai-trap { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.status-list { list-style: none; padding: 0; }
.status-list li { display: flex; gap: var(--s-sm); align-items: baseline; }

@media (max-width: 1080px) {
  .days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero, .lesson-head { grid-template-columns: 1fr; gap: var(--s-lg); }
  .grid.two, .grid.three, .bridge { grid-template-columns: 1fr; }
  .bridge > div + div { border-left: 0; border-top: 1px solid var(--fo-black-40); }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1.display { font-size: 2.5rem; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 var(--s-sm); }
  .site-header .wrap { flex-wrap: wrap; gap: 0 var(--s-md); padding-top: var(--s-sm); padding-bottom: var(--s-xs); min-height: 0; }
  .site-nav { width: 100%; gap: var(--s-md); }
  main { padding: var(--s-xl) 0 var(--s-2xl); }
  h1 { font-size: 2rem; }
  .days { grid-template-columns: 1fr; }
  .day-card { min-height: 0; }
  .card, .tool, .task, .bridge > div { padding: var(--s-md); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-sm); }
  .stat b { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  body { background: #FFFFFF; color: #000000; }
  .grain, .site-header, .site-footer, .lesson-foot, .pager { display: none; }
  a { color: #000000; }
}
