:root {
  /* Cosmic palette pulled from the emblem itself */
  --void: #07070d;
  --void-2: #0c0c18;
  --ink: #e9e6ff;
  --muted: #9a98c4;

  --c-red:    #ff4d4d;
  --c-blue:   #2f8bff;
  --c-green:  #3fd16b;
  --c-yellow: #ffd23f;
  --c-orange: #ff9a2e;
  --c-white:  #f4f2ff;

  --glow-cool: #1fb6ff;
  --glow-warm: #ff8a1e;
  --glow-cyan: #36f0ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--void);
  color: var(--ink);
  font-family: "Sora", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; }

/* ---------- Cosmic background ---------- */
.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  background:
    radial-gradient(40% 50% at 28% 32%, rgba(47, 139, 255, 0.22), transparent 70%),
    radial-gradient(45% 55% at 74% 64%, rgba(255, 138, 30, 0.20), transparent 70%),
    radial-gradient(60% 70% at 50% 50%, rgba(54, 240, 255, 0.08), transparent 75%),
    radial-gradient(120% 120% at 50% 50%, var(--void-2), var(--void) 70%);
  filter: saturate(1.05);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.04); }
  to   { transform: translate3d(1.5%, 1.5%, 0) scale(1.1); }
}

/* Subtle film grain on a fixed, non-scrolling overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: screen;
  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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Falling puzzle pieces ---------- */
.puzzle-field {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.piece {
  position: absolute;
  top: -12vh;
  width: 34px;
  height: 34px;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: fall;
  animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
  animation-iteration-count: infinite;
}

.piece svg { display: block; width: 100%; height: 100%; }

@keyframes fall {
  0%   { transform: translate3d(0, -14vh, 0) rotate(0deg);    opacity: 0; }
  8%   { opacity: 0.85; }
  90%  { opacity: 0.85; }
  100% { transform: translate3d(var(--sway, 4vw), 116vh, 0) rotate(var(--spin, 220deg)); opacity: 0; }
}

/* ---------- Layout primitives ---------- */
main { position: relative; z-index: 3; }

.section {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 7.5rem) clamp(1.25rem, 6vw, 3rem);
}

.section-title {
  margin: 0 0 3rem;
  text-align: center;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 5vmin, 2.7rem);
  letter-spacing: 0.06em;
}

.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1.25rem, 6vw, 3rem);
  background: rgba(7, 7, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: var(--ink);
}

.nav-brand img { width: 30px; height: 30px; object-fit: contain; }

.nav-links {
  display: flex;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
}

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

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.4rem;
  padding: 7rem clamp(1.25rem, 6vw, 3rem) 5rem;
  perspective: 1400px;
}

.cubeai-logo {
  width: min(34vmin, 240px);
  height: min(34vmin, 240px);
  transform-style: preserve-3d;
  animation: spinCube 12s linear infinite;
  filter:
    drop-shadow(0 0 14px rgba(31, 182, 255, 0.55))
    drop-shadow(0 0 30px rgba(255, 138, 30, 0.40))
    drop-shadow(0 0 52px rgba(54, 240, 255, 0.30));
}

.cubeai-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}

@keyframes spinCube {
  0%   { transform: rotateY(0deg)   rotateX(0deg)   scale(1);    }
  25%  { transform: rotateY(90deg)  rotateX(10deg)  scale(1.05); }
  50%  { transform: rotateY(180deg) rotateX(0deg)   scale(1);    }
  75%  { transform: rotateY(270deg) rotateX(-10deg) scale(1.05); }
  100% { transform: rotateY(360deg) rotateX(0deg)   scale(1);    }
}

.hero-title {
  margin: 0.4rem 0 0;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(2.8rem, 11vmin, 5.6rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1;
  background: linear-gradient(100deg, var(--glow-cyan), var(--c-white) 45%, var(--glow-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 26px rgba(54, 240, 255, 0.18);
}

.hero-tag {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: clamp(1rem, 3vmin, 1.4rem);
  letter-spacing: 0.02em;
  color: var(--ink);
}

.hero-copy {
  margin: 0.3rem auto 0;
  max-width: 640px;
  font-weight: 300;
  font-size: clamp(0.95rem, 2.4vmin, 1.12rem);
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2.1rem;
  border-radius: 999px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.btn-buy {
  color: var(--void);
  background: linear-gradient(100deg, var(--glow-cyan), var(--c-green));
  box-shadow: 0 8px 28px rgba(54, 240, 255, 0.25);
}

.btn-buy:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(54, 240, 255, 0.4);
}

.btn-ghost {
  color: var(--glow-cyan);
  border: 1px solid rgba(54, 240, 255, 0.5);
}

.btn-ghost:hover {
  background: rgba(54, 240, 255, 0.1);
  transform: translateY(-3px);
}

/* ---------- Cards (About) ---------- */
.card {
  position: relative;
  padding: 2rem 1.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(54, 240, 255, 0.4);
}

.card-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  margin-bottom: 1.1rem;
  background: var(--mark);
  box-shadow: 0 0 18px var(--mark);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.card p { margin: 0; color: var(--muted); font-weight: 300; }

/* ---------- Origin Story ---------- */
.story {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.story p {
  margin: 0 0 1.4rem;
  font-size: clamp(1rem, 2.5vmin, 1.15rem);
  color: #cfceea;
  font-weight: 300;
}

.pullquote {
  margin: 2rem auto;
  max-width: 620px;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: clamp(1.3rem, 4vmin, 1.9rem);
  line-height: 1.4;
  color: var(--glow-cyan);
  border: 0;
}

/* ---------- AI Cores ---------- */
.core {
  position: relative;
  padding: 1.9rem 1.7rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid var(--core);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.core:hover {
  transform: translateY(-8px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--core);
}

.core-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--core);
  box-shadow: 0 0 14px var(--core);
  margin-bottom: 0.9rem;
}

.core h3 {
  margin: 0 0 0.5rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.15rem;
  color: var(--core);
}

.core p { margin: 0; color: var(--muted); font-weight: 300; }

/* ---------- Tokenomics ---------- */
.token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2.2rem 1.4rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.token-figure {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 4.5vmin, 2.2rem);
  background: linear-gradient(100deg, var(--glow-cyan), var(--glow-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.token-label {
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

/* ---------- Roadmap ---------- */
.phase {
  padding: 1.9rem 1.7rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.phase-tag {
  display: inline-block;
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--glow-cyan);
  margin-bottom: 0.5rem;
}

.phase h3 {
  margin: 0 0 1rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.2rem;
}

.phase ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.9;
}

/* ---------- Mission & Motto ---------- */
.section-quiet { text-align: center; }

.motto {
  max-width: 780px;
  margin: 0 auto;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 500;
  font-style: italic;
  font-size: clamp(1.2rem, 3.4vmin, 1.7rem);
  line-height: 1.6;
  color: #dedcf5;
}

.motto-accent { color: var(--glow-cyan); }

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 4rem clamp(1.25rem, 6vw, 3rem) 3.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  margin: 0 0 0.4rem;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
}

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

.footer-line { margin: 0 0 1.6rem; color: var(--muted); font-weight: 300; }

.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.socials a {
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.socials a:hover {
  color: var(--glow-cyan);
  border-color: rgba(54, 240, 255, 0.5);
  transform: translateY(-2px);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .nav-links { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .piece { width: 26px; height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cubeai-logo,
  .nebula { animation: none; }
  .puzzle-field { display: none; }
}
