/* ===== CSS Variables (Light Theme) ===== */
:root {
  /* Colors - Light Theme */
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: rgba(255, 255, 255, 0.5);

  --text-primary: #2d3436;
  --text-secondary: rgba(45, 52, 54, 0.65);
  --text-tertiary: rgba(45, 52, 54, 0.38);

  --primary-color: #6b7785;
  --primary-light: #8a96a3;
  --primary-dark: #4a5563;

  --secondary-color: #9c8b7a;
  --secondary-light: #b5a598;
  --secondary-dark: #7d6f61;

  --border-color: rgba(45, 52, 54, 0.08);
  --shadow-color: rgba(45, 52, 54, 0.1);

  --gradient-primary: linear-gradient(135deg, #6b7785, #8a96a3);
  --gradient-secondary: linear-gradient(135deg, #9c8b7a, #b5a598);

  /* Spacing */
  --container-padding: 1.5rem;
  --section-padding: 5rem 0;

  /* Typography */
  --font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --line-height-base: 1.8;
  --line-height-heading: 1.3;

  /* Border Radius */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(45, 52, 54, 0.04);
  --shadow-md: 0 2px 6px rgba(45, 52, 54, 0.06);
  --shadow-lg: 0 3px 12px rgba(45, 52, 54, 0.08);
  --shadow-xl: 0 4px 16px rgba(45, 52, 54, 0.1);
  --shadow-2xl: 0 6px 20px rgba(45, 52, 54, 0.12);
  --shadow-3xl: 0 8px 24px rgba(45, 52, 54, 0.14);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Dark Theme ===== */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #252525;
  --bg-tertiary: rgba(37, 37, 37, 0.5);

  --text-primary: #e8e6e3;
  --text-secondary: rgba(232, 230, 227, 0.65);
  --text-tertiary: rgba(232, 230, 227, 0.38);

  --border-color: rgba(232, 230, 227, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 3px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-2xl: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-3xl: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* ===== Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
  position: relative;
}

/* ===== Three.js Canvas Background ===== */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 1;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

[data-theme="dark"] #bg-canvas {
  opacity: 1;
}

/* Enhance background with subtle gradient overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(ellipse at top,
      var(--bg-primary) 0%,
      rgba(156, 139, 122, 0.03) 50%,
      var(--bg-primary) 100%);
  pointer-events: none;
}

[data-theme="dark"] body::before {
  background: radial-gradient(ellipse at top,
      var(--bg-primary) 0%,
      rgba(107, 119, 133, 0.05) 50%,
      var(--bg-primary) 100%);
}

/* Ensure all content is above the canvas */
.navbar,
.hero,
.features,
.how-it-works,
.download,
footer {
  position: relative;
  z-index: 1;
}

/* ===== Container ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ===== Navigation ===== */
.navbar {
  position: sticky;
  top: 0;
  background-color: var(--bg-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all var(--transition-base);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: color var(--transition-fast);
}

.nav-brand:hover {
  color: var(--primary-color);
}

.brand-text {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.github-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.github-btn:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.github-btn svg {
  transition: all var(--transition-fast);
}

.github-btn:hover svg {
  transform: scale(1.1);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 3rem 0;
}

.hero-brand-icon {
  margin-bottom: 2rem;
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-2xl);
  transition: all var(--transition-base);
}

.brand-logo:hover {
  transform: scale(1.05) rotate(-2deg);
  box-shadow: var(--shadow-3xl);
}

.hero-bg {
  position: absolute;
  top: -50%;
  right: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle,
      var(--primary-light) 0%,
      var(--secondary-color) 100%);
  opacity: 0.05;
  border-radius: 50%;
  z-index: -1;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(-50px, -50px) rotate(5deg);
  }
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 500;
  line-height: var(--line-height-heading);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  font-family: var(--font-family);
  letter-spacing: 0.03em;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-color);
}

/* ===== Hero Visual (Floating Cards) ===== */
.hero-visual {
  position: relative;
  height: 500px;
}

.floating-card {
  position: absolute;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-2xl);
  animation: floatCard 6s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@keyframes floatCard {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.card-1 {
  top: 10%;
  right: 5%;
  animation-delay: 0s;
  min-width: 200px;
}

.card-2 {
  top: 35%;
  right: 25%;
  animation-delay: 0.5s;
  min-width: 180px;
}

.card-3 {
  bottom: 25%;
  right: 0;
  animation-delay: 1s;
  min-width: 220px;
}

.card-4 {
  bottom: 5%;
  left: 10%;
  animation-delay: 1.5s;
  min-width: 240px;
}

.floating-card svg {
  color: var(--primary-color);
}

.card-line {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  width: 100%;
}

.card-line.short {
  width: 60%;
}

.link-text {
  font-size: 0.875rem;
  color: var(--primary-light);
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-placeholder {
  width: 100%;
  height: 100px;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.snapshot-preview {
  width: 100%;
}

.snapshot-bar {
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 4px 4px 0 0;
}

.snapshot-content {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 0 0 4px 4px;
}

.snapshot-line {
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

.snapshot-line.short {
  width: 70%;
}

/* ===== Sections ===== */
section {
  padding: var(--section-padding);
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Features Section ===== */
.features {
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  perspective: 1000px;
}

.feature-card {
  background: var(--bg-primary);
  padding: 2.5rem 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  transform-style: preserve-3d;
  will-change: transform;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  box-shadow: var(--shadow-3xl);
  border-color: var(--primary-color);
}

.feature-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.feature-icon svg {
  color: white;
}

.feature-title {
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.feature-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.feature-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.feature-highlight span {
  font-size: 0.875rem;
  color: var(--primary-color);
  background: var(--bg-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ===== How It Works Section ===== */
.how-it-works {
  position: relative;
}

.steps-container {
  max-width: 800px;
  margin: 0 auto;
}

.step-item {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.step-number {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.step-description {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.step-divider {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border-color), transparent);
  margin: 0 auto;
}

kbd {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 0.125rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-family: monospace;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
}

/* ===== Download Section ===== */
.download {
  background: var(--bg-secondary);
}

.download-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background: var(--bg-primary);
  padding: 4rem;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-3xl);
}

.download-title {
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.download-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.download-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.download-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.download-feature svg {
  color: var(--primary-color);
}

.download-note {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-top: 1rem;
  text-align: center;
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

/* ===== Extension Preview ===== */
.download-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.extension-preview {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  width: 100%;
  max-width: 320px;
}

.preview-header {
  background: var(--bg-primary);
  padding: 0.75rem;
}

.preview-dots {
  display: flex;
  gap: 0.5rem;
}

.preview-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.3;
}

.preview-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.preview-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
}

.preview-brand-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-family);
}

.preview-content {
  padding: 1.5rem;
}

.preview-title {
  margin-bottom: 1.5rem;
}

.title-bar {
  height: 10px;
  background: var(--border-color);
  border-radius: 5px;
  margin-bottom: 0.5rem;
}

.title-bar.short {
  width: 60%;
}

.preview-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.item-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  flex-shrink: 0;
}

.item-icon.gradient {
  background: var(--gradient-primary);
}

.item-content {
  flex: 1;
}

.content-line {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.content-line.short {
  width: 70%;
}

/* ===== Simple Footer ===== */
.simple-footer {
  background: var(--bg-secondary);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 2rem;
}

.footer-title {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-family: var(--font-family);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.footer-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9375rem;
}

.footer-repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-size: 0.9375rem;
}

.footer-repo-link:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.footer-repo-link svg {
  transition: transform var(--transition-fast);
}

.footer-repo-link:hover svg {
  transform: scale(1.1);
}

.footer-bottom {
  padding-top: 1.5rem;
}

.copyright {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-title {
    font-size: 2.75rem;
  }

  .download-card {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --section-padding: 3rem 0;
  }

  .nav-menu {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.875rem;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-brand-icon {
    margin-bottom: 1.5rem;
  }

  .brand-logo {
    width: 60px;
    height: 60px;
  }

  .hero-title {
    font-size: 2rem;
  }

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

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-divider {
    width: 60px;
    height: 1px;
  }

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

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

  .step-item {
    flex-direction: column;
    gap: 1rem;
  }

  .download-features {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-visual {
    height: 400px;
  }

  .floating-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

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

  .feature-card {
    padding: 2rem 1.5rem;
  }

  .download-card {
    padding: 2rem 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }

  .btn-large {
    padding: 1rem 2rem;
  }

  .footer-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-repo-link {
    width: 100%;
    justify-content: center;
  }
}

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {

  .floating-card,
  .hero-bg {
    animation-play-state: running;
  }

  [data-theme="dark"] .floating-card,
  [data-theme="dark"] .hero-bg {
    animation-play-state: paused;
  }
}

/* ===== Print Styles ===== */
@media print {

  .navbar,
  .hero-actions,
  .download-actions {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .section-title,
  .hero-title {
    font-size: 2rem;
  }
}

/* ===== Focus Styles (Accessibility) ===== */
.btn:focus-visible,
.nav-link:focus-visible,
.github-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===== Text Reveal Animation ===== */
.reveal-text {
  overflow: hidden;
  line-height: 1.2;
}

.reveal-inner {
  display: block;
  transform: translateY(100%);
}