/* ================================================================
   DevInstaller — Download Page
   Aesthetic: Industrial Terminal / Dark Obsidian + Electric Mint
   ================================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Surfaces */
  --bg-root: #06060c;
  --bg-surface: #0c0c16;
  --bg-elevated: #111120;
  --bg-card: rgba(15, 15, 30, 0.65);
  --bg-card-hover: rgba(20, 20, 40, 0.85);

  /* Accent */
  --accent: #00e5a0;
  --accent-glow: rgba(0, 229, 160, 0.25);
  --accent-dim: #00b37d;
  --accent-subtle: rgba(0, 229, 160, 0.08);

  /* Secondary */
  --amber: #f0b429;
  --amber-dim: rgba(240, 180, 41, 0.15);

  /* Text */
  --text-primary: #e8e6e3;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --text-on-accent: #06060c;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 229, 160, 0.2);

  /* Shadows */
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(0, 229, 160, 0.15), 0 0 80px rgba(0, 229, 160, 0.05);

  /* Typography */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-index */
  --z-bg: -1;
  --z-content: 1;
  --z-nav: 100;
  --z-dropdown: 200;
  --z-overlay: 1000;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--text-primary); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: none;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

img, svg { display: block; }

/* ---------- Background Effects ---------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

/* Floating orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: var(--z-bg);
  pointer-events: none;
  will-change: transform;
}
.orb--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 160, 0.1) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  animation: orbFloat1 20s ease-in-out infinite;
}
.orb--2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(100, 80, 255, 0.08) 0%, transparent 70%);
  bottom: 10%;
  right: -8%;
  animation: orbFloat2 25s ease-in-out infinite;
}
.orb--3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(240, 180, 41, 0.06) 0%, transparent 70%);
  top: 60%;
  left: 30%;
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.1); }
  66% { transform: translate(-30px, 80px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -30px) scale(1.05); }
  66% { transform: translate(40px, -60px) scale(0.9); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, -50px) scale(1.15); }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding: var(--space-md) var(--space-lg);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  background: rgba(6, 6, 12, 0.7);
  border-bottom: 1px solid var(--border);
  transition: background var(--duration-normal) var(--ease-out);
}

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

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.nav__logo-icon { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--duration-fast) var(--ease-out);
}
.nav__link:hover { color: var(--text-primary); }

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(80px + var(--space-3xl)) var(--space-lg) var(--space-3xl);
  position: relative;
}

.hero__content {
  max-width: 760px;
  width: 100%;
  text-align: center;
}

/* Badge */
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.6s var(--ease-out) both;
}
.hero__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

/* Title */
.hero__title {
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-lg);
}

.hero__title-line {
  display: block;
  animation: fadeInUp 0.7s var(--ease-out) both;
}
.hero__title-line:nth-child(1) { animation-delay: 0.1s; }
.hero__title-line:nth-child(2) { animation-delay: 0.2s; }
.hero__title-line:nth-child(3) { animation-delay: 0.3s; }

.hero__title-line--accent {
  color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, #00c9ff 50%, var(--accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fadeInUp 0.7s var(--ease-out) both, gradientShift 6s ease-in-out infinite;
  animation-delay: 0.2s, 0s;
}

/* Subtitle */
.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto var(--space-2xl);
  animation: fadeInUp 0.7s var(--ease-out) 0.35s both;
}
.hero__subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  animation: fadeInUp 0.7s var(--ease-out) 0.45s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  min-height: 48px;
}

.btn--primary {
  background: var(--accent);
  color: var(--text-on-accent);
  box-shadow: 0 0 0 0 var(--accent-glow), var(--shadow-lg);
  padding: 16px 32px;
  font-size: 1.05rem;
}
.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow), 0 20px 50px rgba(0,0,0,0.4);
}
.btn--primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}
.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn__icon {
  display: flex;
  align-items: center;
  font-size: 1.3em;
}

.btn__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}
.btn__label { font-weight: 700; }
.btn__meta {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.7;
  font-family: var(--font-mono);
}

.btn__arrow {
  margin-left: var(--space-xs);
  animation: bounceDown 2s ease-in-out infinite;
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 0.875rem;
}
.btn--ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.03);
}

.btn__chevron {
  transition: transform var(--duration-fast) var(--ease-out);
}
.btn--ghost[aria-expanded="true"] .btn__chevron {
  transform: rotate(180deg);
}

/* ---------- Platform Dropdown ---------- */
.platform-dropdown {
  animation: fadeInUp 0.3s var(--ease-out) both;
  margin-bottom: var(--space-xl);
}
.platform-dropdown[hidden] { display: none; }

.platform-dropdown__inner {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-md) 0;
}

.platform-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
}
.platform-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}
.platform-option__icon {
  font-size: 1.2em;
  display: flex;
}
.platform-option__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.platform-option__name { font-weight: 600; }
.platform-option__size {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ---------- Terminal ---------- */
.terminal {
  max-width: 600px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.8s var(--ease-out) 0.6s both;
  text-align: left;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.terminal__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green { background: #28c840; }

.terminal__title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.terminal__body {
  padding: var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  min-height: 120px;
}

.terminal__line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.terminal__prompt {
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.terminal__cmd {
  color: var(--text-primary);
}

.terminal__cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 300;
}

.terminal__output {
  margin-top: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.terminal__output-line {
  opacity: 0;
  animation: fadeIn 0.3s var(--ease-out) forwards;
}
.terminal__output-line--success {
  color: var(--accent);
}
.terminal__output-line--info {
  color: var(--amber);
}

/* ---------- Features Section ---------- */
.features {
  padding: var(--space-4xl) var(--space-lg);
  position: relative;
}

.features__inner {
  max-width: 1100px;
  margin: 0 auto;
}

.features__heading {
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-3xl);
  color: var(--text-primary);
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.feature-card {
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--duration-slow) var(--ease-out);
  position: relative;
  overflow: hidden;

  /* Staggered entrance */
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s var(--ease-out) calc(var(--delay) * 80ms + 0.2s) both;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.feature-card:hover::before { opacity: 1; }

.feature-card__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  margin-bottom: var(--space-md);
  color: var(--accent);
}
.feature-card__icon svg {
  width: 22px;
  height: 22px;
}

.feature-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.feature-card__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.footer {
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--border);
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer__text a {
  color: var(--text-secondary);
  font-weight: 500;
}
.footer__text a:hover {
  color: var(--accent);
}

/* ---------- Keyframes ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

@keyframes bounceDown {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(4px); }
  60% { transform: translateY(2px); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- Scroll Animations (via IntersectionObserver) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .orb { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-3xl: 48px;
    --space-4xl: 64px;
  }

  .hero {
    padding-top: calc(70px + var(--space-2xl));
  }

  .hero__title {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero__actions {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .btn--primary {
    width: 100%;
    justify-content: center;
    max-width: 340px;
  }

  .btn--ghost {
    width: 100%;
    justify-content: center;
    max-width: 340px;
  }

  .platform-dropdown__inner {
    flex-direction: column;
    align-items: center;
  }

  .platform-option {
    width: 100%;
    max-width: 300px;
  }

  .features__grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .terminal {
    max-width: 100%;
  }

  .terminal__body {
    font-size: 0.78rem;
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .nav__links { gap: var(--space-md); }
  .nav__link { font-size: 0.8rem; }

  .hero__badge {
    font-size: 0.72rem;
    padding: 5px 12px;
  }

  .feature-card {
    padding: var(--space-lg);
  }
}
