/* SPDX-License-Identifier: MIT-0 */
/* Synoema website styles */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-code: #1c2128;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --green: #3fb950;
  --link: #16b8a5;
  --link-hover: #1dd5c0;
  --link-visited: #0fa898;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-w: 960px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; }

/* Content links (inline text) */
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}
a:visited {
  color: var(--link-visited);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* Nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: none;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
nav .logo:hover { color: var(--accent-hover); border-bottom: none; }
nav .logo:visited { color: var(--accent); }
.logo-img {
  height: 28px;
  width: 28px;
  object-fit: contain;
}

.nav-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
  font-size: 0.95rem;
  transition: color 0.2s, border-color 0.2s;
}
.nav-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-links a:visited { color: var(--text-muted); }
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Main */
main {
  flex: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0;
}
.hero-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 3rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.hero .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Sections */
section {
  margin: 2.5rem 0;
}
section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.feature h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* Code blocks */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}
p code, td code {
  background: var(--bg-code);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th, td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Examples gallery */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.example-card h3 {
  color: var(--green);
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-bottom: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-right: 0.5rem;
}
.btn:hover {
  background: var(--accent-hover);
  color: var(--bg);
  border-bottom: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.35);
}
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:visited { color: var(--bg); border-bottom: none; }
.btn-alt {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
.btn-alt:visited { color: var(--accent); border-bottom: 1px solid var(--accent); }
.btn-alt:hover {
  background: var(--accent);
  color: var(--bg);
  border-bottom: 1px solid var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(88, 166, 255, 0.25);
}

/* Playground */
.playground { margin-top: 1rem; }
.playground textarea {
  width: 100%;
  background: var(--bg-code);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 100px;
}
.playground textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.playground button {
  margin-top: 0.75rem;
}
.result {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.result h3 {
  color: var(--green);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}
footer a {
  color: var(--text-muted);
  border-bottom: 1px dotted var(--border);
  transition: color 0.2s, border-color 0.2s;
}
footer a:hover {
  color: var(--text);
  border-bottom-color: var(--text-muted);
}
footer a:visited { color: var(--text-muted); }

/* Article tags */
.article-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-research { background: #1a3a5c; color: #58a6ff; }
.tag-explainer { background: #1a3a1a; color: #3fb950; }
.tag-results { background: #3a1a1a; color: #f85149; }

/* Article meta line */
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.75rem 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Article prose */
.article-body p { margin: 1rem 0; }
.article-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--accent);
}
.article-body ul, .article-body ol {
  margin: 0.75rem 0 0.75rem 1.5rem;
}
.article-body li { margin: 0.35rem 0; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  font-style: italic;
}
.article-body .article-note {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

/* Article hub grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.2s;
}
.article-card:hover { border-color: var(--accent); }
.article-card h3 {
  color: var(--accent);
  font-size: 1.05rem;
  margin: 0.5rem 0 0.5rem;
  line-height: 1.4;
}
.article-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}
.article-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* Back link */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.article-back:hover { color: var(--accent); }

/* Responsive */

/* Tablet: 601px–768px — tables, pre, headings */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  pre {
    max-width: calc(100vw - 2rem);
  }
  h1 {
    font-size: 2rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .hero h1 { font-size: 2.25rem; }
  .hero-logo { width: 90px; height: 90px; }
}

/* Mobile: ≤600px — nav, hero, grids, code */
@media (max-width: 600px) {
  nav {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .nav-links {
    gap: 0.75rem;
    width: 100%;
  }
  .nav-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  main { padding: 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero .subtitle { font-size: 1rem; }
  .hero-logo { width: 72px; height: 72px; }
  .examples { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  pre { font-size: 0.8rem; }
  code { font-size: 0.8rem; }
}
