/* Quant Intelligence — design system
   Dark, futuristic, glass + glow. Two accent hues: cyan (Alden) / violet (Quantmind). */

:root {
  --bg: #05060a;
  --bg-elevated: #0b0d16;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.09);
  --text: #eef1fb;
  --text-dim: #9aa3c0;
  --text-faint: #5c6389;

  --cyan: #4fd8ff;
  --cyan-soft: rgba(79, 216, 255, 0.15);
  --violet: #a76bff;
  --violet-soft: rgba(167, 107, 255, 0.15);
  --grad: linear-gradient(120deg, var(--cyan), var(--violet));

  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1160px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--text-dim); }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
  /* permanent scrim so the wordmark stays legible over any hero background,
     not only once .scrolled adds the full blurred bar */
  background: linear-gradient(rgba(5, 6, 10, 0.65), rgba(5, 6, 10, 0));
}

.nav.scrolled {
  background: rgba(5, 6, 10, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--surface-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(79, 216, 255, 0.55);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 34px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.nav-links a {
  transition: color 0.2s var(--ease);
}

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

.nav-cta {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text) !important;
  font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-cta:hover {
  border-color: var(--cyan);
  background: var(--cyan-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ---------- Language switcher (custom UI, driven by Google Website Translator) ---------- */

.nav-lang {
  position: relative;
  margin-left: 18px;
}

/* Google's own widget renders a bare native <select> that's barely
   stylable — keep it in the DOM (so it still works) but visually
   hidden, and drive it entirely from our own pill + menu below. */
.goog-hidden-host,
#google_translate_element {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.lang-toggle:hover { border-color: var(--text-dim); color: var(--text); }
.lang-toggle svg { width: 15px; height: 15px; }

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: rgba(11, 13, 22, 0.97);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 300;
}

.lang-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu li {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.lang-menu li:hover { background: var(--surface); color: var(--text); }
.lang-menu li[aria-selected="true"] { color: var(--cyan); }

/* Google's translate banner shoves the whole page down and adds a
   branded top bar — suppress it so layout/nav stay untouched. */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}

.skiptranslate iframe {
  display: none !important;
}

body {
  top: 0 !important;
  position: static !important;
}

@media (max-width: 860px) {
  .nav-lang { margin-left: auto; margin-right: 10px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 108px 28px 64px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 28%, rgba(79, 216, 255, 0.16), transparent 70%),
    radial-gradient(50% 45% at 72% 62%, rgba(167, 107, 255, 0.12), transparent 70%),
    linear-gradient(
      to right,
      transparent 0,
      transparent calc(50% - 1px),
      rgba(255, 255, 255, 0.035) 50%,
      transparent calc(50% + 1px),
      transparent 100%
    ),
    var(--bg);
  background-size: 100% 100%, 100% 100%, 64px 64px, 100% 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.tornado-hero-card h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  margin-bottom: 0;
}

.tornado-hero-card h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.btn-primary {
  background: var(--grad);
  color: #050608;
  font-weight: 600;
  box-shadow: 0 0 0 rgba(79, 216, 255, 0);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(79, 216, 255, 0.55);
}

.btn-ghost {
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  transform: translateY(-2px);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
  animation: fade-cue 2.4s ease-in-out infinite;
}

.scroll-cue .line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--text-faint), transparent);
}

@keyframes fade-cue {
  0%, 100% { opacity: 0.35; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 6px); }
}

/* ---------- Section shared ---------- */

section {
  position: relative;
  padding: 120px 0;
}

.section-head {
  max-width: 620px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-tag {
  display: inline-block;
  color: var(--cyan);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Products ---------- */

.products {
  background: linear-gradient(180deg, transparent, rgba(79, 216, 255, 0.03) 40%, transparent);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.product-card {
  position: relative;
  padding: 42px 36px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.product-card::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -30%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
  transition: opacity 0.4s var(--ease);
}

.product-card.alden::before { background: var(--cyan); }
.product-card.quantmind::before { background: var(--violet); }

.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.18);
}

.product-card:hover::before { opacity: 0.55; }

.product-card > * { position: relative; z-index: 1; }

.product-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

.product-icon svg { width: 22px; height: 22px; }

.product-card.alden .product-icon svg { color: var(--cyan); }
.product-card.quantmind .product-icon svg { color: var(--violet); }

.product-card h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.product-tag {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: block;
}

.product-card p { margin-bottom: 26px; }

.product-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 2px;
  transition: border-color 0.2s var(--ease), gap 0.2s var(--ease), color 0.2s var(--ease);
}

.product-card.alden .link-arrow.primary { color: var(--cyan); border-color: var(--cyan); }
.product-card.quantmind .link-arrow.primary { color: var(--violet); border-color: var(--violet); }

.link-arrow:hover { gap: 10px; }

.link-arrow svg { width: 14px; height: 14px; }

/* ---------- Approach / About teaser ---------- */

/* ---------- Single unified tornado: hero + all product cards ---------- */

.tornado-stage {
  position: relative;
  width: min(1500px, 88vw);
  height: min(72vh, 700px);
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
  perspective: 1800px;
  overflow: visible;
}

/* #tornado-info lives as a direct child of <body>, NOT nested inside
   .hero/#tornado-section — GSAP applies a transform to .hero alongside
   position:fixed while it's pinned, and a transformed ancestor creates
   a new containing block that traps position:fixed descendants,
   resolving them against that ancestor instead of the real viewport.
   Being a body-level sibling avoids that entirely. position:fixed here
   is visually equivalent to the old position:absolute-inside-.hero
   during the pinned scroll phase, since .hero fills the viewport while
   pinned — but now it holds regardless of any ancestor's transform. */
.tornado-info {
  position: fixed;
  left: clamp(20px, 4vw, 64px);
  top: 50%;
  transform: translateY(-50%);
  max-width: 340px;
  z-index: 150;
}

.tornado-info h4 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.tornado-info h4:empty {
  display: none;
}

.tornado-info p {
  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 1100px) {
  /* Below desktop width, show the info panel pinned to the bottom of
     the viewport, centered, card-styled — cards are heading-only now,
     so this text is the only place the detail copy lives. The stage
     also shrinks a bit so cards can't orbit into the panel's space.
     (The deeper 900px breakpoint below still owns the full
     static-card-list mobile fallback separately.) */
  .tornado-stage {
    height: min(48vh, 460px);
  }
  .tornado-info {
    /* No transform for centering — JS never writes a transform on this
       element at all (text/opacity only, see spiral.js), but avoiding
       transform-based centering here keeps that guarantee cheap to
       verify by inspection. left/right + auto margins center it with
       zero dependency on transform. */
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 24px;
    transform: none;
    width: auto;
    margin: 0 auto;
    max-width: 500px;
    text-align: center;
    padding: 20px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--surface-border);
    /* Solid elevated surface, not the translucent card gradient — the
       card gradient reads fine floating inside the .hero 3D scene, but
       this panel is a body-level fixed overlay over arbitrary page
       content and needs real contrast on its own, same as .form-panel
       uses elsewhere for standalone card-style overlays. */
    background: var(--bg-elevated);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  }
}

.spiral-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.spiral-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(300px, 66vw);
  will-change: transform, opacity, filter;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
}

/* Front (text) and back (blank) faces of the card, each hidden when
   rotated away from the viewer, so text never renders mirrored as the
   card turns edge-on and shows its back during the exit spiral. */
.spiral-card-face,
.spiral-card-back {
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(6px);
  text-align: center;
  backface-visibility: hidden;
}

.spiral-card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.spiral-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
  border: 1px solid var(--surface-border);
}

.spiral-badge.alden { color: var(--cyan); border-color: rgba(79, 216, 255, 0.35); }
.spiral-badge.quantmind { color: var(--violet); border-color: rgba(167, 107, 255, 0.35); }

.spiral-card h3 { font-size: 1.5rem; margin-bottom: 10px; }
.spiral-card h4 { font-size: 1.25rem; margin-bottom: 10px; }
.spiral-card p { font-size: 0.98rem; margin: 0 0 14px; }
.spiral-card p:last-child { margin-bottom: 0; }
.spiral-card h3:last-child,
.spiral-card h4:last-child { margin-bottom: 0; }
.spiral-card .link-arrow { justify-content: center; }

@media (max-width: 900px) {
  .hero { min-height: auto; padding: 120px 24px 60px; flex-direction: column; }
  .tornado-stage {
    width: 100%;
    max-width: 100%;
    height: auto;
    perspective: none;
  }
  .spiral-ring {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .spiral-card,
  .tornado-hero-card,
  .spiral-card:has(> h3) {
    position: static;
    width: 100%;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  padding: 100px 28px;
}

.cta-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 44px;
  border-radius: 28px;
  border: 1px solid var(--surface-border);
  background: radial-gradient(120% 140% at 50% 0%, rgba(79, 216, 255, 0.1), transparent 60%), var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.cta-panel h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 14px;
}

.cta-panel p {
  max-width: 460px;
  margin: 0 auto 30px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 56px 0 40px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand .nav-brand { margin-bottom: 14px; }

.footer-brand p { font-size: 0.9rem; }

.footer-cols {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
}

.footer-col h5 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 16px;
  font-weight: 600;
}

.footer-col a {
  display: block;
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 12px;
  transition: color 0.2s var(--ease);
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--surface-border);
  font-size: 0.82rem;
  color: var(--text-faint);
}

.footer-bottom-links {
  display: flex;
  gap: 22px;
}

.footer-bottom-links a { color: var(--text-faint); }
.footer-bottom-links a:hover { color: var(--text-dim); }

/* ---------- Simple/legal pages ---------- */

.page-hero {
  padding: 160px 28px 60px;
  text-align: center;
}

.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page-hero p { max-width: 560px; margin: 0 auto; }

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px 120px;
}

.legal h2 {
  font-size: 1.3rem;
  margin-top: 44px;
  margin-bottom: 14px;
}

.legal p, .legal li { color: var(--text-dim); font-size: 0.96rem; }
.legal ul { padding-left: 20px; }
.legal .updated {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 40px;
  display: block;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px 120px;
}

.about-grid .stat {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  margin-bottom: 16px;
}

.about-grid .stat strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.7rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.about-grid .stat span {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 16px 28px 22px;
    background: rgba(5, 6, 10, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--surface-border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .nav-cta { align-self: flex-start; margin-top: 6px; }
  .nav-toggle { display: block; }
  .product-grid { grid-template-columns: 1fr; }
  .approach-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; }
}

@media (max-width: 520px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-eyebrow, .hero h1, .hero-sub, .hero-actions { animation: none; opacity: 1; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue { animation: none; }
}
