/* ----- CSS Variables (Light theme default) ----- */
:root {
  --bg-primary: #faf8f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-support: #1e1b1a;
  --bg-input: #f0ebe6;

  --text-primary: #1e1b1a;
  --text-secondary: #3d3532;
  --text-muted: #5f534d;
  --text-support: #cfc6be;
  --text-support-title: #f0ece8;

  --border-color: rgba(30, 27, 26, 0.06);
  --border-card: rgba(30, 27, 26, 0.05);
  --shadow-card: 0 7px 18px rgba(30, 27, 26, 0.02);
  --shadow-card-hover: 0 8px 30px rgba(30, 27, 26, 0.06);
  --shadow-avatar: 0 18px 35px rgba(30, 27, 26, 0.08);

  --gold: #b8860b;
  --gold-hover: #a0730a;
  --gold-bright: #b8860b;

  --avatar-bg: linear-gradient(145deg, #e8e0d8, #d6cdc4);
  --badge-bg: #f0ebe6;
  --badge-text: #1e1b1a;

  --transition: 0.25s;
}

/* ----- Dark theme via system preference (automatic) ----- */
@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --bg-support: #1e1e1e;
    --bg-input: #2a2a2a;

    --text-primary: #f0ece8;
    --text-secondary: #ccc5c0;
    --text-muted: #9a8e87;
    --text-support: #b8aeaa;
    --text-support-title: #f0ece8;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.06);
    --shadow-card: 0 1px 5px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-avatar: 0 1px 5px rgba(0, 0, 0, 0.35);

    --gold: #d4a017;
    --gold-hover: #e8b82a;
    --gold-bright: #d4a017;

    --avatar-bg: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    --badge-bg: #333333;
    --badge-text: #f0ece8;
  }
}

/* ----- Manual overrides (via class on html) ----- */
html.dark {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --bg-card: #242424;
  --bg-support: #1e1e1e;
  --bg-input: #2a2a2a;

  --text-primary: #f0ece8;
  --text-secondary: #ccc5c0;
  --text-muted: #9a8e87;
  --text-support: #b8aeaa;
  --text-support-title: #f0ece8;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.06);
  --shadow-card: 0 1px 5px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-avatar: 0 1px 8px rgba(0, 0, 0, 0.4);

  --gold: #d4a017;
  --gold-hover: #e8b82a;
  --gold-bright: #d4a017;

  --avatar-bg: linear-gradient(145deg, #3a3a3a, #2a2a2a);
  --badge-bg: #333333;
  --badge-text: #f0ece8;
}

html.light {
  --bg-primary: #faf8f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-support: #1e1b1a;
  --bg-input: #f0ebe6;

  --text-primary: #1e1b1a;
  --text-secondary: #3d3532;
  --text-muted: #5f534d;
  --text-support: #cfc6be;
  --text-support-title: #f0ece8;

  --border-color: rgba(30, 27, 26, 0.06);
  --border-card: rgba(30, 27, 26, 0.05);
  --shadow-card: 0 7px 18px rgba(30, 27, 26, 0.02);
  --shadow-card-hover: 0 8px 30px rgba(30, 27, 26, 0.06);
  --shadow-avatar: 0 18px 35px rgba(30, 27, 26, 0.08);

  --gold: #b8860b;
  --gold-hover: #a0730a;
  --gold-bright: #b8860b;

  --avatar-bg: linear-gradient(145deg, #e8e0d8, #d6cdc4);
  --badge-bg: #f0ebe6;
  --badge-text: #1e1b1a;
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Nav --- */
.navbar {
  padding: 28px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  transition: border-color var(--transition);
}

.logo {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.logo span {
  color: var(--gold);
  transition: color var(--transition);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.7em;
  font-size: 0.93rem;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-links-icon {
  height: 0.9em;
  fill: currentColor;
}

.nav-links-icon.x-icon {
  padding-right: 0.37em;
}

.nav-links-icon.buymeacoffee-icon {
  position: relative;
  top: -0.2em;
  height: 1.2em;
  fill: var(--gold-bright);
}

.nav-cta {
  background: var(--text-primary);
  color: var(--bg-primary) !important;
  padding: 10px 24px;
  border-radius: 40px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-cta:hover {
  background: var(--gold) !important;
  color: var(--bg-primary) !important;
}

/* --- Theme Toggle (Manual) --- */
.theme-toggle {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 40px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background var(--transition), border var(--transition), color var(--transition), box-shadow 0.2s;
  font-family: inherit;
  font-weight: 500;
  box-shadow: var(--shadow-card);
}

.theme-toggle:hover {
  border-color: var(--gold);
  color: var(--text-primary);
  box-shadow: var(--shadow-card-hover);
}

.theme-toggle .icon {
  font-size: 1.1rem;
  line-height: 1;
}

.theme-toggle .label {
  min-width: 36px;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.theme-toggle .separator {
  opacity: 0.3;
  font-weight: 300;
  margin: 0 2px;
}

/* --- Hero --- */
.hero {
  padding: 60px 0 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-content h1 .highlight {
  color: var(--gold);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary {
  display: inline-block;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 14px 36px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.25s, transform 0.15s, color 0.25s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--gold);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-primary);
  padding: 14px 36px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid var(--text-primary);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.15s;
}

.btn-secondary:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
  transform: translateY(-2px);
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image .avatar-placeholder {
  overflow: hidden;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.04em;
  box-shadow: var(--shadow-avatar);
  border: 4px solid var(--bg-secondary);
  transition: background var(--transition), box-shadow var(--transition), border var(--transition), color var(--transition);
}

.hero-image .avatar-placeholder span {
  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }
}

/* --- Stats bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 32px 40px;
  margin: 20px 0 50px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
  transition: background var(--transition), box-shadow var(--transition), border var(--transition);
}

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

.stat-number {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-number .accent {
  color: var(--gold);
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* --- Story Section --- */
.story {
  padding: 40px 0 60px;
}

.story h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.story-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.story-text p:last-child {
  margin-bottom: 0;
}

.story-text strong {
  color: var(--text-primary);
}

.story-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s, background var(--transition), border var(--transition);
}

.feature-card .icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

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

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Plugins --- */
.plugins {
  padding: 50px 0 60px;
  border-top: 1px solid var(--border-color);
  transition: border-color var(--transition);
}

.plugins-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.plugins-header h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.plugins-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 400px;
}

.plugin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.plugin-card {
  background: var(--bg-card);
  padding: 28px 24px;
  border-radius: 18px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.25s, background var(--transition), border var(--transition);
  text-align: center;
  text-decoration: none;
}

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

.plugin-card .emoji-big {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

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

.plugin-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.plugin-badge {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 40px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}

.plugin-card .plugin-card-icon {
  font-size: 2.8rem;
  margin-bottom: 8px;

  svg {
    width: 2em;
    height: 2em;
    fill: var(--gold-bright);
  }
}

/* --- Support Ticket Stat --- */
.support-highlight {
  background: var(--bg-support);
  color: var(--bg-primary);
  border-radius: 24px;
  padding: 48px 50px;
  margin: 40px 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-shadow: var(--shadow-card);
  transition: background var(--transition), color var(--transition);
}

.support-highlight .text {
  flex: 2;
  min-width: 220px;
}

.support-highlight .text h3 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text-support-title);
}

.support-highlight .text p {
  color: var(--text-support);
  font-size: 1rem;
  max-width: 480px;
  margin: 0;
}

.support-highlight .big-number {
  flex: 1;
  text-align: center;
  min-width: 140px;
}

.support-highlight .big-number .num {
  font-size: 3.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-bright);
  letter-spacing: -0.03em;
}

.support-highlight .big-number .label {
  font-size: 0.9rem;
  color: var(--text-support);
  font-weight: 400;
}

/* --- Footer / CTA --- */
.footer-cta {
  padding: 30px 0 50px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  transition: border-color var(--transition);
}

.footer-cta p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.footer-cta .btn-primary {
  background: var(--gold);
  color: var(--bg-primary);
}

.footer-cta .btn-primary:hover {
  background: var(--gold-hover);
}

.footer-cta-icon {
  height: 1.1em;
  fill: var(--gold-bright);
}

.footer-cta .domain-big {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-cta .domain-big span {
  display: inline-block;
  background: var(--text-primary);
  color: var(--bg-primary);
  margin-right: 0.025em;
  padding: 0.1em 0.1em;
  line-height: 1;
  border-radius: 1px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0 10px;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  transition: border-color var(--transition), color var(--transition);
}

.footer-bottom a {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;

  svg {
    height: 0.9em;
  }

  .x-icon {
    fill: currentColor;
    padding-right: 0.35em;
  }

  .buymeacoffee-icon {
    height: 1em;
    fill: var(--gold-bright);
  }
}

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

/* --- Responsive --- */
@media (max-width: 820px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
    padding: 30px 0 20px;
  }

  .hero-content p {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-image .avatar-placeholder {
    width: 200px;
    height: 200px;
    font-size: 3.4rem;
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .stats-bar {
    grid-template-columns: 1fr 1fr 1fr;
    padding: 24px 20px;
    gap: 12px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .support-highlight {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .support-highlight .text p {
    max-width: 100%;
  }

  .support-highlight .big-number .num {
    font-size: 3rem;
  }

  .plugins-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links {
    gap: 16px;
    font-size: 0;
  }

  .nav-links-icon {
    font-size: 1.1rem;
  }
  .nav-links-icon.x-icon {
    padding-right: 0;
  }
  .nav-links-icon.buymeacoffee-icon {
    top: -0.15em;
  }
}

@media (max-width: 480px) {
  .stats-bar {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .plugin-cards {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .nav-links {
    gap: 14px;
  }

  .theme-toggle {
    padding: 4px 12px;
    font-size: 0.8rem;
  }

  .theme-toggle .label {
    min-width: 28px;
  }
}

/* --- Animations --- */
.avatar-float {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

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

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

/* FadeIn Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

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

.stagger-list {
  overflow: hidden;
}

.stagger-list > div {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc((sibling-index() - 1) * 0.1s);
}
