:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-elev-2: #141414;
  --border: #1f1f1f;
  --border-strong: #2a2a2a;
  --text: #e8e8e8;
  --text-mute: #7a7a7a;
  --text-dim: #4a4a4a;
  --metal-1: #f5f5f5;
  --metal-2: #9a9a9a;
  --metal-3: #3a3a3a;
  --glow: rgba(255, 255, 255, 0.18);
  --glow-soft: rgba(220, 230, 255, 0.08);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tracking-wide: 0.4em;

  --container: 1200px;
  --section-pad-y: clamp(6rem, 14vh, 12rem);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255,255,255,0.04), transparent 60%),
    radial-gradient(ellipse at 0% 100%, rgba(255,255,255,0.02), transparent 50%);
  z-index: 0;
}

main { position: relative; z-index: 1; }

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover { color: var(--metal-1); }
a:focus-visible {
  outline: 1px solid var(--metal-1);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ─────────────────────────  NAV  ───────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1.25rem, 4vw, 3rem);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
body.scrolled .nav {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.nav__brand-mark {
  width: 26px;
  height: 26px;
  fill: var(--metal-1);
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.25));
}
.nav__brand-text {
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  font-size: 0.95rem;
  color: var(--metal-1);
  line-height: 1;
  transform: translateY(-3px);
}

.nav__links {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
}
.nav__links a {
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 400;
  position: relative;
  padding: 0.25rem 0;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--metal-1), transparent);
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform 0.3s ease;
}
.nav__links a:hover { color: var(--metal-1); }
.nav__links a:hover::after { transform: scaleX(1); }

@media (max-width: 600px) {
  .nav__brand-text { display: none; }
  .nav__links { gap: 1rem; }
  .nav__links a { font-size: 0.68rem; letter-spacing: 0.25em; }
}

/* ─────────────────────────  HERO  ───────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.5rem 4rem;
  position: relative;
  text-align: center;
  overflow: hidden;
}

/* Subtle blueprint engineering grid mesh overlay in hero */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center center;
  mask-image: radial-gradient(circle at 50% 50%, black 20%, transparent 65%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 20%, transparent 65%);
  pointer-events: none;
  opacity: 0.7;
  z-index: 0;
}

.hero__stage {
  position: relative;
  width: min(48vmin, 440px);
  aspect-ratio: 7267.06 / 8192;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.logo--outer {
  z-index: 2;
}

.logo--inner {
  z-index: 3;
}

.logo--wordmark {
  z-index: 4;
}

/*
 * Logo draw-in animation — driven by a single class (.logo--ready) added on load.
 * 
 * Initial State: paths invisible (fill-opacity: 0, stroke-opacity: 0, stroke-dashoffset: 20000)
 * Ready State: strokes draw in, then fill fades in and stroke becomes a thin outline.
 */

.logo__path {
  fill-opacity: 0;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 24;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke-opacity: 0;
}

/* Staggered transition delays for each layer/path - only active once logo is ready */
/* Order of properties: stroke-dashoffset, stroke-opacity, stroke-width, fill-opacity */
.logo--ready.logo--outer .logo__path {
  transition-delay: 0.1s, 0.1s, 1.8s, 1.8s;
}
.logo--ready.logo--inner .logo__path {
  transition-delay: 0.5s, 0.5s, 2.2s, 2.2s;
}
.logo--ready .logo__path--z { transition-delay: 0.8s, 0.8s, 2.5s, 2.5s; }
.logo--ready .logo__path--h { transition-delay: 0.95s, 0.95s, 2.65s, 2.65s; }
.logo--ready .logo__path--e { transition-delay: 1.1s, 1.1s, 2.8s, 2.8s; }
.logo--ready .logo__path--k { transition-delay: 1.25s, 1.25s, 2.95s, 2.95s; }
.logo--ready .logo__path--a { transition-delay: 1.4s, 1.4s, 3.1s, 3.1s; }

/* Final state once .logo--ready is applied */
.logo--ready .logo__path {
  stroke-dashoffset: 0;
  stroke-opacity: 0.18;
  stroke-width: 12;
  fill-opacity: 1;
  transition:
    stroke-dashoffset 2s cubic-bezier(0.2, 0.8, 0.2, 1),
    stroke-opacity 1.5s ease,
    stroke-width 1.5s ease,
    fill-opacity 1.5s ease;
}


/* CPU-Optimized GPU-Accelerated Glow */
.hero__halo {
  position: absolute;
  inset: -15%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08) 0%, rgba(180, 200, 255, 0.03) 45%, transparent 70%);
  filter: blur(40px);
  animation: halo-breath 8s ease-in-out infinite;
}

@keyframes halo-breath {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1.0; }
}

.hero__sub {
  margin-top: 3.5rem;
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 300;
  z-index: 1;
}

.hero__scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}
.hero__scroll:hover { opacity: 1; }
.hero__scroll span {
  width: 2px;
  height: 6px;
  background: var(--metal-1);
  border-radius: 2px;
  animation: scroll-dot 1.8s ease-in-out infinite;
}
@keyframes scroll-dot {
  0%   { transform: translateY(0); opacity: 1; }
  60%  { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ─────────────────────────  SECTIONS  ───────────────────────── */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--section-pad-y) clamp(1.5rem, 5vw, 3rem);
  position: relative;
}
.section--narrow { max-width: 760px; }
.section--legal  { max-width: 880px; }

.section__eyebrow {
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 1rem 0;
  font-weight: 400;
}

.section__title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 2rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #d9d9d9 60%, #8a8a8a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.7;
  color: var(--text);
  max-width: 65ch;
  font-weight: 300;
}

/* ─────────────────────────  MODULES  ───────────────────────── */
.modules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 3rem;
  overflow: hidden;
}

.module {
  background: var(--bg-elev);
  padding: clamp(2rem, 4vw, 3rem);
  position: relative;
  transition: background 0.3s ease;
  isolation: isolate;
}
.module::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
.module:hover { background: var(--bg-elev-2); }
.module:hover::before { opacity: 1; }

.module__index {
  display: block;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-wide);
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.module__title {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 300;
  letter-spacing: -0.005em;
  margin: 0 0 0.85rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #b8b8b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.module__text {
  margin: 0;
  color: var(--text-mute);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .modules { grid-template-columns: 1fr; }
}

/* ─────────────────────────  SPIELE  ───────────────────────── */
.games {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-top: 3rem;
  overflow: hidden;
}

.game-card {
  display: block;
  background: var(--bg-elev);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.3s ease;
  isolation: isolate;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}
.game-card:hover { background: var(--bg-elev-2); }
.game-card:hover::before { opacity: 1; }

.game-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.game-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.85);
  transition: transform 0.6s ease, filter 0.4s ease;
}
.game-card:hover .game-card__media img {
  transform: scale(1.04);
  filter: saturate(1);
}

.game-card__body { padding: clamp(1.5rem, 3vw, 2.25rem); }

.game-card__index {
  display: block;
  font-size: 0.7rem;
  letter-spacing: var(--tracking-wide);
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-weight: 400;
}

.game-card__title {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 300;
  letter-spacing: -0.005em;
  margin: 0 0 0.75rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #b8b8b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-card__text {
  margin: 0 0 1.25rem 0;
  color: var(--text-mute);
  font-size: 0.95rem;
  line-height: 1.7;
}

.game-card__cta {
  font-size: 0.8rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.game-card:hover .game-card__cta { color: #ffffff; }

@media (max-width: 720px) {
  .games { grid-template-columns: 1fr; }
}

/* ─────────────────────────  KONTAKT  ───────────────────────── */
.contact-mail {
  display: inline-block;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 200;
  letter-spacing: -0.01em;
  margin: 0.5rem 0 1.5rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #c0c0c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  padding-bottom: 0.25rem;
}
.contact-mail::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--metal-2), transparent);
  transform: scaleX(0.6);
  transform-origin: 50% 50%;
  transition: transform 0.4s ease;
}
.contact-mail:hover::after { transform: scaleX(1); }

.contact-address {
  color: var(--text-mute);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ─────────────────────────  LEGAL  ───────────────────────── */
.legal h3 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 2.5rem 0 0.75rem 0;
  color: var(--metal-1);
}
.legal p {
  margin: 0 0 1rem 0;
  color: var(--text-mute);
  font-size: 0.95rem;
  line-height: 1.75;
}
.legal a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  transition: border-color 0.2s ease;
}
.legal a:hover {
  border-bottom-color: var(--metal-1);
}
.legal strong { color: var(--text); font-weight: 500; }

/* ─────────────────────────  FOOTER  ───────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem clamp(1.5rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--container);
  margin: 0 auto;
}

.footer__copy {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.footer__nav {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}
.footer__nav a {
  font-size: 0.72rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-mute);
}
.footer__nav a:hover { color: var(--metal-1); }
.footer__nav span { color: var(--text-dim); }

/* ─────────────────────────  REVEAL ANIMATION  ───────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────  REDUCED MOTION  ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .logo { transform: none !important; }
  .reveal { opacity: 1; transform: none; }
}
