/* ==========================================================================
   LUNIUS LABS — Core Base Stylesheet
   Atmosphere: Living Night Sky · Luna (Calm Moonlight) + Sirius (Crisp Starlight)
   Typography: Cormorant Garamond (Poetic Serif) + Plus Jakarta Sans + JetBrains Mono
   ========================================================================== */

:root {
  /* Sky Depth Palette */
  --sky-zenith: #04060b;
  --sky-mid: #070c17;
  --sky-horizon: #0c1528;

  /* Surfaces */
  --bg-void: #04060b;
  --bg-night: #080d19;
  --bg-card: rgba(11, 17, 31, 0.62);
  --bg-card-hover: rgba(15, 23, 42, 0.78);
  --bg-glass: rgba(255, 255, 255, 0.028);
  --bg-glass-elevated: rgba(255, 255, 255, 0.055);

  /* Luna — Calm Moonlight Silver & Warm Ivory */
  --luna-white: #f4f7fc;
  --luna-silver: #d5deec;
  --luna-ivory: #eef2f9;
  --luna-muted: #98a7be;
  --luna-glow: rgba(213, 222, 236, 0.18);

  /* Sirius — Crisp Celestial Cyan */
  --sirius-cyan: #5ce8ff;
  --sirius-bright: #00f2ff;
  --sirius-deep: #0ea5e9;
  --sirius-glow: rgba(92, 232, 255, 0.28);
  --sirius-subtle: rgba(92, 232, 255, 0.10);

  /* Text Hierarchy (WCAG AA Compliant on #04060b) */
  --text-pure: #f8fafc;
  --text-main: #d4deec;
  --text-muted: #97a6bd;
  --text-dim: #7e8fa6; /* ~5.3:1 contrast ratio on #04060b */

  /* Delicate Celestial Borders */
  --border-subtle: rgba(213, 222, 236, 0.08);
  --border-light: rgba(213, 222, 236, 0.15);
  --border-cyan: rgba(92, 232, 255, 0.28);
  --border-cyan-glow: rgba(92, 232, 255, 0.52);

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --font-display: var(--font-serif);

  /* Geometry & Celestial Motion Curves (Zero bounce, weightless deceleration) */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --ease-celestial: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-breath: cubic-bezier(0.45, 0, 0.55, 1);
  --transition: all 0.45s var(--ease-celestial);
  --transition-slow: all 0.85s var(--ease-celestial);
}

/* Reset & Document Standards */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--sky-zenith);
  color: var(--text-main);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.i18n-pending [data-i18n],
html.i18n-pending #legal-tr {
  opacity: 0;
}

html.i18n-pending * {
  animation-play-state: paused !important;
}

@keyframes celestialEmerge {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.7;
  font-weight: 400;
  background-color: var(--sky-zenith);
  background-image:
    radial-gradient(ellipse 90% 45% at 50% -10%, rgba(18, 34, 64, 0.52), transparent 72%),
    radial-gradient(ellipse 75% 40% at 82% 18%, rgba(92, 232, 255, 0.045), transparent 60%),
    linear-gradient(180deg, var(--sky-zenith) 0%, var(--sky-mid) 52%, var(--sky-horizon) 100%);
}

::selection {
  background-color: rgba(92, 232, 255, 0.25);
  color: var(--text-pure);
}

/* Accessible Keyboard Focus Ring */
:focus-visible {
  outline: 2px solid var(--sirius-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Living Night Sky Canvas */
#sky-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

/* Base Elements */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.35s var(--ease-celestial), opacity 0.35s var(--ease-celestial), border-color 0.35s var(--ease-celestial);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 780px;
}

.section {
  padding: 112px 0;
  position: relative;
}

/* ==========================================================================
   Navigation Bar — Quiet Floating Glass
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: padding 0.5s var(--ease-celestial), background 0.5s var(--ease-celestial), border-color 0.5s var(--ease-celestial);
  background: rgba(4, 6, 11, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  padding: 13px 0;
  background: rgba(4, 6, 11, 0.82);
  border-bottom-color: var(--border-subtle);
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: 0.04em;
  color: var(--text-pure);
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  transition: transform 0.6s var(--ease-celestial), filter 0.6s var(--ease-celestial);
}

.brand-link:hover .brand-logo-img {
  transform: rotate(-6deg) scale(1.05);
  filter: drop-shadow(0 0 10px var(--sirius-glow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  letter-spacing: 0.01em;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sirius-cyan), transparent);
  transition: width 0.45s var(--ease-celestial), left 0.45s var(--ease-celestial);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-pure);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  left: 0;
}

/* Language Switcher */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color 0.35s var(--ease-celestial), background 0.35s var(--ease-celestial);
}

.lang-btn:hover {
  color: var(--text-pure);
}

.lang-btn.active {
  background: rgba(92, 232, 255, 0.13);
  color: var(--sirius-cyan);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 7px;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-toggle:hover {
  border-color: var(--border-light);
  color: var(--text-pure);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 66px;
  left: 16px;
  right: 16px;
  background: rgba(7, 12, 23, 0.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  z-index: 99;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.mobile-menu.open {
  display: block;
  animation: nightFadeIn 0.38s var(--ease-celestial) forwards;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-nav-links a {
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--text-main);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-links li:last-child a {
  border-bottom: none;
}

@keyframes nightFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Section Headers — Editorial Serenity
   ========================================================================== */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sirius-cyan);
  opacity: 0.88;
  margin-bottom: 12px;
}

.section-header {
  margin-bottom: 56px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4.4vw, 3.25rem);
  font-weight: 500;
  color: var(--text-pure);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.72;
}

.text-center {
  text-align: center;
}

.text-center .section-desc {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Buttons — Soft Starlight & Quiet Glass
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.45s var(--ease-celestial), box-shadow 0.45s var(--ease-celestial), background 0.45s var(--ease-celestial), border-color 0.45s var(--ease-celestial), color 0.35s var(--ease-celestial);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(244, 247, 252, 0.96), rgba(213, 222, 236, 0.92));
  color: #050811;
  font-weight: 600;
  box-shadow: 0 6px 28px rgba(213, 222, 236, 0.16);
}

.btn-primary:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(92, 232, 255, 0.26);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border-light);
  color: var(--text-pure);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(92, 232, 255, 0.08);
  border-color: var(--border-cyan);
  transform: translateY(-2px);
}

/* ==========================================================================
   Celestial Glass Card with Gentle Starlight Spotlight
   ========================================================================== */
.card-spotlight {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  transition: border-color 0.55s var(--ease-celestial), transform 0.55s var(--ease-celestial), box-shadow 0.55s var(--ease-celestial);
}

.card-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    560px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(92, 232, 255, 0.065),
    transparent 45%
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s var(--ease-celestial);
}

.card-spotlight:hover::before {
  opacity: 1;
}

.card-spotlight:hover {
  border-color: rgba(213, 222, 236, 0.18);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   Night-Vision Scroll Reveal Animation (Soft focus + gentle rise)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(4px);
  transition:
    opacity 0.95s var(--ease-celestial),
    transform 0.95s var(--ease-celestial),
    filter 0.95s var(--ease-celestial);
  will-change: opacity, transform, filter;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Subtle Starlight Custom Cursor (Desktop Only)
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 5px;
    height: 5px;
    background: var(--luna-white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--sirius-cyan);
    opacity: 0;
    transition: opacity 0.35s ease;
  }

  .custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(213, 222, 236, 0.28);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.35s var(--ease-celestial), height 0.35s var(--ease-celestial), background 0.35s var(--ease-celestial), border-color 0.35s var(--ease-celestial), opacity 0.35s ease;
    opacity: 0;
  }

  .custom-cursor-follower.cursor-hover {
    width: 44px;
    height: 44px;
    background: rgba(92, 232, 255, 0.06);
    border-color: rgba(92, 232, 255, 0.48);
  }
}

/* ==========================================================================
   Footer — Quiet Horizon Line
   ========================================================================== */
.footer {
  padding: 44px 0 52px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.87rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.footer-nav a {
  font-size: 0.87rem;
  color: var(--text-muted);
}

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

/* Responsive Navigation & Spacing */
@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .section {
    padding: 80px 0;
  }
  .section-header {
    margin-bottom: 40px;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-copy {
    justify-content: center;
  }
  .footer-nav {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .section {
    padding: 64px 0;
  }
}
