/* ================================================================
   TENSEN AI — Global Design System
   Typography: Cinzel Decorative (Gothic) + Space Grotesk + Inter
   Theme: Dark space + glassmorphism + nature overlays
   ================================================================ */

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Palette */
  --black: #050508;
  --bg: #08080f;
  --bg-elevated: #0e0e18;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --surface-active: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-active: rgba(255,255,255,0.18);

  /* Text */
  --text: #eaeaef;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #3f3f46;

  /* Accents */
  --violet: #7c3aed;
  --violet-light: #a78bfa;
  --violet-glow: rgba(124,58,237,0.4);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6,182,212,0.3);
  --emerald: #10b981;
  --emerald-glow: rgba(16,185,129,0.3);
  --rose: #f43f5e;
  --amber: #f59e0b;

  /* Color dots */
  --dot-violet: #a78bfa;
  --dot-cyan: #22d3ee;
  --dot-emerald: #34d399;
  --dot-rose: #fb7185;
  --dot-amber: #fbbf24;

  /* Typography */
  --font-gothic: 'Cinzel Decorative', 'Cinzel', serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --space-xl: 64px;
  --space-2xl: 128px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadows — layered, colored */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-xl: 0 16px 64px rgba(0,0,0,0.6), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-glow-violet: 0 0 40px var(--violet-glow), 0 0 80px rgba(124,58,237,0.15);
  --shadow-glow-cyan: 0 0 40px var(--cyan-glow), 0 0 80px rgba(6,182,212,0.15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* Selection */
::selection {
  background: rgba(124,58,237,0.3);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== CONTAINER ===== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== TYPOGRAPHY ===== */
.t-gothic {
  font-family: var(--font-gothic);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.t-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.t-body {
  font-family: var(--font-body);
  font-weight: 400;
}

/* Parentheses hierarchy — secondary text in parentheses */
.t-paren {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-muted);
  font-size: 0.65em;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Hero sizes */
.text-hero {
  font-size: clamp(3.5rem, 8vw, 7rem);
  line-height: 0.95;
}

.text-display {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.text-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  line-height: 1.15;
}

.text-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ===== COLOR DOTS ===== */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

.dot-violet { background: var(--dot-violet); box-shadow: 0 0 12px rgba(167,139,250,0.5); }
.dot-cyan { background: var(--dot-cyan); box-shadow: 0 0 12px rgba(34,211,238,0.5); }
.dot-emerald { background: var(--dot-emerald); box-shadow: 0 0 12px rgba(52,211,153,0.5); }
.dot-rose { background: var(--dot-rose); box-shadow: 0 0 12px rgba(251,113,133,0.5); }
.dot-amber { background: var(--dot-amber); box-shadow: 0 0 12px rgba(251,191,36,0.5); }

/* Dot next to section label */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ===== GLASS CARDS ===== */
.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
}

/* Liquid glass — chromatic refraction effect */
.liquid-glass {
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0%,
    rgba(255,255,255,0.02) 40%,
    rgba(124,58,237,0.04) 60%,
    rgba(6,182,212,0.03) 100%
  );
  backdrop-filter: blur(24px) saturate(1.4) brightness(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.4) brightness(1.1);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -1px 0 rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

/* Chromatic refraction shimmer */
.liquid-glass::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg at 50% 50%,
    transparent 0deg,
    rgba(124,58,237,0.05) 60deg,
    transparent 120deg,
    rgba(6,182,212,0.05) 180deg,
    transparent 240deg,
    rgba(236,72,153,0.03) 300deg,
    transparent 360deg
  );
  animation: glass-refract 12s linear infinite;
  pointer-events: none;
}

@keyframes glass-refract {
  to { transform: rotate(360deg); }
}

/* ===== BUTTONS ===== */
/* ===== NAV LOGO ===== */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
  text-decoration: none;
}

/* Small geometric mark — a slash/angle shape echoing the nature/tension theme */
.nav-logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(135deg, rgba(30,160,80,0.25), rgba(30,80,120,0.25));
  border: 1px solid rgba(60,180,100,0.25);
  border-radius: 7px;
  overflow: hidden;
}

/* Slash accent inside the mark */
.nav-logo-mark::after {
  content: '';
  position: absolute;
  top: 3px; left: 13px;
  width: 1.5px; height: 20px;
  background: linear-gradient(180deg, rgba(100,220,140,0.9), rgba(100,180,255,0.6));
  transform: rotate(-20deg);
  transform-origin: center;
  border-radius: 2px;
}

.nav-logo-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

/* "LABS" — smaller, lighter weight, nature-tinted green */
.nav-logo-labs {
  font-family: var(--font-mono);
  font-size: 0.55em;
  font-weight: 400;
  color: rgba(80,200,120,0.65);
  letter-spacing: 0.18em;
  vertical-align: middle;
  margin-left: 3px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--violet);
  color: #fff;
  box-shadow: var(--shadow-glow-violet);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 60px var(--violet-glow), 0 12px 30px rgba(0,0,0,0.4);
}

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

.btn-ghost:hover {
  border-color: var(--border-active);
  background: var(--surface);
}

/* ===== GRID TEXTURE (imperfection) ===== */
.grid-texture {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 75%);
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.025;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ===== NATURE BACKGROUND ===== */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  /* Dark misty forest base — deep greens bleeding into near-black */
  background:
    radial-gradient(ellipse at 0% 100%, #071a0e 0%, transparent 55%),
    radial-gradient(ellipse at 100% 0%, #08121a 0%, transparent 55%),
    radial-gradient(ellipse at 50% 60%, #0d1a10 0%, transparent 60%),
    var(--bg);
}

/* Nature light orbs — soft bioluminescent glow, forest light beams */
.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  mix-blend-mode: screen;
  will-change: transform;
  opacity: 0.22;
}

/* Deep forest green — bottom left, like light through canopy */
.nebula-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(16,120,60,0.7), transparent 70%);
  bottom: -10%; left: -10%;
  animation: nebula-drift 40s ease-in-out infinite;
}

/* Cool mist blue — top right, like morning fog over mountains */
.nebula-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(30,80,120,0.6), transparent 70%);
  top: -10%; right: -10%;
  animation: nebula-drift 45s ease-in-out infinite reverse;
}

/* Warm amber/gold — center, like sunset through forest */
.nebula-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(100,70,20,0.4), transparent 70%);
  top: 35%; left: 25%;
  animation: nebula-drift 35s ease-in-out infinite;
  animation-delay: -12s;
  opacity: 0.18;
}

/* Emerald bioluminescent — subtle accent */
.nebula-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(20,160,80,0.3), transparent 70%);
  bottom: 20%; right: 15%;
  animation: nebula-drift 32s ease-in-out infinite;
  animation-delay: -18s;
  opacity: 0.14;
}

@keyframes nebula-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(80px, -60px) scale(1.08); }
  50% { transform: translate(-40px, 80px) scale(0.94); }
  75% { transform: translate(60px, 40px) scale(1.04); }
}

/* ===== SECTION BLEND — replaces hard dividers ===== */
/* Sections fade into each other via pseudo-elements top/bottom */
/* Section blend — no overlay gradients. Content just flows. */
.section-blend { position: relative; }

/* ===== STYLIZED SHADOWS ===== */
.shadow-long {
  text-shadow:
    1px 1px 0 rgba(0,0,0,0.3),
    2px 2px 0 rgba(0,0,0,0.25),
    3px 3px 0 rgba(0,0,0,0.2),
    4px 4px 8px rgba(0,0,0,0.4);
}

.shadow-colored {
  box-shadow:
    0 4px 20px rgba(124,58,237,0.15),
    0 8px 40px rgba(0,0,0,0.3),
    0 2px 6px rgba(0,0,0,0.2);
}

.shadow-colored:hover {
  box-shadow:
    0 8px 30px rgba(124,58,237,0.25),
    0 16px 60px rgba(0,0,0,0.4),
    0 4px 10px rgba(0,0,0,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  html { font-size: 15px; }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
}

/* ===== MOBILE PERFORMANCE FIXES ===== */
@media (max-width: 768px) {

  /* Calm the nature orbs on mobile — static, smaller, less opacity */
  .nebula-1 {
    width: 280px; height: 280px;
    opacity: 0.1;
    filter: blur(50px);
    animation: none;
    bottom: 0; left: -5%;
  }
  .nebula-2 {
    width: 220px; height: 220px;
    opacity: 0.09;
    filter: blur(45px);
    animation: none;
    top: -5%; right: -5%;
  }
  /* Remove extra orbs on mobile */
  .nebula-3, .nebula-4 { display: none; }

  /* Reduce backdrop-filter cost on mobile */
  .glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .glass-strong {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .liquid-glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  /* Kill the rotating conic gradient shimmer — too expensive on mobile */
  .liquid-glass::before { display: none; }

  /* Buttons: prevent font/text overflow on small screens */
  .btn {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.88rem;
    padding: 12px 22px;
    white-space: nowrap;
  }

  /* Grid texture off on mobile (not visible anyway) */
  .grid-texture { display: none; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .nebula-1, .nebula-2, .nebula-3, .nebula-4 { animation: none; }
  .reveal-primary, .reveal-secondary, .reveal-tertiary,
  .swipe-in-left, .swipe-in-right, .scale-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .text-ticker { animation: none; }
  .liquid-glass::before { animation: none; }
}
