/* CoM Studios — shared styles */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --bg: #070914;
  --bg-2: #0d1124;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .10);
  --text: #e9edff;
  --muted: #98a2c8;
  --cyan: #38e8ff;
  --violet: #8b6bff;
  --pink: #ff5fc8;
  --gold: #ffd24a;
  --grad: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--pink));
  --radius: 20px;
  --header-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.6; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(139, 107, 255, .45); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--cyan); color: #04121a; padding: 8px 14px; border-radius: 10px; font-weight: 700; transition: top .2s; }
.skip:focus { top: 12px; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  transition: background .35s, box-shadow .35s, height .35s var(--ease), backdrop-filter .35s;
}
.site-header.scrolled {
  background: rgba(7, 9, 20, .72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line), 0 12px 40px -20px rgba(0, 0, 0, .8);
  height: 58px;
}
.progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: .01em; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 500; color: var(--muted); }
.logo { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(139, 107, 255, .55)); transition: transform .6s var(--ease); }
.brand:hover .logo { transform: rotate(60deg) scale(1.08); }
.logo-dot { animation: pulse-dot 2.4s ease-in-out infinite; transform-origin: 20px 19.5px; }
@keyframes pulse-dot { 50% { transform: scale(1.35); opacity: .75; } }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; color: var(--muted); font-weight: 600; font-size: .95rem; padding: 8px 14px; border-radius: 999px;
  transition: color .25s, background .25s;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.nav a::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 0; height: 2px; border-radius: 2px;
  background: var(--grad); transform: translateX(-50%); transition: width .3s var(--ease);
}
.nav a.active { color: var(--text); }
.nav a.active::after { width: 22px; }
.nav .nav-cta { margin-left: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.nav .nav-cta:hover { border-color: rgba(56, 232, 255, .5); box-shadow: 0 0 24px -6px rgba(56, 232, 255, .6); }
.nav .nav-cta::after { display: none; }

.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; cursor: pointer; position: relative; color: var(--text); }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 26px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 820px) {
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0 0 auto 0; top: 0; padding: calc(var(--header-h) + 14px) 20px 24px; flex-direction: column; align-items: stretch;
    background: rgba(7, 9, 20, .96); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
    transform: translateY(-105%); transition: transform .45s var(--ease); z-index: -1; gap: 2px;
  }
  .nav.open { transform: none; }
  .nav a { font-size: 1.1rem; padding: 14px 16px; border-radius: 14px; }
  .nav a::after { display: none; }
  .nav a.active { background: var(--surface-2); }
  .nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent; font: 700 1rem/1 var(--font);
  cursor: pointer; color: #04121a; background: var(--grad); overflow: hidden; isolation: isolate;
  box-shadow: 0 10px 30px -10px rgba(139, 107, 255, .8);
  transition: transform .25s var(--ease), box-shadow .3s;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; width: 40%; transform: translateX(-130%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}
.btn:hover { text-decoration: none; box-shadow: 0 16px 40px -10px rgba(56, 232, 255, .7); }
.btn:hover::before { transition: transform .8s var(--ease); transform: translateX(330%) skewX(-20deg); }
.btn:active { transform: scale(.97) !important; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: rgba(255, 255, 255, .3); background: var(--surface-2); box-shadow: none; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: calc(var(--header-h) + 40px) 0 90px; overflow: hidden; isolation: isolate; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::before {
  content: ""; position: absolute; inset: -20%; z-index: -3;
  background:
    radial-gradient(40% 40% at 20% 30%, rgba(139, 107, 255, .35), transparent 70%),
    radial-gradient(35% 35% at 80% 25%, rgba(56, 232, 255, .22), transparent 70%),
    radial-gradient(40% 40% at 65% 85%, rgba(255, 95, 200, .22), transparent 70%);
  animation: aurora 18s ease-in-out infinite alternate;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 220px; z-index: -1; background: linear-gradient(to bottom, transparent, var(--bg)); }
@keyframes aurora { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.1); } }

.hero-inner { position: relative; text-align: center; max-width: 880px; padding-inline: 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(56, 232, 255, .7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(56, 232, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(56, 232, 255, 0); } }
.hero h1 { font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: 1.02; margin: 22px 0 22px; font-weight: 900; letter-spacing: -.035em; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .22em; margin-bottom: -.22em; }
.hero h1 .w > span { display: inline-block; transform: translateY(110%) rotate(6deg); animation: word-up .9s var(--ease) forwards; animation-delay: calc(.15s + var(--i) * .08s); }
@keyframes word-up { to { transform: none; } }
.grad-text { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--muted); max-width: 620px; margin: 0 auto 34px; opacity: 0; animation: fade-up .9s .75s var(--ease) forwards; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; opacity: 0; animation: fade-up .9s .95s var(--ease) forwards; }
.hero .eyebrow { opacity: 0; animation: fade-up .8s .05s var(--ease) forwards; }
@keyframes fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.floaters { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.fl { position: absolute; width: var(--s); height: var(--s); left: var(--x); top: var(--y); will-change: transform; }
.fl > div {
  width: 100%; height: 100%; background: linear-gradient(145deg, hsla(var(--h), 95%, 75%, .95), hsla(var(--h), 90%, 45%, .55));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 18px hsla(var(--h), 95%, 60%, .8));
  animation: bob var(--d) ease-in-out infinite, spin3d calc(var(--d) * 1.7) linear infinite;
}
@keyframes bob { 50% { translate: 0 -26px; } }
@keyframes spin3d { to { transform: rotateY(360deg); } }
@media (max-width: 720px) { .fl:nth-child(n+4) { display: none; } .fl { opacity: .6; } }

.scroll-cue { position: absolute; bottom: 30px; left: 50%; translate: -50% 0; width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 14px; opacity: .9; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: var(--cyan); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: none; } 80% { opacity: 0; transform: translateY(14px); } 100% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--bg-2); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 28px; padding: 18px 14px 18px 0; font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; color: rgba(233, 237, 255, .55); white-space: nowrap; }
.marquee span::after { content: ""; width: 10px; height: 10px; background: var(--grad); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); margin-right: 14px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 10vw, 130px) 0; position: relative; }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.sec-head h2 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 16px 0 14px; letter-spacing: -.025em; font-weight: 900; }
.sec-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--d, 0) * 1ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Game ---------- */
.play::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 50% at 50% 40%, rgba(139, 107, 255, .16), transparent 70%); }
.game-shell {
  position: relative; width: 100%; max-width: clamp(520px, calc((100vh - 120px) * 1.7778), 960px); max-width: clamp(520px, calc((100svh - 120px) * 1.7778), 960px); margin-inline: auto; padding: 2px; border-radius: 26px; scroll-margin-top: 70px;
  background: conic-gradient(from var(--ang), var(--cyan), var(--violet), var(--pink), var(--gold), var(--cyan));
  animation: spin-ang 7s linear infinite; box-shadow: 0 30px 100px -30px rgba(139, 107, 255, .65), 0 0 80px -30px rgba(56, 232, 255, .5);
}
@keyframes spin-ang { to { --ang: 360deg; } }
.game-frame { position: relative; border-radius: 24px; overflow: hidden; background: #05060f; }
#game-canvas { width: 100%; aspect-ratio: 16 / 9; height: auto; touch-action: none; cursor: pointer; outline-offset: -4px; user-select: none; -webkit-user-select: none; }
#game-canvas.hide-cursor { cursor: none; }
.game-tools { position: absolute; top: 12px; left: 50%; translate: -50% 0; display: flex; gap: 8px; z-index: 2; }
.tool {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: var(--text);
  background: rgba(7, 9, 20, .55); border: 1px solid var(--line); backdrop-filter: blur(8px); transition: transform .2s var(--ease), background .2s, opacity .2s;
}
.tool:hover:not(:disabled) { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }
.tool:disabled { opacity: .35; cursor: default; }
.tool svg { width: 18px; height: 18px; fill: currentColor; }
.tool .alt { display: none; }
.tool[aria-pressed="true"] .main { display: none; }
.tool[aria-pressed="true"] .alt { display: block; }
.hints { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin: 26px 0 0; padding: 0; color: var(--muted); font-size: .95rem; }
.hints li { display: inline-flex; align-items: center; gap: 8px; }
kbd { font: 700 .8rem var(--font); padding: 3px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 3px; color: var(--text); }
.legend { display: inline-block; width: 12px; height: 12px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.legend.red { background: #ff4a64; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card {
  --mx: 50%; --my: 50%; position: relative; padding: 34px 30px 32px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid var(--line);
  overflow: hidden; transform-style: preserve-3d; transition: border-color .3s, box-shadow .4s;
}
.card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(360px circle at var(--mx) var(--my), rgba(139, 107, 255, .28), transparent 60%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.card:hover { border-color: rgba(139, 107, 255, .5); box-shadow: 0 24px 60px -30px rgba(139, 107, 255, .8); }
.card:hover::before { opacity: 1; }
.card .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 20px; background: var(--grad); box-shadow: 0 10px 26px -8px rgba(139, 107, 255, .8); transition: transform .5s var(--ease); }
.card:hover .ico { transform: translateZ(30px) rotate(-8deg) scale(1.08); }
.card .ico svg { width: 26px; height: 26px; stroke: #04121a; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 0 0 8px; font-size: 1.3rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); }

.statement { margin: 70px auto 0; max-width: 780px; text-align: center; font-size: clamp(1.4rem, 3.4vw, 2.1rem); font-weight: 800; line-height: 1.3; letter-spacing: -.02em; color: rgba(233, 237, 255, .9); }

/* ---------- Contact ---------- */
.contact-card {
  position: relative; text-align: center; padding: clamp(40px, 7vw, 80px) 24px; border-radius: 30px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(70% 90% at 50% 0%, rgba(139, 107, 255, .3), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
}
.contact-card::after { content: ""; position: absolute; width: 520px; height: 520px; left: 50%; top: -260px; translate: -50% 0; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .12); animation: rot 40s linear infinite; }
@keyframes rot { to { rotate: 360deg; } }
.contact-card h2 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 12px; letter-spacing: -.03em; font-weight: 900; position: relative; }
.contact-card p { color: var(--muted); max-width: 520px; margin: 0 auto 30px; position: relative; font-size: 1.1rem; }
.contact-card .btn { position: relative; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg), #05060f); padding: 60px 0 28px; position: relative; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: 1 / -1; } }
.foot-grid p { color: var(--muted); max-width: 340px; margin: 14px 0 0; }
.foot-grid h4 { margin: 0 0 14px; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid ul a { color: var(--text); opacity: .85; transition: opacity .2s, padding-left .25s var(--ease), color .2s; }
.foot-grid ul a:hover { opacity: 1; color: var(--cyan); padding-left: 6px; text-decoration: none; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.to-top { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 999px; cursor: pointer; font: 600 .9rem var(--font); transition: transform .25s var(--ease), border-color .25s; }
.to-top:hover { transform: translateY(-3px); border-color: rgba(56, 232, 255, .5); }
.to-top svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Policy page ---------- */
.policy-hero { padding: calc(var(--header-h) + 60px) 0 30px; position: relative; text-align: center; overflow: hidden; }
.policy-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 80% at 50% 0%, rgba(139, 107, 255, .3), transparent 70%); }
.policy-hero h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); margin: 18px 0 10px; letter-spacing: -.03em; font-weight: 900; line-height: 1.08; }
.policy-hero .meta { color: var(--muted); margin: 0; }
.policy { max-width: 820px; margin: 30px auto 90px; padding: clamp(24px, 5vw, 52px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); color: #c7cff0; }
.policy h2 { color: var(--text); font-size: 1.55rem; margin: 2.4rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--line); letter-spacing: -.01em; }
.policy h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.6rem; }
.policy h3 { color: var(--text); font-size: 1.12rem; margin: 1.6rem 0 .6rem; }
.policy p { margin: 0 0 1rem; }
.policy ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.policy li { margin-bottom: .45rem; }
.policy strong { color: var(--text); }
.policy .emoji { margin-right: 5px; }
.policy a { border-bottom: 1px solid rgba(56, 232, 255, .35); }
.policy a:hover { text-decoration: none; border-color: var(--cyan); }
.policy hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero h1 .w > span, .lead, .cta-row, .hero .eyebrow { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}
