/* Lambspring Labs shared stylesheet */

:root {
  --bg: #0a0a0b;
  --bg-elev: #131316;
  --bg-glow: #15110a;
  --fg: #ece9e2;
  --fg-soft: #b8b3a8;
  --fg-mute: #7c7870;
  --accent: #c9a86a;
  --accent-hover: #d6b67c;
  --mark: #2a9d8f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --serif: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  background:
    radial-gradient(ellipse 60rem 30rem at 50% -10%, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

/* Site nav */
.site-nav {
  border-bottom: 1px solid var(--border);
  padding: 1.05rem clamp(1.5rem, 5vw, 2.5rem);
  position: relative;
  z-index: 10;
}
.nav-inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
}
.brand .mark {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mark);
}
.brand .wordmark {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--fg);
}
.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--fg-soft);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--accent); }

/* Containers */
.container {
  max-width: 44rem;
  width: 100%;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 2.5rem);
  position: relative;
  z-index: 2;
}
.page {
  flex: 1;
  position: relative;
  z-index: 2;
}
.page-container {
  max-width: 50rem;
  width: 100%;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 5vw, 2.5rem);
}

/* Typography */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
h1.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.018em;
  line-height: 1.1;
  margin: 0 0 1.25rem;
  color: var(--fg);
}
h1.page-title em { font-style: italic; color: var(--accent); }
h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--fg);
}
.lede {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.8vw, 1.2rem);
  color: var(--fg-soft);
  margin: 0 0 3rem;
  max-width: 36rem;
  line-height: 1.55;
  font-weight: 400;
  font-style: italic;
}
.lede em { font-style: normal; color: var(--fg); }
p {
  color: var(--fg-soft);
  margin: 0 0 1.1rem;
  font-size: 0.98rem;
  line-height: 1.65;
}
p:last-child { margin-bottom: 0; }
a.inline {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 106, 0.3);
  transition: border-color 0.15s ease;
}
a.inline:hover { border-bottom-color: var(--accent); }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: clamp(2.5rem, 6vw, 3.5rem) 0;
  position: relative;
}
.divider::after {
  content: '';
  position: absolute;
  left: 0;
  top: -0.5px;
  height: 2px;
  width: 2.5rem;
  background: var(--accent);
}

/* Sections */
section { margin-bottom: clamp(2.5rem, 6vw, 3.5rem); }
section:last-child { margin-bottom: 0; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  display: block;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.012);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  background: rgba(201, 168, 106, 0.03);
}
.card h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.card p {
  font-size: 0.92rem;
  margin: 0 0 1rem;
  color: var(--fg-soft);
}
.card .card-cta {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Modules (Meridian) */
.module {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 2rem;
}
.module:first-of-type { border-top: none; padding-top: 0; }
.module-head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.module h2 { margin: 0; font-size: 1.55rem; }
.module .tag {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mark);
  border: 1px solid var(--mark);
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
}
.module .module-tagline {
  font-family: var(--serif);
  font-style: italic;
  color: var(--fg-mute);
  font-size: 1.02rem;
  margin: 0 0 0.85rem;
}
.module p { margin: 0; max-width: 38rem; }

/* Module quick-jump */
.module-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0 2rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.module-jump a {
  color: var(--fg-mute);
  text-decoration: none;
  transition: color 0.15s ease;
}
.module-jump a:hover { color: var(--accent); }

/* Contact */
.contact-list {
  display: grid;
  gap: 1.75rem;
  margin-top: 2rem;
}
.contact-item .label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 0.4rem;
}
.contact-item a {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 168, 106, 0.3);
  transition: border-color 0.15s ease;
}
.contact-item a:hover { border-bottom-color: var(--accent); }
.contact-item .desc {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--fg-mute);
}

/* Research / papers */
.paper-list { display: grid; gap: 0; margin-top: 1.5rem; }
.paper {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.paper:first-child { border-top: none; padding-top: 0; }
.paper-meta {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 0.4rem;
}
.paper h3 {
  font-family: var(--serif);
  font-weight: 500;
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.005em;
}
.paper h3 a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.paper h3 a:hover { border-bottom-color: var(--accent); }
.paper p {
  margin: 0;
  font-size: 0.92rem;
  max-width: 38rem;
}
.empty-state {
  font-family: var(--serif);
  font-style: italic;
  color: var(--fg-mute);
  padding: 1.5rem 0;
  font-size: 1.05rem;
}

/* Footer */
footer {
  margin-top: auto;
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 2.5rem);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 2;
}
.footer-inner {
  max-width: 76rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--fg-mute);
}
footer a {
  color: var(--fg-mute);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
footer a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Index landing variant */
body.is-landing .container {
  max-width: 44rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.is-landing h1 {
  font-family: var(--serif);
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 1.5rem;
  color: var(--fg);
}
body.is-landing h1 em { font-style: italic; color: var(--accent); }
body.is-landing .lede {
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  color: var(--fg-soft);
  margin: 0;
  max-width: 30rem;
  line-height: 1.55;
  font-weight: 400;
  font-style: normal;
}
body.is-landing .lede em { font-style: italic; color: var(--fg); }
body.is-landing .lede {
  max-width: 34rem;
}
body.is-landing .lede-aside {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--fg-mute);
  margin: 1.5rem 0 0;
  font-style: italic;
  letter-spacing: 0.005em;
}
body.is-landing .lede-aside em { font-style: italic; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
