/* Teju Games — shared design system.
   Game pages load this from /assets/site.css (the middleware falls back to the
   root when a subdomain asks for it) and add their own accent on top. */

:root {
  --bg: #0b0f1a;
  --bg-2: #10152a;
  --surface: #151b30;
  --surface-2: #1c2340;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f2f4fa;
  --muted: #a3abc6;
  --dim: #6f7896;
  --coral: #ff6b4a;
  --yellow: #ffc93c;
  --teal: #35d0ba;
  --violet: #8b7cf6;
  --accent: var(--coral);
  --accent-ink: #1a0d08;
  --radius: 22px;
  --radius-s: 12px;
  --font-head: "Sora", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 76px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.08; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: min(1180px, 100% - 32px); } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- typography helpers ---------- */
.eyebrow {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.h-xl { font-size: clamp(38px, 5vw, 68px); font-weight: 800; }
.h-l { font-size: clamp(34px, 4.6vw, 58px); font-weight: 800; }
.h-m { font-size: clamp(26px, 3vw, 38px); font-weight: 700; }
.lead { font-size: clamp(18px, 1.5vw, 21px); color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.gradient-text {
  background: linear-gradient(92deg, var(--coral), var(--yellow) 55%, var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--accent);
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px;
  border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  background: var(--b); color: var(--accent-ink);
  border: 1px solid transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s, color .3s;
  isolation: isolate; overflow: hidden;
  will-change: transform;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px var(--b); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.ghost { background: rgba(255,255,255,.05); color: var(--text); border-color: var(--line-2); backdrop-filter: blur(10px); }
.btn.ghost:hover { background: rgba(255,255,255,.1); box-shadow: none; }
.btn.yellow { --b: var(--yellow); }
.btn.teal { --b: var(--teal); --accent-ink: #062621; }
.btn.small { padding: 10px 18px; font-size: 13px; }
.btn.big { padding: 18px 32px; font-size: 17px; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(16px) saturate(140%); border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand img, .brand svg { width: 38px; height: 38px; border-radius: 10px; }
.brand span b { color: var(--accent); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); }
.lang button { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; transition: .25s; }
.lang button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); place-items: center; margin-left: auto; }
.burger span { display: block; width: 18px; height: 2px; background: var(--text); margin: 2.5px 0; transition: .3s; border-radius: 2px; }
@media (max-width: 900px) {
  .nav-links { display: none; position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; padding: 16px 24px 28px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
  .nav.open .nav-links { display: flex; }
  .nav-links a { font-size: 18px; padding: 14px 10px; }
  .burger { display: grid; }
  .nav-cta .btn { display: none; }
  .nav .wrap { gap: 12px; }
  .nav-cta { margin-left: 0; }
}

/* ---------- sections ---------- */
section { position: relative; padding: clamp(80px, 10vw, 140px) 0; }
.section-head { display: grid; gap: 18px; max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  overflow: hidden;
  transition: transform .5s var(--ease), border-color .4s, box-shadow .5s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 40%);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 30px 60px -40px rgba(0,0,0,.8); }
.card:hover::before { opacity: 1; }
.card .icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 22px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.card .icon svg { width: 26px; height: 26px; }
.card h3 { font-size: 21px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 25%, transparent); }
.pill .dot.yellow { background: var(--yellow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow) 25%, transparent); }
.pill .dot.coral { background: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 25%, transparent); }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.reveal-scale { opacity: 0; transform: scale(.92); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal-scale.in { opacity: 1; transform: none; }
.split-word .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .14em; margin-bottom: -.14em; }
.split-word .w > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 60ms); }
.split-word.in .w > span { transform: none; }

/* ---------- marquee ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; -webkit-mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; }
.marquee-track span::after { content: "✦"; color: var(--accent); font-size: 12px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- forms ---------- */
.notify { display: grid; gap: 14px; max-width: 520px; }
.notify form { display: flex; gap: 10px; }
.notify input[type="email"] {
  flex: 1; min-width: 0; padding: 15px 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--text); font: inherit; font-size: 15px;
  transition: border-color .25s, box-shadow .25s;
}
.notify input[type="email"]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.notify input::placeholder { color: var(--dim); }
.notify .hp { position: absolute; left: -9999px; }
.notify .msg { font-size: 14px; min-height: 22px; color: var(--muted); }
.notify .msg.ok { color: var(--teal); }
.notify .msg.err { color: var(--coral); }
@media (max-width: 520px) { .notify form { flex-direction: column; } .notify .btn { justify-content: center; } }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5,7,14,.92); display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(8px); }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-height: 88vh; max-width: 92vw; border-radius: 14px; box-shadow: 0 40px 100px rgba(0,0,0,.6); transform: scale(.96); transition: transform .4s var(--ease); }
.lightbox.open img { transform: none; }
.lightbox button { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); display: grid; place-items: center; color: #fff; transition: background .2s; }
.lightbox button:hover { background: rgba(255,255,255,.18); }
.lightbox .prev { left: 20px; } .lightbox .next { right: 20px; }
.lightbox .close { top: 24px; right: 24px; transform: none; }
.lightbox .cap { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 56px 0 36px; color: var(--muted); font-size: 14px; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 800px) { footer .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { footer .cols { grid-template-columns: 1fr; } }
footer h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin-bottom: 14px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer a:hover { color: var(--text); }
footer .bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }

/* ---------- misc ---------- */
.glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; pointer-events: none; }
.noise::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--coral), var(--yellow), var(--teal)); z-index: 60; }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border-radius: 16px; border: 2px solid var(--line-2); }
.scroll-hint::before { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--text); animation: hint 1.8s infinite; }
@keyframes hint { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

.tilt { transform-style: preserve-3d; transition: transform .6s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .reveal-scale { opacity: 1; transform: none; }
  .split-word .w > span { transform: none; }
}

/* Hero reveals never wait for JavaScript: they run as CSS animations on load,
   so the first screen is complete even while site.js is still downloading. */
.hero .reveal, .hero .reveal-scale, .hero .split-word .w > span { animation: heroIn .9s var(--ease) both; animation-delay: var(--d, 0s); }
.hero .reveal.in, .hero .reveal-scale.in { animation: none; }
.hero .split-word .w > span { animation-delay: calc(var(--i) * 60ms + .1s); }
.hero .split-word.in .w > span { animation: none; }
@keyframes heroIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
html:not(.js) .reveal, html:not(.js) .reveal-scale, html:not(.js) .split-word .w > span { opacity: 1; transform: none; }

/* ---------- motion, round two ---------- */
/* glows drift slowly so the background is never static */
/* translate only — scaling a blurred layer re-rasterises the blur every frame */
.glow { animation: glow-drift 18s ease-in-out infinite alternate; will-change: transform; }
.glow:nth-of-type(2) { animation-duration: 24s; animation-delay: -6s; }
.glow:nth-of-type(3) { animation-duration: 30s; animation-delay: -12s; }
@keyframes glow-drift { 0% { transform: translate(0, 0); } 50% { transform: translate(8%, -10%); } 100% { transform: translate(-6%, 8%); } }
@media (max-width: 900px), (pointer: coarse) {
  .glow { animation: none; filter: blur(60px); }
  .nav.scrolled { backdrop-filter: blur(10px); }
  .noise::after { display: none; }
}

/* "coming soon" pill: a light sweeps across it every few seconds */
.pill.soon { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--yellow) 45%, transparent); color: var(--text); }
.pill.soon::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, color-mix(in srgb, var(--yellow) 35%, transparent) 50%, transparent 65%); transform: translateX(-120%); animation: pill-shine 4s ease-in-out infinite; }
@keyframes pill-shine { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* eyebrow line draws itself when the section reveals */
.eyebrow::before { width: 0; transition: width .8s var(--ease) .1s; }
.eyebrow.in::before, html:not(.js) .eyebrow::before { width: 22px; }

/* magnetic buttons: the pointer pulls them a few pixels */
.magnetic { transition: transform .25s var(--ease), box-shadow .35s var(--ease); }

/* icons wiggle when their card is hovered */
.card:hover .icon svg { animation: wiggle-icon .6s var(--ease); }
@keyframes wiggle-icon { 0% { transform: rotate(0); } 30% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(8deg) scale(1.05); } 100% { transform: rotate(0); } }

/* conic border that spins around a highlighted card */
.glow-border { position: relative; }
.glow-border::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: conic-gradient(from var(--a, 0deg), transparent 0 65%, var(--accent) 82%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .5s; animation: spin-a 5s linear infinite; pointer-events: none; }
.glow-border:hover::after { opacity: 1; }
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin-a { to { --a: 360deg; } }

/* orbit: three dots circling whatever sits in .orbit-core */
.orbit { position: absolute; inset: 0; pointer-events: none; }
.orbit i { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; margin: -50% 0 0 -50%; border-radius: 50%; border: 1px dashed var(--line-2); animation: orbit-spin 22s linear infinite; }
.orbit i::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 16px var(--coral); }
.orbit i:nth-child(2) { width: 118%; height: 118%; margin: -59% 0 0 -59%; animation-duration: 34s; animation-direction: reverse; border-style: dotted; }
.orbit i:nth-child(2)::before { background: var(--teal); box-shadow: 0 0 16px var(--teal); }
.orbit i:nth-child(3) { width: 84%; height: 84%; margin: -42% 0 0 -42%; animation-duration: 16s; border: 0; }
.orbit i:nth-child(3)::before { background: var(--yellow); box-shadow: 0 0 16px var(--yellow); width: 7px; height: 7px; margin-left: -3.5px; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }

/* scroll parallax targets get a little headroom so the shift never shows an edge */
[data-scroll-speed] { will-change: transform; }

@media (prefers-reduced-motion: reduce) { .glow, .pill.soon::after, .orbit i, .glow-border::after { animation: none !important; } }
