/*
 * Reckon Research — Static Site Stylesheet
 * Design: Thinking Machines style
 * Pure white background, near-black text, horizontal sticky nav
 * Centered single column, humanist serif typography, no dark mode
 * Fonts: Playfair Display (headings) + Source Serif 4 (body) + JetBrains Mono (code)
 */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=JetBrains+Mono:wght@400&family=Inter:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:              #ffffff;
  --fg:              #111111;
  --fg-muted:        #666666;
  --fg-subtle:       #999999;
  --divider:         #e8e8e8;
  --nav-height:      52px;
  --content-max:     680px;
  --page-pad:        clamp(1.25rem, 5vw, 4rem);
  --navy:            #0D1F5C;
  --terminal-bg:     #0D1F5C;
  --terminal-text:   #E8EDF8;
  --terminal-comment:#6B7FA8;
  --copy-btn:        #999999;
  --copy-done:       #4A9B6F;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.85;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 6px 12px;
  background: var(--navy);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  border-radius: 4px;
  z-index: 9999;
  overflow: visible;
}

/* ── Sticky horizontal nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  height: var(--nav-height);
}

.nav-inner {
  max-width: calc(var(--content-max) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 0 var(--page-pad);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Left side: small wordmark in nav */
.nav-brand {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; opacity: 0.7; }

/* Right side: nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 120ms ease;
}
.nav-links a:hover { color: var(--fg); text-decoration: none; }
.nav-links a.active { color: var(--fg); }

/* Hamburger — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg);
  padding: 4px;
  align-items: center;
  justify-content: center;
}
.nav-hamburger:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  z-index: 90;
  background: var(--bg);
  padding: 2rem var(--page-pad);
  overflow-y: auto;
}
.mobile-nav-overlay.open { display: block; }

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mobile-nav-links li a {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--fg);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--divider);
  text-decoration: none;
}
.mobile-nav-links li a:hover { color: var(--fg-muted); text-decoration: none; }

/* ── Page wrapper ── */
.page-wrap {
  max-width: calc(var(--content-max) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 0 var(--page-pad);
}

/* ── Homepage hero ── */
.home-hero {
  padding: 3rem 0 2.5rem;
  text-align: left;
}

.hero-logo {
  width: auto;
  max-width: 340px;
  height: auto;
  display: block;
  margin-bottom: 1.5rem;
}

.hero-mark {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.1rem);
  font-weight: 300;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 520px;
}

/* ── Content sections ── */
.section {
  padding: 3rem 0 2.5rem;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
}

/* ── Typography ── */
h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin-bottom: 1.25rem;
}

h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 1rem;
}

h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

p { color: var(--fg); }
p + p { margin-top: 1.25rem; }

em { font-style: italic; }
strong { font-weight: 600; }

/* ── Section label (small caps above heading) ── */
.section-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 0.6rem;
}

/* ── Body text container ── */
.body-text p + p { margin-top: 1.25rem; }

/* ── Footnotes ── */
.footnote-ref {
  font-size: 0.7em;
  vertical-align: super;
  text-decoration: none;
  color: var(--fg-subtle);
  margin-left: 1px;
}
.footnote-ref:hover { color: var(--fg); }

.footnote-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}
.footnote-block p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg-muted);
}

/* ── Research agenda list ── */
.agenda-list { list-style: none; }
.agenda-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.agenda-item:last-child { margin-bottom: 0; }

.agenda-label {
  flex-shrink: 0;
  width: 4rem;
  padding-top: 2px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.agenda-body { color: var(--fg); }

/* ── Terminal / install blocks ── */
.install-group { margin-top: 1.25rem; }
.install-group + .install-group { margin-top: 0.75rem; }

.install-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.install-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.terminal-block {
  display: block;
  background-color: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.7;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  white-space: pre;
  overflow-x: auto;
}

.terminal-comment { color: var(--terminal-comment); }

/* ── Copy button ── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--copy-btn);
  padding: 0;
  line-height: 1;
  transition: color 150ms ease, transform 100ms ease;
}
.copy-btn:hover { color: var(--fg); }
.copy-btn:active { transform: scale(0.96); }
.copy-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }
.copy-btn.done { color: var(--copy-done); }

/* ── Pull quote ── */
.pull-quote {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: var(--fg);
  margin-top: 1.25rem;
  line-height: 1.6;
}

/* ── External link icon ── */
.ext-icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
  margin-bottom: 2px;
  opacity: 0.35;
  transition: opacity 150ms ease;
}
a:hover .ext-icon { opacity: 0.65; }

/* ── Berth subtitle ── */
.berth-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 1.25rem;
  display: block;
}

/* ── Inline code ── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: #f4f4f4;
  padding: 2px 5px;
  border-radius: 3px;
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 1.5rem 0;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 1.5rem 0 1.75rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: calc(var(--content-max) + 2 * var(--page-pad));
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--fg-subtle);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--fg-subtle);
  text-decoration: none;
  transition: color 150ms ease;
}
.footer-links a:hover { color: var(--fg); text-decoration: none; }

/* ── Fade-in animation ── */
@media (prefers-reduced-motion: no-preference) {
  .fade-section {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 450ms ease, transform 450ms ease;
  }
  .fade-section.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .home-hero { padding: 2rem 0 1.75rem; }
  .hero-logo { max-width: 240px; }

  .section { padding: 2.25rem 0 2rem; }
}

@media (max-width: 480px) {
  .hero-logo { max-width: 200px; }
  body { font-size: 16px; }
}
