/* ------------------------------------------------------------------
   webergames.de — Root-Landing, Tier 0
   Schrift wird selbst ausgeliefert (public/fonts, SIL OFL). Keine
   Anfrage verlaesst die eigene Domain, kein Skript, kein Tracking.
   ------------------------------------------------------------------ */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-latin.woff2') format('woff2');
  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: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-latin-ext.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  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;
}

:root {
  --ink: #0c0a18;
  --ink-2: #14102a;
  --plate-a: #16122e;
  --plate-b: #100d20;
  --paper: #ece7f5;
  --paper-dim: #9a92b8;
  --paper-faint: #6d6690;
  --violet: #8b5cf6;
  --hair: rgba(198, 188, 255, 0.14);
  --hair-soft: rgba(198, 188, 255, 0.07);

  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'Roboto Mono', monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image:
    radial-gradient(58rem 34rem at 12% -8%, rgba(139, 92, 246, 0.20), transparent 62%),
    radial-gradient(46rem 30rem at 96% 4%, rgba(61, 123, 255, 0.13), transparent 60%),
    radial-gradient(64rem 40rem at 50% 118%, rgba(139, 92, 246, 0.10), transparent 64%),
    repeating-linear-gradient(122deg, rgba(198, 188, 255, 0.035) 0 1px, transparent 1px 132px);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Feines Korn ueber allem — gibt der Flaeche Tiefe ohne Bilddatei. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.5'/></svg>");
}

.shell {
  width: min(1180px, 100% - clamp(1.5rem, 6vw, 5rem));
  margin-inline: auto;
  padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(2.5rem, 6vw, 5rem);
}

/* --- Kopfzeile ---------------------------------------------------- */

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: clamp(3.5rem, 12vw, 8rem);
}

.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.tag--end { color: var(--paper-dim); }

/* --- Kopf --------------------------------------------------------- */

.hero { padding-bottom: clamp(2.25rem, 5vw, 3.5rem); }

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.1rem, 13.5vw, 9.5rem);
  line-height: 0.88;
  letter-spacing: 0.045em;
  text-indent: -0.03em;   /* optischer Ausgleich der Tracking-Vorlaufkante */
  color: var(--paper);
}
.wordmark .dot { color: var(--violet); }

.tagline {
  margin: clamp(1.1rem, 2.4vw, 1.6rem) 0 0;
  max-width: 48ch;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--paper-dim);
  text-wrap: balance;
}

.rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: linear-gradient(90deg, var(--hair), var(--hair-soft) 62%, transparent);
}

/* --- Spiele ------------------------------------------------------- */

.games {
  list-style: none;
  margin: clamp(2rem, 4.5vw, 3.25rem) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(1.1rem, 2.2vw, 1.75rem);
  grid-template-columns: 1fr;
}

@media (min-width: 660px)  { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--hair);
  border-radius: 5px;
  background: linear-gradient(168deg, var(--plate-a), var(--plate-b));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 0.45s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

/* Akzentkante oben: immer als feine Linie da, zieht beim Hover an. */
.game::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 3;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 25%, transparent));
  opacity: 0.4;
  transition: opacity 0.45s var(--ease);
}

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--ink-2);
  border-bottom: 1px solid var(--hair-soft);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(1.005);
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
  filter: saturate(0.92) brightness(0.94);
}

/* Farbschleier in der Akzentfarbe des Spiels — bindet Bild und Karte. */
.shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(12, 10, 24, 0.55), transparent 46%),
    radial-gradient(120% 90% at 50% 110%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  opacity: 0.85;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}

.body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
  padding: clamp(1.1rem, 2vw, 1.45rem) clamp(1.1rem, 2vw, 1.45rem) clamp(1.15rem, 2vw, 1.4rem);
}

.index {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.index span { color: var(--accent); }

.game h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  line-height: 1.06;
  letter-spacing: 0.012em;
}

.desc {
  margin: 0;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--paper-dim);
  text-wrap: pretty;
}

.cta {
  margin: 0.45rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.cta span {
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 0.45s var(--ease);
}

.arrow {
  font-style: normal;
  transition: transform 0.45s var(--ease);
}

/* --- Zustaende ---------------------------------------------------- */

@media (hover: hover) {
  .game:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    box-shadow:
      0 26px 54px -28px rgba(0, 0, 0, 0.9),
      0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent),
      0 18px 60px -34px color-mix(in srgb, var(--accent) 70%, transparent);
  }
  .game:hover::before { opacity: 1; }
  .game:hover .shot img { transform: scale(1.05); filter: saturate(1.06) brightness(1.02); }
  .game:hover .shot::after { opacity: 0.5; }
  .game:hover .cta span { background-size: 100% 1px; }
  .game:hover .arrow { transform: translateX(5px); }
}

.game:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.game:focus-visible::before { opacity: 1; }

a:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }

/* --- Fuss --------------------------------------------------------- */

.foot { margin-top: clamp(3rem, 7vw, 5.5rem); }

.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.15rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
}
.foot-row p { margin: 0; }
.foot-row a { color: var(--paper-dim); text-decoration: none; border-bottom: 1px solid var(--hair); padding-bottom: 2px; transition: color 0.3s var(--ease), border-color 0.3s var(--ease); }
.foot-row a:hover { color: var(--paper); border-color: var(--violet); }

/* --- Auftritt ----------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.85s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; animation: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* --- Impressum ---------------------------------------------------- */

.page {
  max-width: 60ch;
  padding-top: clamp(1rem, 4vw, 3rem);
}
.page h1 {
  margin: 0 0 1.25rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: 0.02em;
}
.page p { margin: 0 0 1rem; color: var(--paper-dim); max-width: 52ch; }
.page .back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet);
  text-decoration: none;
}
.page .back:hover { color: var(--paper); }
