/*
 * Zephyr — Demo Website Styles
 * 基于 AETHER 设计系统 (os.css :root 变量)
 * Surpassing Claude Design System & Apple App Store
 */

/* ═══════════════════════════════════════
   0. Base Overrides
═══════════════════════════════════════ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 56px;
}

body {
  overflow-x: hidden;
  -webkit-user-select: auto;
  user-select: auto;
  background: var(--depth-0-void);
  text-wrap: pretty;
}

/* L-06: Noise texture overlay — replaced heavy SVG feTurbulence with lightweight pre-generated PNG */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  /* Tiny 100x100 noise PNG (~300 bytes) vs ~800 byte SVG feTurbulence — avoids per-pixel filter computation */
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAN0lEQVQYV2P4z8BQz4AEGBhY/jMwsIJYjEDGfwYGJhANEmAE0UwMDAwMIAVgFSAaZBJYEagYGBkAAANzmH8W0s9xHAAAAAElFTkSuQmCC");
  background-repeat: repeat;
  background-size: 100px 100px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration-fast);
}
a:hover {
  color: var(--accent-hover);
}

::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}

/* Global focus-visible — Claude + Apple pattern */
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════
   1. Navigation (.site-nav)
═══════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 64px);
  z-index: 900;
  background: transparent;
  border-bottom: 0.5px solid transparent;
  transition:
    background var(--duration-normal),
    border-color var(--duration-normal),
    backdrop-filter var(--duration-normal);
}

.site-nav.scrolled {
  background: rgba(15, 14, 13, 0.72);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border-bottom-color: var(--border-subtle);
}

[data-theme="light"] .site-nav.scrolled {
  background: rgba(232, 229, 222, 0.72);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  transition:
    color var(--duration-fast),
    background var(--duration-fast);
  position: relative;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--accent-subtle);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 8px;
  right: 8px;
  height: 1.5px;
  background: var(--accent);
  border-radius: var(--radius-full);
  transform: scaleX(0);
  transition: transform var(--duration-fast) var(--spring-standard);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: var(--radius-md);
  transition:
    background var(--duration-fast),
    transform var(--duration-fast),
    box-shadow var(--duration-fast);
}

.nav-github:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.nav-github svg {
  width: 14px;
  height: 14px;
}

.theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  transition:
    color var(--duration-fast),
    background var(--duration-fast);
}

.theme-toggle:hover {
  color: var(--text-secondary);
  background: var(--accent-dim);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ── Language Toggle Button ── */
.nav-lang-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background var(--duration-fast);
}

.nav-lang-toggle:hover {
  color: var(--text-secondary);
  background: var(--accent-dim);
}

.nav-lang-toggle svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 1024px) {
  .nav-lang-toggle {
    width: 44px;
    height: 44px;
  }

  .nav-lang-toggle svg {
    width: 20px;
    height: 20px;
  }
}

/* ═══════════════════════════════════════
   2. Hero (.hero)
═══════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(80px, 12vw, 160px) clamp(24px, 5vw, 64px) 80px;
  position: relative;
  overflow: hidden;
}

/* Gradient mesh background — Claude pattern (enhanced) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 25% 15%, rgba(124, 139, 160, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 75% 25%, rgba(124, 139, 160, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 60% 75%, rgba(124, 139, 160, 0.04) 0%, transparent 55%),
    radial-gradient(ellipse 35% 30% at 15% 65%, rgba(124, 139, 160, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  will-change: transform;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 5.5vw, 72px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.0;
  color: var(--text-primary);
  max-width: 720px;
  margin: 0 auto;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--text-secondary);
  margin-top: 20px;
  font-weight: 400;
  text-wrap: balance;
}

.hero-philosophy {
  font-family: var(--font-data, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace);
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 16px;
  letter-spacing: 0.05em;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  justify-content: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-inverse);
  background: var(--accent);
  border-radius: var(--radius-md);
  transition:
    background var(--duration-fast),
    transform var(--duration-fast),
    box-shadow var(--duration-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--text-inverse);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  transition:
    color var(--duration-fast),
    border-color var(--duration-fast),
    transform var(--duration-fast);
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-primary svg,
.btn-secondary svg {
  width: 16px;
  height: 16px;
}

/* ── Hero Showcase (CSS-only abstract UI) ── */
.hero-showcase {
  position: relative;
  z-index: 1;
  margin-top: 72px;
  max-width: 900px;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--depth-2-deep);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-depth-5);
  overflow: hidden;
}

.hero-showcase::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(124, 139, 160, 0.03) 0%,
    transparent 40%,
    transparent 60%,
    rgba(124, 139, 160, 0.02) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.hero-showcase-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Top bar with traffic-light dots */
.hero-showcase-bar {
  height: 28px;
  min-height: 28px;
  background: var(--depth-2-deep);
  border-bottom: 0.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

.hero-showcase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.hero-showcase-dot:nth-child(1) { background: #FF5F57; }
.hero-showcase-dot:nth-child(2) { background: #FEBC2E; }
.hero-showcase-dot:nth-child(3) { background: #28C840; }

/* Content area: sidebar + main */
.hero-showcase-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Left sidebar */
.hero-showcase-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--depth-2-deep);
  border-right: 0.5px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.hero-showcase-menu-item {
  height: 12px;
  border-radius: var(--radius-xs);
  background: var(--depth-4-raised);
}

.hero-showcase-menu-item:nth-child(1) { width: 70%; }
.hero-showcase-menu-item:nth-child(2) { width: 55%; }
.hero-showcase-menu-item:nth-child(3) { width: 80%; }
.hero-showcase-menu-item:nth-child(4) { width: 45%; }

/* Right main area with abstract chart */
.hero-showcase-main {
  flex: 1;
  background: var(--depth-3-surface);
  position: relative;
  overflow: hidden;
}

.hero-showcase-main canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════
   3. Philosophy (.philosophy)
═══════════════════════════════════════ */
.philosophy {
  padding: clamp(64px, 8vw, 128px) 0;
}

.philosophy-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(24px, 5vw, 64px);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.philosophy-quote {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 24px;
  max-width: 680px;
  text-wrap: balance;
}

.philosophy-author {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 16px;
}

.philosophy-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.philosophy-card {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition:
    transform 250ms var(--spring-standard),
    border-color 250ms;
}

.philosophy-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-default);
}

.philosophy-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.philosophy-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  text-wrap: pretty;
}

.philosophy-body {
  margin-top: 32px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 420px;
  text-wrap: pretty;
}

/* ═══════════════════════════════════════
   12. Section Common
═══════════════════════════════════════ */
.section {
  padding: clamp(64px, 8vw, 128px) 0;
  position: relative;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(24px, 5vw, 64px);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

/* Section label — Claude pattern */
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.section-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 12px auto 0;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Subtle gradient mesh for alternating sections — Claude pattern */
#features::before,
#security::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(124, 139, 160, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 20% 80%, rgba(124, 139, 160, 0.025) 0%, transparent 55%);
}

[data-theme="light"] #features::before,
[data-theme="light"] #security::before {
  background:
    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(90, 106, 128, 0.025) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 20% 80%, rgba(90, 106, 128, 0.02) 0%, transparent 55%);
}

/* ═══════════════════════════════════════
   4. Features — Bento Grid (.features)
═══════════════════════════════════════ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}

.feature-card.large {
  grid-column: span 2;
  grid-row: span 2;
}

.feature-card.wide {
  grid-column: span 2;
}

.feature-card {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition:
    transform 250ms var(--spring-standard),
    box-shadow 250ms var(--spring-standard),
    border-color 250ms;
  box-shadow: var(--shadow-depth-2);
}

/* Subtle gradient overlay on hover — Apple-inspired */
.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(
    135deg,
    rgba(124, 139, 160, 0.04) 0%,
    transparent 50%
  );
  transition: opacity 210ms;
  pointer-events: none;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-depth-4);
  border-color: var(--border-default);
}

.feature-card:hover::after {
  opacity: 1;
}

.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: var(--radius-lg);
  color: var(--accent);
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 20px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Large card extra padding */
.feature-card.large {
  padding: 32px;
}

/* Chart preview inside the large feature card */
.chart-preview {
  height: 120px;
  background: var(--depth-1-abyss);
  border-radius: var(--radius-md);
  margin-top: 16px;
  overflow: hidden;
  position: relative;
  border: 0.5px solid var(--border-subtle);
}

.chart-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

[data-theme="light"] .chart-preview {
  background: var(--depth-1-abyss);
  border-color: var(--border-subtle);
}

/* ═══════════════════════════════════════
   5. Architecture (.architecture)
═══════════════════════════════════════ */
.arch-stack {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.arch-layer {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-left: 2px solid var(--accent);
  padding: 20px 24px;
  position: relative;
}

.arch-layer:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.arch-layer:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.arch-layer + .arch-layer {
  border-radius: 0;
  margin-top: -1px;
}

.arch-layer-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arch-layer-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.6;
}

.arch-arrow {
  text-align: center;
  padding: 4px 0;
  color: var(--text-ghost);
}

.arch-arrow svg {
  width: 16px;
  height: 16px;
}

.arch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.arch-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  background: var(--depth-4-raised);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  border: 0.5px solid var(--border-subtle);
}

/* ═══════════════════════════════════════
   6. Security (.security)
═══════════════════════════════════════ */
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.security-card {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 250ms var(--spring-standard),
    border-color 250ms;
}

/* Subtle gradient overlay on hover — Apple-inspired */
.security-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(
    135deg,
    rgba(124, 139, 160, 0.04) 0%,
    transparent 50%
  );
  transition: opacity 210ms;
  pointer-events: none;
}

.security-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-default);
}

.security-card:hover::after {
  opacity: 1;
}

.security-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.security-icon svg {
  width: 28px;
  height: 28px;
}

.security-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 12px;
}

.security-card p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ═══════════════════════════════════════
   7. Performance (.performance)
   ═══════════════════════════════════════ */
/* perf-grid, perf-card, perf-unit, perf-label, perf-compare — see Launch Overlay section below */

/* ═══════════════════════════════════════
   8. Demo Section (.demo)
═══════════════════════════════════════ */
.demo-container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  background: var(--depth-0-void);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 1px var(--border-subtle),
    var(--shadow-depth-5),
    0 0 80px -20px var(--accent-glow);
}

#osContainer {
  width: 100%;
  height: 100%;
  position: relative;
}

#osContainer .os-desktop {
  width: 100%;
  height: 100%;
}

/* ── Demo Expand Button ── */
.demo-expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--depth-4-raised);
  border: 0.5px solid var(--border-default);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.demo-expand-btn:hover {
  background: var(--depth-5-float);
  color: var(--text-primary);
  transform: scale(1.1);
}

.demo-container.expanded {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: unset;
  border-radius: 0;
  z-index: 9999;
  animation: demo-expand 400ms var(--spring-standard) both;
}

@keyframes demo-expand {
  0% { border-radius: var(--radius-xl); }
  100% { border-radius: 0; }
}

/* ═══════════════════════════════════════
   9. Footer (.site-footer)
═══════════════════════════════════════ */
.site-footer {
  padding: 64px 0 32px;
  border-top: 0.5px solid var(--border-subtle);
  text-align: left;
  min-height: 88px;
  background: var(--depth-1-abyss);
}

[data-theme="light"] .site-footer {
  background: var(--depth-2-deep);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: clamp(24px, 5vw, 64px);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* Default: hide mobile CTA, show desktop CTAs */
.hero-cta-mobile {
  display: none !important;
}

.hero-cta-desktop {
  display: inline-flex !important;
}

@media (max-width: 480px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Hide demo section on mobile */
  #demo {
    display: none;
  }

  /* Show mobile-only CTA in hero */
  .hero-cta-mobile {
    display: inline-flex !important;
  }

  .hero-cta-desktop {
    display: none !important;
  }

  /* Hide demo link in mobile nav drawer */
  .nav-mobile-drawer a[href="#demo"] {
    display: none;
  }
}

/* footer-col, footer-col h4, footer-col a, footer-bottom — see Launch Overlay section below */

/* ═══════════════════════════════════════
   10. Animations & Reveal System
═══════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms var(--spring-standard),
    transform 600ms var(--spring-standard);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Direction variants — enhanced reveal system */
.reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity 600ms var(--spring-standard),
    transform 600ms var(--spring-standard);
}

.reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition:
    opacity 600ms var(--spring-standard),
    transform 600ms var(--spring-standard);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition:
    opacity 600ms var(--spring-standard),
    transform 600ms var(--spring-standard);
}

.reveal-left.revealed,
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays — Claude pattern (0/80/160/240/320/400ms) */
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }
.reveal[data-delay="5"] { transition-delay: 400ms; }

.reveal-left[data-delay="1"],
.reveal-right[data-delay="1"],
.reveal-scale[data-delay="1"] { transition-delay: 80ms; }

.reveal-left[data-delay="2"],
.reveal-right[data-delay="2"],
.reveal-scale[data-delay="2"] { transition-delay: 160ms; }

.reveal-left[data-delay="3"],
.reveal-right[data-delay="3"],
.reveal-scale[data-delay="3"] { transition-delay: 240ms; }

.reveal-left[data-delay="4"],
.reveal-right[data-delay="4"],
.reveal-scale[data-delay="4"] { transition-delay: 320ms; }

.reveal-left[data-delay="5"],
.reveal-right[data-delay="5"],
.reveal-scale[data-delay="5"] { transition-delay: 400ms; }

/* Blur variant — Apple-inspired */
.reveal-blur {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(16px);
  transition:
    opacity 600ms var(--spring-standard),
    filter 600ms var(--spring-standard),
    transform 600ms var(--spring-standard);
}

.reveal-blur.revealed {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Card glow effect — JS sets --mouse-x/--mouse-y */
.feature-card::before,
.security-card::before,
.philosophy-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(124, 139, 160, 0.06) 0%,
    transparent 60%
  );
  transition: opacity 300ms;
  pointer-events: none;
  z-index: 0;
}

.feature-card:hover::before,
.security-card:hover::before,
.philosophy-card:hover::before {
  opacity: 1;
}

/* Ensure card content stays above glow */
.feature-card > *,
.security-card > * {
  position: relative;
  z-index: 2;
}

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

  .features-grid .feature-card.large,
  .features-grid .feature-card.wide {
    grid-column: span 2;
  }

  .security-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .features-grid .feature-card.large,
  .features-grid .feature-card.wide {
    grid-column: span 1;
  }

  .features-grid .feature-card.large {
    grid-row: span 1;
  }

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

  .perf-metrics {
    flex-direction: column;
    gap: 32px;
  }

  .hero {
    padding: clamp(80px, 12vw, 160px) 24px 60px;
  }

  .hero-showcase {
    margin-top: 48px;
  }

  .demo-container {
    border-radius: var(--radius-lg);
  }

  .nav-github span {
    display: none;
  }

  .nav-github {
    padding: 8px;
  }

  .arch-stack {
    max-width: 100%;
  }
}

/* ═══════════════════════════════════════
   12. Reduced Motion — Apple pattern
═══════════════════════════════════════ */
@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;
  }
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-blur {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ═══════════════════════════════════════════════════
   Launch Overlay (Demo Launch)
   ═══════════════════════════════════════════════════ */
.demo-launch-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, var(--accent-glow) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 30% 70%, var(--accent-subtle) 0%, transparent 50%),
    var(--depth-0-void);
}

.demo-launch-overlay.launching .demo-launch-content {
  opacity: 0;
  transform: scale(0.9);
}

.demo-launch-overlay.launching .demo-launch-icon {
  transform: scale(0);
  opacity: 0;
}

.demo-launch-overlay.launching .demo-launch-btn {
  transform: scale(0.8);
  opacity: 0;
}

.demo-launch-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.demo-launch-particles .launch-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  animation: particle-float linear infinite;
}

.demo-launch-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transition: opacity 500ms ease, transform 500ms var(--spring-standard);
}

.demo-launch-content h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.demo-launch-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.demo-launch-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-subtle);
  animation: launch-icon-breathe 3s ease-in-out infinite;
  transition: transform 600ms var(--spring-bouncy), opacity 600ms ease;
}

.demo-launch-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes launch-icon-breathe {
  0%, 100% { box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-subtle); transform: scale(1); }
  50% { box-shadow: 0 0 60px var(--accent-glow), 0 0 120px var(--accent-dim); transform: scale(1.03); }
}

.demo-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0 20px var(--accent-glow);
  margin-top: 8px;
  transition: transform 600ms var(--spring-bouncy) 200ms, opacity 600ms ease 200ms, background var(--duration-fast);
}

.demo-launch-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.05);
  box-shadow: 0 0 30px var(--accent-glow);
}

.demo-launch-btn:active {
  transform: scale(0.97);
}

.demo-launch-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Demo Frame ── */
.demo-frame-wrapper {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--depth-0-void);
}

.demo-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Demo Limitations Notice ── */
.demo-limitations {
  margin-top: 24px;
  padding: 16px 24px;
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.demo-limitations-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.demo-limitations p:last-child {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.7;
  margin: 0;
}

.demo-limitations strong {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Security CTA ── */
.security-cta {
  text-align: center;
  margin-top: 40px;
}

/* ── Ghost Button ── */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  transition:
    color var(--duration-fast),
    background var(--duration-fast),
    transform var(--duration-fast);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.btn-ghost svg {
  width: 16px;
  height: 16px;
}

/* ═══════════════════════════════════════════════════
   Performance Grid (.perf-grid)
   ═══════════════════════════════════════════════════ */
.perf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.perf-card {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 250ms var(--spring-standard),
    border-color 250ms;
}

.perf-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(
    135deg,
    rgba(124, 139, 160, 0.04) 0%,
    transparent 50%
  );
  transition: opacity 210ms;
  pointer-events: none;
}

.perf-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-default);
}

.perf-card:hover::after {
  opacity: 1;
}

.perf-card > * {
  position: relative;
  z-index: 2;
}

.perf-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 8px;
}

.perf-number {
  font-family: var(--font-display);
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 300;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.perf-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.perf-compare {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-style: italic;
}

/* ── Footer Column ── */
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.footer-col a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
  text-decoration: underline transparent;
  text-underline-offset: 3px;
}

.footer-col a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 0.5px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-ghost);
  text-align: center;
}

.footer-bottom p {
  margin: 0;
}

/* ── Responsive: Performance Grid ── */
@media (max-width: 768px) {
  .perf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .perf-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════
   UX Improvements — All Priorities
   ═══════════════════════════════════════ */

/* ── P0: Hamburger Menu ── */
.nav-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast);
}

.nav-hamburger:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

/* Mobile nav overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 899;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.nav-mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile nav drawer */
.nav-mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  z-index: 901;
  background: var(--depth-2-deep);
  border-left: 0.5px solid var(--border-subtle);
  padding: 72px 24px 24px;
  transform: translateX(100%);
  transition: transform 350ms var(--spring-standard);
}

.nav-mobile-drawer.open {
  transform: translateX(0);
}

.nav-mobile-drawer a {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 0.5px solid var(--border-subtle);
  transition: color var(--duration-fast);
}

.nav-mobile-drawer a:hover,
.nav-mobile-drawer a.active {
  color: var(--accent);
}

@media (max-width: 1024px) {
  .nav-hamburger {
    display: flex;
  }
  .nav-mobile-overlay,
  .nav-mobile-drawer {
    display: block;
  }

  /* Unified icon button sizing on mobile */
  .nav-github {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .nav-github svg {
    width: 16px;
    height: 16px;
  }
  .theme-toggle {
    width: 32px;
    height: 32px;
  }
  .theme-toggle svg {
    width: 16px;
    height: 16px;
  }
  .nav-hamburger {
    width: 32px;
    height: 32px;
  }
  .nav-hamburger svg {
    width: 16px;
    height: 16px;
  }
  .nav-lang-toggle {
    width: 32px;
    height: 32px;
  }
  .nav-lang-toggle svg {
    width: 16px;
    height: 16px;
  }
}

/* ── P0: Touch Target Sizes ── */
@media (pointer: coarse) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
  .demo-expand-btn {
    width: 44px;
    height: 44px;
  }
  .nav-links a {
    padding: 8px 12px;
    margin: -8px -12px;
  }
}

/* ── P1: Security Card Font Sizes ── */
.security-card h3 {
  font-size: 14px;
}

.security-card p {
  font-size: 13px;
  margin-top: 8px;
}

/* ── P1: Demo Limitations Font ── */
.demo-limitations p:last-child {
  font-size: 13px;
}

.demo-limitations-title {
  font-size: 13px;
}

/* ── P1: Demo Launch Hint ── */
.demo-launch-hint {
  font-size: 12px;
  color: var(--text-ghost);
  margin: 0;
  opacity: 0.7;
}

.demo-launch-limitation {
  font-size: 11px;
  color: var(--text-ghost);
  margin: 0;
  opacity: 0.6;
  max-width: 280px;
  text-align: center;
}

/* ── P0: Demo Loading Indicator ── */
.demo-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--depth-0-void);
  z-index: 50;
}

.demo-loading p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
}

.demo-loading-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: demo-spin 0.8s linear infinite;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

/* ── P1: FAQ Section ── */
.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--depth-3-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 250ms;
}

.faq-item:hover {
  border-color: var(--border-default);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  line-height: 1.5;
  transition: color var(--duration-fast);
}

.faq-question:hover {
  color: var(--accent);
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 300ms var(--spring-standard);
  color: var(--text-tertiary);
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms var(--spring-standard), padding 300ms ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding: 0 20px 18px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  text-wrap: pretty;
}

/* ── P1: CTA Section ── */
.cta-section {
  padding: clamp(64px, 8vw, 128px) 0;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(124, 139, 160, 0.04) 0%, transparent 60%);
}

.cta-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  padding-inline: clamp(24px, 5vw, 64px);
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.cta-desc {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 12px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ── P3: Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--depth-4-raised);
  border: 0.5px solid var(--border-default);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 300ms var(--spring-standard),
    transform 300ms var(--spring-standard),
    background var(--duration-fast),
    color var(--duration-fast),
    box-shadow var(--duration-fast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--depth-5-float);
  color: var(--text-primary);
  box-shadow: var(--shadow-depth-3);
}

/* ── P2: Architecture User-Friendly Description ── */
.arch-layer-user-desc {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-style: italic;
}

/* ── P2: Perf Card Spacing ── */
.perf-unit {
  margin-top: 8px;
}

.perf-compare {
  margin-top: 2px;
}

/* ── P2: Security card groups ── */
.security-group-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-ghost);
  padding-top: 8px;
}

.security-group-label:first-child {
  padding-top: 0;
}
