/* ===========================================================================
   Claude Code Masterclass – gemeinsames Design-System
   Eine einzige Quelle der Wahrheit für den Look ALLER Lektionsseiten.
   Farben orientiert an Claude / Claude Code (warmes Cream + Clay-Akzent).
   =========================================================================== */

:root {
  --bg: #f7f4ef;
  --card: #ffffff;
  --ink: #1f1d1a;
  --ink-soft: #38342f;
  --muted: #756f68;
  --line: #e7e1d8;
  --accent: #d97757;          /* Claude clay */
  --accent-ink: #b85c3e;
  --accent-soft: #fbeee7;
  --good: #2f8f5b;
  --good-soft: #e7f4ec;
  --sidebar: #211f1c;
  --sidebar-ink: #e9e3da;
  --sidebar-muted: #948c82;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(31,29,26,.07);
  --radius: 16px;
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); line-height: 1.62;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 60px 24px 96px; }

/* ---------- Header ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 6px 13px; border-radius: 999px;
}
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; margin: 18px 0 12px; letter-spacing: -.022em; }
.sub { font-size: 18px; color: var(--muted); margin: 0; max-width: 62ch; }
.meta { margin-top: 22px; font-size: 14px; color: var(--muted); display: flex; gap: 20px; flex-wrap: wrap; }
.meta b { color: var(--ink); font-weight: 600; }

/* ---------- Kernbotschaft (dark callout) ---------- */
.key {
  margin: 38px 0; padding: 28px 30px; background: var(--ink); color: #faf8f5;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.key .label { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.key p { font-size: 22px; line-height: 1.4; margin: 10px 0 0; font-weight: 500; }
.key.accent { background: var(--accent); }
.key.accent p { color: #fff; }
.key.accent .label { color: #fff; opacity: .85; }

/* ---------- Sections ---------- */
h2 {
  font-size: 24px; margin: 54px 0 16px; letter-spacing: -.012em;
  display: flex; align-items: center; gap: 11px;
}
h2 .n {
  font-size: 13px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-soft); width: 28px; height: 28px; border-radius: 8px;
  display: inline-grid; place-items: center; flex: none;
}
p.lead { font-size: 17px; }

ul.bullets { padding-left: 0; list-style: none; margin: 14px 0; }
ul.bullets li { position: relative; padding-left: 28px; margin: 10px 0; }
ul.bullets li::before {
  content: ""; position: absolute; left: 6px; top: 11px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
strong { font-weight: 650; }
em { color: var(--ink-soft); }
code {
  font-family: var(--mono); font-size: .88em; background: #efe9e1;
  padding: 2px 6px; border-radius: 6px; color: var(--ink);
}

/* ---------- Compare (Chat vs Agent / Vorher–Nachher) ---------- */
.compare {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch;
  margin: 22px 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.compare .col { padding: 24px; }
.compare .col h3 { margin: 12px 0 12px; font-size: 16px; }
.compare .tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; }
.compare .left .tag { color: var(--muted); background: #efe9e1; }
.compare .right { background: var(--good-soft); }
.compare .right .tag { color: var(--good); background: #d4ecdd; }
.compare .step { font-size: 14.5px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.compare .step:last-of-type { border-bottom: 0; }
.compare .divider { display: grid; place-items: center; background: var(--bg); width: 48px; color: var(--muted); font-weight: 700; }
.compare .note { margin-top: 14px; font-size: 13px; color: var(--muted); font-style: italic; }

/* ---------- Loop / Ablauf ---------- */
.loop { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 4px; }
.loop .node { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; padding: 10px 16px; border-radius: 10px; font-size: 15px; }
.loop .arr { color: var(--muted); font-size: 18px; }
.loop .back { width: 100%; font-size: 13px; color: var(--muted); font-style: italic; margin-top: 2px; }

/* ---------- Steps (nummerierte Schritte) ---------- */
ol.steps { counter-reset: s; list-style: none; padding-left: 0; margin: 16px 0; }
ol.steps li { position: relative; padding: 4px 0 4px 44px; margin: 10px 0; min-height: 30px; }
ol.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 9px;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}

/* ---------- Beispiel-Karten ---------- */
.ex { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.ex .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.ex .q { font-weight: 600; }
.ex .a { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ---------- Info / Hinweis-Box ---------- */
.callout { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 18px 22px; margin: 26px 0; box-shadow: var(--shadow); }
.callout.warn { border-left-color: #e0a23b; }
.callout h4 { margin: 0 0 10px; font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Scope-Box (Bewusst nicht in dieser Lektion) ---------- */
.scope { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 18px 22px; margin: 26px 0; box-shadow: var(--shadow); }
.scope h4 { margin: 0 0 10px; font-size: 15px; }
.scope ul { padding-left: 0; list-style: none; margin: 0; }
.scope li { position: relative; padding-left: 20px; margin: 8px 0; font-size: 14.5px; color: var(--ink-soft); }
.scope li::before { content: "→"; position: absolute; left: 0; color: var(--muted); }
.scope a { color: var(--accent-ink); text-decoration: none; font-weight: 600; }
.scope a:hover { text-decoration: underline; }

/* ---------- Pre-Lektion-Hinweis (z.B. zuletzt aufnehmen) ---------- */
.prodnote { font-size: 13.5px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; display: inline-block; margin-top: 16px; }

/* ---------- Prompt-Kopierbox (Codebox mit Copy-Button) ---------- */
.promptbox { position: relative; background: var(--sidebar); color: #f2ede6; border-radius: 12px; padding: 16px 18px; margin: 18px 0; box-shadow: var(--shadow); }
.promptbox-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #b3a99d; font-weight: 700; margin-bottom: 8px; padding-right: 104px; }
.promptbox-text { font-family: var(--mono); font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; margin: 0; color: #f4efe8; }
.promptbox-copy { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); color: #f2ede6; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 6px 11px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: background .15s ease; }
.promptbox-copy:hover { background: rgba(255,255,255,.2); }
.promptbox-copy.copied { background: var(--good); border-color: var(--good); color: #fff; }
.promptbox-copy svg { width: 14px; height: 14px; }

/* ===========================================================================
   NAVIGATION – wird komplett von app.js erzeugt (Sidebar + prev/next)
   =========================================================================== */

/* Toggle-Button (kleines Icon, immer sichtbar) */
#nav-toggle {
  position: fixed; top: 16px; left: 16px; z-index: 60;
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform .15s ease, background .15s ease;
}
#nav-toggle:hover { transform: translateY(-1px); }
#nav-toggle svg { width: 20px; height: 20px; }

/* Off-canvas Sidebar */
#nav-rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: 312px; z-index: 70;
  background: var(--sidebar); color: var(--sidebar-ink);
  transform: translateX(-100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(0,0,0,.18);
}
body.nav-open #nav-rail { transform: translateX(0); }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-title { font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.nav-title small { display: block; font-weight: 400; font-size: 12px; color: #948c82; margin-top: 2px; }
.nav-close { background: none; border: 0; color: #948c82; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.nav-close:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-list { overflow-y: auto; padding: 12px 10px 28px; flex: 1; }
.nav-mod { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8a8278; padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px; color: var(--sidebar-ink); text-decoration: none; font-size: 14px; line-height: 1.3; }
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-num { flex: none; width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #cfc7bc; }
.nav-item.active .nav-num { background: rgba(255,255,255,.22); color: #fff; }

#nav-backdrop { position: fixed; inset: 0; background: rgba(20,18,16,.42); opacity: 0; pointer-events: none; transition: opacity .26s ease; z-index: 65; }
body.nav-open #nav-backdrop { opacity: 1; pointer-events: auto; }

/* prev/next */
#lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--line); }
.lnav { text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 18px; font-size: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; max-width: 47%; transition: transform .15s ease; }
.lnav:hover { transform: translateY(-2px); }
.lnav.next { text-align: right; margin-left: auto; align-items: flex-end; }
.lnav-dir { font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.lnav-ttl { font-weight: 600; color: var(--ink); }
.lnav.ghost { visibility: hidden; }

/* ===========================================================================
   INDEX-Seite
   =========================================================================== */
.hero { padding: 30px 0 8px; }
.modgrid { margin: 28px 0; }
.modcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin: 16px 0; box-shadow: var(--shadow); }
.modcard h3 { margin: 0 0 4px; font-size: 18px; }
.modcard .modsub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.lesslist { display: grid; gap: 8px; }
.lesslink { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; }
.lesslink:hover { background: var(--bg); border-color: var(--line); }
.lesslink .ln { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; }

@media (max-width: 640px) {
  .wrap { padding: 60px 18px 80px; }
  .compare { grid-template-columns: 1fr; }
  .compare .divider { width: auto; height: 40px; }
  .ex { grid-template-columns: 1fr; }
  #nav-rail { width: 86vw; }
}
