/* ============================================================================
   Grade Sync Pro — Home v4 "Out of this world"
   Sci-fi / cyber landing system. Pure external CSS (CSP-safe, no inline styles).
   All motion respects prefers-reduced-motion.
   ========================================================================== */

:root {
  --bg: #04050c;
  --bg-2: #070a18;
  --ink: #e8ecff;
  --ink-soft: #9aa3c7;
  --ink-dim: #6b7299;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #ec4899;
  --emerald: #34d399;
  --amber: #fbbf24;
  --line: rgba(140, 160, 255, 0.14);
  --glass: rgba(16, 20, 40, 0.55);
  --glass-2: rgba(22, 28, 56, 0.65);
  --glow-cyan: rgba(34, 211, 238, 0.55);
  --glow-violet: rgba(139, 92, 246, 0.55);
  --radius: 20px;
  --maxw: 1200px;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.home-v4 {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Ambient layered background ------------------------------------------------ */
.v4-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
/* the live constellation canvas */
#v4-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}
/* drifting aurora blobs */
.v4-bg__aurora {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  mix-blend-mode: screen;
  animation: v4-drift 26s ease-in-out infinite alternate;
}
.v4-bg__aurora--a { top: -18vw; left: -10vw; background: radial-gradient(circle, var(--violet), transparent 60%); }
.v4-bg__aurora--b { top: 10vw; right: -16vw; background: radial-gradient(circle, var(--cyan), transparent 60%); animation-delay: -8s; }
.v4-bg__aurora--c { bottom: -22vw; left: 20vw; background: radial-gradient(circle, var(--magenta), transparent 60%); animation-delay: -14s; }
/* perspective grid floor (synthwave horizon) */
.v4-bg__grid {
  position: absolute;
  left: 50%;
  bottom: -10%;
  width: 200%;
  height: 60%;
  transform: translateX(-50%) perspective(420px) rotateX(62deg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 78%);
  animation: v4-grid 8s linear infinite;
  opacity: 0.5;
}
.v4-bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: radial-gradient(rgba(255,255,255,0.6) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

@keyframes v4-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, 4vw) scale(1.15); }
}
@keyframes v4-grid {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 46px, 46px 0; }
}

/* Layout helpers ----------------------------------------------------------- */
.v4-shell { position: relative; z-index: 2; }
.v4-container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.v4-section { position: relative; padding: 110px 0; }
.v4-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cyan);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(34, 211, 238, 0.06);
}
.v4-eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--glow-cyan); animation: v4-pulse 2s infinite; }
@keyframes v4-pulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:.4; transform:scale(.7);} }

.v4-heading { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.v4-heading h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(28px, 4vw, 46px); line-height: 1.08; margin: 18px 0 14px;
  background: linear-gradient(180deg, #fff, #aeb8f0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.v4-heading p { color: var(--ink-soft); font-size: 17px; margin: 0; }

/* Navigation --------------------------------------------------------------- */
.v4-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.v4-nav.is-scrolled {
  background: rgba(5, 7, 16, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.v4-nav__inner { display: flex; align-items: center; gap: 18px; height: 70px; }
.v4-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.v4-brand img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 0 10px var(--glow-cyan)); }
.v4-brand span { background: linear-gradient(90deg, #fff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.v4-nav__links { display: flex; gap: 6px; margin-left: 20px; list-style: none; padding: 0; }
.v4-nav__links a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; padding: 8px 14px; border-radius: 10px; transition: color .2s, background .2s; }
.v4-nav__links a:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.v4-nav__spacer { margin-left: auto; }
.v4-nav__toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; width: 42px; height: 38px; cursor: pointer; font-size: 20px; }

/* Buttons ------------------------------------------------------------------ */
.v4-btn {
  --b1: var(--cyan); --b2: var(--violet);
  position: relative; display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  padding: 13px 22px; border-radius: 13px; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .3s ease;
  will-change: transform;
}
.v4-btn .material-icons-round { font-size: 19px; }
.v4-btn--primary {
  color: #04050c;
  background: linear-gradient(120deg, var(--b1), var(--b2));
  box-shadow: 0 8px 30px rgba(34,211,238,0.28), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.v4-btn--primary:hover { box-shadow: 0 12px 44px rgba(139,92,246,0.5), 0 0 0 1px rgba(255,255,255,0.25); }
.v4-btn--ghost {
  color: var(--ink); background: var(--glass);
  border-color: var(--line); backdrop-filter: blur(8px);
}
.v4-btn--ghost:hover { border-color: rgba(34,211,238,0.5); color: #fff; }
.v4-btn--sm { padding: 9px 16px; font-size: 13.5px; border-radius: 11px; }
.v4-login { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 9px 18px; border-radius: 11px; border: 1px solid var(--line); transition: border-color .2s, color .2s; }
.v4-login:hover { border-color: var(--cyan); color: #fff; }

/* Hero --------------------------------------------------------------------- */
.v4-hero { position: relative; padding: 150px 0 90px; }
.v4-hero__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.v4-hero__title {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(38px, 5.6vw, 70px); line-height: 1.02; margin: 22px 0 20px;
}
.v4-hero__title .grad {
  background: linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: v4-sheen 6s linear infinite;
}
@keyframes v4-sheen { to { background-position: 200% center; } }
.v4-hero__lead { color: var(--ink-soft); font-size: 18.5px; max-width: 560px; margin: 0 0 16px; }
.v4-hero__terminal {
  font-family: var(--font-mono); font-size: 14px; color: var(--cyan);
  background: rgba(5,8,18,0.6); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin: 0 0 28px; max-width: 560px; min-height: 46px;
}
.v4-hero__terminal .prompt { color: var(--ink-dim); }
.v4-cursor { display: inline-block; width: 9px; background: var(--cyan); margin-left: 2px; animation: v4-blink 1s steps(2) infinite; }
@keyframes v4-blink { 50% { opacity: 0; } }
.v4-hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }

/* Hero metrics */
.v4-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0; padding: 0; }
.v4-metric { padding: 16px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.v4-metric__value { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin: 0; color: #fff; }
.v4-metric__label { font-size: 12.5px; color: var(--ink-dim); margin: 4px 0 0; letter-spacing: .02em; }

/* Holographic scanning card (hero visual) */
.v4-holo { position: relative; perspective: 1200px; }
.v4-holo__card {
  position: relative; border-radius: 22px; padding: 22px;
  background: linear-gradient(160deg, var(--glass-2), rgba(8,11,24,0.85));
  border: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
  transform-style: preserve-3d; transition: transform .2s ease;
  overflow: hidden;
}
.v4-holo__sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(34,211,238,0.14) 48%, rgba(139,92,246,0.14) 52%, transparent 70%);
  background-size: 250% 250%; animation: v4-holosheen 7s linear infinite;
}
@keyframes v4-holosheen { 0%{background-position:0% 0%;} 100%{background-position:200% 200%;} }
.v4-holo__scan {
  position: absolute; left: 0; right: 0; height: 80px; top: -80px;
  background: linear-gradient(180deg, transparent, rgba(34,211,238,0.28), transparent);
  filter: blur(2px); animation: v4-scan 3.4s ease-in-out infinite;
}
@keyframes v4-scan { 0%{top:-80px;} 100%{top:110%;} }
.v4-holo__head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.v4-holo__dot { width: 11px; height: 11px; border-radius: 50%; }
.v4-holo__dot:nth-child(1){background:#ff5f57;} .v4-holo__dot:nth-child(2){background:#febc2e;} .v4-holo__dot:nth-child(3){background:#28c840;}
.v4-holo__title { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--emerald); }
.v4-holo__title::before { content:''; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--emerald); margin-right:7px; box-shadow:0 0 10px var(--emerald); animation:v4-pulse 1.6s infinite; }

.v4-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 13px; background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.05); margin-bottom: 10px; }
.v4-row__ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(34,211,238,0.12); color: var(--cyan); }
.v4-row__ic .material-icons-round { font-size: 20px; }
.v4-row__b { flex: 1; min-width: 0; }
.v4-row__t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.v4-row__m { font-size: 12px; color: var(--ink-dim); }
.v4-tag { font-family: var(--font-mono); font-size: 11px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.v4-tag--ok { color: var(--emerald); background: rgba(52,211,153,0.12); }
.v4-tag--warn { color: var(--amber); background: rgba(251,191,36,0.12); }
.v4-tag--info { color: var(--cyan); background: rgba(34,211,238,0.12); }

/* Marquee strip ------------------------------------------------------------ */
.v4-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; overflow: hidden; background: rgba(5,7,16,0.4); }
.v4-strip__track { display: flex; gap: 14px; width: max-content; animation: v4-marquee 32s linear infinite; }
.v4-strip:hover .v4-strip__track { animation-play-state: paused; }
.v4-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); white-space: nowrap; }
.v4-chip .material-icons-round { font-size: 17px; color: var(--cyan); }
@keyframes v4-marquee { to { transform: translateX(-50%); } }

/* Bento features ----------------------------------------------------------- */
.v4-bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.v4-card {
  position: relative; grid-column: span 3; padding: 26px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  transform-style: preserve-3d;
}
.v4-card[data-span="2"] { grid-column: span 2; }
.v4-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(130deg, transparent, var(--tone, var(--cyan)), transparent);
  -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 .3s ease;
}
.v4-card:hover { border-color: transparent; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.v4-card:hover::before { opacity: 1; }
.v4-card__glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--tone, var(--cyan)), transparent 65%); filter: blur(40px); opacity: 0; top: -60px; right: -60px; transition: opacity .35s; pointer-events: none; }
.v4-card:hover .v4-card__glow { opacity: 0.25; }
.v4-card__ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--tone, var(--cyan)); margin-bottom: 16px; }
.v4-card__ic .material-icons-round { font-size: 26px; }
.v4-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; margin: 0 0 10px; color: #fff; }
.v4-card p { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 14px; }
.v4-card ul { list-style: none; margin: 0; padding: 0; }
.v4-card li { position: relative; padding-left: 22px; color: var(--ink-dim); font-size: 13.5px; margin-bottom: 7px; }
.v4-card li::before { content: '▹'; position: absolute; left: 0; color: var(--tone, var(--cyan)); }
.v4-card[data-tone="cyan"]   { --tone: var(--cyan); }
.v4-card[data-tone="violet"] { --tone: var(--violet); }
.v4-card[data-tone="magenta"]{ --tone: var(--magenta); }
.v4-card[data-tone="amber"]  { --tone: var(--amber); }
.v4-card[data-tone="emerald"]{ --tone: var(--emerald); }

/* Workflow ----------------------------------------------------------------- */
.v4-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.v4-step { position: relative; padding: 28px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.v4-step__num { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); border: 1px solid var(--line); border-radius: 9px; width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 16px; }
.v4-step__ic { color: var(--violet); margin-bottom: 8px; }
.v4-step__ic .material-icons-round { font-size: 30px; }
.v4-step h4 { font-family: var(--font-display); font-size: 19px; margin: 6px 0 10px; color: #fff; }
.v4-step p { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 12px; }
.v4-step__meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-dim); }

/* Testimonials ------------------------------------------------------------- */
.v4-quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.v4-quote { padding: 26px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); }
.v4-quote__stars { color: var(--amber); margin-bottom: 12px; display: flex; gap: 2px; }
.v4-quote__stars .material-icons-round { font-size: 18px; }
.v4-quote p { color: var(--ink); font-size: 15px; margin: 0 0 18px; }
.v4-quote__foot { display: flex; align-items: center; gap: 12px; }
.v4-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #04050c; background: linear-gradient(120deg, var(--cyan), var(--violet)); }
.v4-quote__name { font-weight: 600; font-size: 14px; }
.v4-quote__role { font-size: 12.5px; color: var(--ink-dim); }

/* Pricing ------------------------------------------------------------------ */
.v4-price { max-width: 460px; margin: 0 auto; padding: 36px; border-radius: 26px; text-align: center; position: relative; overflow: hidden; background: linear-gradient(160deg, var(--glass-2), rgba(8,11,24,0.9)); border: 1px solid var(--line); }
.v4-price__glow { position: absolute; inset: -40% 20% auto; height: 200px; background: radial-gradient(circle, var(--glow-violet), transparent 70%); filter: blur(50px); }
.v4-price__badge { position: relative; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--emerald); padding: 6px 12px; border-radius: 999px; background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); }
.v4-price__badge .material-icons-round { font-size: 14px; }
.v4-price__amt { font-family: var(--font-display); font-weight: 700; font-size: 60px; color: #fff; line-height: 1; margin-top: 18px; }
.v4-price__per { color: var(--ink-dim); font-size: 16px; }
.v4-price__trial { color: var(--ink-soft); font-size: 14px; margin: 12px 0 22px; }
.v4-price__list { list-style: none; padding: 0; margin: 0 0 26px; text-align: left; }
.v4-price__list li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.v4-price__list .material-icons-round { color: var(--emerald); font-size: 19px; }
.v4-price__sales { color: var(--ink-dim); font-size: 13px; margin-top: 16px; }
.v4-price__sales a { color: var(--cyan); }

/* Final CTA ---------------------------------------------------------------- */
.v4-cta { position: relative; padding: 100px 0; }
.v4-cta__inner { position: relative; max-width: 860px; margin: 0 auto; text-align: center; padding: 56px 36px; border-radius: 30px; overflow: hidden; background: linear-gradient(135deg, rgba(34,211,238,0.08), rgba(139,92,246,0.08)); border: 1px solid var(--line); }
.v4-cta__inner h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); margin: 0 0 14px; color: #fff; }
.v4-cta__inner p { color: var(--ink-soft); font-size: 17px; margin: 0 0 28px; }
.v4-cta__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Footer ------------------------------------------------------------------- */
.v4-foot { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 30px 24px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; color: var(--ink-dim); font-size: 13.5px; max-width: var(--maxw); margin: 0 auto; }
.v4-foot__links { display: flex; gap: 18px; }
.v4-foot__links a { color: var(--ink-soft); text-decoration: none; }
.v4-foot__links a:hover { color: var(--cyan); }

.v4-divider { height: 1px; max-width: var(--maxw); margin: 0 auto; background: linear-gradient(90deg, transparent, var(--line), transparent); }

/* Scroll reveal ------------------------------------------------------------ */
.v4-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.v4-reveal.is-visible { opacity: 1; transform: none; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 980px) {
  .v4-hero__grid { grid-template-columns: 1fr; }
  .v4-holo { max-width: 480px; margin: 0 auto; }
  .v4-bento { grid-template-columns: repeat(2, 1fr); }
  .v4-card, .v4-card[data-span="2"] { grid-column: span 1; }
  .v4-flow, .v4-quotes { grid-template-columns: 1fr; }
  .v4-nav__links { display: none; }
  .v4-nav__toggle { display: block; }
  .v4-nav__links.is-open { display: flex; position: absolute; top: 70px; left: 0; right: 0; flex-direction: column; background: rgba(5,7,16,0.96); padding: 14px 24px; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .v4-metrics { grid-template-columns: repeat(2, 1fr); }
  .v4-section { padding: 70px 0; }
}

/* Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .v4-reveal { opacity: 1; transform: none; }
}
