/* Global Reset & Variables */
:root {
  /* V5.4: Smooth Scrolling */
  scroll-behavior: smooth;

  --font-main: "Outfit", sans-serif;
  --font-header: "Orbitron", sans-serif;
  /* V5.1: Orbitron */

  /* Colors */
  --color-bg-body: #f9fafb;
  --color-bg-canvas: #ffffff;
  --color-text-primary: #312d37;
  /* V5.5: Soft Black */
  --color-text-secondary: #666666;
  --color-primary: #111111;
  --color-accent: #ff5a5f;
  --color-border: #e5e5e5;
  --color-nav-surface: rgba(249, 249, 249, 0.92);
  --color-nav-surface-scrolled: rgba(243, 243, 243, 0.78);
  --color-nav-border: rgba(17, 17, 17, 0.08);
  --color-nav-shadow: 0 14px 34px rgba(17, 17, 17, 0.07);
  --color-nav-shadow-scrolled: 0 18px 44px rgba(17, 17, 17, 0.11);

  --canvas-width: 1080px;
}

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

body {
  font-family: var(--font-main);
  font-weight: 700;
  /* V5.3: Global Bold */
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden; /* V6: Prevent horizontal scroll */
}

#app-root {
  width: 100%;
  max-width: none;
  background-color: var(--color-bg-canvas);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden; /* V6: Contain all content */
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 500;
  transition: opacity 0.2s;
  text-decoration: none;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  opacity: 0.9;
}

/* === Navbar === */
#navbar-shell {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--canvas-width);
  padding: 0 36px;
  z-index: 1000;
  pointer-events: none;
  box-sizing: border-box;
}

#navbar {
  width: 100%;
  max-width: 1008px;
  margin: 0 auto;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 11px 24px 11px 26px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--color-nav-border);
  background: var(--color-nav-surface);
  color: var(--color-text-primary);
  box-shadow: var(--color-nav-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  transition:
    background-color 0.28s ease,
    border-color 0.28s ease,
    box-shadow 0.28s ease,
    backdrop-filter 0.28s ease,
    -webkit-backdrop-filter 0.28s ease,
    transform 0.28s ease;
}

#navbar[data-scrolled="true"] {
  background: var(--color-nav-surface-scrolled);
  border-color: var(--color-nav-border);
  box-shadow: var(--color-nav-shadow-scrolled);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#nav-logo {
  text-decoration: none;
  text-decoration-line: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  color: #25222a;
  margin-right: 8px;
  letter-spacing: -0.03em;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

#nav-logo:hover,
#nav-logo:focus,
#nav-logo:visited {
  color: #25222a;
  text-decoration: none;
}

#nav-logo-mark {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  transform: translateY(2px);
}

#nav-logo-text {
  display: inline-flex;
  align-items: center;
  transform: translateX(10px);
}

#nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  flex: 1 1 auto;
  transform: translateX(13px);
}

#nav-links a {
  color: #35303b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

#nav-links a:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

#nav-auth {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 208px;
  flex-shrink: 0;
}

.btn-small {
  min-height: 36px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.btn-nav-cta {
  background: #ff6b1d;
  color: white;
  border: none;
  box-shadow: 0 10px 24px rgba(255, 107, 29, 0.22);
  border-radius: 999px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.2s ease;
}

.btn-nav-cta:hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 107, 29, 0.28);
}

.btn-nav-cta-label {
  position: relative;
  z-index: 1;
}

.btn-nav-cta-fill {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.btn-nav-cta:hover .btn-nav-cta-fill {
  transform: translateY(0);
}

/* === Hero === */
#hero {
  position: relative;
  padding: 132px 24px 52px;
  width: 100%;
  overflow: hidden;
}

.hero-shell {
  width: min(100%, 1560px);
  margin: 0 auto;
}

.hero-copy {
  max-width: 820px;
  margin: 0 auto 28px;
  text-align: center;
}

.hero-copy h1 {
  font-size: clamp(45px, 5.6vw, 58px);
  line-height: 1;
  letter-spacing: normal;
  font-weight: 600;
  color: #312d37;
  margin-bottom: 22px;
}

.hero-copy p {
  max-width: 720px;
  margin: 0 auto 30px;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.5;
  font-weight: 500;
  color: #5e5868;
}

.hero-cta {
  min-height: 42px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
}

.hero-demo-frame {
  width: 100%;
  aspect-ratio: 1920 / 1200;
  background: #ffffff;
  overflow: hidden;
  border-radius: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#hero-demo-embed {
  width: min(100%, 1920px);
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
  margin: 0 auto;
}

.btn-primary {
  background: #ff5b04;
  color: white;
  border: none;
  min-height: 42px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid #e5e5e5;
  padding: 12px 24px;
  border-radius: 4px;
}

/* === Sections removed in V2 (logo-strip, features) === */

/* === App Carousel Section === */
#app-carousel {
  position: relative;
  width: 100%;
  margin-top: 120px;
  padding: 40px 0 60px;
  background: #f9fafb;
  overflow: hidden;
  scroll-margin-top: 120px;
}

.carousel-header {
  font-family: var(--font-main);
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text-primary);
  text-align: center;
  margin-bottom: 16px;
}

.carousel-header .accent {
  color: #ff5b04; /* Orange accent matching CTAs */
}

.carousel-subhead {
  font-size: 18px;
  font-weight: 400;
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 40px;
}

.carousel-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 40px; /* 40px spacing between rows */
}

.carousel-track {
  display: flex;
  gap: 48px;
  width: fit-content;
  /* V7.1: GPU acceleration for smooth animation */
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Row 1: Scrolls Left */
.carousel-track.carousel-left {
  animation: scroll-left 50s linear infinite; /* V7.1: 25% slower */
}

/* Row 2: Scrolls Right - starts offset, scrolls opposite */
.carousel-track.carousel-right {
  animation: scroll-right 50s linear infinite; /* V7.1: 25% slower */
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.app-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.app-icon span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* V7.1: Webkit-prefixed keyframes for older Safari */
@-webkit-keyframes scroll-left {
  0% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }
}

@-webkit-keyframes scroll-right {
  0% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* Animation: Scroll Left (Row 1)
   -50% = exactly half the track width (26 icons duplicated) */
@keyframes scroll-left {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Animation: Scroll Right (Row 2)
   Starts at -50%, scrolls back to 0 for opposite direction */
@keyframes scroll-right {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    animation: none;
  }
}

/* === Pricing Section === */
#pricing {
  position: relative; /* V2: Normal flow */
  width: 100%;
  padding: 80px 60px;
  background: #f9fafb;
}

.pricing-header {
  text-align: center;
  margin-bottom: 60px;
}

.pricing-header h2 {
  /* V5.3: Revert to Outfit */
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 16px;
}

.pricing-header p {
  font-size: 18px;
  color: var(--color-text-secondary);
}

.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.pricing-card {
  flex: 1;
  background: white;
  border-radius: 12px;
  padding: 32px;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  background: black;
  color: white;
  border: 1px solid black;
  position: relative;
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.pricing-card h3 {
  font-family: var(--font-header);
  /* V5.3: Keep Orbitron */
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: none;
  /* V5.3: No Caps */
}

.pricing-card.featured h3 {
  color: white;
}

.price {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  font-family: var(--font-main);
}

.period {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.pricing-card.featured .period {
  color: #999;
}

.description {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.pricing-card.featured .description {
  color: #ccc;
}

.full-width {
  width: 100%;
  margin-bottom: 32px;
  height: 44px;
}

/* Override secondary button color for black card context if needed */
.pricing-card.featured .btn-primary {
  background: white;
  color: black;
}

.pricing-card.featured .btn-primary:hover {
  background: #eee;
}

.features {
  list-style: none;
  margin-top: auto;
}

.features li {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-card.featured .features li {
  color: white;
}

.pill-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #10b981;
  /* Green accent from example */
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  /* V5.3: Revert to Outfit */
}

/* === Footer === */
#footer {
  position: relative; /* V2: Normal flow */
  width: 100%;
  padding: 60px;
  background: #f9fafb;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.footer-logo {
  /* V5.3: Revert to Outfit */
  font-weight: 700;
  font-size: 24px;
  color: var(--color-text-primary);
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
}

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

.footer-copyright {
  color: var(--color-text-secondary);
  font-size: 12px;
}

/* === V2: Mobile Responsive === */
@media (max-width: 768px) {
  #navbar-shell {
    top: 16px;
    padding: 0 14px;
  }

  #navbar {
    min-height: 56px;
    gap: 12px;
    padding: 10px 14px 10px 16px;
    max-width: none;
  }

  #nav-logo {
    font-size: 15px;
    margin-right: 0;
  }

  #nav-logo-mark {
    width: 22px;
    height: 22px;
    transform: translateY(2px);
  }

  #nav-logo-text {
    transform: translateX(8px);
  }

  #nav-links {
    gap: 16px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  #nav-links::-webkit-scrollbar {
    display: none;
  }

  #nav-links a {
    font-size: 12px;
    white-space: nowrap;
  }

  #nav-auth {
    min-width: auto;
  }

  .btn-small {
    min-height: 34px;
    padding: 0 16px;
    font-size: 12px;
  }

  #hero {
    padding: 108px 16px 36px;
  }

  .hero-copy {
    margin-bottom: 20px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 12vw, 56px);
    line-height: 1.04;
    margin-bottom: 16px;
  }

  .hero-copy p {
    font-size: 18px;
    line-height: 1.45;
    margin-bottom: 24px;
  }

  #pricing {
    padding: 40px 20px;
  }

  .pricing-grid {
    flex-direction: column;
    gap: 16px;
  }

  .pricing-card.featured {
    transform: none; /* Remove scale on mobile */
  }

  #footer {
    padding: 40px 20px;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  /* V7: Carousel Mobile */
  #app-carousel {
    margin-top: 280px;
    padding: 20px 0 40px;
  }

  .carousel-header {
    font-size: 28px;
    padding: 0 20px;
  }

  .carousel-subhead {
    font-size: 14px;
    padding: 0 20px;
  }

  .carousel-container {
    gap: 24px; /* Reduced row spacing on mobile */
  }

  .carousel-track {
    gap: 32px;
  }

  .carousel-track.carousel-left,
  .carousel-track.carousel-right {
    animation-duration: 31s; /* V7.1: 25% slower (was 25s) */
  }

  .app-icon img {
    width: 48px;
    height: 48px;
    padding: 6px;
  }

  .app-icon span {
    font-size: 10px;
  }
}
