/* BENOGS Games 1.2 — motion is an enhancement; nothing starts hidden. */
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
}

.intro {
  position: relative;
  isolation: isolate;
}

.intro::before,
.intro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.intro::before {
  background:
    radial-gradient(ellipse at 23% 60%, #c1f5850e, transparent 62%),
    radial-gradient(ellipse at 91% 30%, #c28bff0b, transparent 48%);
}

.intro::after {
  left: 52%;
  opacity: .16;
  background-image:
    linear-gradient(#a6b69b33 1px, transparent 1px),
    linear-gradient(90deg, #a6b69b33 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000, transparent 70%);
}

h1 span {
  text-shadow: 0 0 42px #c1f58512;
}

.header-inner nav a,
.text-link,
.details-button {
  transition: color 180ms ease;
}

.text-link span,
.details-button span,
.cover-more,
.gallery-thumbnails button,
.faq-list summary > span {
  transition: transform 220ms var(--motion-ease), color 180ms ease,
    background 180ms ease, border-color 180ms ease;
}

.filters button {
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.filters button[aria-pressed='true'] {
  box-shadow: 0 2px 14px #c1f58514;
}

.games-grid {
  perspective: 1400px;
}

.game-card {
  --card-light: 193, 245, 133;
  position: relative;
  isolation: isolate;
  box-shadow: 0 12px 35px -22px #0008;
  transition: transform 420ms var(--motion-ease), border-color 260ms ease,
    box-shadow 320ms ease;
}

.tcg-card {
  --card-light: 194, 139, 255;
  border-color: #3b3342;
}

.games-grid > .game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    440px circle at var(--light-x, 50%) var(--light-y, 0%),
    rgba(var(--card-light), .085), transparent 70%
  );
  transition: opacity 300ms ease;
}

.game-card:focus-within {
  border-color: rgba(var(--card-light), .6);
  box-shadow: 0 12px 36px -24px rgba(var(--card-light), .28);
}

.game-cover > img {
  transition: transform 800ms var(--motion-ease), opacity 300ms ease;
}

.download-button {
  transition: background 180ms ease, transform 220ms var(--motion-ease),
    box-shadow 220ms ease;
}

.download-button:active {
  transform: translateY(1px);
}

.dialog-gallery {
  overflow: hidden;
}

.dialog-gallery > img {
  transform-origin: center;
}

.game-dialog::backdrop {
  animation: backdrop-enter 220ms ease;
  transition: opacity 160ms ease;
}

.game-dialog.is-closing::backdrop {
  opacity: 0;
}

.gallery-thumbnails button:focus-visible {
  outline-offset: 3px;
}

.faq-list details.is-animating {
  overflow: hidden;
}

.faq-list summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  border-radius: 3px;
}

@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .games-grid > .game-card:hover {
    transform: translateY(-5px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    border-color: rgba(var(--card-light), .55);
    box-shadow: 0 20px 46px -22px #000a,
      0 0 25px -14px rgba(var(--card-light), .28);
  }

  .games-grid > .game-card:hover::after {
    opacity: 1;
  }

  .download-button:hover {
    box-shadow: 0 4px 20px #c1f58520;
  }

  .cover-more:hover {
    transform: rotate(6deg);
  }

  .gallery-thumbnails button:hover {
    transform: translateY(-2px);
    border-color: #89977c;
  }
}

@media (hover: none), (pointer: coarse) {
  .game-card:hover .game-cover > img,
  .download-button:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  .intro::after {
    left: 30%;
    opacity: .1;
    background-size: 28px 28px;
  }

  .gallery-thumbnails button {
    min-width: 48px;
    min-height: 48px;
  }

  .dialog-close {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-dialog::backdrop {
    animation: none !important;
    transition: none !important;
  }

  .games-grid > .game-card:hover,
  .download-button:active,
  .gallery-thumbnails button:hover,
  .cover-more:hover {
    transform: none;
  }
}

/* A more expressive opening, using the original game artwork. */
.scroll-progress {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto;
  height: 2px;
  pointer-events: none;
}

.scroll-progress > span {
  display: block;
  height: 100%;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left;
  background: linear-gradient(90deg, var(--accent) 25%, #bca3ff);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background 220ms ease, box-shadow 220ms ease;
}

.site-header.has-scrolled {
  background: #101211e8;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 26px #0003;
}

.header-inner nav a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms var(--motion-ease);
}

.header-inner nav a.active::after {
  transform: scaleX(1);
}

.intro {
  align-items: center;
  gap: 42px;
  padding-block: 48px 50px;
}

.intro::before {
  background:
    radial-gradient(ellipse at 18% 55%, #c1f58516, transparent 62%),
    radial-gradient(ellipse at 86% 38%, #b68bff1d, transparent 53%);
  animation: ambient-drift 12s ease-in-out infinite alternate;
}

.intro::after {
  left: 38%;
  opacity: .25;
}

.intro-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.discover-button {
  font-size: .875rem;
  padding: 12px 18px;
}

.discover-button svg {
  width: 17px;
  height: 17px;
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #48533e;
  border-radius: 6px;
  background: #171d1580;
  color: #b7c1af;
  font-size: .875rem;
  line-height: 1.5;
}

.motion-toggle:hover,
.motion-toggle[aria-pressed='true'] {
  border-color: #9cbe7c;
  color: var(--accent);
}

.motion-toggle svg {
  width: 16px;
  height: 16px;
}

.motion-toggle .play-symbol,
.motion-toggle[aria-pressed='true'] .pause-symbol {
  display: none;
}

.motion-toggle[aria-pressed='true'] .play-symbol {
  display: inline;
}

.intro-aside {
  flex: 0 0 34%;
  max-width: 390px;
  padding: 0;
}

.intro-aside > p {
  font-size: .875rem;
  line-height: 1.8;
  margin: 22px 0 0;
}

.intro-art {
  position: relative;
  height: clamp(175px, 15vw, 215px);
  width: 100%;
}

.intro-art::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse, #b48aff20, #c1f58509 50%, transparent 72%);
  transform: scale(1.08);
}

.hero-frame {
  position: absolute;
  width: 63%;
  aspect-ratio: 1.55;
  border: 1px solid #acc19552;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 36px #0007;
  background: var(--panel);
  transform: rotate(var(--frame-angle));
  animation: hero-float 7s ease-in-out infinite alternate;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(transparent 35%, #000b);
}

.hero-frame > span {
  position: absolute;
  z-index: 1;
  bottom: 14px;
  left: 14px;
  color: #fff;
  font-size: 15px;
  line-height: 1.2;
  text-shadow: 0 1px 10px #000;
}

.hero-frame-anwesend {
  --frame-angle: -10deg;
  top: 7%;
  left: 4%;
  animation-delay: -2s;
}

.hero-frame-anwesend > span {
  font-family: Georgia, serif;
  letter-spacing: 3px;
}

.hero-frame-tcg {
  --frame-angle: 8deg;
  top: 27%;
  right: 3%;
  border-color: #bf91ee88;
  animation-duration: 8s;
  animation-delay: -4s;
}

.hero-frame-tcg > span {
  font-weight: 800;
  font-style: italic;
  letter-spacing: -.4px;
}

.hero-spark {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 18px #c1f58560;
  animation: spark-drift 5s ease-in-out infinite alternate;
}

.hero-spark-one {
  right: 12%;
  top: 3%;
}

.hero-spark-two {
  left: 6%;
  bottom: 3%;
  width: 4px;
  height: 4px;
  background: #c4a0f7;
  animation-delay: -2s;
}

.game-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-120%) skewX(-16deg);
  background: linear-gradient(90deg, transparent 20%, #ffffff1f 50%, transparent 80%);
}

.download-button {
  position: relative;
  overflow: hidden;
}

.download-button::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-120%) skewX(-16deg);
  background: linear-gradient(90deg, transparent 25%, #ffffff55 50%, transparent 75%);
}

@keyframes hero-float {
  from { transform: translateY(3px) rotate(var(--frame-angle)); }
  to { transform: translateY(-7px) rotate(calc(var(--frame-angle) + 2deg)); }
}

@keyframes ambient-drift {
  from { opacity: .55; }
  to { opacity: 1; }
}

@keyframes spark-drift {
  from { transform: translateY(0); opacity: .5; }
  to { transform: translateY(-9px); opacity: 1; }
}

@keyframes cover-sheen {
  0% { opacity: 0; transform: translateX(-120%) skewX(-16deg); }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(120%) skewX(-16deg); }
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  h1 span {
    background: linear-gradient(110deg, #c1f585 20%, #e1ffc5 38%, #8de5b7 48%, #c1f585 66%);
    background-size: 240% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: title-light 8s ease-in-out infinite alternate;
  }
}

@keyframes title-light {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .games-grid > .game-card:hover {
    border-color: rgba(var(--card-light), .78);
    box-shadow: 0 24px 48px -20px #000b, 0 0 30px -12px rgba(var(--card-light), .3);
  }

  .game-card:hover .game-cover > img {
    transform: scale(1.055);
  }

  .game-card:hover .game-cover::after {
    animation: cover-sheen 1050ms var(--motion-ease);
  }

  .download-button:hover::after {
    animation: cover-sheen 700ms var(--motion-ease);
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .intro {
    gap: 24px;
  }

  .intro-aside {
    flex-basis: 35%;
  }

  .hero-frame > span {
    font-size: 13px;
    left: 10px;
    bottom: 10px;
  }

  .intro-actions {
    gap: 10px;
  }

  .motion-toggle .motion-label {
    display: none;
  }

  .motion-toggle {
    width: 44px;
    padding: 10px;
  }
}

@media (max-width: 760px) {
  .intro {
    padding-block: 36px 32px;
    gap: 24px;
    align-items: stretch;
  }

  .intro-aside {
    flex: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 135px;
    align-items: center;
    gap: 12px;
    max-width: none;
  }

  .intro-art {
    grid-column: 2;
    grid-row: 1;
    height: 105px;
  }

  .intro-art::before {
    transform: none;
  }

  .intro-aside > p {
    grid-column: 1;
    grid-row: 1;
    font-size: .75rem;
    line-height: 1.8;
    margin: 0;
  }

  .hero-frame {
    width: 77%;
    border-radius: 6px;
    animation-duration: 9s;
  }

  .hero-frame-anwesend {
    left: 0;
  }

  .hero-frame-tcg {
    top: 35%;
    right: 0;
  }

  .hero-frame > span {
    left: 6px;
    bottom: 7px;
    font-size: 10px;
  }

  .hero-frame-anwesend > span {
    letter-spacing: 1px;
    font-size: 8px;
  }

  .hero-spark {
    width: 4px;
    height: 4px;
  }

  .intro-actions {
    margin-top: 23px;
    gap: 12px;
  }

  .motion-toggle .motion-label {
    display: none;
  }

  .motion-toggle {
    width: 44px;
    padding: 10px;
  }
}

/* No-JavaScript visitors get a still composition; the control enables motion. */
.intro::before,
.hero-frame,
.hero-spark,
h1 span {
  animation-play-state: paused;
}

html.motion-enabled .intro::before,
html.motion-enabled .hero-frame,
html.motion-enabled .hero-spark,
html.motion-enabled h1 span {
  animation-play-state: running;
}

html.motion-paused *,
html.motion-paused *::before,
html.motion-paused *::after,
html.motion-paused .game-dialog::backdrop {
  animation-play-state: paused !important;
  transition: none !important;
}

html.motion-paused .games-grid > .game-card:hover,
html.motion-paused .game-card:hover .game-cover > img,
html.motion-paused .download-button:hover,
html.motion-paused .cover-more:hover,
html.motion-paused .gallery-thumbnails button:hover {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .intro::before,
  .hero-frame,
  .hero-spark,
  h1 span,
  .game-cover::after,
  .download-button::after {
    animation: none !important;
  }
}
