/* Shared design system for Exact IOT — linked by EVERY page via
   <link rel="stylesheet" href="/css/site.css">. Holds root vars, reset,
   nav + dropdown, footer, reveal animations and other 5-page-common rules.
   Page-specific CSS stays inline in each page's <style>. */

:root {
  --bg-deep: #0a0c10;
  --bg-surface: #111319;
  --bg-card: #161922;
  --accent: #00e5a0;
  --accent-dim: #00e5a020;
  --accent-mid: #00e5a050;
  --text-primary: #e8eaf0;
  --text-secondary: #8b8fa5;
  --text-muted: #555876;
  --border: #1e2130;
  --border-accent: #00e5a025;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) var(--bg-deep);
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-display);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── GRID BACKGROUND ─── */

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.25;
}

.grid-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 900px 600px at 50% 30%, var(--accent-dim), transparent 70%);
}

/* ─── NAV ─── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(1.2);
  background: rgba(10, 12, 16, 0.75);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-mark::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.6); }
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.12em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.3s;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--accent); }

/* ─── PROJECTS DROPDOWN ─── */

.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.nav-caret {
  font-size: 0.6rem;
  transition: transform 0.3s;
}

.nav-dropdown:hover .nav-caret,
.nav-dropdown.open .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  list-style: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.75rem;
  min-width: 210px;
  padding: 0.5rem 0;
  background: rgba(10, 12, 16, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 200;
}

/* bridge the hover gap between toggle and menu */

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: flex; }

.nav-dropdown-menu li { width: 100%; }

.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 1.3rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.3s, background 0.3s;
}

.nav-dropdown-menu a:hover {
  color: var(--accent);
  background: rgba(0, 229, 160, 0.08);
}

@media (max-width: 640px) {
  .nav-dropdown-toggle { justify-content: space-between; }

  .nav-dropdown-menu {
    position: static;
    margin-top: 0.9rem;
    min-width: 0;
    padding: 0 0 0 1rem;
    gap: 0.2rem;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  .nav-dropdown-menu::before { display: none; }

  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }

  .nav-dropdown:hover .nav-caret { transform: none; }
  .nav-dropdown.open .nav-caret { transform: rotate(180deg); }

  .nav-dropdown-menu a { padding: 0.35rem 0; font-size: 0.82rem; }
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s;
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-links.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 12, 16, 0.95);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  gap: 1.2rem;
  border-bottom: 1px solid var(--border);
}

/* Dashboard mock — reuse from main site */

.fv-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.fv-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.2rem;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}

.fv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.fv-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.6rem;
  letter-spacing: 0.03em;
}

.fv-content {
  padding: 1.5rem;
}

.fv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.fv-row:last-child { border-bottom: none; }

.fv-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fv-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ─── SECTION UTILITIES ─── */

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-tag::before {
  content: '//';
  opacity: 0.5;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

/* ─── FOOTER ─── */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 3rem 2.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-company {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.footer-location {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer-right {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s;
}

.footer-link:hover { color: var(--accent); }

/* ─── ANIMATIONS ─── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-primary:hover {
  background: #00ffb3;
  box-shadow: 0 0 30px var(--accent-dim);
  transform: translateY(-1px);
}

.btn-ghost:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
