/* ========================================
   SWRV — Shared theme (about, research, posts)
   Matches landing page: black bg, teal accents, Inter sans
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fraunces:ital,wght@0,400;0,500;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:          #000000;
  --bg-elev:     #0c0c0c;
  --ink:         #ffffff;
  --ink-soft:    #a0a0a0;
  --ink-faint:   #5a5a5a;
  --rule:        #1f1f1f;
  --rule-strong: #353535;
  --teal:        #2d8a8a;
  --teal-bright: #4ab8b8;
  --frame:       rgba(255, 255, 255, 0.08);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max-w: 1200px;
  --gutter: clamp(1.5rem, 4.5vw, 4.5rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Outer frame matches landing page */
body::before {
  content: '';
  position: fixed;
  inset: 18px;
  border: 1px solid var(--frame);
  pointer-events: none;
  z-index: 50;
}

/* ========================================
   Header (matches landing page)
   ======================================== */

.site-header {
  position: relative;
  z-index: 10;
  padding: 3.5rem var(--gutter) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.logo {
  width: 44px;
  height: 44px;
  display: block;
  text-decoration: none;
}

.logo svg,
.logo img { width: 100%; height: 100%; display: block; object-fit: contain; }

.nav {
  display: flex;
  gap: 3rem;
  align-items: center;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--teal-bright);
  transition: width 0.3s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--ink);
}

.nav a:hover::after,
.nav a.active::after {
  width: 100%;
}

/* ========================================
   Main + Footer
   ======================================== */

main {
  flex: 1;
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 2rem var(--gutter) 3rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 4rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ========================================
   Page header (about + research)
   ======================================== */

.page-header {
  padding: 5rem 0 3rem;
  margin-bottom: 4rem;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal-bright);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.page-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(2.75rem, 6.5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-title em {
  font-style: normal;
  color: var(--teal-bright);
  font-weight: 400;
}

/* ========================================
   About prose
   ======================================== */

.prose {
  max-width: 65ch;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.65;
  color: var(--ink-soft);
  font-weight: 400;
}

.prose p { margin-bottom: 1.5rem; }
.prose p:first-of-type {
  font-size: 1.45rem;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 2rem;
  letter-spacing: -0.005em;
}

.prose strong {
  color: var(--teal-bright);
  font-weight: 500;
  font-style: italic;
}

/* Contact block — smaller, quieter, pushed to the bottom */
.prose .contact-block {
  margin-top: 24vh;
}

.prose .contact-block h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  color: var(--ink-faint);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  margin: 0 0 0.15rem;
}

.prose .contact-block p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.2;
}

.prose .contact-block a {
  color: var(--ink-faint);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.prose .contact-block a:hover {
  color: var(--teal-bright);
  border-bottom-color: var(--teal-bright);
}

.prose h2 {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  font-size: 1.5rem;
  margin: 3.5rem 0 1.25rem;
  letter-spacing: -0.01em;
}

.prose a {
  color: var(--teal-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
.prose a:hover { border-color: var(--teal-bright); }

/* ========================================
   Research index
   ======================================== */

.post-list {
  list-style: none;
  padding-bottom: 4rem;
}

.post-list-item {
  border-top: 1px solid var(--rule-strong);
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 2rem;
  align-items: baseline;
  transition: padding 0.3s ease, background 0.3s ease;
}

.post-list-item:last-child {
  border-bottom: 1px solid var(--rule-strong);
}

.post-list-item:hover {
  padding-left: 1rem;
}

.post-list-item .date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-list-item .title {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.post-list-item .title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-list-item:hover .title a { color: var(--teal-bright); }

.post-list-item .read {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.post-list-item:hover .read { color: var(--teal-bright); }

.empty-state {
  margin: 4rem 0;
  padding: 5rem 0;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

/* ========================================
   Individual post (research/*.html)
   ======================================== */

.post-header {
  padding: 3rem 0 3rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3rem;
  max-width: 65ch;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.post-title {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.post-body {
  max-width: 65ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-soft);
  padding-bottom: 4rem;
  font-weight: 300;
}

.post-body p { margin-bottom: 1.5rem; }

.post-body h2 {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
  letter-spacing: -0.01em;
}

.post-body h3 {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--ink);
  font-size: 1.2rem;
  margin: 2.25rem 0 0.75rem;
}

.post-body a {
  color: var(--teal-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.post-body a:hover { border-color: var(--teal-bright); }

.post-body blockquote {
  border-left: 2px solid var(--teal-bright);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-elev);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  color: var(--teal-bright);
}

.post-body pre {
  background: var(--bg-elev);
  padding: 1.25rem;
  overflow-x: auto;
  border-left: 2px solid var(--teal-bright);
  margin: 1.5rem 0;
  border-radius: 2px;
}
.post-body pre code { background: none; padding: 0; color: var(--ink); }

.post-body ul, .post-body ol { margin: 0 0 1.5rem 1.5rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body img { max-width: 100%; height: auto; margin: 2rem 0; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-decoration: none;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  margin-top: 2rem;
  transition: color 0.2s ease;
}

.back-link:hover { color: var(--teal-bright); }

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 700px) {
  .site-header {
    flex-direction: row;
    padding-top: 2rem;
  }
  .nav { gap: 1.5rem; }
  body::before { inset: 8px; }

  .post-list-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .post-list-item .read { display: none; }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}
