/* ===================================================================
   OmniWise AB — Nordic Precision Design System
   =================================================================== */

/* --- Custom Properties --- */
:root {
  --primary: #001736;
  --primary-container: #002b5c;
  --primary-light: #0a2d5e;
  --secondary: #00668a;
  --secondary-container: #54c7ff;
  --accent-cyan: #54c7ff;
  --accent-warm: #ffb875;
  --surface: #f7f9fc;
  --surface-dim: #eceef1;
  --surface-low: #f2f4f7;
  --surface-high: #e6e8eb;
  --surface-highest: #e0e3e6;
  --on-surface: #191c1e;
  --on-surface-variant: #43474f;
  --outline: #747780;
  --outline-variant: #c4c6d0;
  --error: #ba1a1a;
  --white: #ffffff;

  --font-headline: 'Manrope', sans-serif;
  --font-body: 'Outfit', sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Base Reset & Typography --- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--on-surface);
  background: var(--surface);
  overflow-x: hidden;
}

::selection {
  background: var(--accent-cyan);
  color: var(--primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-dim); }
::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

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

/* --- Page Load Animation --- */
@keyframes pageReveal {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

main {
  animation: pageReveal 0.8s var(--ease-out-expo) both;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}
.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* --- Stagger Delays --- */
.delay-1 { transition-delay: 80ms !important; }
.delay-2 { transition-delay: 160ms !important; }
.delay-3 { transition-delay: 240ms !important; }
.delay-4 { transition-delay: 320ms !important; }
.delay-5 { transition-delay: 400ms !important; }
.delay-6 { transition-delay: 480ms !important; }

/* --- Glass Card --- */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo),
              background 0.5s var(--ease-out-expo);
}
.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -12px rgba(0, 23, 54, 0.1);
  background: rgba(255, 255, 255, 0.92);
}

/* --- Bokeh Backgrounds --- */
.bokeh-hero {
  background:
    radial-gradient(ellipse 600px 500px at 85% 20%, rgba(84, 199, 255, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 10% 80%, rgba(0, 102, 138, 0.05) 0%, transparent 70%);
}
.bokeh-subtle {
  background:
    radial-gradient(circle at 20% 30%, rgba(84, 199, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 184, 117, 0.04) 0%, transparent 50%);
}

/* --- Button Effects --- */
.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: var(--white);
  font-family: var(--font-headline);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring),
              box-shadow 0.4s var(--ease-out-expo);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 32px -8px rgba(0, 23, 54, 0.35);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--primary);
  background: transparent;
  border: 1.5px solid rgba(0, 23, 54, 0.1);
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
}
.btn-ghost:hover {
  background: var(--surface-low);
  border-color: rgba(0, 23, 54, 0.2);
  transform: translateY(-1px);
}

/* --- Nav --- */
.nav-main {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(247, 249, 252, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 23, 54, 0.04);
  transition: padding 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo);
}
.nav-main.scrolled {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-shadow: 0 4px 24px -4px rgba(0, 23, 54, 0.08);
}
.nav-main.scrolled .nav-inner { padding-top: 0.5rem; padding-bottom: 0.5rem; }

.nav-link {
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: rgba(0, 23, 54, 0.55);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: width 0.4s var(--ease-out-expo);
}
.nav-link:hover { color: var(--primary); }
.nav-link:hover::after { width: 100%; }
.nav-link.active {
  color: var(--secondary);
}
.nav-link.active::after {
  width: 100%;
  background: var(--secondary);
}

/* --- Section Divider --- */
.section-bar {
  width: 5rem;
  height: 4px;
  background: var(--secondary);
  border-radius: 99px;
}

/* --- Floating Animation --- */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50% { transform: translateY(-16px) rotate(0deg); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

/* --- Pulse Glow --- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 23, 54, 0.3); }
  50% { box-shadow: 0 0 24px 8px rgba(0, 23, 54, 0.08); }
}
.animate-pulse-glow { animation: pulseGlow 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* --- Icon Badge --- */
.icon-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  transition: transform 0.4s var(--ease-spring), background 0.4s ease;
}

/* --- Footer --- */
.footer-main {
  background: var(--primary);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.footer-main a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s var(--ease-out-expo);
  display: inline-block;
}
.footer-main a:hover {
  color: var(--accent-cyan);
  transform: translateX(3px);
}
.footer-heading {
  font-family: var(--font-headline);
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  margin-bottom: 1.5rem;
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 23, 54, 0.97);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-expo);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 2rem;
  color: var(--white);
  text-decoration: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo), color 0.2s ease;
}
.mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.open a:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open a:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open a:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open a:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.open a:nth-child(5) { transition-delay: 0.3s; }
.mobile-menu a:hover { color: var(--accent-cyan); }
.mobile-menu .close-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: var(--white);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1.5rem;
}

/* --- Form Inputs --- */
.form-input {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--surface-highest);
  border: 1.5px solid transparent;
  border-radius: 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--on-surface);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.form-input::placeholder { color: rgba(67, 71, 79, 0.4); }
.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(84, 199, 255, 0.12);
  background: var(--white);
}

/* --- Tag/Chip --- */
.tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-highest);
  color: var(--primary);
  transition: background 0.3s ease, color 0.3s ease;
}

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links-desktop { display: none !important; }
  .nav-mobile-toggle { display: block !important; }
}
@media (min-width: 769px) {
  .nav-mobile-toggle { display: none !important; }
  .mobile-menu { display: none !important; }
}
