:root {
  --primary: #00E676;
  --background: #0A0A0A;
  --text-secondary: #A0A0A0;
  --text-primary: #FFFFFF;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
html, body { height: 100%; }
body { background: linear-gradient(135deg, #0A0A0A 0%, #071207 100%); color: var(--text-primary); overflow-x: hidden; }
/* Prevent iOS Safari text inflation that can equalize font sizes */
html { -webkit-text-size-adjust: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2; }

header { padding: 18px 0; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 28px; font-weight: 700; color: var(--primary); text-decoration: none; }

nav a { color: var(--text-secondary); text-decoration: none; margin-left: 20px; font-size: 15px; }
nav a:hover { color: var(--primary); }
.btn { display: inline-block; padding: 10px 16px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.btn-primary { background: var(--primary); color: #042b12; }
.btn-primary:hover { filter: brightness(0.95); }

.hero { min-height: 0; padding: 24px 0 12px; margin-top: 158px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; position: relative; overflow: hidden; }
.hero h1 { font-size: 64px; font-weight: 700; margin-bottom: 36px; line-height: 1.1; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 22px; color: var(--text-secondary); max-width: 720px; margin-bottom: 28px; }
.hero > p:first-of-type { margin-top: 10px; }
.hero .sub { font-size: 18px; color: #d6d6d6; max-width: 760px; opacity: .95; margin-bottom: 0; }

.concepts { padding: 60px 0; position: relative; }
.hero.section-block + .concepts.section-block { padding-top: 60px; }
.concept-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 40px; align-items: stretch; align-content: center; }
.concept { display: block; flex: 1; min-width: 220px; max-width: 280px; padding: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.03); backdrop-filter: blur(0px); transition: transform .25s ease, background .25s ease, box-shadow .25s ease, backdrop-filter .25s ease; color: inherit; text-decoration: none; }
.concept:hover { transform: translateY(-6px); background: rgba(255,255,255,.085); backdrop-filter: blur(2px); box-shadow: 0 10px 30px rgba(0,230,118,.12); }
.concept:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.concept-icon { font-size: 36px; color: var(--primary); margin-bottom: 16px; text-align: center; }
.concept h3 { font-size: 22px; margin-bottom: 10px; font-weight: 700; text-align: center; }
.concept p {
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  /* Ensure exactly three visual lines for consistency */
  min-height: calc(1.6em * 3);
  max-height: calc(1.6em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Use Cases: make 3 tiles span same total width as 4-tile row */
@media (min-width: 769px) {
  /* Override default max width and flex to evenly occupy full row width
     with two 40px gaps between three tiles: (100% - 2*40px) / 3 */
  #use-cases .concept {
    flex: 0 0 calc((100% - 80px) / 3);
    width: calc((100% - 80px) / 3);
    max-width: none;
  }
}

/* Use-cases examples */
.example { margin-top: 12px; color: var(--text-secondary); font-size: 14px; line-height: 1.4; min-height: 67px; }
.example strong { color: var(--text-primary); }

/* Section headers and bridge */
.section-title { font-size: 38px; margin: 0 0 24px; text-align: center; }
.section-subtitle { color: var(--text-secondary); text-align: center; margin: 0 auto 32px; max-width: 760px; }
.section-bridge { padding: 32px 0 20px; text-align: center; }
.section-bridge .divider { height: 1px; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,230,118,.6), rgba(0,0,0,0)); margin: 6px auto 22px; max-width: 640px; opacity: .7; }

/* Zen divider between sections */
.section-block + .section-block::before {
  content: '';
  display: block;
  height: 1px;
  width: 66vw;
  max-width: 640px;
  margin: 24px auto 40px;
  opacity: .6;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,230,118,.6), rgba(0,0,0,0));
}

/* Increased top gap, normal bottom gap, between hero and next divider */
.hero.section-block + .section-block::before { margin: 188px auto 40px; }

/* Inset divider (within a section) */
.inset-divider { height: 1px; width: 66vw; max-width: 640px; margin: 24px auto 40px; opacity: .6; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,230,118,.6), rgba(0,0,0,0)); }
.inset-divider.inset-large { margin: 84px auto 40px; }

.about { padding: 60px 0; text-align: center; }
.about + .about { padding-top: 50px; }
.about h2 { font-size: 48px; margin: 0 0 18px; }
.about p { color: var(--text-secondary); max-width: 800px; margin: 0 auto; line-height: 1.8; font-size: 18px; }

footer { position: relative; z-index: 2; padding: 50px 0; border-top: 1px solid rgba(255,255,255,.1); }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 40px; }
.footer-info { max-width: 300px; }
.footer-info p { color: var(--text-secondary); margin-top: 20px; font-size: 14px; line-height: 1.6; }
.footer-links h4 { margin-bottom: 12px; font-weight: 600; font-size: 18px; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover, .footer-links a:focus-visible { color: var(--primary); outline: none; }
.copyright { margin-top: 30px; text-align: center; color: var(--text-secondary); font-size: 14px; }
.disclaimer { margin-top: 16px; font-size: 12px; color: var(--text-secondary); text-align: center; }

.molecules-container { position: fixed; width: 100%; height: 100%; top: 0; left: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.molecule { position: absolute; border: 1px solid rgba(0,230,118,.3); border-radius: 50%; opacity: .5; pointer-events: none; will-change: transform; }
.molecule:before { content: ''; position: absolute; width: 8px; height: 8px; background: var(--primary); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; }
.molecule:after { content: ''; position: absolute; width: 40px; height: 40px; border: 1px solid rgba(0,230,118,.2); border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; }

@keyframes float { 0% { transform: translate(0,0) rotate(0deg);} 25% { transform: translate(30px,-30px) rotate(5deg);} 50% { transform: translate(50px,0) rotate(10deg);} 75% { transform: translate(30px,30px) rotate(15deg);} 100% { transform: translate(0,50px) rotate(20deg);} }
@keyframes float2 { 0% { transform: translate(0,0) rotate(0deg);} 25% { transform: translate(-30px,30px) rotate(-5deg);} 50% { transform: translate(-50px,10px) rotate(-10deg);} 75% { transform: translate(-30px,-30px) rotate(-15deg);} 100% { transform: translate(0,-50px) rotate(-20deg);} }

/* Smooth, fluid pulse animation for molecule rings */
@keyframes ring-pulse {
  0% { 
    width: 40px;
    height: 40px;
    opacity: 0.15;
    border-color: rgba(0,230,118,.15);
  }
  25% {
    width: 65px;
    height: 65px;
    opacity: 0.35;
    border-color: rgba(0,230,118,.4);
  }
  50% { 
    width: 90px;
    height: 90px;
    opacity: 0.6;
    border-color: rgba(0,230,118,.7);
  }
  75% {
    width: 65px;
    height: 65px;
    opacity: 0.35;
    border-color: rgba(0,230,118,.4);
  }
  100% { 
    width: 40px;
    height: 40px;
    opacity: 0.15;
    border-color: rgba(0,230,118,.15);
  }
}

@keyframes center-glow {
  0% { 
    width: 8px;
    height: 8px;
    box-shadow: 0 0 20px rgba(0,230,118,.4);
  }
  25% {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 40px rgba(0,230,118,.6);
  }
  50% { 
    width: 14px;
    height: 14px;
    box-shadow: 0 0 80px rgba(0,230,118,.9), 0 0 120px rgba(0,230,118,.4);
  }
  75% {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 40px rgba(0,230,118,.6);
  }
  100% { 
    width: 8px;
    height: 8px;
    box-shadow: 0 0 20px rgba(0,230,118,.4);
  }
}

/* Apply animations to molecule elements with smooth cubic bezier */
.molecule:after { 
  animation: ring-pulse calc(var(--ring-duration, 35) * 1s) cubic-bezier(0.4, 0.0, 0.6, 1.0) infinite;
  animation-delay: calc(var(--delay, 0) * 1s);
}

.molecule:before {
  animation: center-glow calc(var(--glow-duration, 30) * 1s) cubic-bezier(0.4, 0.0, 0.6, 1.0) infinite;
  animation-delay: calc(var(--delay, 0) * 1s);
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .molecules-container { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
  /* Hide nav links except Contact Us button */
  .nav-link { display: none; }
  
  /* Hero spacing adjustments */
  .hero { min-height: 0; margin-top: 180px; padding: 24px 0 24px; }
  .hero.section-block + .concepts.section-block { padding-top: 60px; }
  .hero h1 { 
    /* Larger but responsive; shrink if needed */
    font-size: clamp(30px, 12vw, 52px);
    line-height: 1.12;
    margin-bottom: 48px;
    white-space: normal;
    text-wrap: balance;
    max-width: min(22ch, 92vw);
    margin-left: auto;
    margin-right: auto;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  .hero p { 
    font-size: 18px; 
    margin-bottom: 36px;
  }
  .hero > p:first-of-type { margin-top: 20px; }
  .hero .sub { margin-top: 16px; }
  
  .concept-container { flex-direction: column; align-items: center; }
  .concept { max-width: 320px; width: 100%; }
  .concept p { font-size: 18px; }
  .logo { font-size: 26px; }
  .section-block + .section-block::before { width: 80vw; max-width: 420px; margin: 20px auto 32px; }
  .inset-divider { width: 80vw; max-width: 420px; margin: 20px auto 32px; }
  .inset-divider.inset-large { margin: 80px auto 32px; }
  /* Mobile: also tighten the hero-to-divider gap */
  .hero.section-block + .section-block::before { margin: 163px auto 40px; }
  .hero.section-block + .concepts.section-block { padding-top: 60px; }
  /* Mobile: unify section title sizes */
  .section-title { font-size: 28px; }
  .about h2 { font-size: 28px; }
  /* Mobile: example text size */
  /* Higher specificity so it overrides `.concept p { font-size: 18px; }` */
  .concept .example { font-size: 14px; }
  /* Footer contact form: prevent horizontal overflow and add frosted look */
  footer .footer-links form > div { flex-direction: column; align-items: stretch; }
  footer .footer-links input,
  footer .footer-links textarea {
    width: 100% !important;
    min-width: 0 !important;
    background: rgba(255,255,255,.10) !important; /* less transparent */
    border: 1px solid rgba(255,255,255,.16) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 16px; /* prevent iOS zoom */
    transition: none; /* avoid visual size changes on focus */
  }
  /* Keep input height consistent while typing */
  footer .footer-links input[type="text"],
  footer .footer-links input[type="email"],
  footer .footer-links input[type="tel"],
  footer .footer-links input[type="search"] {
    height: 48px;
    line-height: 48px;
  }
  /* Keep textarea size stable; allow scroll instead of expansion */
  footer .footer-links textarea {
    height: 140px;
    min-height: 140px;
    max-height: 50vh;
    overflow: auto;
    resize: none;
    line-height: 1.4;
  }
}
