/* Light theme (default) */
:root {
  --bg: #ffffff;
  --fg: #24292f;
  --accent: #0969da;
  --accent2: #0550ae;
  --card-bg: #f6f8fa;
  --border: #d0d7de;
  --heading: #1f2328;
  --muted: #656d76;
  --code: #0550ae;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0d1117;
  --fg: #c9d1d9;
  --accent: #58a6ff;
  --accent2: #1f6feb;
  --card-bg: #161b22;
  --border: #30363d;
  --heading: #ffffff;
  --muted: #8b949e;
  --code: #79c0ff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 900px; margin: 0 auto; padding: 2rem; }

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.support-float-btn {
  position: fixed;
  top: 1rem;
  right: 4.125rem;
  background: var(--accent2);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
  z-index: 1000;
}

.support-float-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}

@media (max-width: 640px) {
  .support-float-btn {
    right: 3.875rem;
    height: 38px;
    padding: 0 0.8rem;
    font-size: 0.8rem;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}

header {
  text-align: center;
  padding: 4rem 2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: var(--heading);
}

header .tagline {
  font-size: 1.25rem;
  color: var(--muted);
}

.hero-graphic {
  margin: 2rem auto;
  max-width: 400px;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-style: italic;
}


section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

section h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--heading);
}

section p { margin-bottom: 1rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.feature {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.1s;
}

.feature:hover {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px) rotate(-1deg); }
  40% { transform: translateX(3px) rotate(1deg); }
  60% { transform: translateX(-2px) rotate(-0.5deg); }
  80% { transform: translateX(2px) rotate(0.5deg); }
}

.feature h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

pre {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 1rem 0;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--code);
}

.btn {
  display: inline-block;
  background: var(--accent2);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 1rem;
  transition: background 0.2s;
}

.btn:hover { background: var(--accent); text-decoration: none; }

.github-btn {
  background: #f6f8fa;
  color: #24292f;
  border: 1px solid #d0d7de;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.github-btn:hover {
  background: #eef1f4;
  color: #24292f;
}

[data-theme="dark"] .github-btn {
  background: #21262d;
  color: #c9d1d9;
  border-color: #30363d;
}

[data-theme="dark"] .github-btn:hover {
  background: #30363d;
  color: #f0f6fc;
}

.github-icon {
  flex: 0 0 auto;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* Floating emojis */
.emoji-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 100;
}

.floating-emoji {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.5;
  pointer-events: none;
}

.floating-emoji.ltr {
  animation: floatLTR linear forwards;
}

.floating-emoji.rtl {
  animation: floatRTL linear forwards;
}

.floating-emoji.flipped {
  transform: scaleX(-1);
}

@keyframes floatLTR {
  0% {
    left: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    left: calc(100% + 50px);
    opacity: 0;
  }
}

@keyframes floatRTL {
  0% {
    right: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    right: calc(100% + 50px);
    opacity: 0;
  }
}
