:root{
  /* Enhanced Color System - Blue, Black, White */
  --bg: #ffffff;
  --fg: #0a0e1a;           /* Deep black-blue */
  --muted: #4a5568;        /* Sophisticated gray */
  --line: rgba(10,14,26,.08);
  --card: rgba(255,255,255,.88);
  --card-strong: rgba(255,255,255,.92);
  --shadow: 0 20px 50px rgba(10,14,26,.08), 0 4px 12px rgba(10,14,26,.04);
  --shadow-hover: 0 30px 70px rgba(10,14,26,.12), 0 8px 20px rgba(10,14,26,.06);
  --radius: 20px;
  --radius-sm: 12px;

  /* Refined Blue Accents */
  --accent: #1e40af;       /* Deep royal blue */
  --accent-light: #3b82f6; /* Bright blue */
  --accent-lighter: #60a5fa; /* Sky blue */
  --accent-dark: #1e3a8a;  /* Navy */
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --gradient-accent: linear-gradient(135deg, #0ea5e9 0%, #1e40af 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(30,64,175,.05) 0%, rgba(59,130,246,.05) 100%);

  /* Typography scale */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --h1: clamp(2.5rem, 5vw, 4.2rem);
  --h2: clamp(1.6rem, 2.5vw, 2.25rem);
  --h3: clamp(1.15rem, 1.8vw, 1.35rem);
  --body: clamp(1.05rem, 1.25vw, 1.1rem);
  --sm: clamp(.95rem, 1.05vw, 1rem);
}

/* Base */
*{ box-sizing: border-box }
html, body { height: 100% }
body{
  margin: 0;
  font-family: var(--font);
  color: var(--fg);
  /* Old background - commented out for easy rollback */
  /* background: url('assets/custombackground.jpg') no-repeat center center fixed; */
  /* background-size: cover; */
  
  /* New: Clean white base */
  background: #fefefe;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  --bg-image-opacity: 0;
}

/* Background image layer - gradually revealed on scroll */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/custombackground.jpg') no-repeat center center fixed;
  background-size: cover;
  z-index: -2;
  opacity: var(--bg-image-opacity);
}

/* Only enable will-change on desktop for better mobile performance */
@media (min-width: 961px) {
  body::before,
  body::after {
    will-change: opacity;
  }
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: -2;
  opacity: var(--bg-image-opacity);
}

/* Innovative: Organic mesh gradient with smooth blending */
.backdrop{
  position: fixed;
  inset: -100px;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(at 0% 0%, rgba(219,234,254,.6) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(186,230,253,.5) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(191,219,254,.6) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(147,197,253,.5) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(224,242,254,.4) 0px, transparent 40%),
    radial-gradient(at 30% 70%, rgba(165,180,252,.3) 0px, transparent 35%),
    radial-gradient(at 70% 30%, rgba(196,181,253,.25) 0px, transparent 35%);
  filter: blur(80px) saturate(150%);
}

/* Only animate backdrop on desktop devices */
@media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
  .backdrop {
    animation: meshShift 30s ease-in-out infinite;
  }
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(59,130,246,.015) 2px, rgba(59,130,246,.015) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(30,64,175,.015) 2px, rgba(30,64,175,.015) 4px);
  opacity: .4;
}

/* Only animate noise on desktop devices */
@media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
  .backdrop::after {
    animation: noiseFloat 20s linear infinite;
  }
}

@keyframes meshShift {
  0%, 100% { 
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  25% { 
    transform: translate(-5%, 5%) scale(1.1) rotate(1deg);
  }
  50% { 
    transform: translate(3%, -3%) scale(1.05) rotate(-0.5deg);
  }
  75% { 
    transform: translate(-3%, 2%) scale(1.08) rotate(0.5deg);
  }
}

@keyframes noiseFloat {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Layout */
.wrap{
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 24px 0;
}

/* Enhanced Glass card with better depth */
.glass{
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
  .glass {
    will-change: transform, box-shadow;
  }
  
  .glass:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(30,64,175,.12);
  }
}

/* Nav - Modern redesign */
.nav{
  z-index: 50;
  position: relative;
}

.nav-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  gap: 32px;
}

/* Brand / Logo */
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.brand:hover{
  transform: translateY(-2px);
}

.brand-icon{
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.brand:hover .brand-icon{
  transform: rotate(-5deg) scale(1.05);
}

.brand-text{
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.brand-name{
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
}

.brand-tagline{
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* Navigation Links */
.nav-links{
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a{
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-links a:hover{
  background: rgba(30,64,175,.06);
  color: var(--accent);
}

.nav-cta{
  background: var(--gradient-primary);
  color: white !important;
  margin-left: 8px;
  box-shadow: 0 2px 8px rgba(30,64,175,.2);
}

.nav-cta:hover{
  background: var(--gradient-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,64,175,.3);
}

/* Mobile Menu Button */
.menu-btn{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  appearance: none;
  border: none;
  background: transparent;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

.menu-btn span{
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.nav.open .menu-btn span:nth-child(1){
  transform: translateY(4px) rotate(45deg);
}

.nav.open .menu-btn span:nth-child(2){
  transform: translateY(-4px) rotate(-45deg);
}

/* Hero */
.hero{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: center;
  padding: 42px 0 18px;
}
.hero .lead{
  padding: clamp(14px, 2vw, 18px);
}
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: var(--sm);
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(30,64,175,.15);
  background: rgba(30,64,175,.04);
  backdrop-filter: blur(10px);
}

.eyebrow-dot{
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.15);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}
h1{
  margin: 10px 0 10px;
  font-size: var(--h1);
  line-height: 1.05;
  letter-spacing: -0.5px;
}
.sub{
  font-size: clamp(1.05rem, 1.25vw, 1.15rem);
  color: var(--muted);
  margin: 14px 0 22px;
}
.tags{
  display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 28px;
}
.tag{
  border: 1px solid rgba(30,64,175,.12);
  padding: 10px 16px; 
  border-radius: 999px; 
  font-size: var(--sm);
  font-weight: 500;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.tag:hover {
  transform: translateY(-2px);
  background: rgba(30,64,175,.06);
  border-color: rgba(30,64,175,.2);
  box-shadow: 0 6px 16px rgba(30,64,175,.15);
}
.actions{ display: flex; flex-wrap: wrap; gap: 10px }

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: var(--body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255,255,255,.85);
  position: relative;
  overflow: hidden;
}

/* Only enable will-change on hover-capable devices */
@media (hover: hover) {
  .btn {
    will-change: transform;
  }
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover{ 
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 24px rgba(10,14,26,.1);
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: translateY(0px) scale(0.98);
}

.btn > * {
  position: relative;
  z-index: 1;
}

.btn--primary{
  color: #fff;
  border: none;
  background: var(--gradient-primary);
  box-shadow: 0 10px 30px rgba(30,64,175,.3);
}

/* .btn--primary::after {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
} */

.btn--primary:hover{
  box-shadow: 0 16px 40px rgba(30,64,175,.4);
  transform: translateY(-3px) scale(1.03);
  color: #fff;
}

.btn--primary:hover > * {
  color: #fff;
}

.btn--ghost{ 
  background: rgba(255,255,255,.9);
  border-color: rgba(30,64,175,.15);
}

.hero-card{
  padding: clamp(16px, 2vw, 18px);
  display: grid; gap: 12px;
}
.hero-list{
  display: grid; gap: 8px; margin: 8px 0;
  font-size: var(--body);
}
.li{
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid rgba(30,64,175,.1);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.li:hover {
  background: rgba(30,64,175,.04);
  border-color: rgba(30,64,175,.2);
  transform: translateX(4px);
}
.tick{
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--gradient-primary);
  box-shadow: 0 8px 16px rgba(30,64,175,.25);
  margin-top: 2px;
  position: relative;
  flex: 0 0 20px;
  animation: tickSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes tickSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.tick:after{
  content: "";
  position: absolute; inset: 0;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="white"><path d="M20.285 6.709a1 1 0 0 1 0 1.414l-9.192 9.192a1 1 0 0 1-1.414 0L3.715 11.55a1 1 0 0 1 1.414-1.414l5.142 5.142 8.485-8.485a1 1 0 0 1 1.529-.084z"/></svg>') center/14px 14px no-repeat;
  background: #fff;
  opacity: .95;
}

.li:nth-child(1) .tick { animation-delay: 0.1s; }
.li:nth-child(2) .tick { animation-delay: 0.2s; }
.li:nth-child(3) .tick { animation-delay: 0.3s; }

/* Sections */
section{ margin: 18px 0 }
.section-head{
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 20px;
}
.section-head h2{
  font-size: var(--h2); margin: 0; letter-spacing: -.2px;
}
.section-sub{ 
  color: var(--muted); 
  font-size: var(--body);
  max-width: 600px;
}

.grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card{
  padding: clamp(16px, 2vw, 22px);
  display: grid;
  gap: 12px;
}
.icon{
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--gradient-primary);
  box-shadow: 0 10px 25px rgba(30,64,175,.3);
  display: grid; place-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .icon {
  transform: translateY(-4px) rotate(5deg) scale(1.05);
  box-shadow: 0 15px 35px rgba(30,64,175,.4);
}

.icon svg{ 
  width: 22px; height: 22px; color: #fff;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .icon svg {
  transform: scale(1.1);
}
.card h3{ font-size: var(--h3); margin: 4px 0 2px }
.card p{ margin: 0; color: var(--muted) }
.card ul{ margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: var(--body); color: var(--fg) }
.card li{ display: flex; align-items: center; gap: 8px }
.dot{
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,.12);
  flex: 0 0 8px;
  animation: dotPulse 2.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.card li:nth-child(1) .dot { animation-delay: 0s; }
.card li:nth-child(2) .dot { animation-delay: 0.3s; }
.card li:nth-child(3) .dot { animation-delay: 0.6s; }

/* About / CTA */
.about{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}
.about .glass{ padding: clamp(16px, 2vw, 22px) }

.cta{
  display: grid; gap: 12px;
  align-items: center;
  padding: clamp(18px, 2vw, 22px);
  background: var(--gradient-subtle);
}
.cta h3{ margin: 0; font-size: var(--h2) }
.cta p{ margin: 0; color: var(--muted) }

/* Footer - Simple and integrated */
footer{
  margin-top: 80px;
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: var(--sm);
  text-align: center;
}

/* No reveal animations - instant display */
.reveal{ 
  opacity: 1; 
  transform: none;
}

/* Enhanced Responsive Design */
@media (max-width: 960px){
  .hero{ 
    grid-template-columns: 1fr; 
    gap: 20px;
    padding: 32px 0 18px;
  }
  .about{ grid-template-columns: 1fr; gap: 20px; }
  .grid{ 
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  /* Mobile header */
  .nav-inner {
    padding: 20px 0;
  }
  
  .menu-btn{ 
    display: flex;
  }
  
  .nav-links{ 
    display: none;
  }
  
  .nav.open .nav-links{
    display: flex;
    flex-direction: column;
    position: absolute; 
    left: 0; 
    right: 0; 
    top: 100%;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(24px);
    padding: 20px;
    border: 1px solid rgba(30,64,175,.1);
    border-radius: 12px;
    gap: 4px;
    animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(10,14,26,.12);
    margin-top: 12px;
    z-index: 100;
  }
  
  .nav.open .nav-links a {
    padding: 14px 20px;
    text-align: left;
  }
  
  .nav-cta{ 
    margin-left: 0;
    margin-top: 8px;
  }
  
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* Mobile card enhancements */
  .card {
    padding: 20px;
  }
  
  .hero-card {
    padding: 20px;
  }
  
  .li {
    padding: 12px 14px;
    transition: all 0.3s ease;
  }
  
  .li:active {
    transform: scale(0.98);
    background: rgba(30,64,175,.04);
  }
}

@media (max-width: 640px){
  .grid{ 
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .wrap{ width: min(100%, 94vw) }
  
  h1 {
    letter-spacing: -1px;
  }
  
  /* Better mobile spacing */
  section {
    margin: 24px 0;
  }
  
  .actions {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Touch-friendly targets */
  .nav-links a,
  .btn {
    min-height: 44px;
  }
  
  /* Footer mobile adjustments */
  footer {
    margin-top: 60px;
    padding: 24px 0 40px;
  }
}

/* Respect reduced motion - Performance critical */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal{ transition: none; opacity: 1; transform: none }
  .btn:hover{ transform: none }
  .glass:hover { transform: none; }
  .card:hover .icon { transform: none; }
}

/* Mobile performance optimizations */
@media (max-width: 960px) {
  /* Disable expensive filters on mobile */
  .backdrop {
    filter: blur(40px) saturate(120%);
  }
  
  /* Reduce backdrop-filter blur on mobile */
  .glass,
  .tag,
  .btn,
  .nav.open .nav-links {
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
  }
  
  /* Disable complex animations on mobile */
  .eyebrow-dot,
  .dot,
  .tick {
    animation: none;
  }
  
  /* Simplify hover effects for touch devices */
  .li:hover {
    transform: none;
  }
  
  .tag:hover {
    transform: none;
    box-shadow: none;
  }
}
