/* ===========================================================
   MCP Runbook
   Set in Inter (body) & Fraunces (display).
   Both SIL OFL 1.1.
   =========================================================== */

/* --- Fonts --- */
@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/InterVariable-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/Fraunces-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* --- Design tokens --- */
:root {
  --bg: #faf8f3;
  --bg-card: #f4f0e6;
  --ink: #1a2238;
  --ink-soft: #4a5469;
  --ink-mute: #7a8294;
  --accent: #1e3a5f;
  --accent-hover: #0f2845;
  --warm: #b8743a;
  --warm-soft: #c89968;
  --rule: #e3dcc8;
  --rule-strong: #c8bfa6;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --w-text: 780px;
  --w-wide: 1080px;
  --w-full: 1280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

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

a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: var(--warm);
}

::selection { background: var(--warm-soft); color: var(--ink); }

/* --- Containers --- */
.container {
  max-width: var(--w-text);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container-wide {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { min-height: 60vh; }

/* --- Site header --- */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
  margin-bottom: 0;
  background: var(--bg);
}
.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}
.site-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-title:hover { color: var(--accent); text-decoration: none; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}
.site-nav a {
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0.25rem 0;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* --- Site footer --- */
.site-footer {
  margin-top: 5rem;
  color: var(--ink-mute);
  font-size: 0.9rem;
  background: var(--bg);
}
.footer-band {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--ink);
}
.footer-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
}
.site-footer > .container-wide {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}
.site-footer .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}
.footer-byline img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
}
.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--accent); }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.18;
  margin-top: 2.4rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1.15rem; }

strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-card);
  padding: 0.12em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}
pre {
  background: var(--bg-card);
  padding: 1rem 1.15rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.55;
  border: 1px solid var(--rule);
}
pre code { background: none; padding: 0; color: var(--ink); }

blockquote {
  border-left: 3px solid var(--warm-soft);
  padding-left: 1.15rem;
  margin: 1.5rem 0;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.05em;
}

hr {
  border: 0;
  height: 1.5rem;
  margin: 2.5rem 0;
  background: center / 1.5rem 1.5rem no-repeat
    radial-gradient(circle, var(--rule-strong) 1.5px, transparent 1.6px);
}

/* --- Home: hero --- */
.home-hero {
  position: relative;
  padding: 3.5rem 0 4rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 4rem;
  overflow: hidden;
}
.home-hero .container-wide {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.home-hero-text {
  max-width: 36rem;
}
.home-hero .kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--warm);
  font-weight: 600;
  margin: 0 0 1.25rem;
}
.home-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1.25rem;
  letter-spacing: -0.022em;
  font-weight: 500;
}
.home-hero .lead {
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
  max-width: 32rem;
}
.home-hero .lead-tagline {
  margin-top: 1.25rem;
  max-width: 36rem;
}
.home-hero-image {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  box-shadow: 0 18px 50px -22px rgba(26, 34, 56, 0.45);
}
.home-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Section labels --- */
.section-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--warm);
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin: 0 0 1.5rem;
}

/* --- Featured card --- */
.featured { margin-bottom: 4rem; }
.featured-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: inherit;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s;
}
.featured-card:hover {
  text-decoration: none;
  border-color: var(--rule-strong);
  box-shadow: 0 14px 36px -20px rgba(26, 34, 56, 0.4);
}
.featured-card.has-image {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
}
.featured-card-img {
  background: var(--ink);
  overflow: hidden;
  min-height: 100%;
}
.featured-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.featured-card-img.is-padded {
  background: #fff;
  padding: 1rem;
}
.featured-card-img.is-padded img {
  object-fit: contain;
}
.featured-card-body {
  padding: 2.25rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-card h3 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0 0 0.8rem;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.15s;
}
.featured-card:hover h3 { color: var(--accent); }
.featured-card p {
  margin: 0 0 1.1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.featured-cta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  color: var(--warm);
}

/* --- Mission --- */
.mission { margin-bottom: 4rem; }
.mission p {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 36rem;
}

/* --- Start here --- */
.start-here { margin-bottom: 4rem; }
.start-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.start-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
}
.start-item:last-child { border-bottom: 0; }
.start-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--warm);
  padding-top: 0.4rem;
  min-width: 1.8rem;
}
.start-body { min-width: 0; }
.start-body a { color: inherit; text-decoration: none; }
.start-body a:hover { text-decoration: none; }
.start-body a:hover h3 { color: var(--accent); }
.start-body h3 {
  font-family: var(--font-serif);
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 500;
  transition: color 0.15s;
  line-height: 1.25;
}
.start-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* --- Posts list --- */
.posts { margin-bottom: 3rem; }
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item {
  margin: 0;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-item:last-child { border-bottom: 0; }
.post-item a { display: block; color: inherit; text-decoration: none; }
.post-item a:hover { text-decoration: none; }
.post-item a:hover h2 { color: var(--accent); }
.post-item h2 {
  font-family: var(--font-serif);
  margin: 0 0 0.3rem;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.2;
  transition: color 0.15s;
}
.post-item time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.post-item p {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* --- Article --- */
.post {
  max-width: var(--w-text);
  margin: 0 auto;
  padding-top: 3rem;
}
.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-family: var(--font-serif);
  margin: 0 0 1rem;
  font-size: clamp(1.95rem, 3.6vw, 2.7rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.018em;
}
.post-meta {
  font-family: var(--font-mono);
  color: var(--ink-mute);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

.post-content { font-size: 1.05rem; }
.post-content > p:first-child {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
}
.post-content h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  margin-top: 2.6rem;
  margin-bottom: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.post-content h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-top: 2rem;
  font-weight: 600;
}
.post-content img {
  margin: 1.75rem auto;
  border-radius: 4px;
  box-shadow: 0 10px 30px -16px rgba(26, 34, 56, 0.35);
}
.post-content figure {
  margin: 1.75rem 0;
  max-width: 100%;
}
.post-content figure.embed {
  margin: 2rem 0;
}
.post-content figure a {
  display: block;
  text-decoration: none;
  border: none;
}
.post-content figure img {
  margin: 0;
  display: block;
  background: #fff;
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(26, 34, 56, 0.06);
  box-sizing: border-box;
  max-width: 100%;
  height: auto;
}
.post-content figcaption {
  margin-top: 0.65rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-mute);
  text-align: left;
}
.post-content figure.align-right {
  margin-left: auto;
}
.post-content figure.align-right figcaption {
  text-align: right;
}
.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin: 0 0 1.15rem;
}
.post-content li { margin: 0.4rem 0; }
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-content a:hover {
  text-decoration-color: var(--warm);
}
.post-footer {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}
.post-footer a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-weight: 600;
}
.post-footer a:hover { color: var(--accent); }

/* --- Static pages --- */
.page {
  max-width: var(--w-text);
  margin: 0 auto;
  padding-top: 3rem;
}
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-family: var(--font-serif);
  margin: 0;
  font-size: 2.2rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.018em;
}
.page-content { font-size: 1.04rem; }
.page-content h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 2.4rem;
}
.page-content ul, .page-content ol { padding-left: 1.5rem; }
.page-content li { margin: 0.35rem 0; }
.page-content img {
  margin: 1.5rem 0;
  border-radius: 4px;
}

/* About page: portrait next to bio */
.page-content .about-portrait {
  float: right;
  width: 200px;
  margin: 0.4rem 0 1.25rem 1.75rem;
  border-radius: 4px;
  box-shadow: 0 14px 36px -20px rgba(26, 34, 56, 0.45);
}

/* --- Mobile --- */
@media (max-width: 820px) {
  .home-hero { padding: 2.5rem 0 3rem; margin-bottom: 3rem; }
  .home-hero .container-wide {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .home-hero-image { aspect-ratio: 16 / 10; }
  .featured-card.has-image {
    grid-template-columns: 1fr;
  }
  .featured-card-img {
    aspect-ratio: auto;
    min-height: 0;
  }
  .featured-card-img img {
    height: auto;
    object-fit: contain;
  }
}

@media (max-width: 540px) {
  body { font-size: 16px; }
  .container, .container-wide { padding: 0 1.15rem; }

  .site-header { padding: 1rem 0; }
  .site-header .container-wide { gap: 0.5rem; }
  .site-title { font-size: 1.2rem; }
  .site-nav { width: 100%; gap: 0.25rem 1.25rem; }
  .site-nav a { font-size: 0.88rem; }

  .home-hero { padding: 2rem 0 2.5rem; margin-bottom: 2.5rem; }
  .home-hero h1 { font-size: 2rem; }
  .home-hero .lead { font-size: 1.05rem; }

  .featured-card-body { padding: 1.75rem 1.5rem; }
  .featured-card h3 { font-size: 1.35rem; }

  .mission p { font-size: 1.1rem; }

  .post { padding-top: 1.75rem; }
  .post-header h1 { font-size: 1.8rem; }
  .post-content { font-size: 1.02rem; }
  .post-content > p:first-child { font-size: 1.1rem; }
  .post-content h2 { font-size: 1.35rem; }

  .page { padding-top: 1.75rem; }
  .page-header h1 { font-size: 1.75rem; }
  .page-content .about-portrait {
    float: none;
    width: 180px;
    margin: 0 0 1.5rem 0;
    display: block;
  }

  .site-footer { margin-top: 3rem; }
  .footer-band { height: 130px; }
  .site-footer > .container-wide {
    padding-top: 2rem;
    padding-bottom: 2rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
}
