/* styles/site.css */
/* styles/site.css */
/* ==========================================================================
   FHound Insights — native stylesheet (Tailwind-free)
   Colors, type and spacing reference the Instatic design tokens (var(--*)).
   Dark mode: html.dark (toggled by scripts/theme.js).
   ========================================================================== */

/* ---------- Reset (replaces the Tailwind preflight) ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: 0 solid; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-size: inherit; font-weight: inherit }
a { color: inherit; text-decoration: none; }
ul, ol, menu { list-style: none; }
img, svg, video, canvas, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
button, input, select, optgroup, textarea { font: inherit; letter-spacing: inherit; color: inherit; background-color: transparent; border-radius: 0; }
[hidden] { display: none !important; }

/* ---------- State helpers (used by runtime scripts) ---------- */
.hidden { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; padding: 0 2rem; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background-color .15s ease, color .15s ease, opacity .15s ease }
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; pointer-events: none; }
.btn:disabled { pointer-events: none; opacity: .5; }
.btn-primary { background-color: var(--ink); color: var(--surface); }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background-color: transparent; color: var(--ink); }
.btn-ghost:hover { background-color: var(--accent); }
.btn-hero { font-weight: 600; width: 12rem; }
.btn-header { padding: 0 1rem }
.btn-block { width: 100%; height: auto; padding: 0.75rem 1rem; font-weight: 600; }

/* ---------- Header / navigation ---------- */
.container-shell { max-width: 1400px; margin-inline: auto; padding-inline: 1.5rem; }
.site-header { position: relative; z-index: 10; width: 100%; padding-block: 1rem; background: transparent; }
/* Landing only: the transparent header overlays the hero (prod behaviour).
   Every other page keeps the header in normal flow. */
body:has(.hero) .site-header { position: absolute; top: 0; left: 0; right: 0; }
.nav-desktop { display: none; }
.nav-mobile { width: 100%; display: flex; justify-content: space-between; align-items: center; }
@media (min-width: 1024px) {
  .nav-desktop { display: flex; width: 100%; justify-content: space-between; align-items: center; }
  .nav-mobile { display: none; }
}
.nav-left { display: flex; justify-content: flex-start; align-items: center; }
.logo-link { display: inline-flex; align-items: center; margin-right: 2rem; cursor: pointer; }
.logo-link--flush { margin-right: 0; }
.logo { object-fit: contain; object-position: center; background-repeat: no-repeat; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }
.main-nav { position: relative; z-index: 10; display: flex; max-width: max-content; flex: 1; align-items: center; justify-content: center; }
.nav-list { display: flex; flex: 1; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; white-space: nowrap; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: color .15s ease, background-color .15s ease }
.nav-link svg { margin-left: 0.25rem; }
.nav-link:hover { background-color: var(--accent); color: var(--ink); }
.nav-right { position: relative; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.icon-button {
  display: inline-flex; padding: 0.5rem; border-radius: 9999px;
  color: inherit; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.icon-button:hover { background-color: var(--accent); }

/* ---------- Mobile drawer ---------- */
.mobile-drawer { position: fixed; inset: 0; z-index: 50; background-color: var(--surface); padding: 1.5rem; overflow-y: auto; }
.drawer-top { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 2rem; }
.drawer-cta { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.drawer-links { display: flex; flex-direction: column; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.drawer-link { padding-block: 0.75rem; font-size: 1.125rem; font-weight: 500; color: var(--muted); }
.drawer-link:hover { color: var(--ink); }
.drawer-link--split { display: flex; align-items: center; justify-content: space-between; }
.drawer-theme { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.drawer-theme-label { font-weight: 500; color: var(--muted); }

/* ---------- Theme pills ---------- */
.pill-group { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9999px; padding: 0.25rem; }
.theme-pill { padding: 0.5rem; font-size: 0.75rem; color: var(--muted); cursor: pointer; border-radius: 9999px; transition: color .15s ease, background-color .15s ease; }
.theme-pill:hover { color: var(--ink); }
.theme-pill.is-active { background-color: var(--accent); color: var(--ink); }
.theme-pill--footer { padding: 0.375rem; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { width: 100%; background-color: var(--canvas); padding-block: 4.5rem; margin-top: 8rem; }
@media (min-width: 640px) { .site-footer { padding-block: 6rem; } }
@media (min-width: 1024px) { .site-footer { margin-top: 16rem; } }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 4rem; }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } }
@media (min-width: 1280px) { .footer-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.footer-brand { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 1rem; }
@media (min-width: 1024px) { .footer-brand { grid-column: span 1 / span 1; } }
@media (min-width: 1280px) { .footer-brand { grid-column: span 2 / span 2; } }
.footer-col { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; }
.footer-heading { font-size: 1rem; font-weight: 500; margin-bottom: 1rem }
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-link { display: inline-flex; justify-content: flex-start; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); cursor: pointer; }
.footer-link:hover { text-decoration: underline; }
.footer-copyright { font-size: 0.75rem; color: var(--muted); }

/* ---------- Focus visibility ---------- */
.btn:focus-visible, .nav-link:focus-visible, .icon-button:focus-visible,
.theme-pill:focus-visible, .drawer-link:focus-visible, .footer-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Article prose (framework / researches / docs) ---------- */
.prose h1 { padding-block: 2rem; font-size: var(--text-l); font-weight: 700 }
.prose h2 { padding-block: 1.5rem; font-size: var(--text-m); font-weight: 700 }
.prose h3 { padding-block: 1rem; font-size: var(--text-s); font-weight: 700 }
.prose h4 { padding-block: 0.5rem; font-size: var(--text-xs); font-weight: 700 }
.prose h5 { padding-block: 0.75rem; font-size: 1rem; font-weight: 700 }
.prose h6 { font-size: 0.875rem; font-weight: 700 }
.prose p { margin-block: 0.5rem; padding: 1rem; font-size: var(--text-xs); line-height: 1.625; color: var(--ink); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose em, .prose i { font-style: italic; }
.prose ul { margin-block: 1rem; margin-left: 1.5rem; list-style-type: disc; }
.prose ol { margin-block: 1rem; margin-left: 1.5rem; list-style-type: decimal; }
.prose li { margin-block: 0.75rem; font-size: var(--text-xs); line-height: 1.6; }
.prose blockquote { margin-block: 1.5rem; border-left: 4px solid var(--border); padding-left: 1rem; font-size: var(--text-xs); color: var(--muted); font-style: italic; }
.prose a { color: var(--primary); }
.prose a:hover { text-decoration: underline; }
.prose code { border-radius: 0.5rem; background-color: var(--canvas); padding: 0.25rem 0.375rem; font-size: var(--text-xs); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose hr { margin-block: 2rem; border-top: 1px solid var(--border); }
.prose table { margin-block: 2rem; border-collapse: collapse; border: 1px solid var(--border); border-radius: 0.75rem; text-align: left; width: 100%; font-size: 0.875rem; overflow: hidden; }
.prose thead { border-bottom: 1px solid var(--border); background-color: var(--canvas); font-size: 0.875rem; }
.prose th { border-bottom: 1px solid var(--border); padding: 0.75rem 1.5rem; font-weight: 600; color: var(--ink); }
.prose td { border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }
.prose img { margin-block: 2rem; border-radius: 0.75rem; max-width: 100%; height: auto; }

/* ---------- Callouts ---------- */
[data-callout] { display: flex; flex-direction: column; gap: 0.5rem; margin-block: 1.5rem; padding: 1rem 1rem 1.25rem; border: 1px solid hsla(221, 83%, 53%, .2); border-radius: 0.625rem; background-color: hsla(213, 100%, 66%, .2); }
[data-callout-title] { display: flex; flex-direction: row; align-items: flex-start; gap: 0.5rem; font-weight: 700; color: var(--primary); }
html.dark [data-callout] { border-color: hsla(224, 76%, 48%, .2); background-color: hsla(221, 83%, 53%, .1); }

/* ---------- Document pages (privacy policy etc.) ---------- */
.doc-page { width: 100%; min-height: 100vh; padding-block: 4rem; padding-inline: 1.5rem; }
.doc-shell { max-width: 56rem; margin-inline: auto; }

/* ---------- Researches listing ---------- */
.researches-page { display: flex; flex-direction: column; width: 100%; }
.researches-header { width: 100%; position: relative; padding-top: 3.5rem; }
.researches-inner { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: 1.5rem; }
.researches-title { font-family: var(--font-heading); font-size: clamp(2.5rem, 1.6rem + 2.6vw, 3.75rem); font-weight: 700; line-height: 1.15; text-align: left }
.researches-cards { width: 100%; position: relative; }
.researches-cards .researches-inner { display: flex; flex-direction: column; gap: var(--space-s); margin-top: var(--space-l); }
@media (min-width: 768px) { .researches-cards .researches-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-m); } }
@media (min-width: 1280px) { .researches-cards .researches-inner { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Research article ---------- */
.researches-hero { width: 100%; background-color: hsla(222, 47%, 11%, .06); padding-block: 4rem 2.5rem; }
html.dark .researches-hero { background-color: oklch(20.5% 0 0); }
.researches-hero-inner { max-width: 80rem; margin-inline: auto; padding-inline: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.researches-hero-title { font-family: var(--font-heading); font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem); font-weight: 600; line-height: 1.25 }
.researches-hero-date { font-size: 0.75rem; color: var(--muted); }
.researches-article { width: 100%; }
.researches-prose { width: 100%; max-width: none; }

/* ---------- Research listing rows (match fhoundinsights.com) ---------- */
.researches-cards .researches-inner { display: flex; flex-direction: column; }
.research-row { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); padding: 2rem 1.5rem; border-radius: 0.25rem; cursor: pointer; transition: background-color 0.15s ease; width: 100%; max-width: 1400px; margin-inline: auto; }
.research-row:hover { background-color: color-mix(in oklab, var(--accent) 30%, transparent); }
.research-row h2 { font-size: 1.5rem; font-weight: 700 }
.research-row-date { margin-top: 1.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); }

/* ---------- Prose typography (match fhoundinsights.com fixed scale) ---------- */
.prose h1 { font-size: 1.5rem; line-height: 1.33; padding-block: 1.5rem; }
.prose h2 { font-size: 1.5rem; line-height: 1.33; padding-block: 1.5rem; }
.prose h3 { font-size: 1.125rem; line-height: 1.4; padding-block: 1rem; }
.prose h4 { font-size: 1rem; }
.prose p { margin-block: 0; padding: 0.25rem 1rem; font-size: 1rem; line-height: 1.5; }
.prose li { font-size: 1rem; line-height: 1.6; }

/* ---------- Subpage header is in-flow: drop overlay clearance ---------- */
.fw-hero { padding-top: 0; }
.researches-header { padding-top: 1rem; }
.researches-hero { padding-top: 2rem; }
.doc-page { padding-block: 2rem 4rem; }

/* ---------- Research article layout (match fhoundinsights.com) ---------- */
.researches-hero { height: auto; padding-block: 3.5rem 2.5rem; }
.researches-hero-inner { max-width: 1400px; width: 100%; height: auto; margin-inline: auto; padding: 0 1.5rem; }
.researches-hero-title { font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem); line-height: 1.05; font-weight: 600; }
.researches-hero-date { margin-top: 0; font-size: 0.875rem; }
html.dark .researches-hero { background-color: oklab(0.278 -0.00750867 -0.0321344 / 0.9); }
.researches-article { max-width: 56rem; margin-inline: auto; padding-inline: 1.5rem; }
.researches-article .researches-prose { margin-top: 4rem; padding-bottom: 5rem; }
.researches-prose h1 { font-size: 1.875rem; padding-block: 1rem; }
.researches-prose h2 { font-size: 1.5rem; padding-block: 1rem; }
