/* ─────────────────────────────────────────────────────────────
   core.css — Shared design tokens, theming, base components.
   Used by:  index.html (Home), gaming/index.html (Gaming)
   ───────────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────────
   LOKALE SCHRIFTARTEN (DSGVO-KONFORM — TTF VERSION)
   ───────────────────────────────────────────────────────────── */

/* Instrument Serif - Normal */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/InstrumentSerif-Regular.ttf') format('truetype');
}

/* Instrument Serif - Kursiv */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/InstrumentSerif-Italic.ttf') format('truetype');
}

/* Geist (Standard-Schriftart) */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 600; /* Deckt deine Stärken 300, 400, 500, 600 ab */
  font-display: swap;
  src: url('fonts/Geist-Regular.ttf') format('truetype');
}

/* Geist Mono (Code-Schriftart) */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('fonts/GeistMono-Regular.ttf') format('truetype');
}

/* ─────────────────────────────────────────────────────────────
   
   ───────────────────────────────────────────────────────────── */

:root {
  /* light is the default; data-theme="dark" overrides below */
  --bg:           oklch(0.985 0.006 75);
  --bg-2:         oklch(0.965 0.010 75);
  --bg-3:         oklch(0.935 0.014 70);
  --ink:          oklch(0.18 0.010 60);
  --ink-2:        oklch(0.42 0.012 60);
  --ink-3:        oklch(0.62 0.010 60);
  --line:         oklch(0.88 0.012 70);
  --line-strong:  oklch(0.78 0.014 70);
  --accent:       oklch(0.62 0.145 45);
  --accent-2:     oklch(0.78 0.060 60);
  --accent-soft:  oklch(0.62 0.145 45 / 0.18);

  --good:         oklch(0.68 0.14 145);
  --warn:         oklch(0.78 0.14 75);

  --radius:       14px;
  --maxw:         1240px;
  --pad-x:        clamp(20px, 4vw, 56px);

  --grain-opacity: 0.06;
  --grain-blend:   multiply;
  --cursor-blend:  normal;
}

html[data-theme="dark"] {
  --bg:           oklch(0.155 0.010 60);
  --bg-2:         oklch(0.195 0.012 60);
  --bg-3:         oklch(0.245 0.014 60);
  --ink:          oklch(0.96 0.006 75);
  --ink-2:        oklch(0.74 0.010 75);
  --ink-3:        oklch(0.55 0.012 75);
  --line:         oklch(0.30 0.014 65);
  --line-strong:  oklch(0.42 0.014 65);
  --accent:       oklch(0.74 0.140 45);
  --accent-2:     oklch(0.62 0.090 55);
  --accent-soft:  oklch(0.74 0.140 45 / 0.22);

  --good:         oklch(0.78 0.16 145);
  --warn:         oklch(0.84 0.14 80);

  --grain-opacity: 0.08;
  --grain-blend:   screen;
  --cursor-blend:  normal;
}

*,*::before,*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light dark; }
body {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
  transition: background .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }

.mono  { font-family: "Geist Mono", ui-monospace, monospace; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.serif { font-family: "Instrument Serif", "Times New Roman", serif; font-weight: 400; letter-spacing: -0.005em; }
.it    { font-style: italic; }

/* ───── Grain overlay ───── */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
}

/* ───── Custom cursor ───── */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1001;
  border-radius: 50%; transform: translate(-50%,-50%);
  will-change: transform, width, height;
}
.cursor {
  width: 28px; height: 28px;
  border: 1px solid var(--ink);
  transition: width .25s ease, height .25s ease, background .25s ease, border-color .25s ease;
  mix-blend-mode: var(--cursor-blend);
}
.cursor-dot {
  width: 4px; height: 4px;
  background: var(--ink);
  mix-blend-mode: var(--cursor-blend);
}
.cursor.is-hover {
  width: 60px; height: 60px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}
.cursor.is-hover + .cursor-dot { opacity: 0; }
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor, .cursor-dot { display: none; }
}

/* ───── Scroll progress ───── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: transparent;
}
.scroll-progress::after {
  content: ""; display: block; height: 100%;
  width: var(--p, 0%); background: var(--accent);
  transition: width .1s linear;
}

/* ───── Reveal animation ───── */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

.split { display: inline-block; overflow: hidden; vertical-align: top; }
.split > span { display: inline-block; transform: translateY(110%); transition: transform .9s cubic-bezier(.2,.7,.2,1); }
.split.in > span { transform: translateY(0); }
.split.delay-1 > span { transition-delay: .12s; }
.split.delay-2 > span { transition-delay: .24s; }
.split.delay-3 > span { transition-delay: .36s; }

/* ───── Top nav ───── */
.nav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50; width: calc(100% - 28px); max-width: var(--maxw);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: transform .35s ease, top .35s ease, background .4s, border-color .4s;
}
.nav-inner {
  padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: flex; align-items: baseline; gap: 8px;
  font-family: "Instrument Serif", serif;
  font-size: 20px; line-height: 1;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); display: inline-block; transform: translateY(-2px);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 60%, 100% { opacity: 1; }
  70% { opacity: 0.3; }
}
.brand .it { color: var(--ink-2); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  font-size: 13px; color: var(--ink-2);
  padding: 8px 14px; border-radius: 999px;
  position: relative; transition: color .2s ease, background .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--bg-2); }
.nav-cta {
  font-family: "Geist Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 9px 14px; background: var(--ink); color: var(--bg);
  border-radius: 999px; transition: transform .25s ease, background .25s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: var(--accent); color: var(--bg); }
.nav-cta .arrow { display: inline-block; transition: transform .25s ease; }
.nav-cta:hover .arrow { transform: rotate(-45deg); }

/* ───── i18n: bilingual text visibility ───── */
/* Pair of twin elements <span data-en>EN</span><span data-de>DE</span>
   shows the one matching <html data-lang>. Default: English.
   !important because page-level rules (e.g. legend `span { display: inline-flex }`)
   would otherwise override the simple attribute selector. */
html[data-lang="en"] [data-de] { display: none !important; }
html[data-lang="de"] [data-en] { display: none !important; }

/* ───── Language toggle (matches theme toggle visually) ───── */
.lang-toggle {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: inline-grid; place-items: center;
  cursor: none;
  transition: background .25s, border-color .25s;
  font-family: "Geist Mono", monospace;
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--ink-2);
  padding: 0;
  position: relative; overflow: hidden;
}
.lang-toggle:hover { background: var(--bg-3); border-color: var(--line-strong); color: var(--ink); }
.lang-toggle > span {
  font-weight: 500;
}
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: inline-grid; place-items: center;
  cursor: none;
  transition: background .25s, border-color .25s;
  position: relative; overflow: hidden;
}
.theme-toggle:hover { background: var(--bg-3); border-color: var(--line-strong); }
.theme-toggle svg { width: 16px; height: 16px; color: var(--ink); transition: transform .5s cubic-bezier(.5,1.6,.4,1), opacity .3s; }
.theme-toggle .sun  { position: absolute; transform: rotate(90deg) scale(0); opacity: 0; }
.theme-toggle .moon { position: absolute; transform: rotate(0deg) scale(1);  opacity: 1; }
html[data-theme="dark"] .theme-toggle .sun  { transform: rotate(0deg) scale(1);  opacity: 1; }
html[data-theme="dark"] .theme-toggle .moon { transform: rotate(-90deg) scale(0); opacity: 0; }

/* ───── Marquee ───── */
.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
  background: var(--bg-2);
}
.marquee-track {
  display: flex; gap: 48px; white-space: nowrap;
  animation: marquee 40s linear infinite;
  width: max-content;
}
.marquee span {
  font-family: "Instrument Serif", serif;
  font-size: 38px; line-height: 1; color: var(--ink);
  display: inline-flex; align-items: center; gap: 48px;
}
.marquee span::after {
  content: "✦"; color: var(--accent); font-size: 22px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ───── Section frame ───── */
section.rubric {
  border-top: 1px solid var(--line);
  padding: clamp(56px, 8vw, 96px) var(--pad-x);
  position: relative;
}
.rubric-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 5vw, 72px);
}
.rubric-aside { position: sticky; top: 84px; align-self: start; }
.rubric-num {
  font-family: "Geist Mono", monospace; font-size: 11px;
  letter-spacing: 0.12em; color: var(--ink-3);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.rubric-num::before {
  content: ""; width: 24px; height: 1px; background: var(--ink-3); display: inline-block;
}
.rubric-name {
  font-family: "Instrument Serif", serif;
  font-size: 36px; line-height: 1; margin: 0 0 16px 0;
}
.rubric-name .it { color: var(--ink-2); }
.rubric-aside p {
  font-size: 13px; color: var(--ink-2); margin: 0; max-width: 22ch;
}

/* ───── Generic tag/pill ───── */
.tag {
  display: inline-block;
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ───── Star rating (0–10 in 0,5er Schritten — gespeist aus 0-100) ───── */
.stars-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 100%;
}
.stars {
  --size: 14px;
  --gap:  3px;
  position: relative;
  display: inline-grid;
  isolation: isolate;
  line-height: 0;
}
.stars > .stars-bg,
.stars > .stars-fg {
  grid-area: 1 / 1;
  display: flex;
  gap: var(--gap);
  line-height: 0;
}
.stars > .stars-bg { color: var(--line-strong); }
.stars > .stars-fg {
  color: var(--accent);
  overflow: hidden;
  width: var(--w, 0%);
  white-space: nowrap;
  transition: width .8s cubic-bezier(.2,.7,.2,1);
}
.stars svg {
  width: var(--size); height: var(--size);
  fill: currentColor;
  flex-shrink: 0;
}
.stars-num {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stars-num small { color: var(--ink-3); margin-left: 1px; }
.stars-sm { --size: 11px; --gap: 2px; }
.stars-sm + .stars-num { font-size: 10px; }
.stars-lg { --size: 17px; --gap: 4px; }
.stars-lg + .stars-num { font-size: 13px; }

/* ───── Cover artwork ───── */
.cover {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background:
    linear-gradient(140deg,
      oklch(0.62 0.09 var(--h, 30)) 0%,
      oklch(0.42 0.07 calc(var(--h, 30) + 50)) 100%);
  border: 1px solid var(--line);
  display: block;
  isolation: isolate;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 20% 20%, oklch(1 0 0 / 0.18), transparent 60%),
    repeating-linear-gradient(135deg, oklch(1 0 0 / 0.03) 0 2px, transparent 2px 4px);
  pointer-events: none;
}
.cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  z-index: 1;
}
.cover:has(img) { background: var(--bg-3); }
.cover:has(img)::after { opacity: 0.4; }
.cover:has(img) .ini { display: none; }
.cover .ini {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: "Instrument Serif", serif;
  color: oklch(1 0 0 / 0.78);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px oklch(0 0 0 / 0.25);
  z-index: 0;
}
html[data-theme="dark"] .cover { border-color: oklch(0.35 0.012 60); }

/* Fixed pixel sizes — use width + height explicitly so the image
   inside (position:absolute inset:0) can never blow past the box. */
.cover-row  { width: 48px;  height: 64px; }
.cover-row  .ini { font-size: 18px; }
.cover-tile { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; }
.cover-tile .ini { font-size: 56px; }
.cover-goty { width: 92px;  height: 123px; }
.cover-goty .ini { font-size: 32px; }
.cover-mini { width: 36px;  height: 48px; border-radius: 5px; }
.cover-mini .ini { font-size: 14px; }

/* ───── Status dot ───── */
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-live { background: var(--good); box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); animation: pulse-green 2.2s infinite; }
@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.status-wip  { background: var(--warn); }
.status-arch { background: var(--ink-3); }

/* ───── Footer ───── */
footer.foot {
  border-top: 1px solid var(--line);
  padding: 80px var(--pad-x) 40px;
  text-align: center;
  position: relative; overflow: hidden;
}
.foot-huge {
  font-family: "Instrument Serif", serif;
  font-size: clamp(80px, 18vw, 260px);
  line-height: 0.9;
  margin: 0 0 40px 0;
  letter-spacing: -0.03em;
  color: var(--ink);
  user-select: none;
}
.foot-huge .it { color: var(--ink-2); }
.foot-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
  font-family: "Geist Mono", monospace; font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.06em;
  padding-top: 24px; border-top: 1px solid var(--line);
}
.foot-inner a:hover { color: var(--ink); }

/* ───── Responsive ───── */
@media (max-width: 900px) {
  .rubric-inner { grid-template-columns: 1fr; }
  .rubric-aside { position: static; }
  .nav-links { display: none; }
  .marquee span { font-size: 28px; }
}
