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

:root {
  --bg: #f7f8fb;
  --bg-elev: rgba(255, 255, 255, 0.85);
  --bg-card: rgba(255, 255, 255, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.4);
  --text: #0c0e11;
  --text-muted: #5f6670;
  --border: rgba(12, 14, 17, 0.08);
  --border-strong: rgba(12, 14, 17, 0.15);
  --accent: #8AE234;
  --accent-rgb: 138, 226, 52;
  --accent-soft: rgba(138, 226, 52, 0.12);
  --accent-glow: rgba(138, 226, 52, 0.4);
  --shadow-sm: 0 2px 8px rgba(12, 14, 17, 0.04);
  --shadow: 0 8px 32px rgba(12, 14, 17, 0.08);
  --shadow-lg: 0 24px 80px rgba(12, 14, 17, 0.12);
  --shadow-accent: 0 8px 32px rgba(138, 226, 52, 0.25);
  --radius: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --transition: 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dark-mode {
  --bg: #08090b;
  --bg-elev: rgba(17, 19, 23, 0.85);
  --bg-card: rgba(24, 27, 32, 0.6);
  --bg-glass: rgba(24, 27, 32, 0.4);
  --text: #f4f5f7;
  --text-muted: #8a919c;
  --border: rgba(244, 245, 247, 0.08);
  --border-strong: rgba(244, 245, 247, 0.15);
  --accent-soft: rgba(138, 226, 52, 0.15);
  --accent-glow: rgba(138, 226, 52, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.5);
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

::selection {
  background: var(--accent);
  color: #0a0c08;
}

::-moz-selection {
  background: var(--accent);
  color: #0a0c08;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 24px 20px 60px;
  position: relative;
  -webkit-overflow-scrolling: touch;
  transition: background-color 0.4s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  will-change: auto;
  contain: strict;
}

.dark-mode .grain {
  opacity: 0.05;
}

.glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.6;
  z-index: -1;
  transition: transform 0.1s linear;
  will-change: transform;
  contain: strict;
}

.glow-1 {
  width: 800px;
  height: 800px;
  top: -300px;
  left: -200px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  top: 20%;
  right: -150px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.08) 0%, transparent 70%);
}

.glow-3 {
  width: 500px;
  height: 500px;
  bottom: 10%;
  left: 30%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.02); }
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  transition: transform var(--transition-fast);
  padding-left: 4px;
}

.brand:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  transition: transform var(--transition);
}

.brand:hover .brand-logo {
  transform: rotate(-5deg) scale(1.05);
}

.brand-text {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: transform var(--transition), background-color var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.theme-toggle .icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.dark-mode .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.dark-mode .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  background: color-mix(in srgb, var(--bg-elev), var(--accent-soft) 40%);
  box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.98);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}

.animate-in {
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-in.delay-1 {
  animation-delay: 0.15s;
  opacity: 0;
}

.animate-in.delay-2 {
  animation-delay: 0.3s;
  opacity: 0;
}

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.animate-on-scroll.delay-1 {
  transition-delay: 0.05s;
}

.animate-on-scroll.delay-2 {
  transition-delay: 0.1s;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer {
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 24px;
  height: 24px;
}

.footer-text {
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

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

@media (max-width: 768px) {
  body {
    padding: 16px 16px 48px;
  }

  .glow {
    display: none;
  }

  .topbar {
    padding: 4px 0 24px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
  }

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

  .brand-text {
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 28px 0;
  }

  .footer-left {
    justify-content: center;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
  }

  .footer-links a {
    padding: 8px 4px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-in,
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .glow {
    animation: none;
  }
}
