/* gotrans docs — GitHub Pages */

:root {
  --bg-deep: #07090d;
  --bg-panel: #0f141c;
  --bg-elevated: #161d28;
  --text: #e8edf4;
  --text-muted: #8b98a8;
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --warm: #f97316;
  --warm-dim: rgba(249, 115, 22, 0.12);
  --border: rgba(232, 237, 244, 0.08);
  --font-sans: "Sora", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(249, 115, 22, 0.06), transparent 50%),
    linear-gradient(180deg, var(--bg-deep) 0%, #0a0d12 100%);
}

/* Floating Polar support — top-right, clears sticky header */
.polar-support {
  position: fixed;
  top: calc(5.1rem + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 1000;
  max-width: calc(100vw - 24px);
  background: #111827;
  color: #f9fafb;
  text-decoration: none;
  border: 1px solid #1f2937;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
  text-align: center;
  line-height: 1.25;
}

.polar-support:hover {
  background: #1f2937;
  color: #fff;
}

@media (max-width: 52rem) {
  .polar-support {
    top: calc(7.35rem + env(safe-area-inset-top, 0px));
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg-deep);
  font-weight: 600;
  border-radius: 6px;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

.wrap {
  width: min(56rem, 92vw);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 9, 13, 0.85);
  backdrop-filter: blur(12px);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.lang-switch a {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

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

.lang-switch a.is-current {
  color: var(--bg-deep);
  background: var(--accent);
}

/* Hero */
.hero {
  padding-block: 3.5rem 2rem;
  text-align: center;
}

.hero-logo {
  display: block;
  width: clamp(7rem, 26vw, 12rem);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-lead {
  margin: 0 auto 1.75rem;
  max-width: 38rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pill strong {
  color: var(--warm);
  font-weight: 600;
}

/* Sections */
section {
  padding-block: 2.5rem;
}

section h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

section h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

section p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

section p strong {
  color: var(--text);
}

section p a {
  color: var(--accent);
  text-decoration: none;
}

section p a:hover {
  text-decoration: underline;
}

.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

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

.card p {
  margin: 0;
  font-size: 0.95rem;
}

/* Code blocks */
.pre-wrap {
  position: relative;
  margin: 1rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.pre-wrap pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: #c4d4e8;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

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

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

.note {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--warm-dim);
  border-left: 3px solid var(--warm);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* API strip */
.api-strip {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--accent-dim);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  word-break: break-all;
}

/* Download (aligned with https://runableapp.github.io/tts-onnx/ download-cta) */
.download-cta {
  text-align: center;
  padding-block: 2rem 2.5rem;
}

.download-lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.download-os-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 0.75rem;
  margin-bottom: 1rem;
}

.download-os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.download-os-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.download-os-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-top: 6px;
}

.download-btn {
  display: inline-block;
  margin-top: 0;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

.download-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
  color: #f9fafb;
  text-decoration: none;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
}

.support-btn:hover {
  background: #1f2937;
  color: #fff;
}

.repo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.repo-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Footer (aligned with https://runableapp.github.io/tts-onnx/ ) */
.big-line {
  margin: 2.5rem 0 10px;
  border: 0;
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(90deg, #0f172a 0%, #1d4ed8 50%, #16a34a 100%);
}

.footer-branding {
  text-align: center;
  padding-bottom: 1.5rem;
}

.footer-image {
  width: 150px;
  display: block;
  margin: 8px auto 8px;
  border-radius: 12px;
  border: 0;
  box-shadow: none;
}

.footer-copy {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

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

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