/* Tlang documentation website — mainstream polish, dark theme */

:root {
  --bg: #0a0e14;
  --bg-card: #0d1117;
  --bg-elevated: #161b22;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #00d9a5;
  --accent-hover: #00e6b3;
  --accent-dim: rgba(0, 217, 165, 0.15);
  --border: #21262d;
  --code-bg: #161b22;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* {
  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: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 217, 165, 0.08), transparent);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap--wide {
  max-width: 1100px;
}

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

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

/* Toolbar/header logo on all pages (index, playground, docs, view) */
.logo-img,
.site-header .logo-img {
  display: block;
  height: 32px;
  width: auto;
  background: var(--code-bg);
  padding: 4px 6px;
  border-radius: 6px;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.site-header nav a:hover {
  color: var(--accent);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

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

.lang-switch a.lang-active {
  color: var(--accent);
  font-weight: 600;
}

.lang-sep {
  color: var(--border);
  user-select: none;
}

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  text-align: center;
  position: relative;
}

.hero .wrap > * {
  animation: fadeUp 0.6s ease both;
}

.hero .hero-logo { animation-delay: 0s; }
.hero h1 { animation-delay: 0.1s; }
.hero .tagline { animation-delay: 0.2s; }
.hero .hero-actions { animation-delay: 0.3s; }

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

.hero-logo {
  display: block;
  margin: 0 auto 1.25rem;
  height: 96px;
  width: auto;
  background: var(--bg-elevated);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-logo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 217, 165, 0.15);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 1rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #0a0e14;
  box-shadow: 0 2px 12px rgba(0, 217, 165, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 217, 165, 0.4);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

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

/* Install section */
.install {
  padding: 3rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.install h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.install-intro {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.install-intro a {
  color: var(--accent);
  text-decoration: none;
}

.install-intro a:hover {
  text-decoration: underline;
}

.install-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.install-tab {
  padding: 0.5rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.install-tab:hover {
  color: var(--text);
  background: var(--code-bg);
}

.install-tab.install-tab--active {
  color: var(--accent);
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.install-panels {
  position: relative;
}

.install-panel {
  display: none;
}

.install-panel.install-panel--active {
  display: block;
}

.install-code-wrap {
  position: relative;
}

.install-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.install-code {
  position: relative;
  margin: 0 0 0.5rem;
  padding-right: 3.5rem;
}

.install-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.install-copy:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
}

.install-copy.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.install-extension-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* Sections */
.quick-start,
.features,
.philosophy {
  padding: 2.5rem 0;
}

.quick-start {
  background: var(--bg);
}

.quick-start .wrap {
  background: var(--bg-card);
  padding: 2rem 2rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.quick-start h2,
.features h2,
.philosophy h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.features h2 a {
  color: inherit;
  text-decoration: none;
}

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

.quick-start p,
.philosophy p {
  margin: 0 0 0.75rem;
  color: var(--text);
}

.quick-start p:last-of-type {
  margin-bottom: 0;
}

.quick-start a[href*="docs"] {
  color: var(--accent);
  font-weight: 500;
}

.quick-start a[href*="docs"]:hover {
  text-decoration: underline;
}

/* Code blocks */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.code-block {
  background: #1a1d24;
  color: #e6e4e1;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  border: 1px solid var(--border);
}

.code-block:hover {
  border-color: rgba(0, 217, 165, 0.2);
}

.code-block--small {
  padding: 0.9rem 1.25rem;
  font-size: 0.85rem;
}

.code-block code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Feature grid */
.feature-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

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

.feature-grid strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.feature-grid span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-grid code {
  font-size: 0.85em;
}

/* Philosophy */
.philosophy {
  border-top: 1px solid var(--border);
}

.philosophy p {
  font-size: 1.05rem;
}

/* Docs page */
.docs-main {
  padding: 2rem 0 3rem;
}

.docs-main h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.docs-main .lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 2.5rem;
}

.docs-section {
  margin-bottom: 2.5rem;
}

.docs-section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

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

.doc-list li {
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.doc-list a {
  color: var(--accent);
  text-decoration: none;
}

.doc-list a:hover {
  text-decoration: underline;
}

.doc-list code {
  font-size: 0.85em;
}

.doc-list strong {
  font-weight: 600;
  color: var(--text);
}

/* Footer */
.site-footer {
  padding: 3rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .muted {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Doc viewer (view.html) */
.view-main {
  padding: 2rem 0 3rem;
}

.view-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.back-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.view-doc-path {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.view-error {
  padding: 1rem;
  background: #fef2f2;
  color: #991b1b;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
}

/* Rendered markdown (.prose) */
.prose {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.prose h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prose h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.prose h4, .prose h5, .prose h6 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul, .prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

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

.prose blockquote {
  margin: 1rem 0;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  color: var(--text-muted);
}

.prose pre {
  background: #252422;
  color: #e6e4e1;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
}

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

.prose p code,
.prose li code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose a {
  color: var(--accent);
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose th {
  background: var(--code-bg);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

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

/* Why Tlang section (home page) */
.why-tlang {
  padding: 3rem 0;
  background: var(--bg);
}

.why-tlang .wrap {
  background: var(--bg-card);
  padding: 2rem 2rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.why-tlang h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.why-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.why-tlang h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.why-tlang h3:first-of-type {
  margin-top: 0;
}

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

.why-col {
  padding: 1.25rem;
  background: var(--code-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.why-col ul {
  margin: 0;
  padding-left: 1.25rem;
}

.why-col li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.why-tldr {
  margin: 1.5rem 0 0 !important;
  padding: 1.25rem 1.5rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 217, 165, 0.25);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

/* CLI page (cli.html) */
.cli-page-main {
  padding: 2rem 0 3rem;
}

.cli-page-header {
  margin-bottom: 2rem;
}

.cli-page-header .back-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.cli-page-header .back-link:hover {
  text-decoration: underline;
}

.cli-page-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.cli-page-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
}

.cli-prose .cli-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

.cli-prose .cli-table th,
.cli-prose .cli-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.cli-prose .cli-table th {
  background: var(--code-bg);
  font-weight: 600;
}

.cli-prose .cli-table td code {
  font-size: 0.85em;
  white-space: nowrap;
}

.cli-prose .cli-table .cli-example {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cli-prose .cli-syntax {
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.cli-prose .cli-syntax code {
  background: none;
  padding: 0;
}

.cli-prose .cli-updated {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .cli-prose .cli-table {
    font-size: 0.82rem;
  }
  .cli-prose .cli-table th,
  .cli-prose .cli-table td {
    padding: 0.5rem 0.6rem;
  }
  .cli-prose .cli-table td code {
    white-space: normal;
  }
}

/* CLI section (index.html inline) */
.cli-section {
  padding: 2.5rem 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.cli-section h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.cli-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

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

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

.cli-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.cli-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.cli-card li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cli-card code {
  font-size: 0.82em;
}

.cli-section > .wrap > p:last-child {
  margin: 0;
}

.cli-section > .wrap > p:last-child a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.cli-section > .wrap > p:last-child a:hover {
  text-decoration: underline;
}

.philosophy-removed {
  display: none !important;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  text-align: left;
}

.compare-table th {
  background: var(--code-bg);
  font-weight: 600;
}

.compare-table td:first-child {
  font-weight: 500;
}

.compare-table td strong {
  color: var(--accent);
}

.compare-table tbody tr:hover {
  background: var(--accent-dim);
}

.prose img[src*="tlang-logo"] {
  background: var(--code-bg);
  padding: 0.75rem;
  border-radius: var(--radius);
  width: auto;
  max-width: 200px;
}

@media (max-width: 768px) {
  .wrap {
    padding: 0 1.25rem;
  }
  .install {
    margin: 2rem 1rem 0;
  }
  .why-tlang .wrap,
  .quick-start .wrap {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 2.5rem 0 3rem;
  }
  .hero-logo {
    height: 72px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .prose {
    padding: 1.25rem;
  }
  .why-columns {
    grid-template-columns: 1fr;
  }
}
