/* ==========================================================================
   KI-Masterclass · Datenbank-Anbindung mit Supabase
   BERENT.AI Corporate Identity
   Schriften lokal gehostet, keine externen Requests
   ========================================================================== */

/* --- Schriften ---------------------------------------------------------- */

@font-face {
  font-family: 'Bebas Neue';
  src: url('../fonts/bebas-neue-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Farben ------------------------------------------------------------- */

:root {
  --bg:        #090806;
  --card:      #110e0a;
  --border:    #2a2118;
  --copper:    #B5742A;
  --gold:      #E8C98A;
  --text:      #C4BCB1;
  --muted:     #7A6A58;
  --muted2:    #9a8870;
  --header-bg: rgba(9,8,6,.94);
  --maxw:      820px;
}

/* Hellmodus, Palette nach BERENT CI. Dunkel bleibt Standard, hell wird
   ueber data-theme="light" am html-Element aktiviert. */
[data-theme="light"] {
  --bg:        #F5F2EE;
  --card:      #EDEAE4;
  --border:    #D1CBBD;
  --copper:    #9A6320;
  --gold:      #9A6320;
  --text:      #2E2318;
  --muted:     #7A6248;
  --muted2:    #9A8C78;
  --header-bg: rgba(245,242,238,.94);
}

/* --- Grundgerüst -------------------------------------------------------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-weight: 300;
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }

/* --- Plus-Symbol (Markenelement) ---------------------------------------- */

.plus-mark {
  width: 18px; height: 18px;
  position: relative; flex-shrink: 0; display: inline-block;
}
.plus-mark::before,
.plus-mark::after {
  content: ''; position: absolute;
  background: var(--gold); border-radius: 1px;
}
.plus-mark::before { width: 2px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
.plus-mark::after  { width: 100%; height: 2px; top: 50%; left: 0; transform: translateY(-50%); }

/* --- Header ------------------------------------------------------------- */

header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
}
.header-in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav {
  display: flex; align-items: center; gap: .7rem;
  padding: .9rem 0;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: .08em; font-size: 1rem;
  color: var(--muted2); text-decoration: none;
}
.nav:hover { color: var(--copper); }

/* --- Modus-Button ------------------------------------------------------- */

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted2);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--copper); color: var(--gold); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* --- Hero --------------------------------------------------------------- */

.hero { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--border); }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 1.6rem;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: .95; letter-spacing: .04em;
  color: var(--copper);
  margin: 0 0 1rem;
}

.hero .lede { font-size: 1.15rem; color: var(--text); max-width: 40em; margin: 0 0 1.6rem; }
.meta { font-family: 'JetBrains Mono', monospace; font-size: .8rem; color: var(--muted); letter-spacing: .05em; }

/* --- Rahmen-Kasten ------------------------------------------------------ */

.frame {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--copper);
  padding: 1.6rem 1.8rem;
  margin: 2.5rem 0;
}
.frame h3 {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  letter-spacing: .08em; font-size: 1.25rem;
  color: var(--gold); margin: 0 0 .7rem;
}
.frame p { margin: 0 0 .8rem; }
.frame p:last-child { margin-bottom: 0; }

/* --- Stufen-Legende ----------------------------------------------------- */

.levels { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; }
.levels li { display: flex; gap: .9rem; align-items: baseline; }
.tier {
  font-family: 'JetBrains Mono', monospace;
  color: var(--gold); font-size: .9rem; letter-spacing: .1em;
  min-width: 3.4rem; flex-shrink: 0;
}

/* --- Abschnitte --------------------------------------------------------- */

section { padding: 3.2rem 0; border-bottom: 1px solid var(--border); }

.step-head { display: flex; gap: 1.2rem; align-items: baseline; margin-bottom: .4rem; }
.step-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.6rem; line-height: 1; letter-spacing: .04em;
  color: var(--copper); flex-shrink: 0;
}

h2 {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  font-size: 1.9rem; letter-spacing: .05em;
  color: var(--copper); margin: 0; line-height: 1.1;
}

.duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 1.4rem 4.2rem;
}
.duration.flush { margin-left: 0; }

h3 {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  letter-spacing: .07em; font-size: 1.25rem;
  color: var(--gold); margin: 2rem 0 .6rem;
}

p { margin: 0 0 1rem; }
strong { color: var(--gold); font-weight: 600; }
a { color: var(--copper); }
a:hover { color: var(--gold); }

/* --- Listen ------------------------------------------------------------- */

ul.plus { list-style: none; padding: 0; margin: 0 0 1.2rem; }
ul.plus li { position: relative; padding-left: 1.6rem; margin-bottom: .5rem; }
ul.plus li::before { content: '+'; position: absolute; left: 0; color: var(--gold); font-weight: 600; }

ol.steps { padding-left: 1.4rem; margin: 0 0 1.2rem; }
ol.steps li { margin-bottom: .6rem; padding-left: .3rem; }
ol.steps li::marker { color: var(--copper); font-family: 'JetBrains Mono', monospace; font-size: .9rem; }

/* --- Code und Kopierbutton ---------------------------------------------- */

.code { position: relative; margin: 1.2rem 0 1.6rem; }
.code pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1.1rem 1.2rem;
  margin: 0; overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem; font-weight: 400; line-height: 1.65;
  color: var(--text);
}
.code pre .c { color: var(--muted); }
.code pre .k { color: var(--copper); }

.copy {
  position: absolute; top: .55rem; right: .55rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted2);
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .32rem .7rem; border-radius: 2px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.copy:hover { border-color: var(--copper); color: var(--gold); }
.copy.done  { border-color: var(--copper); color: var(--gold); }

code.inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: .85em; color: var(--gold);
  background: var(--card); padding: .1em .4em;
  border-radius: 2px; border: 1px solid var(--border);
}

/* --- Aufklappbare Bereiche (Plus / Kür) --------------------------------- */

details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  margin: .8rem 0;
  transition: border-color .15s, background-color .15s;
}
details[open] { border-color: var(--copper); }

summary {
  cursor: pointer; list-style: none;
  padding: .85rem 1.2rem;
  display: flex; align-items: center; gap: .8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted2);
  transition: color .15s, background-color .15s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { color: var(--gold); }

/* Impulse-Block: Hover sichtbar, nicht nur Cursorwechsel */
details.impulse:hover {
  border-color: var(--copper);
  background: color-mix(in srgb, var(--card) 70%, var(--copper) 8%);
}
details.impulse summary:hover {
  color: var(--gold);
  background: color-mix(in srgb, var(--card) 60%, var(--copper) 12%);
}
details.impulse[open]:hover { border-color: var(--copper); }
summary .sig { color: var(--gold); letter-spacing: .05em; font-weight: 600; min-width: 2.2rem; }
summary .hint {
  color: var(--muted); text-transform: none; letter-spacing: .02em;
  font-family: 'Lora', serif; font-size: .9rem; margin-left: auto;
}
details[open] summary { color: var(--gold); border-bottom: 1px solid var(--border); }
.details-body { padding: 1.2rem 1.2rem .4rem; }
.details-body p:last-child { margin-bottom: 1rem; }

/* --- Linear-Marker ------------------------------------------------------ */

.linear {
  border-left: 2px solid var(--muted);
  padding: .2rem 0 .2rem 1.1rem;
  margin: 1.6rem 0;
  color: var(--muted2);
  font-size: .95rem;
}
.linear b {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); display: block; margin-bottom: .3rem; font-weight: 400;
}

/* --- Hinweiskasten ------------------------------------------------------ */

.warn {
  border-left: 3px solid var(--gold);
  background: var(--card);
  padding: 1.1rem 1.3rem;
  margin: 1.4rem 0;
  font-size: .97rem;
}
.warn b { color: var(--gold); }

/* --- Vorab ohne Schrittnummer ------------------------------------------- */

.vorab-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem; color: var(--muted);
  letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 .5rem;
}
#vorab h2 {
  margin-bottom: 1.2rem;
}

/* --- Pause zwischen den Schritten --------------------------------------- */

.pause {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  padding: 1.6rem 1.8rem;
  margin: 0;
}
.pause h3 {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400;
  letter-spacing: .08em; font-size: 1.25rem;
  color: var(--muted2); margin: 0 0 .7rem;
}
.pause .duration { margin-left: 0; color: var(--muted); }
.pause p:last-child { margin-bottom: 0; }

/* --- Trennelement ------------------------------------------------------- */

.sep {
  text-align: center; padding: 2.2rem 0;
  color: var(--copper);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1.2em; font-size: .8rem;
}
.sep span { color: var(--gold); }

/* --- Footer ------------------------------------------------------------- */

footer { padding: 2.5rem 0 3.5rem; font-size: .85rem; color: var(--muted); }
.footer-in {
  display: flex; flex-wrap: wrap; gap: 1.2rem;
  align-items: center; justify-content: space-between;
}
.footer-brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: .1em; color: var(--muted2); font-size: 1rem;
}
footer a { text-decoration: none; color: var(--muted2); }
footer a:hover { color: var(--copper); }
.footer-links { display: flex; gap: 1.8rem; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .step-head { gap: .8rem; }
  .step-num { font-size: 2rem; }
  .duration { margin-left: 0; }
  summary .hint { display: none; }
  .footer-in { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
