/* ============================================
   Horizon AI Labs - Cosmos-inspired light theme
   ============================================ */

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

:root {
  --bg-primary: #fafafa;
  --bg-secondary: #f0f0f0;
  --bg-card: rgba(0, 0, 0, 0.02);
  --bg-card-hover: rgba(0, 0, 0, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --text-primary: #111111;
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-muted: rgba(0, 0, 0, 0.35);
  --accent: #7c5cbf;
  --accent-warm: #d4845a;
  --accent-green: #3b9b6e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Ambient Background Orbs ---------- */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.07;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-warm);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: var(--accent-green);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(10px, 30px) scale(1.02); }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.nav:hover {
  border-color: var(--border-medium);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 12px;
  white-space: nowrap;
}

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

.nav-links a {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav-links a.active {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.06);
}

/* Products dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-trigger svg {
  width: 12px;
  height: 12px;
  transition: transform var(--transition);
}

.nav-dropdown:hover .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-dropdown-menu a:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.dropdown-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.dropdown-label strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.dropdown-label span {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-cta {
  padding: 8px 20px !important;
  background: var(--text-primary) !important;
  color: var(--bg-primary) !important;
  font-weight: 500 !important;
  border-radius: var(--radius-pill) !important;
}

.nav-cta:hover {
  opacity: 0.85;
  background: #222 !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg {
  width: 20px;
  height: 20px;
}

/* ---------- Page Wrapper ---------- */
.page-content {
  position: relative;
  z-index: 1;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeUp 0.8s ease both;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 900px;
  animation: fadeUp 0.8s 0.1s ease both;
}

.hero h1 em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 560px;
  margin-top: 24px;
  line-height: 1.6;
  animation: fadeUp 0.8s 0.2s ease both;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 48px;
  animation: fadeUp 0.8s 0.3s ease both;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  animation: fadeUp 0.8s 0.5s ease both;
}

.hero-scroll::after {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-muted), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: #222;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

/* ---------- Sections ---------- */
.section {
  padding: 120px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--text-muted);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 700px;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin-top: 16px;
  line-height: 1.6;
}

/* ---------- Product Cards ---------- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 64px;
}

.product-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  min-height: 340px;
}

.product-card:hover {
  border-color: var(--border-medium);
}

.product-card:hover .product-card-body {
  background: var(--bg-card-hover);
}

.product-card:hover .product-card-link {
  gap: 10px;
  color: var(--text-primary);
}

.product-card-image {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.product-card-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.product-card-body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-card);
  transition: var(--transition);
}

.product-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
  width: fit-content;
  margin-bottom: 20px;
}

.tag-purple {
  background: rgba(124, 92, 191, 0.08);
  color: var(--accent);
}

.tag-green {
  background: rgba(59, 155, 110, 0.08);
  color: var(--accent-green);
}

.tag-orange {
  background: rgba(212, 132, 90, 0.08);
  color: var(--accent-warm);
}

.product-card h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 12px;
}

.product-card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.product-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 24px;
  transition: var(--transition);
}

.product-card-link svg {
  width: 14px;
  height: 14px;
}

/* Flip second card image to the right */
.product-card:nth-child(even) {
  direction: rtl;
}

.product-card:nth-child(even) > * {
  direction: ltr;
}

/* No-image variant: side-by-side text cards */
.product-card--no-image {
  grid-template-columns: 1fr;
  min-height: auto;
}

/* ---------- Mission / About Section ---------- */
.mission {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mission .section-title {
  max-width: 800px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 64px;
  width: 100%;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.value-card {
  padding: 40px 32px;
  background: #fff;
  text-align: left;
  transition: var(--transition);
  position: relative;
}

.value-card:hover {
  background: var(--bg-card);
}

.value-number {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.06);
  line-height: 1;
  margin-bottom: 24px;
}

.value-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
}

.value-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.value-accent {
  display: block;
  width: 24px;
  height: 2px;
  margin-bottom: 20px;
}

.value-accent--purple { background: var(--accent); }
.value-accent--green { background: var(--accent-green); }
.value-accent--warm { background: var(--accent-warm); }

/* ---------- CTA Section ---------- */
.cta-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 120px 24px 160px;
}

.cta-section .section-title {
  max-width: 600px;
}

.cta-section .btn {
  margin-top: 32px;
}

/* ---------- Product Detail Page ---------- */
.product-hero {
  padding: 160px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.product-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  max-width: 800px;
}

.product-hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 560px;
  margin-top: 20px;
  line-height: 1.6;
}

.product-hero .hero-actions {
  margin-top: 36px;
}

/* Screenshots gallery */
.screenshots {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.screenshot-frame {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot-frame:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
}

.screenshot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Features section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 64px;
}

.feature-card {
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
}

/* Bento sizing — wide cards span 2 columns */
.feature-card--wide {
  grid-column: span 2;
}

/* Accent top borders */
.feature-card--accent-purple::before { background: var(--accent); }
.feature-card--accent-green::before { background: var(--accent-green); }
.feature-card--accent-warm::before { background: var(--accent-warm); }
.feature-card--accent-none::before { background: transparent; }

.feature-number {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Wide cards get a different internal layout */
.feature-card--wide .feature-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.feature-card--wide .feature-inner > div:first-child {
  border-right: 1px solid var(--border-subtle);
  padding-right: 32px;
}

/* ---------- Legal Pages ---------- */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 160px 24px 120px;
}

.legal-page h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 400;
  margin-bottom: 8px;
}

.legal-page .last-updated {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.legal-page h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
}

.legal-page p,
.legal-page li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-page ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-page a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 60px 24px 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 280px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: var(--transition);
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .values-grid {
    grid-template-columns: 1fr;
    gap: 1px;
  }

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

  .feature-card--wide {
    grid-column: span 2;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  }

  .nav-links.open a {
    padding: 12px 16px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: transparent;
    border: none;
    backdrop-filter: none;
    padding: 0 0 0 16px;
  }

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

  .product-card {
    grid-template-columns: 1fr;
  }

  .product-card:nth-child(even) {
    direction: ltr;
  }

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

  .feature-card--wide {
    grid-column: span 1;
  }

  .feature-card--wide .feature-inner {
    grid-template-columns: 1fr;
  }

  .feature-card--wide .feature-inner > div:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 20px;
  }

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

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .screenshots-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
