:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-dim: #888;
  --accent: #3B82F6;
  --accent-dim: #2563EB;
  --red: #EF4444;
  --green: #22C55E;
  --yellow: #EAB308;
  --orange: #F97316;
  --purple: #A855F7;
  --font-display: 'Space Mono', monospace;
  --font-body: 'IBM Plex Sans', sans-serif;
  --max-width: 1100px;
  --radius: 8px;
}

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

html { scroll-behavior: smooth; }

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

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }

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

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
}

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

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

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

nav { display: flex; gap: 24px; align-items: center; }
nav a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s; }
nav a:hover, nav a.active { color: var(--text); text-decoration: none; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero h1 { font-size: 2.4rem; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-dim); font-size: 1.1rem; max-width: 650px; margin: 0 auto; }

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

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

/* Cards / Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text);
}

/* Forms */
label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  font-family: var(--font-display);
}

input[type="number"], input[type="text"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 100px; }

.input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.input-field { display: flex; flex-direction: column; }

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary { background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Result display */
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.result-box .shape {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}

.result-box .formula {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 8px;
  line-height: 1.5;
}

.result-box.error { border-color: var(--red); }
.result-box.error .shape { color: var(--red); }
.result-box.success { border-color: var(--green); }

/* Chain mode */
.chain-layer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.chain-layer.mismatch { border-color: var(--red); background: rgba(239,68,68,0.05); }

.chain-layer .layer-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 24px;
}

.chain-layer select { max-width: 160px; }

.chain-layer .chain-shape {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 120px;
  text-align: right;
}

.chain-layer .chain-shape.err { color: var(--red); }

.chain-arrow {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 4px 0;
}

.chain-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.remove-layer-btn {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  opacity: 0.6;
}

.remove-layer-btn:hover { opacity: 1; }

/* Tensor visualization */
.tensor-viz {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tensor-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(59,130,246,0.08);
  transition: all 0.3s ease;
  min-width: 30px;
  min-height: 30px;
  max-width: 200px;
  max-height: 120px;
  padding: 4px;
  text-align: center;
  word-break: break-all;
}

.tensor-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
}

/* Error paste mode */
.error-match {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 12px;
}

.error-match h4 {
  color: var(--orange);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.error-match .extracted {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 8px;
}

.error-match .suggestion {
  color: var(--green);
  font-size: 0.9rem;
}

/* Presets */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.preset-card {
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.preset-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.preset-card h4 { font-size: 0.85rem; margin-bottom: 4px; }
.preset-card p { font-size: 0.75rem; color: var(--text-dim); }

/* Framework toggle */
.framework-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch.active { background: var(--accent); }

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch.active::after { transform: translateX(24px); }

/* FAQ */
.faq-section {
  padding: 60px 0;
}

.faq-section h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 32px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-q {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--bg-card);
  transition: background 0.2s;
}

.faq-q:hover { background: var(--bg-hover); }

.faq-q::after {
  content: '+';
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.faq-item.open .faq-q::after { content: '-'; }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

.faq-item.open .faq-a {
  max-height: 500px;
  padding: 0 20px 16px;
}

/* Footer — removed, see V14 block at end of file */

/* Section spacing */
.section { padding: 40px 0; }
.section h2 { font-size: 1.5rem; margin-bottom: 24px; }

/* Hidden tab panes */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Blog styles */
.blog-list { list-style: none; }
.blog-item { margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.blog-item:last-child { border-bottom: none; }
.blog-item h3 a { color: var(--text); }
.blog-item h3 a:hover { color: var(--accent); }
.blog-meta { color: var(--text-dim); font-size: 0.8rem; margin-top: 4px; }
.blog-excerpt { color: var(--text-dim); margin-top: 8px; font-size: 0.9rem; }

/* Article */
.article { max-width: 720px; margin: 0 auto; padding: 40px 20px; }
.article h1 { font-size: 2rem; margin-bottom: 8px; }
.article .meta { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 32px; }
.article h2 { font-size: 1.3rem; margin-top: 32px; margin-bottom: 12px; }
.article h3 { font-size: 1.1rem; margin-top: 24px; margin-bottom: 8px; }
.article p { margin-bottom: 16px; color: var(--text); line-height: 1.8; }
.article ul, .article ol { margin-bottom: 16px; padding-left: 24px; }
.article li { margin-bottom: 8px; line-height: 1.7; }
.article code {
  font-family: var(--font-display);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
.article pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  line-height: 1.5;
}
.article pre code { background: none; padding: 0; }
.article blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* About page */
.about-content { max-width: 720px; margin: 0 auto; padding: 60px 20px; }
.about-content h1 { font-size: 2rem; margin-bottom: 24px; }
.about-content p { margin-bottom: 16px; line-height: 1.8; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .hero { padding: 40px 0 24px; }
  .input-group { grid-template-columns: 1fr 1fr; }
  nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px 20px; gap: 12px; }
  nav.open { display: flex; }
  .mobile-toggle { display: block; }
  .tab-btn { min-width: 80px; font-size: 0.75rem; padding: 8px 10px; }
  .chain-layer { flex-wrap: wrap; }
  .preset-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .input-group { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.3rem; }
}


/* === V5: Nav Pro + Zovo Tools === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.nav-pro {
  background: var(--accent);
  color: #000 !important;
  padding: 5px 13px;
  border-radius: var(--radius, 6px);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.nav-pro:hover {
  opacity: 0.85;
}

.nav-zovo {
  color: var(--text-muted, #888) !important;
  font-size: 0.78rem;
  text-decoration: none;
  white-space: nowrap;
}

.nav-zovo:hover {
  color: var(--text, #e8e8e8) !important;
}

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

/* === V5: Footer — removed, see V14 block at end of file === */

/* === V5: Pro Nudge === */
.pro-nudge {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--accent-dim, rgba(110, 231, 183, 0.06));
  border: 1px solid var(--accent, #6ee7b7);
  border-radius: var(--radius, 8px);
  animation: v5-nudge-in 0.3s ease;
}

.pro-nudge-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.pro-nudge-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1.4;
}

.pro-nudge-text {
  font-size: 0.88rem;
  color: var(--text-muted, #888);
  line-height: 1.55;
}

.pro-nudge-text strong {
  color: var(--text, #e8e8e8);
}

.pro-nudge-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

@keyframes v5-nudge-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FOOTER — V14 STANDARDIZED
   Do NOT modify individual properties per site.
   This CSS is identical across all 18 domains.
   ============================================ */
.site-footer {
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    margin-top: 4rem;
    padding: 0;
}
.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem 2rem 2rem;
    text-align: center;
}
.footer-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #e4e2f0);
    letter-spacing: -0.01em;
}
.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-dim, #666);
    margin-top: 0.3rem;
    margin-bottom: 1.5rem;
}
.footer-cta {
    display: inline-block;
    padding: 0.6rem 1.75rem;
    border: 1.5px solid var(--accent, #34d399);
    border-radius: 6px;
    color: var(--accent, #34d399);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.footer-cta:hover {
    background: var(--accent, #34d399);
    color: #000;
    text-decoration: none;
}
.footer-copy {
    font-size: 0.7rem;
    color: var(--text-dim, #555);
    margin-top: 1.25rem;
}
.footer-copy a {
    color: inherit;
    text-decoration: none;
}
.footer-copy a:hover {
    text-decoration: underline;
}
.zovo-network {
    border-top: 1px solid var(--border, rgba(255,255,255,0.08));
    padding: 2rem 2rem 3rem;
    text-align: center;
}
.zovo-network-inner {
    max-width: 720px;
    margin: 0 auto;
}
.zovo-network-title {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text, #e4e2f0);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 1rem;
}
.zovo-network-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.25rem;
}
.zovo-network-links a {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    line-height: 1.9;
}
.zovo-network-links a:hover {
    color: var(--accent, #34d399);
}
@media (max-width: 640px) {
    .footer-inner {
        padding: 2.5rem 1.5rem 1.5rem;
    }
    .footer-cta {
        padding: 0.55rem 1.25rem;
        font-size: 0.8rem;
    }
    .zovo-network {
        padding: 1.5rem 1.5rem 2.5rem;
    }
    .zovo-network-links {
        gap: 0.3rem 1rem;
    }
    .zovo-network-links a {
        font-size: 0.72rem;
    }
}
