@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght=300;400;500;600;700;800&family=Geist:wght=300;400;500;600;700;800&display=swap');

:root {
  /* Colors - Sleek Black and Gray Tone System */
  --background: #fafafa;
  --foreground: #09090b;

  --card: #ffffff;
  --card-foreground: #09090b;

  --popover: #ffffff;
  --popover-foreground: #09090b;

  --primary: #09090b;
  --primary-foreground: #ffffff;
  --primary-glow: rgba(9, 9, 11, 0.05);

  --secondary: #f4f4f5;
  --secondary-foreground: #09090b;

  --muted: #f4f4f5;
  --muted-foreground: #71717a;

  --accent: #f4f4f5;
  --accent-foreground: #09090b;

  --destructive: #ef4444;
  --destructive-foreground: #ffffff;

  --border: #e4e4e7;
  --input: #f4f4f5;
  --ring: #18181b;

  --radius-lg: 0.75rem;
  --radius-md: 0.5rem;
  --radius-sm: 0.25rem;

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-sans);
}

[data-theme="dark"] {
  --background: #09090b;
  --foreground: #f4f4f5;

  --card: #0c0c0e;
  --card-foreground: #f4f4f5;

  --popover: #0c0c0e;
  --popover-foreground: #f4f4f5;

  --primary: #f4f4f5;
  --primary-foreground: #09090b;
  --primary-glow: rgba(244, 244, 245, 0.1);

  --secondary: #18181b;
  --secondary-foreground: #f4f4f5;

  --muted: #121214;
  --muted-foreground: #a1a1aa;

  --accent: #18181b;
  --accent-foreground: #f4f4f5;

  --border: #18181b;
  --input: #121214;
  --ring: #f4f4f5;
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
}

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Unified Fluid Media Adjustments */
@media (max-width: 900px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .flex-mobile-col {
    flex-direction: column;
  }
}

/* Page spacing for floating header */
main {
  padding-top: 8rem;
}

/* Header (Floating Capsule Navigation) */
header {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 3rem);
  max-width: 1100px;
  z-index: 100;
  background-color: rgba(250, 250, 250, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] header {
  background-color: rgba(9, 9, 11, 0.75);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding: 0 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--foreground);
}

.logo img {
  height: 28px;
  width: auto;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

/* Dropdown Menu styling */
.nav-item-dropdown {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.15s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--foreground);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  width: 260px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  list-style: none;
  z-index: 110;
}

.dropdown-menu li a {
  display: block;
  padding: 0.6rem 0.8rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.dropdown-menu li a:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.nav-item-dropdown:hover .dropdown-menu {
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--accent);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background-color: var(--secondary);
}

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--secondary);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  background-color: var(--secondary);
  color: var(--foreground);
  margin-bottom: 1rem;
}

/* Cards */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--card-foreground);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--foreground);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* Hero Section */
.hero-section {
  position: relative;
  padding: 4rem 0;
  overflow: hidden;
  background-image: radial-gradient(var(--border) 0.75px, transparent 0.75px);
  background-size: 20px 20px;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted-foreground);
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

@media (max-width: 600px) {
  .hero-title { font-size: 2.25rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: center; width: 100%; }
  .hero-actions .btn { width: 100%; max-width: 300px; }
}

/* Details Page Showcases */
.showcase-header {
  padding: 4rem 0 2rem 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
  
  /* ADDED: Ensures the element container itself is centered on the page */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.showcase-header h2 {
  font-size: 2.75rem;
}

/* Dashboard Mock Widget */
.dashboard-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  min-height: 450px; /* Safe fluid fallback layout instead of hard aspect-ratio */
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  height: 3.5rem;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dashboard-window-dots {
  display: flex;
  gap: 6px;
}

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

.dashboard-dot:nth-child(1) { background-color: #e4e4e7; }
.dashboard-dot:nth-child(2) { background-color: #d4d4d8; }
.dashboard-dot:nth-child(3) { background-color: #a1a1aa; }

.dashboard-nav-tabs {
  display: flex;
  gap: 0.25rem;
}

.dashboard-tab {
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: all 0.2s;
  white-space: nowrap;
}

.dashboard-tab.active {
  background-color: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.dashboard-body {
  flex: 1;
  display: flex;
  background-color: var(--background);
}

.dashboard-sidebar {
  width: 200px;
  border-right: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: var(--muted);
}

.dashboard-content-area {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* Chat Simulator Components */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.chat-bubble.inbound {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

.chat-bubble.outbound {
  background-color: var(--primary);
  color: var(--primary-foreground);
  align-self: flex-end;
  border-bottom-right-radius: 0;
}

/* Forms Alignment and Responsive Handling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  font-family: var(--font-sans);
  outline: none;
  font-size: 16px; /* Optimized layout parameter to stop iOS input zooming */
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Contact Showcase Grid Realignment */
.grid-showcase {
  display: grid;
  grid-template-columns: 1.20fr 1fr;
  gap: 5rem;
  align-items: center;
  justify-content: center;
  justify-items: center;
  margin-bottom: 6rem;
}

.estimator-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: sticky;
  top: 7.5rem;
  width: 100%;
}

@media (max-width: 900px) {
  .grid-showcase {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .estimator-box {
    position: static;
  }
}

/* Native Dialog Structural Bounds */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  background-color: var(--card);
  color: var(--card-foreground);
  width: calc(100% - 2rem);
  max-width: 450px;
  margin: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Footer Layout Realignment */
footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem 0;
  background-color: var(--muted);
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.footer-column h4 {
  color: var(--foreground);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--foreground);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-legal-links a {
  color: var(--muted-foreground);
  font-size: 0.8rem;
  text-decoration: none;
}

@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
}

/* Mobile Hamburger Menu Logic Adjustments */
.menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  header {
    width: calc(100% - 1.5rem);
    border-radius: 24px;
    top: 0.75rem;
  }

  .nav-container {
    padding: 0 1.25rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-actions {
    display: none; /* Hide wide header layout links on compact layout */
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 4.5rem;
    left: 0;
    right: 0;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    width: 100%;
  }

  .nav-links.show {
    display: flex;
  }

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

  .nav-item-dropdown.active-mobile .dropdown-menu {
    display: block;
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
  }
  
  .dashboard-body {
    flex-direction: column;
  }

  .dashboard-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }

  .sidebar-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0;
  }
}

/* Checkbox Cards Custom Rendering Alignment */
.checkbox-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.checkbox-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-card::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1px solid var(--muted-foreground);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.checkbox-card.selected::before {
  background: var(--foreground);
  border-color: var(--foreground);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Social Rack Container Configuration */
.footer-socials {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}

.footer-socials .social-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--secondary);
  border: 1px solid var(--border);
}

.footer-socials .social-link svg {
  width: 18px !important;
  height: 18px !important;
  stroke: var(--muted-foreground) !important;
  fill: none !important;
}

/* Reveal Elements Definitions */
.reveal-hidden {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.stagger-1 { transition-delay: 100ms; }
.stagger-2 { transition-delay: 200ms; }
.stagger-3 { transition-delay: 300ms; }

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

.hero-animate {
  animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 768px) {
  /* ... your other mobile responsive settings ... */

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  #themeToggle {
    display: flex !important;
  }
}

/* Base Desktop configuration */
.mobile-header-actions {
  display: none;
}

/* Base Styles: Hide the mobile action wrapper on desktops */
.mobile-header-actions {
  display: none;
}

/* Inside your existing Mobile Media Query block */
@media (max-width: 768px) {
  .nav-actions {
    display: none !important; /* Safely hides the desktop CTA block */
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Puts a clean gap between dark mode and hamburger icons */
  }

  .menu-toggle {
    display: flex !important;
  }
}

/* Bulletproof fix for dynamically loaded layout heights */
footer, 
#footer-placeholder {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: max-content !important;
  clear: both !important;
  background-color: var(--muted) !important; /* Forces the background down */
  padding: 4rem 0 2rem 0 !important;
  border-top: 1px solid var(--border) !important;
}

/* Fix grid inner calculation collapse */
.footer-grid {
  display: grid !important;
  width: 100% !important;
  height: auto !important;
}