:root {
  --bg: #0f1117;
  --bg-elevated: #171b26;
  --bg-card: #1c2230;
  --border: #2a3142;
  --text: #e8ecf4;
  --text-muted: #9aa4b8;
  --accent: #7f52ff;
  --accent-hover: #9b75ff;
  --accent-soft: rgba(127, 82, 255, 0.14);
  --kotlin: #a97bff;
  --success: #3dd68c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --container: 1120px;
  --header-height: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(127, 82, 255, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(169, 123, 255, 0.08), transparent),
    var(--bg);
  min-height: 100vh;
}

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

a {
  color: var(--kotlin);
  text-decoration: none;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 2rem, 760px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.82);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-brand:hover {
  color: var(--text);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}

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

.nav-github {
  color: var(--text) !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
}

.nav-github:hover {
  border-color: var(--accent);
  color: var(--text) !important;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Hero */
.hero {
  padding: 5rem 0 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--kotlin);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.12;
  margin: 0 0 1.25rem;
  letter-spacing: -0.03em;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hero-meta span::before {
  content: "•";
  margin-right: 1rem;
  color: var(--border);
}

.hero-meta span:first-child::before {
  content: none;
  margin: 0;
}

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

.hero-visual img {
  filter: drop-shadow(var(--shadow));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6b3fe0);
  color: white;
}

.btn-primary:hover {
  color: white;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
}

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

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

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.section-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 62ch;
  margin: 0 0 2.5rem;
}

.problem {
  background: rgba(255, 255, 255, 0.02);
  border-block: 1px solid var(--border);
}

.problem p {
  color: var(--text-muted);
}

/* Code blocks */
.code-block {
  margin: 1.25rem 0;
  padding: 1.25rem 1.5rem;
  background: #0a0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-block code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #d6deeb;
  white-space: pre;
}

.code-block-sm code {
  font-size: 0.8rem;
}

.tok-keyword { color: #c792ea; }
.tok-type { color: #ffcb6b; }
.tok-string { color: #c3e88d; }
.tok-comment { color: #697098; }
.tok-annotation { color: #82aaff; }
.tok-literal { color: #f78c6c; }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

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

.feature-card:hover {
  border-color: rgba(127, 82, 255, 0.45);
  transform: translateY(-2px);
}

.feature-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

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

/* Quick start */
.quickstart {
  background: rgba(127, 82, 255, 0.04);
  border-block: 1px solid var(--border);
}

.steps {
  display: grid;
  gap: 2rem;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--kotlin);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.step h3 {
  margin: 0 0 0.5rem;
}

.step p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.resolution-box {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.resolution-box h3 {
  margin: 0 0 0.75rem;
}

.resolution-box ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.resolution-box li {
  margin-bottom: 0.35rem;
}

.note {
  margin: 0;
  padding: 0.85rem 1rem;
  background: rgba(247, 140, 108, 0.08);
  border-left: 3px solid #f78c6c;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Internals */
.internals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.internals-grid h3 {
  margin: 0 0 0.75rem;
}

.internals-grid p {
  color: var(--text-muted);
}

.module-list {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.module-list li {
  margin-bottom: 0.4rem;
}

/* Roadmap */
.roadmap-list {
  color: var(--text-muted);
  padding-left: 1.25rem;
}

.roadmap-list li {
  margin-bottom: 0.5rem;
}

/* CTA */
.cta-box {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
}

.cta-box h2 {
  margin-bottom: 0.75rem;
}

.cta-box p {
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}

.cta .hero-actions {
  justify-content: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  background: #0b0d12;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.footer-tagline,
.footer-keywords {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-heading {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-lead {
    margin-inline: auto;
  }

  .hero-actions,
  .hero-meta {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-visual img {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu li a {
    display: block;
    padding: 0.75rem 0;
  }

  .nav {
    position: relative;
  }

  .step {
    grid-template-columns: 1fr;
  }

  .step-number {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
  }
}
