/* ---------------------------------------------------------------------------
 * Aetherfin landing page
 *
 * Tokens from the app's design system (lib/design_tokens/colors.dart).
 * Typography: Inter Variable + JetBrains Mono.
 * ------------------------------------------------------------------------- */

:root {
  --canvas: #0B0B14;
  --surface-low: #101020;
  --surface-base: #15152A;
  --surface-raised: #1B1B36;
  --surface-high: #232347;
  --border: rgba(168, 157, 236, 0.10);
  --border-hover: rgba(168, 157, 236, 0.25);

  --indigo-100: #E8E5FB;
  --indigo-200: #CDC6F4;
  --indigo-300: #A89DEC;
  --indigo-400: #8276E0;
  --indigo-500: #6657D7;
  --indigo-600: #5644C9;
  --indigo-800: #332C7A;
  --indigo-900: #251F58;

  --text-primary: #F2F1F8;
  --text-secondary: #BFBED0;
  --text-tertiary: #8C8AA3;

  --glow: 0 24px 64px -16px rgba(86, 68, 201, 0.4);
  --glow-hover: 0 32px 80px -12px rgba(102, 87, 215, 0.55);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--canvas);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--surface-raised);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  color: var(--indigo-200);
}

a {
  color: var(--indigo-300);
  text-decoration: none;
  transition: color 200ms var(--ease);
}
a:hover { color: var(--indigo-100); }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------------
 * Nav
 * ------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  background: rgba(11, 11, 20, 0.8);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.brand-mark { width: 30px; height: 30px; border-radius: var(--radius-sm); }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 500;
  transition: color 200ms var(--ease);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: background 200ms var(--ease), color 200ms var(--ease);
}
.nav-github:hover {
  background: var(--surface-raised);
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-github) { display: none; }
}

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.1px;
  transition: transform 200ms var(--ease-out), background 200ms var(--ease), box-shadow 300ms var(--ease);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--indigo-500), var(--indigo-600));
  color: var(--text-primary);
  box-shadow: 0 6px 20px -6px rgba(86, 68, 201, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-hover);
  color: var(--text-primary);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-high);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-small { padding: 10px 18px; font-size: 14px; border-radius: 10px; }
.btn-large { padding: 16px 36px; font-size: 17px; border-radius: 14px; }

/* ---------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(ellipse at center, rgba(86, 68, 201, 0.2), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 72px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-base);
  border: 1px solid var(--border);
  color: var(--indigo-200);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -2px;
  font-weight: 800;
  margin-bottom: 24px;
}

.accent {
  background: linear-gradient(135deg, var(--indigo-300), var(--indigo-500));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lead {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.micro {
  font-size: 13px;
  color: var(--text-tertiary);
}

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

.hero-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at center, rgba(130, 118, 224, 0.2), transparent 60%);
  filter: blur(50px);
  z-index: -1;
}

.phone-frame {
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--glow);
  display: block;
  background: var(--surface-base);
}

video.phone-frame { object-fit: cover; }

@media (max-width: 880px) {
  .hero { padding: 64px 0 80px; }
  .hero-inner { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .hero-cta { justify-content: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .phone-frame { max-width: 260px; }
}

/* ---------------------------------------------------------------------------
 * Sections
 * ------------------------------------------------------------------------- */

.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -1px;
  font-weight: 700;
  margin-bottom: 12px;
  text-align: center;
}

.section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 56px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * Features
 * ------------------------------------------------------------------------- */

.features {
  padding: 100px 0;
  background: linear-gradient(180deg, var(--canvas), var(--surface-low));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--surface-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform 300ms var(--ease-out), border-color 300ms var(--ease), box-shadow 300ms var(--ease);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 16px 48px -12px rgba(86, 68, 201, 0.15);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--indigo-600), var(--indigo-800));
  color: var(--indigo-100);
  margin-bottom: 16px;
}
.feature-icon svg { width: 22px; height: 22px; }

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * Screenshots
 * ------------------------------------------------------------------------- */

.screenshots {
  padding: 100px 0;
  background: var(--surface-low);
}

.shot-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.shot-row figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.shot-row img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease);
}
.shot-row figure:hover img {
  transform: scale(1.03) translateY(-4px);
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.7);
}

.shot-row figcaption {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

@media (max-width: 768px) {
  .shot-row { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}
@media (max-width: 480px) {
  .shot-row { grid-template-columns: 1fr; max-width: 280px; margin: 0 auto; }
}

/* ---------------------------------------------------------------------------
 * Install
 * ------------------------------------------------------------------------- */

.install {
  padding: 100px 0;
  background: var(--canvas);
}

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.steps li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 200ms var(--ease);
}
.steps li:hover { border-color: var(--border-hover); }

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}

.steps h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.steps p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.steps li:last-child p { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
 * CTA
 * ------------------------------------------------------------------------- */

.cta {
  padding: 120px 0;
  background: linear-gradient(180deg, var(--canvas) 0%, var(--indigo-900) 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center bottom, rgba(86, 68, 201, 0.2), transparent 60%);
  pointer-events: none;
}

.cta-inner { position: relative; z-index: 1; }

.cta h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -1.2px;
  font-weight: 700;
  margin-bottom: 16px;
}

.cta p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------- */

footer {
  background: var(--canvas);
  border-top: 1px solid var(--border);
  padding: 48px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.footer-brand .brand-mark { width: 24px; height: 24px; border-radius: 6px; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.footer-links a {
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}
.footer-links a:hover { color: var(--text-primary); }

.footer-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ---------------------------------------------------------------------------
 * Accessibility
 * ------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

:focus-visible {
  outline: 2px solid var(--indigo-400);
  outline-offset: 3px;
  border-radius: 4px;
}
