:root {
  --primary: #2D6CB5;
  --primary-light: #E8F1FA;
  --primary-dark: #1E4A7A;
  --primary-muted: #A7C7E7;
  --accent: #E8913A;
  --accent-hover: #D07E2E;
  --bg: #F6F8FA;
  --bg-secondary: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #6B7D8E;
  --card-bg: #FFFFFF;
  --card-border: rgba(45, 108, 181, 0.12);
  --hero-gradient: linear-gradient(160deg, #E8F1FA 0%, #F6F8FA 50%, #FFF5EB 100%);
  --privacy-badge: #2E9B54;
  --nav-bg: rgba(246, 248, 250, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5DA3E6;
    --primary-light: #1A2D42;
    --primary-dark: #89BEF0;
    --primary-muted: #3D6A9E;
    --accent: #F0A856;
    --accent-hover: #E8913A;
    --bg: #0F1419;
    --bg-secondary: #1A2029;
    --text: #F0F0F0;
    --text-secondary: #94A3B3;
    --card-bg: #1A2029;
    --card-border: rgba(93, 163, 230, 0.15);
    --hero-gradient: linear-gradient(160deg, #1A2D42 0%, #0F1419 50%, #2A1F14 100%);
    --privacy-badge: #4FC97A;
    --nav-bg: rgba(15, 20, 25, 0.85);
  }
}

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

html {
  font-size: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nav-brand {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 0 2rem;
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero Section */
.hero {
  background: var(--hero-gradient);
  padding: 5rem 2rem 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4rem;
}

.hero-content {
  text-align: left;
  max-width: 480px;
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 32px rgba(45, 108, 181, 0.2);
}

.hero h1 {
  font-size: 3.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 440px;
  margin-bottom: 1.75rem;
  line-height: 1.7;
}

.badge-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--privacy-badge);
  flex-shrink: 0;
}

/* Device Mockups */
.hero-devices {
  position: relative;
  flex-shrink: 0;
}

.device-iphone {
  position: relative;
  z-index: 2;
}

.device-frame {
  width: 260px;
  height: 530px;
  background: #1A1A1A;
  border-radius: 40px;
  padding: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.25),
    inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
}

.device-notch {
  width: 100px;
  height: 28px;
  background: #1A1A1A;
  border-radius: 0 0 18px 18px;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}

.screen-placeholder {
  padding: 48px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screen-header {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.placeholder-card {
  background: var(--card-color);
  border-radius: 14px;
  height: 72px;
  position: relative;
  overflow: hidden;
}

.placeholder-card::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 16px;
  width: 45%;
  height: 10px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
}

.placeholder-card::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 14px;
  left: 16px;
  width: 55%;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3) 0px,
    rgba(255, 255, 255, 0.3) 2px,
    transparent 2px,
    transparent 4px
  );
  border-radius: 2px;
}

/* Apple Watch */
.device-watch {
  position: absolute;
  bottom: -10px;
  right: -70px;
  z-index: 3;
}

.watch-frame {
  width: 130px;
  height: 162px;
  background: #2A2A2A;
  border-radius: 32px;
  padding: 10px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
  position: relative;
}

.watch-crown {
  width: 6px;
  height: 22px;
  background: #3A3A3A;
  border-radius: 3px;
  position: absolute;
  right: -4px;
  top: 42%;
  transform: translateY(-50%);
}

.watch-button {
  width: 6px;
  height: 12px;
  background: #3A3A3A;
  border-radius: 3px;
  position: absolute;
  right: -4px;
  top: 58%;
}

.watch-screen {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.watch-screen-header {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #F0F0F0;
  margin-bottom: 2px;
}

.placeholder-card-sm {
  background: var(--card-color);
  border-radius: 10px;
  height: 44px;
  position: relative;
  overflow: hidden;
}

.placeholder-card-sm::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  width: 50%;
  height: 7px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 3px;
}

.placeholder-card-sm::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 10px;
  width: 40%;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3) 0px,
    rgba(255, 255, 255, 0.3) 1.5px,
    transparent 1.5px,
    transparent 3px
  );
  border-radius: 2px;
}

/* Sections */
.section {
  max-width: 980px;
  margin: 0 auto;
  padding: 5rem 2rem;
  scroll-margin-top: 56px;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.0625rem;
  margin-bottom: 3rem;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(45, 108, 181, 0.1);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(45, 108, 181, 0.12);
  background: color-mix(in srgb, var(--icon-color) 12%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.feature-icon {
  font-size: 1.5rem;
  display: block;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Privacy Banner */
#privacy {
  padding: 0 2rem 5rem;
  scroll-margin-top: 56px;
}

.privacy-banner {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3.5rem 2.5rem;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.privacy-banner::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  background: rgba(46, 155, 84, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.privacy-banner::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -30px;
  width: 120px;
  height: 120px;
  background: rgba(45, 108, 181, 0.05);
  border-radius: 50%;
  pointer-events: none;
}

.privacy-banner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
}

.privacy-banner p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
  position: relative;
}

.privacy-list {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 1.5rem;
  position: relative;
}

.privacy-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.privacy-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(46, 155, 84, 0.12);
  color: var(--privacy-badge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all 0.25s ease;
  position: relative;
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(232, 145, 58, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 145, 58, 0.4);
}

.btn-secondary {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(45, 108, 181, 0.2);
}

.btn-secondary:hover {
  background-color: var(--primary);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Open Source Section */
.open-source {
  text-align: center;
  padding: 4rem 2rem 5rem;
}

.open-source h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.open-source p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  max-width: 560px;
  margin: 0 auto 1.25rem;
  line-height: 1.7;
}

.code-block {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  margin: 0 auto 1.75rem;
  max-width: 520px;
  font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  color: var(--primary);
  user-select: all;
  overflow-x: auto;
  white-space: nowrap;
}

/* Footer */
.footer {
  border-top: 1px solid var(--card-border);
  padding: 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

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

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Barcode Types */
.barcode-types {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.barcode-tag {
  background-color: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-bottom: 2px solid var(--primary);
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  transition: transform 0.2s ease;
}

.barcode-tag:hover {
  transform: translateY(-2px);
}

/* Privacy Page */
.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.page-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-content .last-updated {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 2.5rem;
}

.page-content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.page-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.page-content ul {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.page-content li {
  margin-bottom: 0.375rem;
}

/* Scroll Animations — only active when JS adds .js-animations to <html> */
.js-animations .feature-card,
.js-animations .privacy-banner,
.js-animations .open-source,
.js-animations .hero-devices {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-animations .feature-card.in-view,
.js-animations .privacy-banner.in-view,
.js-animations .open-source.in-view,
.js-animations .hero-devices.in-view {
  opacity: 1;
  transform: translateY(0);
}

.js-animations .feature-card:nth-child(2):not(.in-view) { transition-delay: 0.08s; }
.js-animations .feature-card:nth-child(3):not(.in-view) { transition-delay: 0.16s; }
.js-animations .feature-card:nth-child(4):not(.in-view) { transition-delay: 0.24s; }
.js-animations .feature-card:nth-child(5):not(.in-view) { transition-delay: 0.32s; }
.js-animations .feature-card:nth-child(6):not(.in-view) { transition-delay: 0.4s; }

/* Responsive — Tablet */
@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    gap: 2.5rem;
  }

  .hero-content {
    text-align: center;
    max-width: 100%;
  }

  .hero .tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .badge-row {
    justify-content: center;
  }

  .hero-devices {
    transform: scale(0.8);
    transform-origin: center top;
  }

  .hero {
    overflow: hidden;
  }
}

/* Responsive — Mobile */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.25rem;
  }

  .hero .tagline {
    font-size: 1rem;
  }

  .hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .hero-devices {
    transform: scale(0.65);
    transform-origin: center top;
  }

  .device-watch {
    display: none;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .privacy-list {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .privacy-banner {
    padding: 2.5rem 1.5rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .page-content h1 {
    font-size: 1.75rem;
  }

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

  .code-block {
    font-size: 0.75rem;
    padding: 0.625rem 1rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .js-animations .feature-card,
  .js-animations .privacy-banner,
  .js-animations .open-source,
  .js-animations .hero-devices {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .feature-card:hover,
  .btn:hover,
  .barcode-tag:hover {
    transform: none;
  }
}
