/* ============================================================
   PLAI — Design System
   Dark ink-violet · violet→cyan aurora · lime action
   ============================================================ */

:root {
  /* surfaces */
  --bg:        #0a0911;
  --bg-1:      #0e0d18;
  --bg-2:      #14121f;
  --panel:     rgba(255,255,255,0.035);
  --panel-2:   rgba(255,255,255,0.055);
  --line:      rgba(255,255,255,0.09);
  --line-2:    rgba(255,255,255,0.14);

  /* text */
  --fg:        #f4f2fb;
  --muted:     #a9a4c2;
  --muted-2:   #6f6a89;

  /* brand */
  --violet:    #8b6cff;
  --violet-hi: #b29bff;
  --indigo:    #6a52ff;
  --cyan:      #36d6e7;
  --lime:      #c9f24e;
  --lime-hi:   #d9ff6e;

  --grad-brand: linear-gradient(110deg, #b29bff 0%, #7c5cff 42%, #36d6e7 100%);
  --grad-soft:  linear-gradient(135deg, rgba(139,108,255,0.22), rgba(54,214,231,0.14));

  /* type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body:    "Hanken Grotesk", system-ui, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, monospace;

  /* layout */
  --maxw: 1200px;
  --radius: 10px;
  --radius-lg: 10px;
  --radius-sm: 10px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 28px;
}

/* ---------- shared type scale ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet-hi);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
}

.section-title {
  font-size: clamp(30px, 4.4vw, 52px);
}
.lead {
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 58ch;
}

.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% center; }
}

/* ---------- buttons ---------- */
.btn {
  --pad-y: 15px; --pad-x: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease),
              background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: var(--lime);
  color: #14180a;
  box-shadow: 0 0 0 0 rgba(201,242,78,0.5), 0 14px 40px -14px rgba(201,242,78,0.55);
}
.btn-primary:hover {
  background: var(--lime-hi);
  transform: translateY(-2px);
  box-shadow: 0 0 38px -4px rgba(201,242,78,0.55), 0 18px 50px -16px rgba(201,242,78,0.6);
}
/* sheen sweep */
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(130%); }

.btn-ghost {
  background: var(--panel);
  color: var(--fg);
  border-color: var(--line-2);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--panel-2);
  border-color: var(--violet);
  transform: translateY(-2px);
}
.btn-lg { --pad-y: 18px; --pad-x: 34px; font-size: 17px; }
.btn-sm { --pad-y: 11px; --pad-x: 18px; font-size: 14.5px; }

.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- chips / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), rgba(255,255,255,0.012));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: border-color .4s var(--ease), transform .4s var(--ease), background .4s var(--ease);
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-4px);
}

/* ---------- animated background (no blobs) ---------- */
.fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 15% -10%, rgba(106,82,255,0.18), transparent 55%),
    radial-gradient(120% 80% at 85% 0%, rgba(54,214,231,0.12), transparent 50%),
    radial-gradient(140% 100% at 50% 120%, rgba(178,91,255,0.14), transparent 60%);
}
/* slow drifting colour sheen */
.fx::before {
  content: "";
  position: absolute; inset: -30%;
  background:
    conic-gradient(from 0deg at 50% 50%,
      rgba(124,92,255,0.10), rgba(54,214,231,0.06), rgba(201,242,78,0.05),
      rgba(178,91,255,0.10), rgba(124,92,255,0.10));
  filter: blur(70px);
  animation: spinSheen 40s linear infinite;
  will-change: transform;
}
@keyframes spinSheen { to { transform: rotate(360deg); } }

/* particle canvas */
.fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* grain + grid overlays */
.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 78%);
  animation: gridPulse 9s ease-in-out infinite;
}
@keyframes gridPulse { 0%,100%{opacity:.7} 50%{opacity:1} }
@media (prefers-reduced-motion: reduce) {
  .fx::before, .grid-overlay { animation: none; }
}

main, header, footer { position: relative; z-index: 1; }

/* ---------- scroll reveal ----------
   Content is VISIBLE by default. The hidden-then-animate state is only
   applied under html.motion, which JS adds only when the document is
   actually visible (animations can run). This guarantees content never
   stays hidden in throttled / hidden-visibility / no-JS contexts. */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
html.motion .reveal { opacity: 0; transform: translateY(28px); }
html.motion .reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- section rhythm ---------- */
section { padding-block: clamp(72px, 9vw, 130px); }
.section-head { max-width: 720px; margin-bottom: 54px; }
.section-head .section-title { margin-top: 16px; }
.section-head .lead { margin-top: 18px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10,9,17,0.72);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 74px;
}
.nav-links {
  display: flex; align-items: center; gap: 6px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a {
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 15px;
  color: var(--muted);
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--fg); background: var(--panel); }
.nav-cta { display: flex; align-items: center; gap: 12px; }

/* logo */
.logo { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; }
.logo .mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
}
.logo .mark svg { overflow: visible; }
/* animated mark: gentle breathing glow + hover tilt */
.logo .mark svg > rect {
  transform-box: fill-box; transform-origin: center;
  animation: markBreath 4s ease-in-out infinite;
}
@keyframes markBreath {
  0%,100% { filter: drop-shadow(0 0 0 rgba(124,92,255,0)); }
  50% { filter: drop-shadow(0 0 7px rgba(124,92,255,0.55)); }
}
/* rotating ring */
.logo .logo-ring {
  transform-box: fill-box; transform-origin: center;
  animation: ringSpin 6s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
/* pulsing play triangle */
.logo .mark svg > path {
  transform-box: fill-box; transform-origin: center;
  animation: playPulse 2.4s var(--ease) infinite;
}
@keyframes playPulse {
  0%,100% { transform: scale(1); opacity: .92; }
  50% { transform: scale(1.14); opacity: 1; }
}
.logo:hover .mark { animation: markPop .6s var(--ease); }
@keyframes markPop { 0%{transform:rotate(0)} 40%{transform:rotate(-10deg) scale(1.08)} 100%{transform:rotate(0)} }
.logo .word { position: relative; }
.logo .dot {
  color: var(--lime); display: inline-block;
  animation: dotBlink 1.6s steps(1) infinite;
}
@keyframes dotBlink { 0%,100%{opacity:1} 50%{opacity:.35} }
@media (prefers-reduced-motion: reduce) {
  .logo .mark svg > rect, .logo .logo-ring, .logo .mark svg > path, .logo .dot { animation: none; }
}
.logo .word {
  font-family: var(--font-display);
  font-weight: 600; font-size: 23px; letter-spacing: -0.03em;
}
.logo .word b { font-weight: 600; }

/* mobile nav */
.hamburger { display: none; }
.mobile-menu { display: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 64px 40px;
  background: linear-gradient(180deg, transparent, rgba(124,92,255,0.04));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted-2); font-weight: 400; margin-bottom: 18px;
}
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { color: var(--muted); font-size: 15px; transition: color .25s; width: fit-content; }
.footer-links a:hover { color: var(--lime); }
.footer-bottom {
  margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  flex-wrap: wrap;
  color: var(--muted-2); font-size: 14px;
}
.footer-contact { color: var(--muted); font-size: 15px; line-height: 1.9; }
.footer-contact a:hover { color: var(--lime); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1040px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 20px; }
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 10px;
    background: var(--panel); border: 1px solid var(--line-2);
    cursor: pointer;
  }
  .hamburger span { display: block; width: 18px; height: 2px; background: var(--fg); position: relative; transition: .3s; }
  .hamburger span::before, .hamburger span::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--fg); transition: .3s;
  }
  .hamburger span::before { top: -6px; }
  .hamburger span::after { top: 6px; }
  .hamburger.open span { background: transparent; }
  .hamburger.open span::before { top: 0; transform: rotate(45deg); }
  .hamburger.open span::after { top: 0; transform: rotate(-45deg); }

  .nav-cta .btn-sm { --pad-y: 9px; --pad-x: 15px; font-size: 14px; }

  .mobile-menu {
    display: block;
    position: fixed; inset: 74px 0 auto 0; z-index: 55;
    background: rgba(10,9,17,0.96);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    padding: 14px 20px 26px;
    transform: translateY(-120%);
    transition: transform .5s var(--ease);
  }
  .mobile-menu.open { transform: translateY(0); }
  .mobile-menu a {
    display: block; padding: 15px 6px; font-size: 18px;
    font-family: var(--font-display); border-bottom: 1px solid var(--line);
    color: var(--fg);
  }
  .mobile-menu a:last-of-type { border-bottom: none; }
  .mobile-menu .btn { width: 100%; margin-top: 18px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  section { padding-block: clamp(58px, 12vw, 90px); }
  .section-head { margin-bottom: 40px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
