:root {
  /* Light mode colors */
  --bg: #faf8f5;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-strong: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.95);
  --text: #1a1612;
  --text-secondary: #4a433d;
  --muted: #6b6258;
  --line: rgba(26, 22, 18, 0.08);
  --line-strong: rgba(26, 22, 18, 0.15);
  --accent: #e85a2b;
  --accent-deep: #c4471f;
  --accent-light: #fcede8;
  --success: #2d8a4e;
  --warning: #d4a017;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(26, 22, 18, 0.06);
  --shadow: 0 8px 32px rgba(26, 22, 18, 0.1);
  --shadow-lg: 0 20px 60px rgba(26, 22, 18, 0.14);
  --shadow-glow: 0 0 40px rgba(232, 90, 43, 0.15);
  
  /* Radius */
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100e;
    --surface: rgba(30, 27, 24, 0.85);
    --surface-strong: #1e1b18;
    --surface-elevated: rgba(38, 34, 30, 0.95);
    --text: #f5f2ef;
    --text-secondary: #c9c3bc;
    --muted: #9a9188;
    --line: rgba(245, 242, 239, 0.08);
    --line-strong: rgba(245, 242, 239, 0.15);
    --accent: #f06b3e;
    --accent-deep: #ff855c;
    --accent-light: rgba(240, 107, 62, 0.15);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(240, 107, 62, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background: var(--accent-light);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Site shell */
.site-shell {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 64px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  margin: 0 -24px 32px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.brand:hover .brand-mark {
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Navigation */
.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.site-nav a:active {
  transform: scale(0.98);
}

/* Main content */
main {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero section */
.hero {
  display: block;
  margin-bottom: 24px;
}

.hero-copy {
  width: 100%;
  max-width: 960px;
  padding: 48px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 16px;
  font: 700 0.75rem/1 system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  font-weight: 800;
  max-width: 24ch;
}

.hero-text {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 52ch;
  margin: 0;
}

.hero-media {
  margin: 8px 0 4px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.hero-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transition: transform var(--transition-slow);
  margin: 0;
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.hero-video:hover {
  transform: scale(1.01);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font: 600 0.95rem/1 system-ui, sans-serif;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.button:hover::before {
  opacity: 1;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232, 90, 43, 0.3);
}

.button-primary:hover {
  box-shadow: 0 6px 24px rgba(232, 90, 43, 0.4);
  transform: translateY(-1px);
}

.button-secondary {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-elevated);
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  padding: 14px 20px;
}

.button-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

/* Chrome Store button specific */
.button-chrome {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.button-chrome:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(232, 90, 43, 0.15);
}

.button-chrome svg {
  width: 20px;
  height: 20px;
}

/* Sections */
.section {
  padding: 64px 0 0;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

.section h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--muted);
  font-size: 1.1rem;
}

/* Feature grid */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  padding: 28px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 24px;
  transition: transform var(--transition-fast);
}

.card:hover .card-icon {
  transform: scale(1.05);
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* Screenshot grid */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.shot-card {
  margin: 0;
  padding: 20px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  overflow: hidden;
}

.shot-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.shot-card-large {
  grid-column: 1 / -1;
}

.shot-card img {
  display: block;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  transition: transform var(--transition-slow);
}

.shot-card:hover img {
  transform: scale(1.02);
}

.shot-card figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Image loading state */
.shot-card img {
  opacity: 0;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.shot-card img.loaded {
  opacity: 1;
}

/* Accent section */
.section-accent {
  margin-top: 48px;
  padding: 48px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--surface) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.section-accent h2 {
  margin-bottom: 12px;
}

.section-accent > p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 50ch;
  margin: 0 auto 24px;
}

.link-list {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.link-list a {
  padding: 12px 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.link-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 64px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footer-links a {
  color: var(--muted);
  transition: color var(--transition-fast);
}

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

/* Page panels (for support/privacy pages) */
.page-panel {
  padding: 48px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: fadeInUp 0.5s ease-out;
}

.page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: none;
}

.page-lead {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.7;
  max-width: 64ch;
  margin: 16px 0 0;
}

.page-content {
  max-width: 75ch;
}

.page-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text);
}

.page-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text);
}

.page-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 0 0 16px;
}

.page-content ul,
.page-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.page-content li {
  margin-bottom: 8px;
}

.page-content li::marker {
  color: var(--accent);
}

.page-content code {
  background: var(--surface-strong);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  border: 1px solid var(--line);
}

.page-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: all var(--transition-fast);
}

.page-content a:hover {
  color: var(--accent-deep);
  text-underline-offset: 4px;
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.back-link:hover {
  color: var(--text);
  transform: translateX(-4px);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* Responsive */
@media (max-width: 960px) {
  .grid,
  .shot-grid {
    grid-template-columns: 1fr;
  }
  
  .shot-card-large {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .site-shell {
    width: calc(100% - 32px);
    padding: 0 0 48px;
  }
  
  .site-header {
    padding: 12px 16px;
    margin: 0 -16px 24px;
  }
  
  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
  
  .hero-copy,
  .page-panel {
    padding: 24px;
  }
  
  .section {
    padding: 40px 0 0;
  }
  
  .section-accent {
    padding: 32px 24px;
  }
  
  .hero-actions {
    flex-direction: column;
  }
  
  .button {
    width: 100%;
  }
  
  .card {
    padding: 20px;
  }
  
  .card-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

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

/* Print styles */
@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .section-accent {
    display: none;
  }
  
  .page-panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: white;
    color: black;
  }
}
