/* Telex TUI - Landing Page & Blog Styles */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-code: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #3fb950;
  --orange: #d29922;
  --purple: #bc8cff;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --max-width: 800px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ── Layout ── */

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

/* ── Header / Nav ── */

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

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-link:hover {
  color: var(--text);
}

.logo-link img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* ── Hero ── */

.hero {
  text-align: center;
  padding: 5rem 0 3rem;
}

.hero-logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ── Code Block ── */

.code-section {
  padding: 2rem 0 3rem;
}

.code-section h2 {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 400;
}

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-block code {
  color: var(--text);
}

/* Syntax highlighting - minimal */
.kw { color: var(--purple); }       /* keywords */
.fn { color: #d2a8ff; }             /* function names */
.str { color: #a5d6ff; }            /* strings */
.mac { color: var(--accent); }      /* macros */
.cm { color: var(--text-muted); }   /* comments */
.ty { color: var(--green); }        /* types */
.num { color: #79c0ff; }            /* numbers */
.op { color: var(--text-muted); }   /* operators / punctuation */

/* ── Features ── */

.features {
  padding: 1rem 0 3rem;
}

.features h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

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

.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.feature h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.feature p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Footer ── */

footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

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

/* ── Blog ── */

.page-title {
  padding: 3rem 0 1rem;
}

.page-title h1 {
  font-size: 2rem;
  font-weight: 700;
}

.page-title p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.post-list {
  padding: 1rem 0 3rem;
  list-style: none;
}

.post-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  transition: border-color 0.15s;
}

.post-item:hover {
  border-color: var(--text-muted);
}

.post-item a {
  display: block;
}

.post-item h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Blog Post ── */

.post {
  padding: 2rem 0 3rem;
}

.post h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.post .post-meta {
  margin-bottom: 2rem;
}

.post h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.post h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post p {
  margin-bottom: 1rem;
}

.post ul, .post ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post li {
  margin-bottom: 0.35rem;
}

.post pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.post code {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.post p code {
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

.post blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post strong {
  color: var(--text);
}

/* ── Aside / Note boxes ── */

.post .note {
  background: var(--bg-card);
  border-left: 3px solid var(--text-muted);
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: 0 6px 6px 0;
}

.post .note code {
  font-size: 0.85em;
}

/* ── Tables ── */

.post table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.post th {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post td {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.post tr:last-child td {
  border-bottom: none;
}

.post td code {
  background: var(--bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  white-space: nowrap;
}

/* ── Series Nav ── */

.series-nav {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.series-index {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}

.series-index h2 {
  font-size: 1.1rem;
  width: 100%;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.series-index ol {
  width: 100%;
  padding-left: 2rem;
  font-size: 0.88rem;
  line-height: 1.8;
}

.series-index li {
  margin-bottom: 0;
}

/* ── Empty / Coming Soon ── */

.empty-state {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 1rem;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .tagline {
    font-size: 1.05rem;
  }

  .hero-logo {
    width: 100px;
    height: 100px;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 250px;
    justify-content: center;
  }

  .code-block {
    font-size: 0.78rem;
    padding: 1rem;
  }

  nav {
    gap: 1rem;
  }

  nav a {
    font-size: 0.85rem;
  }

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