:root {
  /* Colors */
  --primary-color: #007AFF;
  --primary-hover: #0056b3;
  --accent-color: rgb(255, 175, 50);
  --bg-color: #FFFFFF;
  --bg-secondary: #F5F5F7;
  --text-main: #1D1D1F;
  --text-secondary: #86868B;
  --border-color: #E6E6EB;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing */
  --container-width: 1200px;
  --section-padding: 100px;
  --showcase-stage-height: 680px;
  --iphone-showcase-height: 620px;
  --iphone-cutout-height: 590px;
  --device-stage-height: 300px;

  /* Effects */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
  --radius-lg: 24px;
  --radius-md: 12px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.text-center {
  text-align: center;
}

/* Typography */
h1 {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
}

h2 {
  font-size: 48px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

p {
  font-size: 18px;
  color: var(--text-secondary);
}

.showcase-device {
  object-fit: contain;
  transform-origin: center center;
}

.showcase-device-iphone {
  max-height: var(--iphone-showcase-height);
}

.showcase-device-iphone-cutout {
  max-height: var(--iphone-cutout-height);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 100px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.badge-pill {
  display: inline-block;
  background-color: var(--accent-color);
  color: #fff;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0px; /* Touching the title */
}

/* Navbar */
.navbar {
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-tagline {
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

/* Hero Section */
.hero {
  padding: 120px 0 140px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: flex;
  align-items: flex-start;
  /* Align tops like reference */
  gap: 60px;
}

.hero-content {
  flex: 1;
  text-align: left;
  z-index: 10;
  position: relative;
  padding-top: 20px;
  /* Optical adjustment to align with image */
}

.hero-subtitle {
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 40px;
}

.hero-visual {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: flex-end;
  /* Align image to the right */
  align-items: flex-start;
}

.hero-mac-img {
  width: 683px;
  height: 450px;
  /* 450px height with 4340×2860 aspect ratio */
  max-width: none;
  /* Allow it to overflow container column if needed to preserve ratio */
  object-fit: contain;
}


/* Comparison Section */
.comparison {
  background:
    /* Glowing orange accent highlights */
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(244, 179, 79, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 85% 15%, rgba(244, 179, 79, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 40% 50% at 75% 85%, rgba(255, 160, 60, 0.2) 0%, transparent 50%),
    /* Deep warm base gradient - Updated to be more orange/less brown */
    linear-gradient(135deg, #5e2405 0%, #8a3508 25%, #702b06 50%, #8a3508 75%, #5e2405 100%);
  padding: var(--section-padding) 0;
  position: relative;
  overflow: hidden;
}

.comparison h2,
.comparison p {
  color: #ffffff;
}

.comparison p {
  color: rgba(255, 255, 255, 0.85);
}

.comparison-layout {
  display: flex;
  align-items: center;
  gap: 60px;
  transform: translateX(-80px);
}

.comparison-visual {
  flex: 1;
  display: flex;
  justify-content: center;
}

.phone-transform {
  position: relative;
  width: 300px;
  height: 500px;
}

.phone-before,
.phone-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.8s ease-in-out;
}

.phone-before {
  opacity: 1;
  z-index: 2;
}

.phone-after {
  opacity: 0;
  z-index: 1;
}

.phone-transform.transformed .phone-before {
  opacity: 0;
}

.phone-transform.transformed .phone-after {
  opacity: 1;
}

.comparison-content {
  flex: 1;
  text-align: left;
}

.comparison-content h2 {
  margin-bottom: 20px;
}

.comparison-content p {
  font-size: 20px;
}





/* Video Feature Section */
.video-feature {
  padding: var(--section-padding) 0;
  background-color: var(--bg-color);
}

.video-feature-layout {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 80px;
}

.video-feature-content {
  flex: 1;
  text-align: left;
}

.video-feature-content h2 {
  margin-bottom: 24px;
}

.video-feature-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-feature-visual video {
  max-width: 100%;
  width: 320px;
  aspect-ratio: 960 / 1962;
  height: auto;
  /* Limit video width */
  border-radius: 40px;
  /* Match device curve roughly if needed, or just clean roundness */
  /* Remove shadow/border if the goal is "transparent background", but video might have its own bounds. 
     If the transparent video is distinct, we might not want a box shadow on the bounding box. 
     Let's keep it clean. */
}

/* CLI Feature Section */
.cli-feature {
  padding: 38px 0;
  background-color: var(--bg-secondary);
}

.cli-feature .section-header {
  margin-bottom: 32px;
}

.cli-feature .subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-top: 10px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cli-split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.cli-left-col {
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevent grid blowout */
}

.cli-left-col .section-header {
  text-align: left;
  margin-bottom: 24px;
}

.cli-left-col .badge-pill {
  margin-bottom: 0px;
}

.cli-left-col h2 {
  margin-bottom: 18px;
}

.cli-left-col .subtitle {
  margin-left: 0;
  margin-top: 0;
  max-width: 100%;
}

.cli-terminal-wrapper {
  width: 100%;
  max-width: 800px;
}

.cli-terminal-window {
  width: 100%;
  height: 300px; /* Fixed height so it doesn't jump vertically while typing */
  background-color: rgba(30, 30, 30, 0.95);
  border-radius: var(--radius-lg);
  /* shadow removed to keep it flat */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: monospace;
  color: #E0E0E0;
  font-size: 18px;
  line-height: 1.6;
  text-align: left;
}

.cli-terminal-header {
  height: 40px;
  background-color: #2D2D2D;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid #111;
}

.cli-terminal-dots {
  display: flex;
  gap: 8px;
}

.cli-terminal-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background-color: #FF5F56; }
.dot.yellow { background-color: #FFBD2E; }
.dot.green { background-color: #27C93F; }

.cli-terminal-body {
  padding: 24px;
  flex: 1;
  white-space: pre-wrap;
}

.cli-prompt { color: #27C93F; }
.cli-path { color: #58A6FF; }

@keyframes blink {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0; }
}

.cli-cursor {
  width: 10px;
  height: 18px;
  background-color: #fff;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

.cli-right-col {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: var(--showcase-stage-height);
  min-width: 0; /* Prevent grid blowout */
}

.cli-result-wrapper {
  position: relative;
  width: 100%;
  max-width: 580px;
  height: var(--showcase-stage-height);
  display: flex;
  justify-content: center;
  align-items: center;
}

.cli-result-wrapper:has(.cli-result-iphone.animate-in) {
  max-width: 420px;
}

.cli-result-wrapper:has(.cli-result-tablet.animate-in) {
  max-width: 500px;
}

.cli-result-wrapper:has(.cli-result-mac.animate-in) {
  max-width: 620px;
}

.cli-result-wrapper:has(.cli-result-iphone-cutout.animate-in) {
  max-width: 400px;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.cli-result-img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-height: calc(var(--showcase-stage-height) - 40px);
  max-width: 100%;
  object-fit: contain;
  opacity: 0; /* hidden by default */
  pointer-events: none;
}

.cli-result-iphone {
  max-height: 640px;
  max-width: 320px;
}

.cli-result-iphone-cutout {
  max-height: 610px;
  max-width: 315px;
}

.cli-result-tablet {
  max-height: 540px;
  max-width: 440px;
}

.cli-result-mac {
  max-width: min(100%, 620px);
  max-height: 405px;
}

@media (min-width: 1025px) {
  .cli-right-col {
    overflow: visible;
    min-height: 640px;
  }

  .cli-result-wrapper {
    height: 640px;
  }

  .cli-result-wrapper:has(.cli-result-iphone.animate-in),
  .cli-result-wrapper:has(.cli-result-iphone-cutout.animate-in) {
    left: 24px;
  }

  .cli-result-wrapper:has(.cli-result-tablet.animate-in) {
    left: 80px;
    width: 560px;
    max-width: none;
  }

  .cli-result-wrapper:has(.cli-result-mac.animate-in) {
    left: 80px;
    width: 620px;
    max-width: none;
  }

  .cli-result-tablet {
    top: 48px;
    max-height: 580px;
    max-width: 470px;
  }

  .cli-result-mac {
    top: auto;
    bottom: 72px;
    width: 620px;
    max-width: none;
    max-height: 430px;
  }
}

.cli-result-img.animate-in {
  animation: popIn 0.35s ease-out forwards;
}

/* Device Variety Section */
.devices {
  padding: var(--section-padding) 0;
  background-color: var(--bg-color);
  overflow: hidden;
  /* Hide overflow from marquee */
}

.devices .section-header {
  margin-bottom: 60px;
}

.devices .subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-top: 10px;
}

.devices-carousel-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.devices-track {
  display: flex;
  gap: 40px;
  width: max-content;
  /* Allow track to be as wide as content */
}

.device-card {
  flex: 0 0 auto;
  /* Don't shrink */
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease;
}

/* Hover effect only when not scrolling (desktop) */
@media (min-width: 1025px) {
  .device-card:hover {
    transform: translateY(-5px);
  }

  /* Hide the duplicate items on desktop */
  .device-card[aria-hidden="true"] {
    display: none;
  }
}

.device-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  /* Preserve aspect ratio */
}

.device-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}

/* Marquee Animation Keyframes */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 20px));
    /* Move by half track width + half gap context */
    /* 
       Actually, with gap, simpler logic:
       We have 2 sets. We need to move by the width of 1 set + the gap sum for that set. 
       Let's refine the animation logic below in Media Queries for safety.
    */
  }
}


/* Features Grid */
.features {
  padding: var(--section-padding) 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.feature-card {
  padding: 30px;
  border-radius: var(--radius-lg);
  background: #fff;
  /* In if we add grey bg to this section, currently white on white which is fine for clean look, or we can add border */
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-color);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 20px;
}

/* Legal pages */
.legal-page {
  padding: 96px 0 120px;
}

.legal-content {
  max-width: 760px;
}

.legal-back,
.legal-page a {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legal-page .legal-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--accent-color);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.legal-back::before {
  content: "← ";
}

.legal-page h1 {
  font-size: 48px;
  margin-bottom: 32px;
}

.legal-updated {
  margin-top: -16px;
  font-size: 15px;
}

.legal-page h2 {
  margin-top: 48px;
  font-size: 28px;
}

.legal-page p + p,
.legal-page ul {
  margin-top: 24px;
}

.legal-page ul {
  padding-left: 24px;
  color: var(--text-secondary);
  font-size: 18px;
}

.legal-page li + li {
  margin-top: 10px;
}

.legal-page ul + p {
  margin-top: 32px;
}


/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.footer-links {
  display: flex;
  gap: 16px;
  white-space: nowrap;
}

.footer-links a:hover {
  color: var(--primary-color);
  opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  :root {
    --section-padding: 60px;
    --showcase-stage-height: 520px;
    --iphone-showcase-height: 468px;
    --iphone-cutout-height: 442px;
    --device-stage-height: 250px;
  }

  h1 {
    font-size: 48px;
  }

  /* Reduce hero padding on mobile */
  .hero {
    padding: 40px 0 60px;
  }

  h2 {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 18px;
    padding: 0 20px;
    margin-bottom: 24px;
  }

  .hero-grid {
    flex-direction: column;
    align-items: center;
    /* Reset alignment for mobile */
    text-align: center;
    gap: 24px;
  }

  .hero-content {
    text-align: center;
    padding-bottom: 0;
  }

  .hero-cta {
    display: flex;
    justify-content: center;
    margin-bottom: -6%;
  }

  .hero-cta img {
    height: 50px;
    width: auto;
  }

  .hero-visual {
    padding-bottom: 0;
    /* Remove offset on mobile */
  }

  .badge-pill {
    /* Center badge on mobile */
    margin-left: auto;
    margin-right: auto;
  }

  .comparison-layout {
    flex-direction: column;
    gap: 40px;
    text-align: center;
    transform: none !important;
  }

  .comparison-content {
    text-align: center;
  }

  .comparison-content p {
    padding: 0 20px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    /* Reduced gap from 40px */
  }

  .hero-mac-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    /* Reset max-width */
  }

  /* Carousel Logic for Mobile/Tablet within the same media query */
  .devices-track {
    animation: scroll 20s linear infinite;
  }

  .devices-carousel-wrapper {
    justify-content: flex-start;
    /* Align left to start scrolling */
  }

  /* Video Feature Mobile */
  .video-feature-layout {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .video-feature-content {
    text-align: center;
  }

  /* Footer Mobile */
  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .legal-page {
    padding: 64px 0 80px;
  }

  .legal-page h1 {
    font-size: 40px;
  }

  /* CLI Feature Section Mobile */
  .cli-feature {
    padding: 32px 0;
  }
  .cli-split-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cli-terminal-wrapper {
    margin: 0 auto;
  }
  .cli-terminal-window {
    font-size: 14px;
    height: 240px; /* Fixed height */
  }
  .cli-left-col .section-header {
    text-align: center;
    margin-bottom: 20px;
  }
  .cli-left-col h2 {
    margin-bottom: 16px;
  }
  .cli-left-col .subtitle {
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
  }
  .cli-right-col {
    justify-content: center;
    min-height: var(--showcase-stage-height);
    width: 100%;
  }
  .cli-result-wrapper {
    justify-content: center;
    max-width: 420px;
  }
  .cli-result-wrapper:has(.cli-result-iphone.animate-in),
  .cli-result-wrapper:has(.cli-result-tablet.animate-in),
  .cli-result-wrapper:has(.cli-result-mac.animate-in),
  .cli-result-wrapper:has(.cli-result-iphone-cutout.animate-in) {
    max-width: min(100%, 420px);
  }
  .cli-result-wrapper:has(.cli-result-tablet.animate-in) {
    max-width: min(100%, 520px);
  }
  .cli-result-wrapper:has(.cli-result-mac.animate-in) {
    max-width: min(100%, 680px);
  }
  .cli-result-img {
    left: 0; right: 0; margin: auto;
    max-width: 100%;
  }
  .cli-result-iphone {
    max-height: 560px;
  }
  .cli-result-iphone-cutout {
    max-height: 540px;
  }
  .cli-result-tablet {
    width: auto;
    max-height: calc(var(--showcase-stage-height) - 20px);
    max-width: 100%;
  }
  .cli-result-mac {
    width: 100%;
    max-height: calc(var(--showcase-stage-height) - 20px);
  }
}

@media (max-width: 720px) {
  .nav-tagline {
    display: none;
  }
}

@keyframes scroll {
  to {
    transform: translateX(calc(-1 * (280px * 4 + 40px * 4)));
  }
}
