/* =========================================================
   PerraTech — styles.css (STABLE)
   Doel: stabilisatie + voorspelbaarheid (1 definitieve versie per component)
   Let op: geen redesign, alleen opschonen van dubbele/strijdige regels.
   ========================================================= */

/* =====================
   0) Tokens / Base
   ===================== */
:root{
  --bg-dark:#0d0d10;
  --bg-darker:#0b0b0e;
  --bg-light:#f8fafb;

  --fg-dark:#0f172a;
  --fg-light:#e5e7eb;

  --muted:#eef2f6;

  --primary:#00c2ff;
  --primary-strong:#1dd0ff;

  --card-dark:#121218;
  --card-light:#ffffff;

  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Calm glow / elevation */
  --shadow-glow: 0 0 28px rgba(0,194,255,0.35);
  --e1-shadow: 0 10px 30px rgba(15,23,42,0.08);
  --e2-shadow: 0 18px 54px rgba(2,6,23,0.18);
  --e3-shadow: 0 24px 70px rgba(2,6,23,0.26);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
html{ scroll-behavior:smooth; }
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--fg-dark);
  background: var(--bg-light);
}

a{ text-decoration:none; color:inherit; }

.container{ max-width:1200px; margin:0 auto; padding:0 24px; }

/* Anchor offset so sections don't hide under sticky header */
[id]{ scroll-margin-top: 88px; }
@media (max-width: 768px){
  [id]{ scroll-margin-top: 72px; }
}

/* =====================
   1) Header / Navigation
   ===================== */
header{
  position: sticky;
  top: 0;
  z-index: 50;

  background: linear-gradient(90deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  backdrop-filter: saturate(180%) blur(10px);

  border-bottom: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 8px 26px rgba(15,23,42,0.08);
}

header .inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height: 72px;
}

.logo{
  font-size: clamp(19px, 2.1vw, 24px);
  font-weight: 800;
  letter-spacing: -0.15px;
  line-height: 1;
}

.logo span{
  background: linear-gradient(90deg, var(--primary), #6ae1ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

header nav{
  display:flex;
  align-items:center;
}

header nav a{
  margin-left: 20px;
  opacity: .9;
  font-weight: 600;
  position: relative;
}

header nav a:hover{ opacity:1; }

/* underline animation */
header nav a::after{
  content:'';
  position:absolute;
  left:0;
  bottom:-6px;
  width:0%;
  height:2px;
  background: var(--primary);
  transition: width .25s ease;
}
header nav a:hover::after{ width:100%; }
header nav a.active::after{ width:100%; }

/* Shrink state */
header.shrink{
  box-shadow: 0 14px 40px rgba(15,23,42,0.10);
  background: linear-gradient(90deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}
header.shrink .inner{ height:56px; transition: height .2s ease; }
header.shrink .logo{ font-size: clamp(18px, 1.9vw, 22px); transition: font-size .2s ease; }

/* Mobile toggle button (hamburger) */
.nav-toggle{
  display:none;
  border:none;
  background: transparent;
  padding: 0;
  cursor:pointer;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 5px;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.nav-toggle:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(0,194,255,0.18);
}
.nav-toggle-line{
  display:block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: rgba(15,23,42,0.92);
}

/* =====================
   2) Sections / Backgrounds
   ===================== */
section{ padding: 84px 0; }
.section{ padding: 84px 0; } /* (HTML uses .section in a few places) */

.section-light{ background: var(--bg-light); }
.section-muted{ background: var(--muted); }

.section-dark{
  color: var(--fg-light);
  background:
    radial-gradient(800px 400px at 10% -20%, rgba(0,194,255,0.18), transparent 60%),
    radial-gradient(600px 300px at 110% 0%, rgba(138,43,226,0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-dark), var(--bg-darker));
}

/* =====================
   3) Buttons
   ===================== */
.btn{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}

.btn-primary{
  background: linear-gradient(90deg, var(--primary), #6ae1ff);
  color: #001018;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(0,194,255,0.28);
  filter: saturate(110%);
}
.btn-primary:active{
  transform: translateY(0);
  box-shadow: 0 6px 22px rgba(0,194,255,0.22);
}

.btn-glass{
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--fg-light);
}
.btn-glass:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.12);
}
.btn-glass:active{ transform: translateY(0); }

.btn:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(0,194,255,0.25);
}

/* =====================
   4) Hero
   ===================== */
.hero{
  position: relative;
  overflow: hidden;
  padding: 110px 0 120px;
}
.mesh{
  position:absolute;
  inset:-10%;
  z-index:-1;
  background:
    radial-gradient(600px 200px at 70% 20%, rgba(0,194,255,.15), transparent 60%),
    radial-gradient(400px 160px at 20% 80%, rgba(138,43,226,.12), transparent 60%);
  filter: blur(30px);
  animation: float 12s ease-in-out infinite alternate;
}
@keyframes float{ from{ transform:translateY(-10px); } to{ transform:translateY(10px); } }

.hero-minimal{ padding-top: 10px; }

.hero-inner{ display:grid; grid-template-columns: 1fr; gap: 22px; }
.hero-left{ min-width: 0; }

.hero-logo{
  font-size: clamp(48px, 7.5vw, 80px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1;
}
.hero-logo span{
  background: linear-gradient(90deg, var(--primary), #6ae1ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-tagline{
  max-width: 28ch;
  font-size: clamp(30px, 4.0vw, 44px);
  line-height: 1.16;
  font-weight: 520;
  letter-spacing: -0.01em;
  margin: 0;
  opacity: .92;
}
.hero-cta{
  margin-top: 56px;
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-cta .btn{
  min-width: 160px;
  justify-content: center;
}

/* =====================
   5) Layout helpers / Grids
   ===================== */
.grid{ display:grid; gap: 22px; }
.grid-3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4{ grid-template-columns: repeat(4, minmax(0,1fr)); }

@media (max-width: 1024px){
  .grid-3{ grid-template-columns: repeat(2, 1fr); }
  .grid-4{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .grid-3, .grid-4{ grid-template-columns: 1fr; }
}

/* =====================
   6) Cards (generic)
   ===================== */
.card{
  border-radius: var(--radius-md);
  padding: 22px;
  border: 1px solid rgba(15,23,42,0.08);
  background: var(--card-light);
  box-shadow: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display:flex;
  flex-direction: column;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--e1-shadow);
  border-color: rgba(15,23,42,0.12);
}
.card h3{ margin: 6px 0 8px; font-size: 18px; }

.muted{ opacity: .75; }

/* Dark card (used in dark sections + some blocks) */
.card-dark{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  border: 1px solid rgba(255,255,255,0.08);
}
.section-dark .card{
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.section-dark .card:hover{
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(0,194,255,0.18), var(--e2-shadow);
  border-color: rgba(0,194,255,0.22);
}

/* =====================
   7) Products (Services)
   ===================== */
.services-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 32px;
  margin-top: 40px;
}
@media (max-width: 1024px){
  .services-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px){
  .services-grid{ grid-template-columns: 1fr; }
}

/* Dark product cards (PerraTech style) */
.dot-accent{ color: var(--primary); font-weight: inherit; }
.os-accent{ color: var(--primary); font-weight: inherit; }

.service-card{
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(11,11,14,0.98));
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: var(--radius-md);
  padding: 24px;
  display:flex;
  flex-direction: column;
  box-shadow: 0 18px 44px rgba(2,6,23,0.28);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.service-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 22px 60px rgba(2,6,23,0.34);
  border-color: rgba(0,194,255,0.38);
}

.service-card h3{
  margin: 0 0 10px;
  font-size: 20px;
  color: var(--fg-light);
}
.service-description{
  opacity: .86;
  line-height: 1.5;
  margin: 0 0 14px;
  font-weight: 600;
  color: var(--fg-light);
}

/* Equalize intro height on desktop for alignment */
@media (min-width: 769px){
  .service-description{ min-height: 4.8em; }
}

.service-features{
  margin: 0 0 20px;
  padding-left: 1.2em;
  opacity: .90;
  line-height: 1.6;
  color: var(--fg-light);
}
.service-features li{ margin-bottom: 10px; font-weight: 600; }
.service-features li:last-child{ margin-bottom: 0; }
.service-features li::marker{ color: var(--primary); }

/* Features toggle is mobile-only (JS toggles .features-expanded on card) */
#services .features-toggle{ display:none; }

/* Products title/subtitle spacing */
#services .section-title{ margin-bottom: 4px; }
#services .section-subtitle{
  margin-top: 0;
  margin-bottom: 22px;
  font-size: 15px;
  opacity: .72;
  font-weight: 600;
}

/* =====================
   8) About / Showcase tuning
   ===================== */
#hero{ padding-bottom: 80px; }
#services{ padding-top: 60px; }

/* About section should feel like a clean document */
#about{
  background: var(--bg-light);
  color: var(--fg-dark);
}
#about .card{
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}
#about .card:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}
#about .muted{ opacity: .8; }
#about.section-light{ padding-bottom: 72px; }

/* Visie cards: stronger weight in dark section */
#showcase .card.card-dark{
  background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(15,23,42,0.99));
  border: 1px solid rgba(148,163,184,0.45);
  box-shadow: 0 20px 50px rgba(15,23,42,0.85);
}
#showcase .card.card-dark:hover{
  border-color: rgba(56,189,248,0.9);
  box-shadow: 0 26px 70px rgba(56,189,248,0.45);
}

/* =====================
   9) Footer
   ===================== */
footer{
  color: var(--fg-light);
  background: linear-gradient(180deg,#0b0b0e,#09090b);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-grid{
  display:grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
}
@media (max-width: 780px){
  .footer-grid{ grid-template-columns: 1fr; }
}
.footer-container{ padding: 40px 24px; }

.footer-desc{
  opacity: .85;
  max-width: 520px;
  margin-top: 12px;
}
.footer-leados-link{
  color: var(--fg-light);
  font-weight: 650;
  opacity: 1;
}
.footer-leados-link:hover{ opacity: .9; }
.footer-desc .os-accent{
  font-weight: 750;
  font-size: 0.93em;
  letter-spacing: -0.01em;
}
.footer-demo-link{
  color: var(--primary);
  font-weight: 600;
  opacity: .9;
}
.footer-demo-link:hover{ text-decoration: none; }

.footer-bottom{
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 26px;
  padding-top: 16px;
  opacity: .7;
  font-size: 14px;
}
.footer-bottom .footer-tagline{
  margin-top: 8px;
  opacity: 1;
  font-size: inherit;
}

/* =====================
   10) Mobile
   ===================== */
@media (max-width: 768px){
  /* rhythm */
  section{ padding: 64px 0; }
  .container{ padding: 0 20px; }

  /* Header sizes */
  header .inner{ height: 60px; }
  header.shrink .inner{ height: 52px; }

  .logo{ font-size: 18px; letter-spacing: -0.2px; }

  /* Mobile nav: hidden by default, popover when open */
  .nav-toggle{ display:inline-flex; }

  header nav{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: fixed;
    top: 56px;
    right: 8px;
    left: auto;

    width: min(240px, calc(100vw - 16px));
    max-width: 240px;

    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 14px 40px rgba(2,6,23,0.18);

    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity .16s ease, transform .16s ease;
    z-index: 60;
  }
  header.nav-open nav{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  header nav a{
    width: 100%;
    display:block;
    margin: 0;
    margin-left: 0;
    padding: 10px 10px;
    border-radius: 10px;
    font-size: 15px;
    opacity: .92;
  }
  header nav a + a{ margin-top: 4px; }
  header nav a::after{ display:none; }
  header nav a:hover{ background: rgba(15,23,42,0.04); opacity: 1; }
  header nav a.active{ background: rgba(15,23,42,0.06); opacity: 1; }

  /* overlay only when open */
  header.nav-open::after{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.18);
    z-index: 40;
  }

  /* Hero: compact, scroll-first */
  .hero{ padding: 80px 0 64px; }
  .hero-minimal{ padding-top: 0; }
  .hero-tagline{
    font-size: 22px;
    line-height: 1.25;
    max-width: 26ch;
  }

  /* Mobile: hide hero CTAs */
  .hero-cta{ display:none; }

  /* Products: sit closer */
  #services{ padding-top: 52px; }

  .services-grid{ gap: 18px; margin-top: 22px; }
  .service-card{ padding: 18px; border-radius: 14px; }
  .service-card h3{ font-size: 18px; margin-bottom: 8px; }
  .service-description{ min-height: auto; font-size: 14.5px; margin-bottom: 12px; }
  .service-features{ margin-bottom: 10px; }

  /* Collapsed features on mobile */
  #services .service-card .service-features li:nth-child(n+4){ display:none; }
  #services .service-card.features-expanded .service-features li{ display:list-item; }

  /* Toggle button */
  #services .features-toggle{
    display: inline-block;
    appearance:none;
    border:none;
    background:none;
    padding: 4px 0;
    margin-top: 6px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    cursor:pointer;
    text-align:left;
  }
  #services .features-toggle:hover{ color: rgba(255,255,255,0.95); }
  #services .service-card.features-expanded .features-toggle{ color: rgba(255,255,255,0.90); }

  /* Products subtitle hidden on mobile */
  #services .section-subtitle{ display:none; }

  /* About: force single column for principles */
  #about .grid{ grid-template-columns: 1fr !important; }
  #about .card{ padding: 18px; }

  /* Showcase: single column + readable text */
  #showcase{ padding:56px 0; }
  #showcase p.muted br{ display:none; }
  #showcase .grid{ grid-template-columns: 1fr !important; gap:14px !important; }
  #showcase .card{ padding:18px; border-radius:14px; }
  #showcase .card:hover{ transform:none; }

  /* Footer: mobile order & density */
  #contact{ padding-top: 40px !important; }
  .footer-container{ padding: 28px 20px; }
  .footer-grid{
    display:flex;
    flex-direction: column;
    gap: 16px;
  }
  .footer-grid > div:nth-child(2){ order: 1; }
  .footer-grid > div:nth-child(3){ order: 2; }
  .footer-grid > div:nth-child(1){ order: 3; }

  footer h4{ font-size: 15px; }
  footer p{ font-size: 14px; line-height: 1.55; }

  .footer-bottom{
    margin-top: 18px;
    padding-top: 14px;
    font-size: 13px;
  }
  .footer-bottom .footer-tagline{ display:none; }
}

/* =====================
   11) Touch devices: no “jump” on hover
   ===================== */
@media (hover: none){
  .card:hover,
  .service-card:hover,
  .btn:hover{
    transform: none;
  }
}

/* =====================
   Mobile nav: vertical menu fix
   ===================== */
@media (max-width: 768px){
  header{
    position: sticky;
  }

  header.nav-open{
    position: relative;
  }

  header nav{
    position: absolute;
    top: 100%;
    right: 12px;
    left: auto;

    display: flex;
    flex-direction: column; /* 👈 vertical stack */
    align-items: stretch;

    gap: 4px;
  }

  header nav a{
    display: block;
    width: 100%;
    margin: 0;
    text-align: left;
  }
}
