/* PlotTwistMind — single stylesheet, no build step. */

:root {
  --bg: #0b0e14;
  --bg-soft: #0f1420;
  --ink: #e8eef7;
  --muted: #93a0b8;
  --cyan: #00d2ff;
  --violet: #a855f7;
  --orange: #ff7e11;
  --line: rgba(255, 255, 255, 0.09);
  --card: rgba(255, 255, 255, 0.035);
  --radius: 20px;
  --wrap: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient light behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 45% at 50% -10%, rgba(0, 210, 255, 0.14), transparent 70%),
    radial-gradient(45% 40% at 85% 25%, rgba(168, 85, 247, 0.11), transparent 70%),
    radial-gradient(40% 40% at 10% 75%, rgba(255, 126, 17, 0.07), transparent 70%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

::selection {
  background: rgba(0, 210, 255, 0.28);
}

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.5em;
  font-weight: 800;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 100;
  background: var(--cyan);
  color: #04121a;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 10px 0;
  font-weight: 700;
}

.skip:focus {
  inset-inline-start: 0;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 0.9rem;
}

.grad {
  background: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 5vw, 3rem);
  background: rgba(11, 14, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 30px;
  height: 30px;
}

.brand span span {
  color: var(--cyan);
}

.nav nav ul {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav nav a {
  color: var(--muted);
}

.nav nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

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

.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(4rem, 10vw, 8rem);
  text-align: center;
  overflow: hidden;
}

.pixels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.px {
  position: absolute;
  width: var(--sz, 6px);
  height: var(--sz, 6px);
  border-radius: 2px;
  background: var(--cyan);
  opacity: var(--o, 0.3);
  animation: drift var(--d, 12s) linear infinite;
  animation-delay: var(--dl, 0s);
  will-change: transform;
}

.px:nth-child(3n) {
  background: var(--violet);
}

.px:nth-child(3n + 2) {
  background: var(--orange);
}

@keyframes drift {
  from {
    transform: translate3d(0, 30px, 0) rotate(0deg);
  }
  to {
    transform: translate3d(12px, -140px, 0) rotate(90deg);
  }
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.emblem {
  position: relative;
  width: clamp(150px, 26vw, 215px);
  aspect-ratio: 1;
  margin-bottom: 2.4rem;
  perspective: 700px;
  animation: bob 9s ease-in-out infinite;
}

.emblem img {
  position: relative;
  width: 100%;
  height: auto;
  transition: transform 0.35s ease-out;
  filter: drop-shadow(0 10px 28px rgba(0, 210, 255, 0.3))
    drop-shadow(0 0 60px rgba(168, 85, 247, 0.22));
}

@keyframes bob {
  50% {
    transform: translateY(-10px);
  }
}

.hero h1 {
  font-size: clamp(2.4rem, 7.2vw, 4.6rem);
  max-width: 16ch;
  margin-bottom: 0.6em;
}

.lede {
  max-width: 54ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.9vw, 1.18rem);
  margin-bottom: 2rem;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.3s ease, background 0.3s ease,
    border-color 0.3s ease;
  overflow: hidden;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  color: #04121a;
  background: linear-gradient(100deg, var(--cyan), #7ee7ff 40%, var(--violet));
  box-shadow: 0 10px 30px -12px rgba(0, 210, 255, 0.65);
}

.btn-primary:hover {
  box-shadow: 0 16px 40px -12px rgba(0, 210, 255, 0.85);
}

/* Neon shine sweep */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-ghost {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(0, 210, 255, 0.45);
  background: rgba(0, 210, 255, 0.07);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section-head {
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

/* ---------- Game card ---------- */

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s ease;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(0, 210, 255, 0.65),
    rgba(168, 85, 247, 0.5) 45%,
    rgba(255, 255, 255, 0.06) 75%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px -30px rgba(0, 210, 255, 0.4);
}

.game-art {
  position: relative;
  min-height: 280px;
  background:
    radial-gradient(60% 60% at 28% 18%, rgba(0, 210, 255, 0.32), transparent 62%),
    radial-gradient(55% 55% at 82% 78%, rgba(168, 85, 247, 0.34), transparent 62%),
    linear-gradient(160deg, #141b2b, #0a0d14);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}

.game-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 75%);
}

.game-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #04121a;
  background: linear-gradient(100deg, var(--cyan), #8be9ff);
}

.game-body {
  padding: clamp(1.6rem, 3.4vw, 2.6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-body h3 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.25em;
}

.game-tag {
  color: var(--orange);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.9em;
}

.game-body > p {
  color: var(--muted);
  font-size: 0.98rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
}

.tags li {
  font-size: 0.78rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.game-body .actions {
  justify-content: flex-start;
  margin-bottom: 1rem;
}

.game-links {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.game-links a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(147, 160, 184, 0.4);
}

.game-links a:hover {
  color: var(--cyan);
}

/* ---------- Coming soon ---------- */

.soon {
  margin-top: 1.25rem;
  padding: clamp(1.6rem, 4vw, 2.4rem);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.soon h3 {
  font-size: 1.15rem;
  margin: 0;
}

.soon p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 46ch;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.about-copy p {
  color: var(--muted);
}

.values {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0 0;
  display: grid;
  gap: 1.1rem;
}

.values li {
  padding-left: 1.2rem;
  border-left: 2px solid rgba(0, 210, 255, 0.35);
  color: var(--muted);
  font-size: 0.97rem;
}

.values strong {
  display: block;
  color: var(--ink);
  font-weight: 650;
  margin-bottom: 0.15rem;
}

/* ---------- Support ---------- */

.support-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
  padding: clamp(1.8rem, 5vw, 3rem);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(70% 120% at 12% 0%, rgba(0, 210, 255, 0.14), transparent 60%),
    radial-gradient(60% 120% at 95% 100%, rgba(168, 85, 247, 0.14), transparent 60%),
    rgba(255, 255, 255, 0.025);
}

.support-card > div {
  flex: 1 1 420px;
}

.support-card > .btn {
  flex: 0 0 auto;
}

.support-card h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  margin-bottom: 0.4em;
}

.support-card p {
  color: var(--muted);
  margin: 0;
  max-width: 48ch;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer a {
  color: var(--muted);
}

.footer a:hover {
  color: var(--ink);
}

.footer p {
  margin: 0;
}

/* ---------- Legal / document pages ---------- */

.doc {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 4rem;
}

.crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.crumbs a {
  color: var(--muted);
}

.crumbs span {
  opacity: 0.5;
  margin: 0 0.4rem;
}

.doc-body {
  max-width: 74ch;
}

.doc h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  margin-bottom: 0.3em;
}

.doc h2 {
  font-size: 1.3rem;
  margin: 2.4em 0 0.6em;
}

.doc h3 {
  font-size: 1.05rem;
  margin: 1.8em 0 0.5em;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc li {
  margin-bottom: 0.5rem;
}

.doc ul {
  padding-inline-start: 1.2rem;
}

.doc .meta {
  font-size: 0.88rem;
  color: var(--muted);
  border-inline-start: 2px solid rgba(0, 210, 255, 0.4);
  padding-inline-start: 1rem;
  margin-bottom: 2.5rem;
}

.doc strong {
  color: var(--ink);
}

.doc a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 210, 255, 0.4);
}

/* Arabic / RTL documents */
html[lang="ar"] body {
  font-family: "Noto Naskh Arabic", "Geeza Pro", "Segoe UI", Tahoma,
    ui-sans-serif, system-ui, sans-serif;
  line-height: 1.9;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 {
  letter-spacing: 0;
  line-height: 1.45;
}

html[lang="ar"] .eyebrow {
  letter-spacing: 0.06em;
}

.ltr {
  direction: ltr;
  unicode-bidi: embed;
}

/* ---------- Portal (holding) page ---------- */

.portal {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: center;
  padding: 4rem 0;
  text-align: center;
}

.portal-inner {
  max-width: 60ch;
}

.portal h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

/* ---------- Reveal on scroll ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Hero entrance */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.js .hero-inner > * {
  animation: rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.js .hero-inner > *:nth-child(1) {
  animation-delay: 0.05s;
}
.js .hero-inner > *:nth-child(2) {
  animation-delay: 0.15s;
}
.js .hero-inner > *:nth-child(3) {
  animation-delay: 0.25s;
}
.js .hero-inner > *:nth-child(4) {
  animation-delay: 0.35s;
}

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

@media (max-width: 880px) {
  .game-card {
    grid-template-columns: 1fr;
  }

  .game-art {
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .game-body .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .nav {
    padding: 0.75rem 1.25rem;
  }

  .nav nav ul {
    gap: 1rem;
    font-size: 0.88rem;
  }

  .brand span {
    display: none;
  }

  .support-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .soon {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  body::before,
  .nav,
  .footer,
  .pixels {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .doc p,
  .doc li {
    color: #222;
  }
}
