/* -------- Theme tokens (emerald option 1) -------- */
:root{
  --emerald:#059669;      /* corporate emerald */
  --emerald-600:#047857;  /* deeper */
  --emerald-50:#ecfdf5;   /* pale background */
}

/* -------- Base -------- */
*{box-sizing:border-box}html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;background:#fff;color:#0a0a0a;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
}

/* Links inherit color (no blue) + emerald underline hover */
a, a:visited { color: inherit; text-decoration: none; }
a:hover { opacity:.95 }
.links a,
.muted a {
  position: relative;
  text-decoration: none;
  padding-bottom: 2px;
}
.links a::after,
.muted a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--emerald), var(--emerald-600));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.links a:hover::after,
.muted a:hover::after { transform: scaleX(1); }

/* Layout tokens */
.container{max-width:72rem;margin:0 auto;padding:0 1.5rem}
.section{padding:4rem 0;border-top:1px solid #e5e5e5}
.muted{color:#525252}.muted-2{color:#737373}

/* Headings */
h1,h2,h3,.brand-name{
  font-family:"Space Grotesk", Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial
}
h1{letter-spacing:-.02em}
.brand-name{font-weight:700;letter-spacing:.02em}

/* -------- Nav -------- */
.nav{position:sticky;top:0;z-index:50;border-bottom:1px solid #e5e5e5}
.glass{background:rgba(255,255,255,.85);backdrop-filter:saturate(140%) blur(10px)}
.nav-inner{display:flex;align-items:center;justify-content:space-between;padding:.8rem 0}
.brand-sub{font-size:11px;text-transform:uppercase;letter-spacing:.18em;color:#737373}
.links{display:none;gap:2rem}
.nav-cta{display:flex;align-items:center;gap:.5rem}
.cta{display:none}
.hamb{display:inline-flex;flex-direction:column;gap:4px;background:transparent;border:0}
.hamb span{width:22px;height:2px;background:#0a0a0a;display:block}
.logo{width:40px;height:40px;border-radius:12px;object-fit:cover}

.theme-toggle{
  border:1px solid #e5e5e5;background:#fff;color:#0a0a0a;
  border-radius:14px;padding:.45rem .6rem;cursor:pointer;display:inline-flex;gap:.25rem;align-items:center
}
.theme-toggle .icon-moon{display:none}

@media(min-width:768px){.links{display:flex}.cta{display:inline-flex}.hamb{display:none}}

/* --- Single-line desktop nav layout (prevents wrapping) --- */
@media (min-width: 1024px) {
  .nav-inner{
    display: grid;
    grid-template-columns: auto 1fr auto;  /* brand | links | actions */
    align-items: center;
    gap: 1rem;
    white-space: nowrap;                   /* keep one line */
  }
  .brand-sub{ display: none; }             /* remove second line under logo */
  .links{
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    min-width: 0;
  }
  .links a{
    font-size: 15px;
    white-space: nowrap;                   /* “What We Do” stays on one line */
  }
  .nav-cta .btn.cta{
    padding: .7rem 1rem;                   /* slimmer CTA so it doesn’t wrap */
    font-size: .95rem;
  }
  .theme-toggle{
    padding: .35rem .5rem;                 /* smaller toggle fits in one row */
  }
}

/* -------- Hero with subtle emerald tint -------- */
.heroGradient{
  background:
    radial-gradient(1200px 600px at 60% -20%, rgba(5,150,105,.10), transparent 60%),
    radial-gradient(1000px 500px at 10% 0%, rgba(5,150,105,.06), transparent 60%),
    linear-gradient(180deg,#fff 0%, #f7f7f7 100%);
}
.heroPad{padding:3.5rem 0}
@media(min-width:768px){.heroPad{padding:7.5rem 0 6rem}}
.lead{font-size:1.125rem;max-width:40rem}
.badge{
  display:inline-flex;align-items:center;gap:.35rem;
  padding:.35rem .6rem;border-radius:999px;background:var(--emerald-50);color:#0a0a0a;border:1px solid rgba(5,150,105,.35);font-size:12px
}

/* ==================== PRECISION INDUSTRIAL HERO ==================== */
.hero-title-precision{
  margin:.35rem 0 0 0;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.14em;
  line-height:1.05;
  font-size:clamp(2rem, 5vw, 3.75rem);
  color:#0a0a0a;
  position:relative;
  padding-bottom:.6rem; /* space for baseline */
}
/* Baseline: desktop only, animates with reveal */
@media(min-width:768px){
  .hero-title-precision::after{
    content:"";
    position:absolute; left:0; bottom:0;
    width:360px; max-width:55vw; height:1px;
    background:linear-gradient(90deg, var(--emerald), rgba(5,150,105,.0));
    transform:scaleX(0);
    transform-origin:left;
    transition:transform .6s ease .15s;
  }
  .reveal.on .hero-title-precision::after{
    transform:scaleX(1);
  }
}
.hero-sub-precision{ margin-top:.9rem; max-width:40rem; }
body.dark .hero-title-precision{ color:#e5e5e5; }

/* -------- Grids -------- */
.grid-3{display:grid;grid-template-columns:1fr;gap:1rem}
@media(min-width:768px){.grid-3{grid-template-columns:repeat(3,1fr)}}
.md-grid-2{display:grid;grid-template-columns:1fr;gap:2.5rem}
@media(min-width:768px){.md-grid-2{grid-template-columns:1fr 1fr}}

/* -------- Buttons (pill radius) -------- */
.btn{
  display:inline-flex;align-items:center;gap:.5rem;padding:.85rem 1.15rem;border-radius:999px;
  border:1px solid #e5e5e5;font-weight:600;text-decoration:none;transition:.2s ease;background:#fff;color:#0a0a0a
}
.btn-primary{
  background:var(--emerald);color:#fff;border-color:var(--emerald);
  box-shadow:0 6px 16px rgba(5,150,105,.22), 0 2px 6px rgba(5,150,105,.18)
}
.btn-primary:hover{background:var(--emerald-600);border-color:var(--emerald-600)}
.btn-ghost{background:#fff;border-color:#e5e5e5}
.btn-ghost:hover{background:#f5f5f5}
.btn-dark{background:#111;color:#fff;border-color:#111}
.btn:focus-visible{outline:3px solid rgba(5,150,105,.25);outline-offset:2px}

/* Uniform rows + vertical spacing in cards */
.btn-row{display:flex;flex-wrap:wrap;gap:1rem}
.card .btn{margin-top:1rem}

/* --- Fix anchor :visited overriding button colors --- */
.btn, .btn:visited { color: #0a0a0a; }
.btn-primary, .btn-primary:visited { color: #fff; }
.btn-dark, .btn-dark:visited { color: #fff; }
.btn-ghost, .btn-ghost:visited { color: #0a0a0a; }

/* -------- Chips with emerald outline -------- */
.chips{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}
.chip{
  border:1px solid rgba(5,150,105,.35);background:#fff;border-radius:999px;
  padding:.35rem .6rem;font-size:12px;color:#0a0a0a
}

/* -------- Cards & Featured -------- */
.card{
  border:1px solid #e5e5e5;border-radius:16px;background:#fff;padding:1.1rem;
  box-shadow:0 8px 24px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04)
}
.card-featured{border-color:var(--emerald-600)}

/* -------- Pilot visual with emerald grid -------- */
.pilot-frame{position:relative;aspect-ratio:16/10;border:1px solid #e5e5e5;border-radius:22px;background:linear-gradient(135deg,#fff,#f7f7f7);overflow:hidden}
.pilot-overlay{position:absolute;inset:0;opacity:.5;-webkit-mask-image:radial-gradient(ellipse at center,#fff,transparent 70%);mask-image:radial-gradient(ellipse at center,#fff,transparent 70%)}
.pilot-grid{
  width:100%;height:100%;
  background-image:linear-gradient(135deg, rgba(0,0,0,.08) 1px, transparent 1px);
  background-size:20px 20px;animation:pan 18s linear infinite
}
.pilot-grid-emerald{
  background-image:linear-gradient(135deg, rgba(5,150,105,.22) 1px, transparent 1px);
}
.pilot-meta{position:absolute;left:16px;right:16px;bottom:16px;display:flex;justify-content:space-between;color:#8a8a8a;font-size:12px}
@keyframes pan{0%{background-position:0% 0%}50%{background-position:100% 100%}100%{background-position:0% 0%}}

/* -------- Partners -------- */
.partners-strip{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem;margin-top:1rem}
@media(min-width:640px){.partners-strip{grid-template-columns:repeat(3,1fr)}}
@media(min-width:900px){.partners-strip{grid-template-columns:repeat(5,1fr)}}
.partner{display:flex;align-items:center;justify-content:center;padding:12px;border:1px dashed #e5e5e5;border-radius:12px;background:#fff}
.logo-mono{width:120px;height:36px;fill:#9ca3af}
.logo-mono rect{fill:#f3f4f6}
.logo-mono text{fill:#6b7280;font:600 12px Inter, Arial, sans-serif}

/* -------- Testimonials -------- */
.quote blockquote{margin:0 0 .75rem 0;line-height:1.6}
.quote figcaption{font-size:.9rem;color:#737373}

/* -------- Form -------- */
.form{display:grid;gap:1rem}
.form input,.form textarea{
  border:1px solid #e5e5e5;border-radius:12px;padding:12px;font:inherit
}
.form input:focus-visible,.form textarea:focus-visible{
  outline:3px solid rgba(5,150,105,.22);outline-offset:2px
}
.form-meta{display:flex;justify-content:space-between;align-items:center;gap:1rem}

/* -------- Footer -------- */
.footer{border-top:1px solid #e5e5e5}
.footer-inner{display:flex;flex-direction:column;gap:.5rem;align-items:center;justify-content:space-between;padding:2rem 0}
@media(min-width:768px){.footer-inner{flex-direction:row}}

/* -------- Reveal -------- */
.reveal{opacity:0;transform:translateY(20px);transition:opacity .6s ease, transform .6s ease}
.reveal.on{opacity:1;transform:translateY(0)}

/* === Emerald gradient halo around logo (spins on hover) === */
.logo-ring{
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  isolation: isolate;
}
.logo-ring::before{
  content:"";
  position:absolute; inset:-2px;
  border-radius: 16px;
  background: conic-gradient(from 210deg,
    rgba(5,150,105,0) 0%,
    rgba(5,150,105,.55) 40%,
    rgba(5,150,105,0) 80%);
  filter: blur(.4px);
  opacity: .55;
  transition: opacity .3s ease;
  z-index: 0;
}
.logo-ring::after{
  content:"";
  position:absolute; inset:0;
  border-radius: 12px;
  background: #fff;
  z-index: 0;
}
.logo{ position: relative; z-index: 1; }

.brand:hover .logo-ring::before{ opacity: .9; }

/* subtle elegant spin on hover */
@keyframes haloSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.brand:hover .logo-ring::before {
  animation: haloSpin 10s linear infinite;
  animation-delay: .2s;
}

/* ==================== DARK MODE ==================== */
body.dark{background:#0b0b0b;color:#e5e5e5}
body.dark .nav{border-bottom-color:#1f1f1f}
body.dark .glass{background:rgba(10,10,10,.72);backdrop-filter:saturate(160%) blur(10px)}
body.dark .brand-sub{color:#a3a3a3}
body.dark .section{border-top-color:#1f1f1f}
body.dark .card{background:#111;border-color:#1f1f1f;box-shadow:none}
body.dark .muted{color:#c7c7c7}
body.dark .muted-2{color:#a6a6a6}
body.dark .btn-ghost{background:transparent;border-color:#2a2a2a;color:#e5e5e5}
body.dark .btn-ghost:hover{background:#111}
body.dark .btn-dark{background:#0f0f0f}
body.dark .pilot-frame{background:linear-gradient(135deg,#0b0b0b,#111);border-color:#1f1f1f}
body.dark .pilot-meta{color:#9a9a9a}
body.dark .chip{background:#0e0e0e;border-color:rgba(5,150,105,.35);color:#e5e5e5}
body.dark .footer{border-top-color:#1f1f1f}
body.dark .badge{background:#0e1714;border-color:rgba(5,150,105,.35);color:#e5e5e5}
body.dark .heroGradient{
  background:
    radial-gradient(1200px 600px at 60% -20%, rgba(5,150,105,.12), transparent 60%),
    radial-gradient(1000px 500px at 10% 0%, rgba(5,150,105,.08), transparent 60%),
    linear-gradient(180deg,#0b0b0b 0%, #0f0f0f 100%);
}
body.dark .partner{background:#0f0f0f;border-color:#1f1f1f}
body.dark .logo-mono rect{fill:#0b0b0b}
body.dark .logo-mono text{fill:#c7c7c7}
body.dark .logo-ring::after { background:#0f0f0f; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .links a::after,
  .muted a::after,
  .logo-ring::before,
  .hero-title-precision::after { transition: none; }
}

/* === animated bottom emerald glow (light + dark) === */
/* JS will update --glow-intensity between ~0.10 and ~0.30 */
:root { --glow-intensity: .12; }

body::after {
  content:"";
  position:fixed;
  bottom:-20vh;
  left:50%;
  transform:translateX(-50%);
  width:140vw;
  height:70vh;
  pointer-events:none;
  z-index:-1;
  background:radial-gradient(
    circle at bottom center,
    rgba(16,185,129,0.25) 0%,
    rgba(16,185,129,0.0) 65%
  );
  filter:blur(60px);
  opacity: var(--glow-intensity);
  transition: opacity .4s ease;
}
