/* DataPyn institutional site — aligned with IDE + Pynia brand */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-deep: #070b12;
  --bg-base: #0c111b;
  --bg-raised: #121a28;
  --bg-card: #161f30;
  --bg-card-hover: #1a2438;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #eef2f7;
  --text-muted: #8b9cb3;
  --text-dim: #5c6d85;
  --accent: #3369ff;
  --accent-cyan: #33c2ff;
  --accent-glow: rgba(51, 105, 255, 0.35);
  --sql: #569cd6;
  --python: #dcdcaa;
  --dp-bg-editor: #181a1f;
  --dp-bg-block: #1f2228;
  --dp-bg-code: #1e1e1e;
  --dp-border: rgba(255, 255, 255, 0.06);
  --dp-border-muted: rgba(255, 255, 255, 0.03);
  --dp-accent-sql: #e38c00;
  --dp-accent-py: #3572a5;
  --success: #4ade80;
  --radius: 12px;
  --radius-lg: 18px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --nav-h: 64px;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code, kbd, pre { font-family: var(--mono); }

/* Background atmosphere */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(51, 105, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(51, 194, 255, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(51, 105, 255, 0.08), transparent 45%),
    var(--bg-deep);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand img { width: 28px; height: 28px; }

.brand-pynia img { width: 26px; height: 26px; }

.nav-links {
  display: none;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: flex;
  padding: 3px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 2px;
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: var(--font);
}

.lang-switch button.active {
  background: var(--bg-card);
  color: var(--text);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-raised);
}

.menu-toggle {
  display: flex;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 20px;
  z-index: 99;
}

.mobile-drawer.open { display: block; }

.mobile-drawer a {
  display: block;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mobile-drawer a:last-child { border-bottom: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #2a7ee6 50%, var(--accent-cyan) 100%);
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 32px rgba(51, 105, 255, 0.45);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg-raised);
  border-color: var(--text-dim);
}

/* Layout */
.section {
  padding: 88px 20px;
}

.section-tight { padding: 64px 20px; }

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

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted);
}

.badge-pynia {
  border-color: rgba(51, 105, 255, 0.35);
  background: rgba(51, 105, 255, 0.12);
  color: #9ec5ff;
}

.badge-pynia img { width: 16px; height: 16px; }

/* Hero */
.hero {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 72px;
}

.hero-grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.hero-copy h1 .gradient,
.hero-copy h1.gradient {
  background: linear-gradient(120deg, #fff 0%, #9ec5ff 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-copy .lead {
  margin: 0 0 28px;
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 520px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Product preview */
.preview-window {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-base);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 80px rgba(0, 0, 0, 0.55);
}

.preview-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.preview-dots i:nth-child(1) { background: #ff5f57; }
.preview-dots i:nth-child(2) { background: #febc2e; }
.preview-dots i:nth-child(3) { background: #28c840; }

.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.88fr);
  min-height: 360px;
  background: var(--dp-bg-editor);
}

/* Session editor — stacked blocks like DataPyn */
.preview-session {
  border-right: 1px solid var(--border);
  padding: 10px 10px 12px;
  overflow: hidden;
  min-height: 0;
}

.preview-blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.dp-block {
  border-radius: 12px;
  border: 1px solid var(--dp-border);
  background: var(--dp-bg-block);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
}

.dp-block--sql {
  border-left: 3px solid var(--dp-accent-sql);
}

.dp-block--py {
  border-left: 3px solid var(--dp-accent-py);
}

.dp-block-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 34px;
  padding: 4px 8px 4px 6px;
  background: var(--dp-bg-block);
  border-bottom: 1px solid var(--dp-border-muted);
  font-size: 0.62rem;
}

.dp-block-grip {
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--text-dim) 0,
    var(--text-dim) 2px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.55;
  flex-shrink: 0;
}

.dp-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.6rem;
  border: 1px solid var(--dp-border);
  background: #282c34;
  color: var(--text);
}

.dp-lang--sql { color: #f0b878; }
.dp-lang--py { color: #7eb8e8; }

.dp-conn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--dp-border);
  background: #282c34;
  color: var(--text-muted);
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-conn::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #cc2927;
  flex-shrink: 0;
}

.dp-block-name {
  margin-left: auto;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.dp-block-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}

.dp-icon-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--dp-border);
  background: #282c34;
  flex-shrink: 0;
}

.dp-icon-btn--run {
  position: relative;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.dp-icon-btn--run::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  border: 5px solid transparent;
  border-left: 7px solid #4ade80;
}

.dp-block-code {
  background: var(--dp-bg-code);
  padding: 8px 10px 10px;
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.5;
}

.dp-block-code pre {
  margin: 0;
  white-space: pre;
}

.dp-block--sql .dp-block-code { min-height: 72px; }
.dp-block--py .dp-block-code { min-height: 56px; }

/* Pynia dock (right panel) */
.preview-pynia {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-base);
  border-left: 1px solid var(--border);
}

.pynia-dock-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(51, 105, 255, 0.22), rgba(51, 194, 255, 0.08));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pynia-dock-head strong {
  font-size: 0.78rem;
  display: block;
}

.pynia-dock-head small {
  font-size: 0.62rem;
  color: var(--text-muted);
}

.pynia-dock-msgs {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.68rem;
  overflow: hidden;
  min-height: 0;
}

.pynia-dock-composer {
  flex-shrink: 0;
  margin: 0 10px 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pynia-composer-input {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.pynia-composer-meta {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-family: var(--mono);
  align-self: flex-end;
}

.chat-code-block {
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid var(--dp-border);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.chat-code-head {
  padding: 4px 8px;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--dp-border-muted);
  background: rgba(0, 0, 0, 0.2);
}

.chat-code-block pre {
  margin: 0;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.45;
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-bubble.agent {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.chat-bubble .agent-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.chat-bubble .agent-tag img { width: 12px; height: 12px; }

.chat-code {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.62rem;
}

/* Providers */
.providers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.provider-pill {
  padding: 6px 12px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* Bento features */
.bento {
  display: grid;
  gap: 16px;
}

.bento-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s, background 0.2s;
}

.bento-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.bento-card.wide { grid-column: span 1; }

.bento-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: rgba(51, 105, 255, 0.12);
  color: var(--accent-cyan);
}

.bento-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.bento-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Pynia spotlight */
.spotlight {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(51, 105, 255, 0.25);
  background: linear-gradient(160deg, rgba(51, 105, 255, 0.08) 0%, var(--bg-card) 45%);
  padding: 40px 32px;
}

.spotlight-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.spotlight-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spotlight-list li {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.spotlight-list li strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.spotlight-list .li-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(51, 105, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.notice {
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* DB grid */
.db-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.db-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  min-height: 130px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s, transform 0.15s;
  text-align: center;
}

.db-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.db-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.85;
}

.db-card span {
  font-size: 0.8rem;
  font-weight: 500;
}

/* Steps */
.steps { display: flex; flex-direction: column; gap: 24px; }

.step {
  display: flex;
  gap: 16px;
}

.step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  overflow-x: auto;
  color: var(--text-muted);
}

/* Docs cards */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.doc-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s;
}

.doc-card:hover { border-color: var(--accent); }

.doc-card h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
}

.doc-card p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.doc-card.pynia { border-color: rgba(51, 105, 255, 0.3); }

/* CTA band */
.cta-band {
  text-align: center;
  padding: 72px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-raised) 100%);
}

.cta-band h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.cta-band p {
  margin: 0 auto 24px;
  max-width: 480px;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 32px 20px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

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

.divider {
  height: 1px;
  background: var(--border);
  max-width: var(--max);
  margin: 0 auto;
}

/* Syntax colors in preview */
.kw { color: #c586c0; }
.fn { color: #dcdcaa; }
.str { color: #ce9178; }
.num { color: #b5cea8; }
.cm { color: #6a9955; }

/* Responsive */
@media (min-width: 768px) {
  .nav-links { display: flex; }
  .menu-toggle { display: none; }
  .hero-grid { grid-template-columns: 1fr 1.05fr; }
  .spotlight-grid { grid-template-columns: 1fr 1fr; }
  .bento { grid-template-columns: repeat(3, 1fr); }
  .bento-card.span-2 { grid-column: span 2; }
  .db-grid { grid-template-columns: repeat(3, 1fr); }
  .doc-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 1024px) {
  .db-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 767px) {
  .preview-body { grid-template-columns: 1fr; min-height: 0; }
  .preview-session {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }
  .preview-pynia { min-height: 200px; }
  .dp-block-name { display: none; }
}
