/* ─── Reset + Base ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --surface: #181b24;
  --surface2: #242836;
  --border: #2e3344;
  --text: #e2e4ea;
  --subtext: #9ba1b0;
  --accent: #6c8aff;
  --accent-dim: #4a6ae0;
  --green: #6bdfb8;
  --peach: #f0a77b;
  --max-w: 1080px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── Typography ─── */
h1 { font-size: 2.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; }
p  { font-size: 1.125rem; color: var(--subtext); }

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

/* ─── Section (normal mode) ─── */
.section {
  padding: 5rem 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); }

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

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}

/* ─── Code blocks ─── */
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.875em;
}

/* ─── Nav ─── */
.site-nav {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 17, 23, 0.72);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

[data-mode="present"] .site-nav { position: static; }

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

.site-nav .nav-links a { color: var(--subtext); font-size: 1.05rem; }
.site-nav .nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-brand {
  font-weight: 700;
  font-size: 1.68rem;
  color: var(--text) !important;
  letter-spacing: -0.01em;
}

.brand-xi,
.brand-product,
.nav-brand .brand-xi,
.nav-brand .brand-product {
  color: var(--accent);
  font-weight: 600;
}

.nav-brand .brand-sep {
  color: var(--subtext);
  font-weight: 500;
  margin: 0 0.08em;
}

h1 .brand-xi,
h1 .brand-product { font-weight: 700; }

@media (max-width: 768px) {
  .nav-brand .brand-product { display: none; }
}

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

/* ─── Footer ─── */
.site-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer p { font-size: 0.85rem; color: var(--subtext); }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.gap-1 { gap: 0.75rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* ─── Present Mode ─── */
html[data-mode="present"] {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

html[data-mode="present"] body {
  overflow-x: hidden;
}

[data-mode="present"] .section {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border-top: none;
}

[data-mode="present"] .section > .container {
  max-width: var(--max-w);
  width: 100%;
}

/* Bump type in present mode for recording readability */
[data-mode="present"] h1 { font-size: 3.5rem; }
[data-mode="present"] h2 { font-size: 2.25rem; }
[data-mode="present"] h3 { font-size: 1.5rem; }
[data-mode="present"] p  { font-size: 1.35rem; }
[data-mode="present"] pre { font-size: 1.05rem; }

/* Hide nav/footer in present mode */
[data-mode="present"] .site-nav,
[data-mode="present"] .site-footer { display: none; }

/* ─── Scroll-reveal ─── */
/* Paired with shared/reveal.js: adds .is-visible via IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
[data-mode="present"] .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─── Lead form status ─── */
.lead-form-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.lead-form-status {
  max-width: 640px;
  margin: 1.25rem auto 0;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}
.lead-form-status--success {
  background: rgba(107, 223, 184, 0.08);
  border: 1px solid rgba(107, 223, 184, 0.35);
  color: var(--green);
}
.lead-form-status--error {
  background: rgba(240, 167, 123, 0.08);
  border: 1px solid rgba(240, 167, 123, 0.4);
  color: var(--peach);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 0 1.25rem; }
  .section { padding: 3rem 0; }
}

/* ─── Build Blog ─── */
/* Generic styles for any <product>/blog/ surface. First used by /brilliant/blog/. */

.site-nav .nav-links .is-current {
  color: var(--text);
}

/* Blog index — hero */
.blog-hero { padding-top: 4rem; padding-bottom: 2rem; }
.blog-hero-inner { text-align: center; max-width: 720px; margin: 0 auto; }
.blog-hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.blog-hero h1 { margin-bottom: 1rem; }
.blog-hero .lead { font-size: 1.2rem; color: var(--subtext); }

/* Blog index — entry list */
.blog-list-section { padding-top: 2rem; }
.blog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 820px;
  margin: 0 auto;
}
.blog-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, transform 0.1s;
  color: var(--text) !important;
  text-decoration: none;
}
.blog-entry:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.blog-entry-thumb {
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--subtext);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.blog-entry-body { min-width: 0; }
.blog-entry-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--subtext);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}
.blog-entry-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.blog-entry-excerpt {
  font-size: 1rem;
  color: var(--subtext);
  line-height: 1.6;
  margin: 0;
}

/* Per-entry page — banner, header, video, body, prev/next */
.blog-banner {
  max-width: 820px;
  margin: 0 auto 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--subtext);
  line-height: 1.6;
}
.blog-banner a { color: var(--accent); }

.blog-entry-header {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 0 1.5rem;
}
.blog-entry-header h1 { margin-bottom: 0.75rem; }
.blog-entry-header .blog-entry-meta { font-size: 0.9rem; }

.blog-entry-body-main {
  max-width: 820px;
  margin: 0 auto;
}
.blog-entry-body-main h2 { margin: 6.25rem 0 1rem; }
.blog-entry-body-main h3 { margin: 3rem 0 0.75rem; }
.blog-entry-body-main p { margin-bottom: 1.25rem; }
.blog-entry-body-main ul,
.blog-entry-body-main ol { margin: 0 0 1.25rem 1.5rem; color: var(--subtext); font-size: 1.125rem; line-height: 1.7; }
.blog-entry-body-main li { margin-bottom: 0.4rem; }

.video-slot {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 820px;
  margin: 2rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--subtext);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  overflow: hidden;
}
.video-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.blog-artifacts {
  max-width: 820px;
  margin: 2rem auto 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.blog-artifacts h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.blog-artifacts ul { margin: 0 0 0 1.25rem; color: var(--subtext); }

.blog-prev-next {
  max-width: 820px;
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.blog-prev-next a {
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--subtext);
  font-size: 0.95rem;
}
.blog-prev-next a:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}
.blog-prev-next .spacer { flex: 1; }

.install-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}
.install-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}
.install-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.install-card p {
  color: var(--subtext);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.9rem;
  flex: 1;
}
.install-card pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  margin: 0;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.5;
}
.install-card code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  white-space: pre;
}

@media (max-width: 640px) {
  .blog-entry { grid-template-columns: 1fr; }
  .blog-entry-thumb { aspect-ratio: 16 / 9; }
  .install-grid { grid-template-columns: 1fr; }
}

/* ─── Contact section + lead-form (promoted from brilliant/index.html
       so blog pages render the form consistently) ─── */
.contact-section .container { text-align: center; }
.contact-section h2 { margin-bottom: 1rem; }
.contact-linkedin {
  font-size: 0.95rem;
  color: var(--subtext);
}
.contact-linkedin a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.contact-linkedin a:hover { text-decoration: underline; }
.linkedin-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.15em;
  margin-right: 0.3em;
}

.lead-form {
  max-width: 540px;
  margin: 2rem auto 0;
  text-align: left;
  display: grid;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
}
.lead-form .form-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  text-align: center;
}
.lead-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--subtext);
  margin-bottom: 0.4rem;
}
.lead-form input,
.lead-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.lead-form textarea { min-height: 96px; resize: vertical; }
.lead-form button { justify-self: start; }
