/* ============================================
   IINA Landing Page — Apple-style Design
   ============================================ */

/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Apple palette */
  --bg-white: #ffffff;
  --bg-dark: #000000;
  --bg-alt: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: #2997ff;
  --border: #d2d2d7;
  --border-light: rgba(210, 210, 215, 0.4);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'PingFang SC', 'Hiragino Sans GB', 'Helvetica Neue', 'Inter',
    system-ui, sans-serif;

  /* Spacing */
  --max-width: 980px;
  --section-py: clamp(5rem, 10vw, 8rem);
  --section-px: 1.5rem;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-white);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ─── Container ─── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--section-px);
}

/* ─── Navbar ─── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 48px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  background: transparent;
}

.navbar.scrolled {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background-color: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border-light);
}

.navbar.dark-mode {
  background: transparent;
}

.navbar.dark-mode.scrolled {
  background-color: rgba(0, 0, 0, 0.8);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  width: 28px;
  height: 28px;
  background: var(--text-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo svg {
  width: 14px;
  height: 14px;
  fill: white;
}

.nav-brand span {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.navbar.dark-mode .nav-brand span {
  color: #f5f5f7;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.75rem;
  color: rgba(29, 29, 31, 0.8);
  transition: color 0.2s;
}

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

.navbar.dark-mode .nav-links a {
  color: rgba(245, 245, 247, 0.8);
}

.navbar.dark-mode .nav-links a:hover {
  color: #f5f5f7;
}

.nav-links .github-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent);
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

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

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 18px;
  height: 1.5px;
  background: var(--text-primary);
  transition: all 0.3s;
}

.navbar.dark-mode .nav-toggle span {
  background: #f5f5f7;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
  }

  .navbar.dark-mode .nav-links {
    background: rgba(0, 0, 0, 0.98);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-cta-desktop {
    display: none;
  }
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 500;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
}

.btn-dark {
  background: var(--text-primary);
  color: white;
}

.btn-dark:hover {
  background: #333336;
}

/* ─── Hero ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  position: relative;
  overflow: hidden;
  background: var(--bg-white);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 113, 227, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

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

.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, #1a1a2e, #0a0a14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.hero-icon svg {
  width: 36px;
  height: 36px;
  fill: white;
}

@media (min-width: 768px) {
  .hero-icon {
    width: 96px;
    height: 96px;
    border-radius: 26px;
  }

  .hero-icon svg {
    width: 44px;
    height: 44px;
  }
}

.hero-pronunciation {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-desc {
  font-size: 1rem;
  color: rgba(134, 134, 139, 0.8);
  margin-top: 0.75rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.hero-note {
  margin-top: 1.25rem;
  font-size: 0.75rem;
  color: rgba(134, 134, 139, 0.7);
}

.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator .mouse {
  width: 20px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6px;
}

.scroll-indicator .dot {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--text-secondary);
  animation: scrollBounce 1.5s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.4; }
}

/* ─── Section: Dark Mode ─── */
.section-dark {
  background: var(--bg-dark);
  color: white;
  padding: var(--section-py) var(--section-px);
}

.section-dark .section-label {
  color: var(--accent-light);
}

.section-dark .section-title {
  color: white;
}

.section-dark .section-desc {
  color: var(--text-secondary);
}

/* ─── Section: Alt BG ─── */
.section-alt {
  background: var(--bg-alt);
  padding: var(--section-py) var(--section-px);
}

/* ─── Section: White ─── */
.section-white {
  background: var(--bg-white);
  padding: var(--section-py) var(--section-px);
}

/* ─── Section Common ─── */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.section-desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 32rem;
  margin: 1rem auto 0;
}

/* ─── Split Layout ─── */
.split {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

@media (min-width: 768px) {
  .split {
    flex-direction: row;
    gap: 4rem;
  }
}

.split-text {
  flex: 1;
}

.split-visual {
  flex: 1;
  width: 100%;
}

@media (min-width: 768px) {
  .split-reverse {
    flex-direction: row-reverse;
  }
}

/* ─── macOS Window ─── */
.macos-window {
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.08),
    0 8px 40px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.macos-titlebar {
  height: 36px;
  background: linear-gradient(180deg, #e8e8e8, #d6d6d6);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 7px;
}

.macos-titlebar.dark {
  background: linear-gradient(180deg, #3a3a3a, #2d2d2d);
}

.macos-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.macos-body {
  background: #f5f5f7;
}

.macos-body.dark {
  background: #1a1a1a;
}

/* ─── Feature Cards ─── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.feature-card .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 1rem;
  stroke-width: 1.5;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

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

/* ─── Format Grid ─── */
.format-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .format-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .format-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.format-item {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.3s ease;
}

.format-item:hover {
  transform: translateY(-2px);
}

.format-item .icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  stroke-width: 1.5;
}

.format-item span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 4rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

.stat-value {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

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

/* ─── Plugins Page ─── */
.plugins-hero {
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  background: var(--bg-white);
}

.plugins-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.plugins-hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-top: 1rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.plugin-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .plugin-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .plugin-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .plugin-list.four-columns {
    grid-template-columns: repeat(4, 1fr);
  }
}

.plugin-card {
  background: var(--bg-alt);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.plugin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.plugin-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.plugin-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plugin-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.5;
}

.plugin-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plugin-card-header .version {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.plugin-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.plugin-tags {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.plugin-tag {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  font-weight: 500;
}

.plugin-install {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: gap 0.2s;
}

.plugin-install:hover {
  gap: 0.5rem;
}

.plugin-install svg {
  width: 12px;
  height: 12px;
}

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-white);
  padding: 2rem 1.5rem;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .footer .container {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand .nav-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.footer-brand .nav-logo svg {
  width: 10px;
  height: 10px;
}

.footer-brand span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

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

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 100ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 200ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 300ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 400ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 500ms; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 600ms; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 700ms; }

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Link style ─── */
.link-accent {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.2s;
}

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

.link-accent svg {
  width: 14px;
  height: 14px;
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.mt-10 { margin-top: 2.5rem; }
.mt-16 { margin-top: 4rem; }

/* Mobile-only line break */
@media (max-width: 767px) {
  .mobile-break { display: block; }
}
@media (min-width: 768px) {
  .mobile-break { display: none; }
}
