/* ===== DESIGN TOKENS ===== */
:root {
  --color-bg: #08090a;
  --color-bg-panel: #0f1011;
  --color-bg-surface: #191a1b;
  --color-bg-hover: #28282c;
  --color-text-primary: #f7f8f8;
  --color-text-secondary: #d0d6e0;
  --color-text-tertiary: #8a8f98;
  --color-text-quaternary: #62666d;
  --color-accent: #5e6ad2;
  --color-accent-bright: #7170ff;
  --color-accent-hover: #828fff;
  --color-border-subtle: rgba(255, 255, 255, 0.04);
  --color-border: rgba(255, 255, 255, 0.06);
  --color-border-solid: #23252a;
  --color-success: #10b981;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-full: 9999px;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--color-bg);
  color: var(--color-text-secondary);
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  font-feature-settings: "cv01", "ss03";
}

input, button, textarea, select {
  font-family: inherit;
  font-feature-settings: "cv01", "ss03";
}

::selection {
  color: var(--color-text-primary);
  background: rgba(94, 106, 210, 0.3);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border-solid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-bg-hover); }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
ol, ul, menu { list-style: none; }

/* ===== TYPOGRAPHY ===== */
.overline {
  color: var(--color-text-quaternary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 500;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 510;
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 16px;
  color: var(--color-text-tertiary);
  max-width: 560px;
  line-height: 1.7;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

section {
  padding: 100px 0;
}

/* ===== BUTTONS ===== */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn-large {
  padding: 12px 32px;
  font-size: 16px;
}

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(8, 9, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

#navbar.scrolled {
  border-bottom-color: var(--color-border-subtle);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.4px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desktop-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.desktop-nav button {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color 0.2s;
}
.desktop-nav button:hover {
  color: var(--color-text-primary);
}

.cta-btn {
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 14px;
  font-weight: 500;
  margin-left: 16px;
  transition: background 0.2s;
}
.cta-btn:hover {
  background: var(--color-accent-hover);
}

.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 18px;
}

/* Mobile Menu Dropdown */
.mobile-menu {
  display: none;
  padding: 8px 32px 16px;
  border-top: 1px solid var(--color-border-subtle);
}
.mobile-menu.active {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu button {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  text-align: left;
  width: 100%;
}
.mobile-menu button:hover {
  color: var(--color-text-primary);
}

/* ===== HERO ===== */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 32px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-glow--1 {
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 900px;
  background: radial-gradient(circle, rgba(94, 106, 210, 0.06) 0%, transparent 70%);
}

.hero-glow--2 {
  bottom: 10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(113, 112, 255, 0.04) 0%, transparent 70%);
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  background: rgba(94, 106, 210, 0.12);
  color: var(--color-accent-bright);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: 0.2px;
}

#hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 510;
  color: var(--color-text-primary);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

#hero p {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--color-text-tertiary);
  max-width: 620px;
  margin: 0 auto 44px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== ABOUT ===== */
#about {
  background: var(--color-bg-panel);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.about-content {
  max-width: 800px;
}

.about-content p {
  font-size: 16px;
  color: var(--color-text-tertiary);
  line-height: 1.8;
  margin-bottom: 20px;
}
.about-content p:last-child {
  margin-bottom: 0;
}

/* ===== SERVICES ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.service-card {
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: border-color 0.3s, background 0.3s;
}
.service-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
}

.service-icon {
  margin-bottom: 14px;
  color: var(--color-accent-bright);
  display: inline-flex;
  align-items: center;
}

.service-card h3 {
  font-size: 17px;
  font-weight: 590;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.service-card p {
  font-size: 14px;
  color: var(--color-text-tertiary);
  line-height: 1.65;
}

/* ===== AMI DASHBOARD ===== */
#ami {
  background: var(--color-bg-panel);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: center;
}

.ami-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ami-dashboard {
  width: 100%;
  max-width: 1000px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-top: 40px;
  text-align: left;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.ami-dashboard-header {
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

#ami-dashboard h3 {
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent-bright);
  margin-top: 28px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(113, 112, 255, 0.15);
  padding-bottom: 6px;
}

#ami-dashboard h3:first-of-type {
  margin-top: 0;
}

#ami-dashboard p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

#ami-dashboard ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

#ami-dashboard li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

#ami-dashboard li::marker {
  color: var(--color-accent-bright);
  font-weight: bold;
}

#ami-dashboard strong {
  color: var(--color-text-primary);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-accent-bright);
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== PORTFOLIO ===== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  display: block;
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: 0.3s;
}
.project-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.025);
  transform: translateY(-2px);
}

.project-label {
  font-size: 12px;
  font-weight: 510;
  color: var(--color-text-quaternary);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 10px;
}

.project-card h3 {
  font-size: 18px;
  font-weight: 590;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.project-card p {
  font-size: 14px;
  color: var(--color-text-tertiary);
  line-height: 1.6;
}

.project-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent-bright);
}

/* ===== CONTACT ===== */
#contact {
  background: var(--color-bg-panel);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: center;
}

.contact-content {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 36px;
}

.contact-email {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-accent-bright);
  transition: color 0.2s;
}
.contact-email:hover {
  color: var(--color-accent-hover);
}

.contact-location {
  font-size: 15px;
  color: var(--color-text-tertiary);
}

/* ===== FOOTER ===== */
footer {
  padding: 40px 32px;
  text-align: center;
  border-top: 1px solid var(--color-border-subtle);
}

footer p {
  font-size: 13px;
  color: var(--color-text-quaternary);
}

/* ===== ANIMATIONS ===== */
.animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

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

.animate-card {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.animate-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-sm {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.animate-sm.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .desktop-nav { display: none !important; }
  .cta-btn { display: none !important; }
  .mobile-toggle { display: flex !important; }

  section { padding: 70px 0; }
  .container { padding: 0 20px; }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .trades-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  #hero { padding: 100px 20px 60px; }

  .hero-glow--1 { width: 500px; height: 500px; }
  .hero-glow--2 { width: 250px; height: 250px; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 280px; text-align: center; }
}
