:root {
  --bg0: #11111b;
  --bg1: #181825;
  --bg2: #1e1e2e;
  --bg3: #242438;
  --bg4: #2a2a40;
  --bg5: #313148;
  --fg0: #cdd6f4;
  --fg1: #bac2de;
  --grey0: #6c7086;
  --grey1: #a6adc8;
  --accentPurple: #cba6f7;
  --accentPurpleRgb: 203, 166, 247;
  --accentBlue: #89b4fa;
  --accentAqua: #94e2d5;
  --accentYellow: #f9e2af;
  --accentRed: #f38ba8;
  --accentGreen: #a6e3a1;
  --border-md: 8px;
  --border-lg: 12px;
  --fontWeightSemiBold: 600;
  --fontWeightBold: 700;
}

body.light {
  --bg0: #eff1f5;
  --bg1: #e6e9ef;
  --bg2: #dce0e8;
  --bg3: #ccd0da;
  --bg4: #bcc0cc;
  --bg5: #acb0be;
  --fg0: #4c4f69;
  --fg1: #5c5f77;
  --grey0: #8c8fa1;
  --grey1: #9ca0b0;
  --accentPurple: #8839ef;
  --accentPurpleRgb: 136, 57, 239;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg0);
  color: var(--fg0);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

nav {
  background: var(--bg1);
  border-bottom: 1px solid var(--bg4);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

#logo a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

#logo-text {
  font-weight: var(--fontWeightBold);
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accentPurple), var(--accentBlue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#btns ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

#btns a {
  text-decoration: none;
  color: var(--grey1);
  font-weight: var(--fontWeightSemiBold);
  padding: 0.5rem 1rem;
  border-radius: var(--border-md);
  transition: color 0.2s, background 0.2s;
  font-size: 0.9rem;
}

#btns a:hover {
  color: var(--fg0);
  background: var(--bg3);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-md);
  color: var(--grey1);
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: var(--fg0);
  background: var(--bg3);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

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

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 0 2rem;
}

.logo-main {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accentPurple), var(--accentBlue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.75rem;
  color: var(--grey1);
  font-weight: 500;
  margin-bottom: 2rem;
  text-align: center;
}

.buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: var(--fontWeightSemiBold);
  padding: 0.8em 2em;
  border-radius: var(--border-md);
  transition: 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accentPurple);
  color: var(--bg0);
}

.btn-primary:hover {
  background: rgba(var(--accentPurpleRgb), 0.8);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--fg0);
  outline: 2px solid transparent;
}

.btn-secondary:hover {
  background: var(--bg5);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accentBlue);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--bg2);
  padding: 1.25rem;
  border-radius: var(--border-lg);
  border: 1px solid var(--bg4);
  transition: 0.2s ease;
}

.feature-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.feature-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg0);
  border-radius: var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--grey0);
  margin: 0;
}

h2 {
  font-size: 1.5rem;
  font-weight: var(--fontWeightBold);
  margin: 2.5rem 0 0.75rem;
  color: var(--fg0);
}

p {
  color: var(--grey1);
  margin-bottom: 1rem;
}

code {
  background: var(--bg3);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accentAqua);
}

pre {
  background: var(--bg2);
  padding: 1.25rem;
  border-radius: var(--border-lg);
  overflow-x: auto;
  border: 1px solid var(--bg4);
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--fg0);
}

.flake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.flake-card {
  background: var(--bg2);
  border: 1px solid var(--bg4);
  border-radius: var(--border-lg);
  padding: 1.25rem;
  transition: 0.2s ease;
}

.flake-card:hover {
  border-color: var(--accentBlue);
}

.flake-card h3 {
  color: var(--accentBlue);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.flake-card p {
  font-size: 0.85rem;
  color: var(--grey0);
  margin: 0 0 0.75rem;
}

.flake-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.tag {
  display: inline-block;
  background: var(--bg3);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  margin: 0.15rem 0.3rem 0.15rem 0;
  line-height: 1.4;
}

.tag.purple { border: 1px solid var(--accentPurple); color: var(--accentPurple); }
.tag.blue { border: 1px solid var(--accentBlue); color: var(--accentBlue); }
.tag.aqua { border: 1px solid var(--accentAqua); color: var(--accentAqua); }
.tag.yellow { border: 1px solid var(--accentYellow); color: var(--accentYellow); }

.cmd { color: var(--accentGreen); }
.str { color: var(--accentAqua); }
.kwd { color: var(--accentRed); }

footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--bg4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.footer-links a {
  color: var(--grey0);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

.footer-socials {
  display: flex;
  gap: 1rem;
}

.footer-socials a {
  color: var(--grey0);
  transition: color 0.2s;
}

.footer-socials a:hover {
  color: var(--fg0);
}

.footer-socials svg {
  width: 1.5rem;
  height: 1.5rem;
}

.footer-disclaimer {
  font-size: 0.8rem;
  color: var(--grey0);
  text-align: center;
}

@media (max-width: 800px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .logo-main { font-size: 3.5rem; }
  .tagline { font-size: 1.25rem; }
}

@media (max-width: 500px) {
  .features { grid-template-columns: 1fr; }
  .buttons { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
  .nav-content { flex-wrap: wrap; height: auto; padding: 0.75rem 0; gap: 0.5rem; }
  #btns ul { flex-wrap: wrap; }
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg1);
}
::-webkit-scrollbar-thumb {
  background: var(--bg4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg5);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg4) var(--bg1);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="number"]),
textarea,
select {
  background: var(--bg2);
  border: 1px solid var(--bg4);
  border-radius: var(--border-md);
  padding: 0.65rem 0.85rem;
  color: var(--fg0);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accentBlue);
}
input[type="number"] {
  background: var(--bg2);
  border: 1px solid var(--bg4);
  border-radius: var(--border-md);
  padding: 0.6rem 0.8rem;
  color: var(--fg0);
  font-family: inherit;
  font-size: 0.9rem;
}
input[type="number"]:focus {
  outline: none;
  border-color: var(--accentBlue);
}
textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: var(--bg3);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--grey1);
  margin-left: 0.5rem;
}
.api-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--grey0);
}
.api-dot.online { background: var(--accentGreen); box-shadow: 0 0 6px var(--accentGreen); }
.api-dot.offline { background: var(--accentRed); box-shadow: 0 0 6px var(--accentRed); }
.api-dot.blocked { background: var(--accentYellow); box-shadow: 0 0 6px var(--accentYellow); }
