/* ==========================================================================
   ALOFTZ — Core Stylesheet
   Dark, editorial-finance aesthetic: near-black canvas, hairline borders,
   a tight blue/violet/green/lime/red accent spectrum, Akira Expanded for
   headings, Francy for second headings, Helvetica for body, Space Mono for
   data/labels.
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
svg { display: block; }

/* ---------- Tokens ---------- */
@font-face {
  font-family: "Akira Expanded";
  src: local("Akira Expanded"), local("Akira Expanded Demo");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Francy";
  src: local("Francy"), local("Francy Regular");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  /* surfaces */
  --ink: #0a0a0b;
  --ink-2: #131314;
  --surface: #161617;
  --surface-hi: #1d1d1f;

  /* text */
  --text: #f3f3f1;
  --muted: #9b9b9f;
  --muted-2: #6c6c70;

  /* borders */
  --border: #232325;
  --border-hi: #313134;

  /* accents */
  --blue: #3393ff;
  --violet: #554cff;
  --indigo: #0f0f10;
  --purple: #3c33dc;
  --green: #00ff36;
  --lime: #e5ff33;
  --red: #ff3a3a;
  --spectrum: linear-gradient(90deg, var(--blue), var(--violet), var(--green), var(--lime), var(--red), var(--blue));
  --spectrum-bg: linear-gradient(90deg, var(--blue), var(--violet), var(--indigo), var(--lime), var(--red), var(--blue));

  /* type */
  --font-headline: "Akira Expanded", "Akira Expanded Demo", sans-serif;
  --font-second-heading: "Francy", Georgia, "Times New Roman", serif;
  --font-display: Helvetica, Arial, sans-serif;
  --font-body: Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", monospace;

  /* shape */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  /* motion */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
}
h1 { font-size: clamp(40px, 6vw, 76px); }
h2 {
  font-family: var(--font-second-heading);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
}
h3 { font-size: clamp(20px, 2.4vw, 26px); }
h4 { font-size: 18px; }

p { color: var(--muted); }
p.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--text); opacity: 0.85; line-height: 1.55; }

.gradient-text {
  background: var(--spectrum);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: spectrum-shift 8s ease-in-out infinite;
}
@keyframes spectrum-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

::selection { background: var(--blue); color: #fff; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.section { padding: 28px 0; }
.section-tight { padding: 60px 0; }
.section-alt { background: var(--ink-2); border-top: 10px solid var(--border); border-bottom: 1px solid var(--border); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }

/* ---------- Shared Page Hero Background ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  text-align: center;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: -24% -12% -18%;
  z-index: -2;
  background:
    radial-gradient(circle at 82% 0%, rgb(16 3 255 / 97%), #ffffff00 28%), radial-gradient(circle at 12% 92%, rgb(11 67 233 / 75%), transparent 30%), radial-gradient(circle at 48% 42%, rgba(118, 113, 113, 0.44), #00000012 26%);
  filter: blur(22px);
  transform: translate3d(0, 0, 0);
  animation: page-bg-drift 22s ease-in-out infinite;
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 10, 11, 0.08), var(--ink) 92%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05), transparent 34%);
  pointer-events: none;
}
.page-hero > .container {
  position: relative;
  z-index: 1;
}
@keyframes page-bg-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(28px, 22px, 0) scale(1.04); }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--spectrum-bg); background-size: 300% auto;
  z-index: 1100; transition: width 0.1s linear;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 22px 0;
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-soft), padding 0.3s var(--ease-soft), background 0.3s var(--ease-soft);
}
.nav.is-scrolled { padding: 14px 0; border-color: var(--border); background: rgba(10, 10, 11, 0.85); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 27px; width: 100px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-size: 14.5px; color: var(--muted); transition: color 0.25s var(--ease-soft); position: relative; }
.nav-links a:hover { color: var(--text); }

.nav-cta { display: flex; align-items: center; gap: 12px; }

.nav-burger {
  display: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-hi); align-items: center; justify-content: center;
  position: relative;
}
.nav-burger span, .nav-burger span::before, .nav-burger span::after {
  content: ""; position: absolute; width: 16px; height: 1.5px; background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-burger span::before { transform: translateY(-5px); }
.nav-burger span::after { transform: translateY(5px); }
.nav-burger.is-open span { background: transparent; }
.nav-burger.is-open span::before { transform: translateY(0) rotate(45deg); }
.nav-burger.is-open span::after { transform: translateY(0) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 999;
  background: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity 0.35s var(--ease-soft), transform 0.35s var(--ease-soft), visibility 0.35s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu a { font-family: var(--font-display); font-size: 26px; font-weight: 600; color: #040cd5d4; }
.mobile-menu .mm-cta { margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 26px; border-radius: 100px;
  font-size: 23.5px; font-weight: 800;
  transition: transform 0.3s var(--ease-soft), background 0.3s var(--ease-soft), border-color 0.3s var(--ease-soft), color 0.3s var(--ease-soft);
  white-space: nowrap;
}
.btn-primary { background: var(--text); color: var(--ink); }
.btn-primary:hover { background: var(--blue); color: #fff; }
.btn-ghost { border: 1px solid var(--border-hi); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 11px 20px; font-size: 13.5px; }
.btn-arrow { transition: transform 0.35s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ---------- Eyebrow ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 18px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.eyebrow.is-blue { color: var(--blue); }
.eyebrow.is-lime { color: var(--lime); }
.eyebrow.is-blue { color: #054bf8; }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.3s var(--ease-soft), transform 0.3s var(--ease-soft), background 0.3s var(--ease-soft);
}
.card:hover { border-color: var(--border-hi); background: var(--surface-hi); }

.tag, .mono-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2);
  padding: 5px 10px; border: 1px solid var(--border-hi); border-radius: 100px;
}
.mono-tag { color: var(--muted); }

/* ---------- Reveal-on-scroll ---------- */
.reveal, .reveal-fade, .reveal-scale {
  opacity: 0;
  transition: opacity 0.8s var(--ease-soft), transform 0.8s var(--ease-soft);
}
.reveal { transform: translateY(28px); }
.reveal-fade { transform: translateY(0); }
.reveal-scale { transform: scale(0.96); }
.reveal.is-visible, .reveal-fade.is-visible, .reveal-scale.is-visible {
  opacity: 1; transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-fade, .reveal-scale { opacity: 1; transform: none; transition: none; }
  .page-hero::before { animation: none; }
}

/* ---------- Footer ---------- */
.footer { padding: 90px 0 36px; border-top: 1px solid var(--border); background: var(--ink-2); }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; gap: 40px;
  padding-bottom: 56px; border-bottom: 1px solid var(--border);
}
.footer-brand p { margin-top: 16px; font-size: 14px; max-width: 280px; }
.footer-brand .brand-name { font-size: 16px; }
.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  transition: border-color 0.3s, color 0.3s;
}
.social-row a:hover { border-color: var(--blue); color: var(--blue); }

.footer h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 14.5px; color: var(--muted); transition: color 0.25s; }
.footer-links a:hover { color: var(--text); }

.all-pages {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.all-pages h5 {
  margin-bottom: 16px;
}
.all-pages-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.all-pages-grid a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--border-hi);
  border-radius: 100px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.all-pages-grid a:hover {
  border-color: var(--blue);
  color: var(--text);
  background: var(--surface);
}

.newsletter-form { display: flex; gap: 8px; margin-top: 16px; }
.newsletter-form input {
  flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 100px; padding: 11px 16px; font-size: 13.5px;
}
.newsletter-form input::placeholder { color: var(--muted-2); }
.newsletter-form button {
  background: var(--text); color: var(--ink); border-radius: 100px; padding: 11px 18px;
  font-size: 13.5px; font-weight: 600; transition: background 0.3s, color 0.3s;
}
.newsletter-form button:hover { background: var(--blue); color: #fff; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px; font-size: 13px; color: var(--muted-2);
  font-family: var(--font-mono);
}
.hero-3d-stage {
  position: absolute; inset: 0; right: 0; left: auto;
  width: 52%; height: 100%; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.hero-3d-stage canvas { width: 100%; height: 100%; display: block; }
.hero-3d-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at 40% 30%, rgba(84, 234, 255, 0.22), transparent 32%),
              radial-gradient(circle at 70% 50%, rgba(115, 190, 255, 0.18), transparent 42%);
}
.hero-3d-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  opacity: .12; mix-blend-mode: screen;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 45%, rgba(255,255,255,0.1) 100%);
}
@media (max-width: 1024px) { .hero-3d-stage { width: 62%; } }
@media (max-width: 760px) { .hero-3d-stage { width: 100%; opacity: .55; } }

.moon-ambient {
  position: absolute;
  top: 8%; right: -20%;
  width: 520px; height: 520px;
  z-index: -2;
  pointer-events: none;
  opacity: 0.94;
  transform: translateZ(0);
}
.moon-ambient .moon-glow {
  position: absolute;
  inset: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110,240,255,0.34) 0%, rgba(70,180,255,0.12) 32%, transparent 72%);
  filter: blur(28px);
}
.moon-ambient .moon-halo {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, rgba(120,220,255,0.06) 34%, transparent 72%);
  filter: blur(12px);
}
.moon-ambient .moon-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #f3ffff 0%, #d8f6ff 12%, #95d2ec 30%, #5a8fb2 54%, #27445c 78%, #102340 100%);
  box-shadow:
    inset -24px -18px 72px rgba(255,255,255,0.26),
    inset 18px 14px 32px rgba(146, 227, 255, 0.36),
    0 0 50px rgba(100, 220, 255, 0.14);
  overflow: hidden;
}
.moon-ambient .crater {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 24%, rgba(255,255,255,0.45), rgba(148, 217, 255, 0.45) 24%, rgba(35,55,90,0.3) 60%, rgba(14, 28, 48, 0.18) 100%);
  mix-blend-mode: screen;
  opacity: 0.9;
}
.moon-ambient .c1 { width: 70px; height: 70px; top: 24%; left: 24%; }
.moon-ambient .c2 { width: 38px; height: 38px; top: 50%; left: 60%; }
.moon-ambient .c3 { width: 52px; height: 52px; top: 62%; left: 22%; }
.moon-ambient .c4 { width: 24px; height: 24px; top: 36%; left: 64%; }
.moon-ambient .c5 { width: 18px; height: 18px; top: 46%; left: 40%; }
.moon-ambient .moon-storm-drop {
  position: absolute;
  top: 26%;
  width: 3px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(190,255,255,0.95), rgba(38,176,255,0.12));
  filter: blur(0.6px);
  opacity: 0;
  transform: translateX(0) translateY(-18px) rotate(12deg);
}
@media (max-width: 1080px) {
  .moon-ambient { width: 380px; height: 380px; top: -2%; right: -14%; }
}
@media (max-width: 760px) {
  .moon-ambient { width: 240px; height: 240px; top: 0%; right: -16%; opacity: 0.76; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .container { padding: 0 24px; }
  .grid-2 { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; row-gap: 36px; }
}
@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .section { padding: 76px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}
