/* Sefy Studio design system — one stylesheet for the studio home, both game pages and their support/privacy pages.
   Layout concept: a night-sky studio. Deep ink background with a slow aurora, frosted glass panels, one warm
   accent per game (set with data-game on <body>), big friendly display type over a calm, readable body face. */
:root {
  --ink: #110a2b;          /* page background */
  --ink-2: #1a1140;        /* raised surface */
  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .13);
  --text: #f5f0ff;
  --muted: #b8acd8;
  --dim: #8a7fb0;
  --pink: #ff5fb8;
  --gold: #ffc94a;
  --violet: #8b5cf6;
  --teal: #2dd4bf;
  --accent: var(--pink);   /* per game, see [data-game] */
  --accent-2: var(--gold);
  --display: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 26px;
  --wrap: 1120px;
  color-scheme: dark;
}
body[data-game="loom"] { --accent: #ff5fb8; --accent-2: #ffc94a; }
body[data-game="pip"]  { --accent: #2dd4bf; --accent-2: #a78bfa; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 400 17px/1.6 var(--body); overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.04; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }

/* Ambient background: aurora blobs + faint grain, fixed behind everything. */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--ink); }
.sky::before, .sky::after, .sky i {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: drift 22s ease-in-out infinite alternate;
}
.sky::before { width: 60vw; height: 60vw; left: -15vw; top: -20vw; background: radial-gradient(circle, var(--violet), transparent 65%); }
.sky::after  { width: 55vw; height: 55vw; right: -18vw; top: 10vh; background: radial-gradient(circle, var(--accent), transparent 65%); animation-delay: -8s; opacity: .38; }
.sky i { width: 45vw; height: 45vw; left: 25vw; bottom: -25vw; background: radial-gradient(circle, var(--accent-2), transparent 65%); opacity: .22; animation-delay: -14s; }
.sky b {
  position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.5px);
  background-size: 120px 120px; mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
@keyframes drift { to { transform: translate(6vw, 4vh) scale(1.12); } }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.nav .bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 14px; padding: 10px 12px 10px 18px; border-radius: 999px;
  background: rgba(17, 10, 43, .62); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.nav .logo img { height: 34px; width: auto; }
.nav nav { display: flex; align-items: center; gap: 6px; }
.nav nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav nav a:hover, .nav nav a[aria-current] { color: var(--text); background: var(--glass-2); }
@media (max-width: 720px) { .nav nav a.opt { display: none; } .nav .logo img { height: 28px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; cursor: pointer;
  font: 700 16px/1 var(--body); padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { color: #1a0f2e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px -8px var(--accent); }
.btn.ghost { color: var(--text); background: var(--glass); border-color: var(--line); }
.btn.small { padding: 10px 16px; font-size: 14px; }
.btn.store { color: #fff; background: #000; border-color: rgba(255,255,255,.22); padding: 10px 20px 10px 16px; border-radius: 14px; }
.btn.store svg { width: 26px; height: 26px; }
.btn.store span { display: flex; flex-direction: column; text-align: left; font: 700 19px/1.05 system-ui, -apple-system, sans-serif; }
.btn.store small { font-size: 11px; font-weight: 500; opacity: .85; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* Labels */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.chip { display: inline-block; font: 600 13px/1 var(--body); color: var(--muted); padding: 7px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); }

/* Sections */
section { padding-block: 72px; }
.section-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(32px, 4.6vw, 52px); }
.section-head p { color: var(--muted); font-size: 18px; }

/* Glass panel */
.glass {
  position: relative; border-radius: var(--radius); background: var(--glass);
  border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* Home hero */
.hero { padding-block: 64px 40px; }
.hero .grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(44px, 7vw, 86px); font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--muted); font-size: clamp(18px, 2vw, 21px); max-width: 560px; margin-top: 18px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.stage { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: center; width: 100%; }
.stage .halo { position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(255,95,184,.35), transparent 65%); }
.stage .ring { position: absolute; inset: 4%; border-radius: 50%; border: 1px dashed rgba(255,255,255,.18); animation: spin 60s linear infinite; }
.stage img { position: absolute; filter: drop-shadow(0 20px 30px rgba(0,0,0,.45)); }
.stage .mascot { width: 52%; left: 24%; top: 18%; animation: bob 5s ease-in-out infinite; }
.stage .app { width: 30%; border-radius: 22%; }
.stage .app.a { left: 2%; bottom: 10%; transform: rotate(-10deg); animation: bob 6s ease-in-out infinite -2s; }
.stage .app.b { right: 2%; bottom: 4%; transform: rotate(9deg); animation: bob 6.5s ease-in-out infinite -4s; }
@keyframes bob { 50% { translate: 0 -12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.facts .chip strong { color: var(--text); }

/* Game cards (home) */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.game-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.game-card:hover { transform: translateY(-6px); border-color: rgba(255,255,255,.28); box-shadow: 0 30px 60px -30px var(--glow, var(--accent)); }
.game-card .art { aspect-ratio: 16 / 8; overflow: hidden; }
.game-card .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.game-card:hover .art img { transform: scale(1.05); }
.game-card .body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 22px; align-items: start; }
.game-card .icon { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 8px 18px rgba(0,0,0,.35); margin-top: -50px; border: 3px solid var(--ink-2); }
.game-card h3 { font-size: 30px; }
.game-card p { color: var(--muted); margin-top: 6px; }
.game-card .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.game-card .cta { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 22px 22px; margin-top: auto; }
.game-card.loom { --glow: #ff5fb8; }
.game-card.pip { --glow: #2dd4bf; }

/* Values */
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.value { padding: 26px; display: grid; gap: 10px; align-content: start; }
.value .glyph { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0f2e; font: 800 22px/1 var(--display); }
.value h3 { font-size: 24px; }
.value p { color: var(--muted); }

/* Contact band */
.contact { padding: 34px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(135deg, rgba(139,92,246,.28), rgba(255,95,184,.18)); }
.contact h2 { font-size: clamp(28px, 3.6vw, 40px); }
.contact p { color: var(--muted); margin-top: 6px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.copy-row code { font: 600 17px/1 var(--body); padding: 14px 18px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid var(--line); user-select: all; }

/* Game page hero */
.ghero { padding-block: 34px 20px; }
.ghero .panel { overflow: hidden; }
.ghero .art { aspect-ratio: 16 / 7; max-height: 520px; width: 100%; overflow: hidden; }
.ghero .art img { width: 100%; height: 100%; object-fit: cover; }
.ghero .info { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 26px 30px 30px; }
.ghero .icon { width: 112px; height: 112px; border-radius: 26px; margin-top: -78px; border: 4px solid var(--ink-2); box-shadow: 0 14px 30px rgba(0,0,0,.45); }
.ghero h1 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 800; }
.ghero h1 span { color: var(--accent-2); display: block; }
.ghero .tagline { color: var(--muted); font-size: 18px; margin-top: 8px; max-width: 640px; }
.ghero .actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.ghero .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Features with phone shots */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feature { padding: 18px 18px 24px; display: grid; gap: 14px; align-content: start; }
.feature .shot { border-radius: 20px; overflow: hidden; aspect-ratio: 9 / 12; background: var(--ink-2); }
.feature .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.feature h3 { font-size: 24px; }
.feature p { color: var(--muted); }

/* Video + facts */
.watch { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; align-items: center; }
.phone { border-radius: 42px; padding: 10px; background: linear-gradient(160deg, #2b2056, #120b2b); border: 1px solid var(--line); box-shadow: 0 40px 80px -30px var(--accent); }
.phone video { border-radius: 33px; width: 100%; aspect-ratio: 886 / 1920; object-fit: cover; background: #000; }
.facts-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
.fact { padding: 16px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.fact small { display: block; font: 700 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.fact strong { font: 700 18px/1.3 var(--body); }

/* Screenshot rail */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 14px; }
.rail img { border-radius: 22px; scroll-snap-align: start; border: 1px solid var(--line); }
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-thumb { background: var(--glass-2); border-radius: 8px; }

/* Help cards */
.help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.help a { padding: 22px; text-decoration: none; color: var(--text); display: grid; gap: 6px; transition: transform .2s ease, border-color .2s ease; }
.help a:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.3); }
.help a span { color: var(--muted); }
.help a b { font: 800 22px/1.1 var(--display); }

/* Documents (support, privacy) */
.doc { padding: 34px clamp(20px, 4vw, 48px); max-width: 820px; margin: 30px auto 0; }
.doc h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 10px; }
.doc h2 { font-size: 26px; margin: 30px 0 8px; }
.doc p, .doc li { color: var(--muted); }
.doc p + p { margin-top: 12px; }
.doc ul { padding-left: 20px; }
.doc a { color: var(--accent); }

/* Footer */
footer { padding-block: 56px 40px; margin-top: 40px; border-top: 1px solid var(--line); }
footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 26px; }
footer .brand img { height: 40px; width: auto; }
footer .brand p { color: var(--dim); margin-top: 12px; font-size: 15px; max-width: 280px; }
footer h4 { font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 6px 0 14px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
footer ul a { color: var(--muted); text-decoration: none; font-size: 15px; }
footer ul a:hover { color: var(--text); }
footer .legal { margin-top: 36px; color: var(--dim); font-size: 13px; }

/* Reveal on scroll (visible by default; JS adds the motion only) */
.reveal.pending { opacity: 0; transform: translateY(18px); }
.reveal { transition: opacity .7s ease, transform .7s ease; }

@media (max-width: 900px) {
  .hero .grid, .watch { grid-template-columns: 1fr; }
  .stage { max-width: 340px; order: -1; }
  .games, .features, .values, .help { grid-template-columns: 1fr; }
  .ghero .art { aspect-ratio: 16 / 9; }
  .ghero .info { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .ghero .actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .ghero .meta { justify-content: center; }
  .watch .phone { max-width: 300px; margin: 0 auto; }
  footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  section { padding-block: 52px; }
  .facts-table { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr; }
  .contact { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.pending { opacity: 1; transform: none; }
}

/* Join page */
.room-code { font: 800 clamp(56px, 14vw, 88px)/1 var(--display); letter-spacing: .14em; margin: 18px 0 22px; color: var(--accent);
  text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }

/* Icons overlap the art above them: keep them on top while the art zooms on hover. */
.game-card .body, .ghero .info { position: relative; z-index: 1; }
