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

:root {
  --purple: #7c3aed;
  --lavender: #f3f0ff;
  --text: #1e1b4b;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-subtle: #faf9fb;
  --radius: 24px;
  --radius-inner: 18px;
  --inset: 4px;
  --max-width: 900px;

  --elixir: #4e2a8e;    --elixir-bg: #ede5ff;   --elixir-code: #1e152e;
  --gleam-text: #ad2d93; --gleam-bg: #fff0fb;    --gleam-code: #2a1528;
  --python: #306998;     --python-bg: #e3eeff;   --python-code: #121e2e;
  --ruby: #cc342d;       --ruby-bg: #ffe8e8;     --ruby-code: #2a1515;
  --ts: #3178c6;         --ts-bg: #e6f0ff;       --ts-code: #121a2e;
}

html { scroll-behavior: smooth; }

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

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

/* Inline code: just monospace. Nothing else. */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 32px 0; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  background: var(--lavender);
  padding-bottom: calc(32px + 4px);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  border-bottom: 1.5px dashed #c4b0e8;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 48px;
}

.mascot { flex-shrink: 0; }

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.hero-lead strong {
  color: var(--purple);
  font-weight: 800;
}

.hero-text h1 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-text .subtitle {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
}

.hero-text .subtitle a { font-weight: 600; color: var(--purple); }

.lang-link { text-decoration: none; font-weight: 800; }
.lang-link:hover { text-decoration: underline; }
.lang-link.elixir { color: var(--elixir); }
.lang-link.gleam { color: var(--gleam-text); }
.lang-link.python { color: var(--python); }
.lang-link.ruby { color: var(--ruby); }
.lang-link.ts { color: var(--ts); }

@media (max-width: 640px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text h1 { font-size: 1.4rem; }
  .mascot { width: 160px; height: auto; }

  .tabs-inner { flex-wrap: wrap; justify-content: center; }
  .tab-indicator { display: none; }
  .tab.active { background: var(--purple); color: #fff; }

  .arch-boxes { flex-direction: column; }
  .arch-transport { flex: none; padding: 16px 0; }
  .arch-transport svg { max-width: 200px; margin: 0 auto; }

  .arch-descriptions { flex-direction: column; gap: 16px; }
  .arch-descriptions .arch-description:first-child { border-right: none; border-bottom: 1px solid #e5e7eb; padding: 0 0 16px; }
  .arch-description { padding: 0; }

  .footer-links { flex-direction: column; gap: 8px; }
}

/* ── Language tabs ─────────────────────────────────────────────────────────── */

.languages-section { background: var(--bg-subtle); }

.tabs {
  display: inline-flex;
  margin-bottom: 28px;
  border-radius: var(--radius);
  padding: var(--inset);
  transition: background 0.2s;
}

.tabs-inner {
  display: inline-flex;
  border: 1.5px dashed;
  border-radius: var(--radius-inner);
  padding: 2px;
  position: relative;
}

.tab-indicator {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 0;
  border-radius: 999px;
  transition: left 0.3s ease, width 0.3s ease, background-color 0.3s ease;
  z-index: 0;
}

/* Pill container background matches active language's pastel */
.tabs[data-active-lang="elixir"]     { background: var(--elixir-bg); }
.tabs[data-active-lang="gleam"]      { background: var(--gleam-bg); }
.tabs[data-active-lang="python"]     { background: var(--python-bg); }
.tabs[data-active-lang="ruby"]       { background: var(--ruby-bg); }
.tabs[data-active-lang="typescript"] { background: var(--ts-bg); }

.tabs[data-active-lang="elixir"] .tabs-inner     { border-color: #c4b0e8; }
.tabs[data-active-lang="gleam"] .tabs-inner       { border-color: #e8a0d8; }
.tabs[data-active-lang="python"] .tabs-inner      { border-color: #94b8d8; }
.tabs[data-active-lang="ruby"] .tabs-inner        { border-color: #e0a0a0; }
.tabs[data-active-lang="typescript"] .tabs-inner  { border-color: #94b0d8; }

.tab {
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  transition: color 0.2s;
  position: relative;
  z-index: 1;
}

.tab:hover { color: var(--text); }
.tab.active { color: #fff; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Language card: outer fabric + inner stitching ─────────────────────────── */

.lang-card-outer {
  border-radius: var(--radius);
  padding: var(--inset);
}

.lang-card-inner {
  border: 1.5px dashed;
  border-radius: var(--radius-inner);
  overflow: hidden;
  padding: 0;
}

.tab-panel[data-lang="elixir"] .lang-card-outer     { background: var(--elixir-bg); }
.tab-panel[data-lang="elixir"] .lang-card-inner      { border-color: #c4b0e8; }
.tab-panel[data-lang="gleam"] .lang-card-outer       { background: var(--gleam-bg); }
.tab-panel[data-lang="gleam"] .lang-card-inner        { border-color: #e8a0d8; }
.tab-panel[data-lang="python"] .lang-card-outer      { background: var(--python-bg); }
.tab-panel[data-lang="python"] .lang-card-inner       { border-color: #94b8d8; }
.tab-panel[data-lang="ruby"] .lang-card-outer        { background: var(--ruby-bg); }
.tab-panel[data-lang="ruby"] .lang-card-inner         { border-color: #e0a0a0; }
.tab-panel[data-lang="typescript"] .lang-card-outer  { background: var(--ts-bg); }
.tab-panel[data-lang="typescript"] .lang-card-inner   { border-color: #94b0d8; }

/* ── Card header ──────────────────────────────────────────────────────────── */

.lang-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px;
  font-size: 1.1rem;
  line-height: 1.3;
  color: var(--text-light);
  flex-wrap: wrap;
}

.lang-title {
  font-weight: 800;
  text-decoration: none;
}

.lang-title:hover { text-decoration: underline; }

.tab-panel[data-lang="elixir"] .lang-title     { color: var(--elixir); }
.tab-panel[data-lang="gleam"] .lang-title       { color: var(--gleam-text); }
.tab-panel[data-lang="python"] .lang-title      { color: var(--python); }
.tab-panel[data-lang="ruby"] .lang-title        { color: var(--ruby); }
.tab-panel[data-lang="typescript"] .lang-title  { color: var(--ts); }

.lang-links {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

/* ── Code blocks (dark patches sewn onto the fabric) ──────────────────────── */

.code-area {
  margin: 12px;
  padding: 12px;
  overflow-x: auto;
  border-radius: 12px;
}

.code-area pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #e2e0f0;
}

.code-area pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Language-tinted dark backgrounds */
.tab-panel[data-lang="elixir"] .code-area     { background: var(--elixir-code); }
.tab-panel[data-lang="gleam"] .code-area      { background: var(--gleam-code); }
.tab-panel[data-lang="python"] .code-area     { background: var(--python-code); }
.tab-panel[data-lang="ruby"] .code-area       { background: var(--ruby-code); }
.tab-panel[data-lang="typescript"] .code-area  { background: var(--ts-code); }

/* ── Architecture ─────────────────────────────────────────────────────────── */

.architecture { text-align: center; }
.architecture h2 { font-size: 1.5rem; margin-bottom: 24px; }

.arch-boxes {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.arch-app, .arch-renderer { flex: 1; }
.arch-app .lang-card-outer { background: #f1f1f4; }
.arch-app .lang-card-inner { border-color: #c8c8d0; }
.arch-renderer .lang-card-outer { background: var(--elixir-bg); }
.arch-renderer .lang-card-inner { border-color: #c4b0e8; }
.arch-transport { flex: 0 0 130px; padding: 40px 0; margin: 0 16px; }

.arch-descriptions {
  display: flex;
  text-wrap: pretty;
  text-align: left;
}

.arch-description {
  flex: 1;
  color: var(--text-light);
  font-size: 1rem;
  padding: 0 24px;
}

.arch-descriptions .arch-description:first-child {
  border-right: 1px solid #e5e7eb;
}

/* ── Features ─────────────────────────────────────────────────────────────── */

.features { background: var(--bg-subtle); }
.features h2 { font-size: 1.5rem; margin-bottom: 24px; }

.feature-group {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple);
  margin-top: 24px;
  margin-bottom: 0;
}

.features h2 + .feature-group { margin-top: 0; }

.feature-list {
  list-style: none;
  max-width: 700px;
}

.feature-list li {
  padding: 10px 0;
  font-size: 0.95rem;
  line-height: 1.7;
  border-bottom: 1px dashed #e5e7eb;
}

.feature-list li:last-child { border-bottom: none; }
.feature-list strong { color: var(--text); }

/* ── Bottom mascot ───────────────────────────────────────────────────────── */

.bottom-mascot {
  text-align: center;
  padding: calc(32px + 4px) 0 32px;
  background: var(--lavender);
  position: relative;
}

.bottom-mascot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  border-top: 1.5px dashed #c4b0e8;
}

.bottom-mascot img {
  max-width: 512px;
  height: auto;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 0;
  text-align: center;
  font-size: 0.85rem;
}

footer a { color: rgba(255, 255, 255, 0.9); }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* ── Prism overrides ──────────────────────────────────────────────────────── */

.code-area pre[class*="language-"],
.code-area code[class*="language-"] {
  background: none;
  text-shadow: none;
}

.token.comment, .token.prolog   { color: #6b6b8d; font-style: italic; }
.token.keyword, .token.tag      { color: #c792ea; }
.token.function                 { color: #82aaff; }
.token.string, .token.attr-value { color: #c3e88d; }
.token.number                   { color: #f78c6c; }
.token.operator                 { color: #89ddff; }
.token.class-name, .token.builtin { color: #ffcb6b; }
.token.punctuation              { color: #89ddff; }
.token.boolean                  { color: #f78c6c; }
.token.attr-name                { color: #ffcb6b; }
.token.variable                 { color: #f07178; }
.token.constant                 { color: #f78c6c; }
.token.symbol, .token.atom      { color: #82aaff; }
.token.regex                    { color: #c3e88d; }
.token.module                   { color: #ffcb6b; }
