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

/* ==========================================
   1. DESIGN SYSTEM & CSS VARIABLES
   ========================================== */
:root {
  /* Color Palette - Obsidian Space theme */
  --bg-primary: #080c14;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Neons */
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-violet: #7f00ff;
  --accent-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 50%, var(--accent-violet) 100%);
  --text-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  
  /* Glassmorphism settings */
  --glass-bg: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(0, 242, 254, 0.3);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --glass-blur: blur(12px);

  /* Layout */
  --container-max-width: 1200px;
  --header-height: 80px;
}

/* ==========================================
   2. RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* ==========================================
   3. TYPOGRAPHY & UTILITIES
   ========================================== */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  color: var(--text-secondary);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px 0 rgba(0, 242, 254, 0.15);
}

/* ==========================================
   4. NAVIGATION HEADER
   ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(8, 12, 20, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  max-width: var(--container-max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

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

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.25rem 0;
}

nav a:hover, nav a.active {
  color: var(--accent-cyan);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

nav a:hover::after, nav a.active::after {
  width: 100%;
}

/* Mobile Nav Toggle (Hidden by default) */
.nav-toggle {
  display: none;
}

/* ==========================================
   5. HERO & GENERAL SECTIONS
   ========================================== */
main {
  flex: 1;
  margin-top: var(--header-height);
}

section {
  padding: 6rem 2rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
}

/* Hero Section */
.hero-section {
  min-height: 80vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4rem;
  padding-top: 4rem;
}

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

.hero-content p {
  font-size: 1.2rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 550px;
}

.hero-image-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  width: 100%;
  max-width: 480px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  z-index: 2;
}

.hero-glow {
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, rgba(127, 0, 95, 0.05) 50%, rgba(0,0,0,0) 100%);
  filter: blur(40px);
  z-index: 1;
}

/* Buttons */
.cta-group {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

/* ==========================================
   6. CORE PILLARS SECTION
   ========================================== */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header p {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.pillar-card {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.pillar-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 242, 254, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.pillar-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent-cyan);
}

.pillar-card h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.pillar-card p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================
   7. ABOUT PAGE & PHILOSOPHY
   ========================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  padding-top: 2rem;
}

.about-text h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

.about-text p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-highlight {
  border-left: 3px solid var(--accent-cyan);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* ==========================================
   8. INTERACTIVE MACHINE SANDBOX
   ========================================== */
.sandbox-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: stretch;
}

.canvas-wrapper {
  position: relative;
  min-height: 450px;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

#engine-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #050811;
}

.sandbox-controls {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
}

.control-group {
  margin-bottom: 2rem;
}

.control-group h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-item label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.control-item input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
}

.control-item input[type="range"]::-webkit-scrollbar-thumb {
  background: var(--accent-cyan);
}

.control-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.8);
  transition: transform 0.1s ease;
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ==========================================
   9. FOOTER
   ========================================== */
footer {
  background: #04060b;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4rem 2rem 2rem 2rem;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 3rem;
}

.footer-brand {
  max-width: 320px;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-column h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
  color: var(--accent-cyan);
}

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

.footer-column a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================
   10. VIEW TRANSITIONS (Baseline Newly Available)
   ========================================== */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: 0.25s cubic-bezier(0.4, 0, 0.2, 1) both fade-out;
  }

  ::view-transition-new(root) {
    animation: 0.35s cubic-bezier(0.4, 0, 0.2, 1) both fade-in;
  }
}

@keyframes fade-out {
  from { opacity: 1; transform: scale(1); filter: blur(0px); }
  to { opacity: 0; transform: scale(0.98); filter: blur(4px); }
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(1.02); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0px); }
}

/* ==========================================
   11. CONTACT PAGE STYLES
   ========================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: start;
  padding-top: 2rem;
}

.contact-form-panel {
  padding: 3rem;
}

.contact-form h2 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.form-group.optional label::after {
  content: " (Optional)";
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

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

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.info-card {
  padding: 2.5rem;
}

.info-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.info-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-cyan);
}

.info-content p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.info-content strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-status {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  display: none;
  animation: slideUp 0.3s ease forwards;
}

.form-status.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.form-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

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

/* ==========================================
   12. PRODUCTS PAGE STYLES
   ========================================== */
.products-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
  padding-top: 2rem;
}

.product-showcase-card {
  padding: 3.5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.product-showcase-card.reverse {
  grid-template-columns: 0.8fr 1.2fr;
}

.product-info h2 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.product-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
}

.product-desc {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  padding: 1.5rem 0;
}

.product-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.product-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-mockup {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 380px;
}

.mockup-phone {
  width: 180px;
  border-radius: 20px;
  border: 4px solid #1e293b;
  box-shadow: 0 15px 35px rgba(0,0,0,0.6);
  background: #000;
  overflow: hidden;
  position: absolute;
  transition: transform 0.3s ease;
}

.mockup-phone img {
  width: 100%;
  height: auto;
  display: block;
}

.mockup-phone.phone-1 {
  transform: translateX(-45px) rotate(-8deg);
  z-index: 1;
}

.mockup-phone.phone-2 {
  transform: translateX(45px) rotate(6deg) translateY(20px);
  z-index: 2;
  border-color: #334155;
}

.mockup-phone:hover {
  transform: scale(1.05) translateY(-10px) rotate(0deg);
  z-index: 10;
}

.product-features-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.product-feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.product-feature-icon {
  color: var(--accent-cyan);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.product-feature-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent-cyan);
}

.product-feature-text h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.product-feature-text p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

/* ==========================================
   13. RESPONSIVENESS
   ========================================== */
@media (max-width: 968px) {
  .hero-section {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding-top: 2rem;
  }

  .hero-content p {
    margin: 0 auto 2.5rem auto;
  }

  .cta-group {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .sandbox-container {
    grid-template-columns: 1fr;
  }

  .canvas-wrapper {
    min-height: 350px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .product-showcase-card, .product-showcase-card.reverse {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    padding: 2.5rem;
  }

  .product-mockup {
    min-height: 320px;
  }

  .mockup-phone {
    width: 150px;
  }
}

@media (max-width: 576px) {
  html {
    font-size: 15px;
  }

  .hero-content h1 {
    font-size: 2.75rem;
  }

  nav ul {
    gap: 1rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .product-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem 0;
  }
}
