/* ============================================
   Apt Systems — Brand Stylesheet
   Dark-first design, clean typography,
   trustworthy & modern
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Dark theme (default) */
  --bg-primary: #0a0a0b;
  --bg-secondary: #121214;
  --bg-tertiary: #1a1a1e;
  --bg-card: #161618;
  --bg-elevated: #1e1e22;

  --text-primary: #f0f0f2;
  --text-secondary: #a1a1aa;
  --text-tertiary: #6b6b76;
  --text-inverse: #0a0a0b;

  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-subtle: rgba(139, 92, 246, 0.08);
  --accent-glow: rgba(139, 92, 246, 0.15);

  --green: #22c55e;
  --green-subtle: rgba(34, 197, 94, 0.08);
  --blue: #3b82f6;
  --blue-subtle: rgba(59, 130, 246, 0.08);
  --amber: #f59e0b;
  --amber-subtle: rgba(245, 158, 11, 0.08);
  --rose: #f43f5e;
  --rose-subtle: rgba(244, 63, 94, 0.08);
  --cyan: #06b6d4;
  --cyan-subtle: rgba(6, 182, 212, 0.08);

  --border: #27272a;
  --border-light: #3f3f46;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);

  --max-width: 1200px;
  --header-height: 72px;
}

/* Light theme */
.light {
  --bg-primary: #fafafa;
  --bg-secondary: #f4f4f5;
  --bg-tertiary: #e9e9ed;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --text-inverse: #f0f0f2;

  --border: #e4e4e7;
  --border-light: #d4d4d8;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 3.5vw, 3rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { color: var(--text-secondary); max-width: 65ch; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

::selection { background: var(--accent); color: white; }

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.section-title { margin-bottom: 1rem; }
.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 3rem;
  line-height: 1.7;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--blue), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--font-sans);
  line-height: 1;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-light);
  transform: translateY(-1px);
}
.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }

/* --- Header --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.light header { background: rgba(250, 250, 250, 0.85); }
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo:hover { color: var(--text-primary); }
.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: white;
  font-weight: 700;
}
nav { display: flex; align-items: center; gap: 2rem; }
nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
nav a:hover { color: var(--text-primary); }
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.theme-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--header-height);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero h1 { margin-bottom: 1.5rem; }
.hero p {
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.hero-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.hero-card-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.hero-card-title { font-size: 0.9rem; font-weight: 600; }
.hero-card-subtitle { font-size: 0.8rem; color: var(--text-tertiary); }
.hero-card-message {
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.hero-card-message:last-child { margin-bottom: 0; }
.hero-card-message .tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}
.tag-user { background: var(--blue-subtle); color: var(--blue); }
.tag-luna { background: var(--accent-subtle); color: var(--accent); }
.hero-card-message p { font-size: 0.9rem; margin: 0; }

/* Background glow */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: -1;
}

/* --- Services --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.25s;
}
.service-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.service-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}
.service-card h3 { margin-bottom: 0.75rem; }
.service-card p { font-size: 0.9rem; line-height: 1.7; }

/* --- Use Cases --- */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.use-case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
}
.use-case-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.use-case-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}
.use-case-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}
.use-case-card p {
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.use-case-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* --- How It Works --- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  position: relative;
}
.step {
  text-align: left;
}
.step-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.step h3 { margin-bottom: 0.75rem; }
.step p { font-size: 0.9rem; line-height: 1.7; }

/* --- Deployment --- */
.deploy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.deploy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: all 0.25s;
}
.deploy-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.deploy-card .icon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}
.badge-cloud { background: var(--blue-subtle); color: var(--blue); }
.badge-onprem { background: var(--green-subtle); color: var(--green); }
.deploy-card h3 { margin-bottom: 0.75rem; }
.deploy-card p { font-size: 0.9rem; line-height: 1.7; margin-bottom: 1.5rem; }
.deploy-features { list-style: none; }
.deploy-features li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.deploy-features li::before {
  content: "→";
  color: var(--accent);
  flex-shrink: 0;
}

/* --- CTA --- */
.cta-section {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.cta-content h2 { margin-bottom: 1rem; }
.cta-content p { margin: 0 auto 2.5rem; }

/* --- Footer --- */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand p {
  font-size: 0.85rem;
  margin-top: 1rem;
  line-height: 1.7;
}
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* --- Legal Pages --- */
.legal-page {
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 80px;
}
.legal-page .container {
  max-width: 800px;
}
.legal-page h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 0.5rem;
}
.legal-page .last-updated {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 3rem;
  display: block;
}
.legal-page h2 {
  font-size: 1.4rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}
.legal-page h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.legal-page p, .legal-page li {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.legal-page ul, .legal-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.legal-page li { margin-bottom: 0.5rem; }
.legal-page .legal-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.legal-page .legal-nav a {
  font-size: 0.85rem;
  font-weight: 500;
}
.legal-highlight {
  background: var(--amber-subtle);
  border-left: 3px solid var(--amber);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}
.legal-highlight p { margin-bottom: 0; font-size: 0.9rem; }
.legal-highlight strong { color: var(--text-primary); }

/* --- Back to home --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
  .hero-visual { order: -1; }
  .hero-card { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  nav { display: none; }
  .mobile-menu-btn { display: flex; }
  
  .services-grid { grid-template-columns: 1fr; }
  .use-cases-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 2rem; }
  .deploy-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  
  .section { padding: 60px 0; }
  .hero { min-height: auto; padding-bottom: 60px; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
}

/* --- Mobile nav --- */
.mobile-nav-open nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 24px;
  gap: 1.25rem;
  align-items: flex-start;
}