/* ==========================================================================
   Blueprint theme — visual language ported from https://twotimespi.dev
   Light-only. Font stacks are declared but not loaded, matching the source.
   ========================================================================== */

/* --- reset ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

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

button { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

/* --- design tokens ----------------------------------------------------- */

:root {
  --ground: #FFFFFF;
  --grid: #DCE4F2;
  --grid-strong: #C9D6EE;
  --ink: #13213C;
  --ink-soft: #54607A;
  --accent: #1B3FA0;
  --red: #D6435B;
  --green: #1F8A5F;
  --paper-edge: #EEF2FA;
  --paper: #FFFFFF;

  --serif: "Spectral", Georgia, serif;
  --grotesk: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --math: "STIX Two Text", "Cambria Math", "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", cursive;

  --cell: 28px;
  --maxw: 1080px;
}

/* --- the graph paper --------------------------------------------------- */

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell), var(--cell) var(--cell);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 0 32px;
  flex: 1;
}

/* --- nav --------------------------------------------------------------- */

.site-nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 26px 32px 0;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.brand-group { display: flex; align-items: baseline; gap: 14px; }

.brand { display: flex; align-items: baseline; gap: 12px; }

.brand .glyph {
  font-family: var(--math);
  font-style: italic;
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}

.brand .name {
  font-family: var(--grotesk);
  font-weight: 500;
  letter-spacing: .04em;
  font-size: 18px;
}

.brand .ver {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  border: 1px solid var(--grid-strong);
  border-radius: 2px;
  padding: 1px 6px;
  transform: translateY(-2px);
}

.navlinks {
  display: flex;
  gap: 24px;
  font-family: var(--grotesk);
  font-size: 14.5px;
  align-items: center;
}

.navlinks a { color: var(--ink-soft); transition: color .2s; }
.navlinks a:hover { color: var(--accent); }
.navlinks a.active { color: var(--ink); font-weight: 500; }

.nav-toggle {
  display: none;
  background: 0 0;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 6px 2px;
}

.nav-toggle .bar {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
  border-radius: 1px;
}

/* --- hero -------------------------------------------------------------- */

.hero { padding: 74px 0 40px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(48px, 8.5vw, 92px);
  line-height: 1.02;
  letter-spacing: -.005em;
  margin: 14px 0 0;
}

.hero h1 em { font-style: italic; color: var(--accent); }

.eyebrow-hand {
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--red);
  display: inline-block;
  margin: 0 0 2px;
}

.lede {
  margin: 24px 0 0;
  max-width: 34em;
  color: var(--ink);
  font-weight: 400;
  font-size: 19px;
}

.lede strong { font-weight: 600; }

.lede + .lede { margin-top: 16px; color: var(--ink-soft); }

/* --- links & CTAs ------------------------------------------------------ */

.ghost {
  font-family: var(--grotesk);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 2px;
  transition: opacity .2s;
  display: inline-block;
}

.ghost:hover { opacity: .65; }
.ghost .arr { font-family: var(--serif); }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: center;
  margin-top: 34px;
}

/* --- social icons ------------------------------------------------------ */

.social-icons {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 34px;
}

.social-icons a { color: var(--ink-soft); transition: color .2s; }
.social-icons a:hover { color: var(--accent); }
.social-icons svg { width: 21px; height: 21px; }

/* --- terminal panel ---------------------------------------------------- */

.terminal {
  border: 1px solid var(--grid-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #0e1a30;
  box-shadow: 0 28px 60px -34px rgba(19, 33, 60, .5);
}

.terminal .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.terminal .bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}

.terminal .bar span:first-child { background: var(--red); opacity: .8; }

.terminal .bar .t {
  width: auto;
  height: auto;
  border-radius: 0;
  background: 0 0;
  margin-left: 8px;
  font-family: var(--grotesk);
  font-size: 12px;
  color: rgba(255, 255, 255, .45);
}

.terminal pre {
  margin: 0;
  padding: 22px 20px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, .82);
  overflow-x: auto;
}

.terminal .pmt { color: var(--accent); filter: brightness(2.1); }
.terminal .cmd { color: #fff; }
.terminal .out { color: rgba(255, 255, 255, .45); }
.terminal .key { color: #8fb4ff; }
.terminal .com { color: var(--green); filter: brightness(1.5); }

/* --- section scaffolding ----------------------------------------------- */

section { padding: 88px 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 44px;
}

.sec-head .mark {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--red);
  transform: translateY(-2px);
}

.sec-head h2 {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1;
  margin: 0;
  letter-spacing: -.01em;
}

/* --- card grids -------------------------------------------------------- */

.capabilities,
.layers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--grid-strong);
  border: 1px solid var(--grid-strong);
  border-radius: 6px;
  overflow: hidden;
}

.capabilities div {
  background: rgba(255, 255, 255, .82);
  padding: 20px 18px;
  font-family: var(--grotesk);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

.layer { background: var(--ground); padding: 30px 26px 34px; position: relative; }

.layer .idx {
  position: absolute;
  top: 24px;
  right: 24px;
  font-family: var(--math);
  font-style: italic;
  font-size: 22px;
  color: var(--grid-strong);
}

.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 36px 56px;
}

.pr { border-top: 1.5px solid var(--ink); padding-top: 18px; }

.pr h3 {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.02;
  margin: 0 0 6px;
}

.pr p { margin: 0; font-size: 16.5px; color: var(--ink-soft); }

.capabilities code,
.pr code {
  font-family: var(--mono);
  font-size: .9em;
  color: var(--accent);
  background: rgba(201, 214, 238, .35);
  padding: 1px 4px;
  border-radius: 3px;
}

/* --- document pages (about, posts) ------------------------------------- */

.breadcrumbs {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  padding-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs-separator { color: var(--grid-strong); }

.single-intro-container { padding: 10px 0 4px; }

.single-title {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -.005em;
  margin: 8px 0 0;
}

.single-readtime {
  font-family: var(--grotesk);
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}

.single-content { padding-bottom: 40px; max-width: 46em; }

.single-content h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  margin: 48px 0 16px;
  letter-spacing: -.01em;
  border-top: 1px solid var(--grid-strong);
  padding-top: 32px;
  line-height: 1.25;
}

.single-content h3 {
  font-family: var(--grotesk);
  font-weight: 600;
  font-size: 19px;
  margin: 32px 0 12px;
  line-height: 1.35;
}

.single-content p { margin: 14px 0; color: var(--ink-soft); }

.single-content strong { color: var(--ink); font-weight: 600; }

.single-content ul, .single-content ol { margin: 14px 0; padding-left: 22px; }
.single-content li { margin: 8px 0; color: var(--ink-soft); }
.single-content li::marker { color: var(--grid-strong); }
.single-content li p { margin: 6px 0; }

.single-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--grid-strong);
  transition: border-color .2s;
}

.single-content a:hover { border-bottom-color: var(--accent); }

.single-content hr {
  border: none;
  height: 1px;
  background: var(--grid-strong);
  margin: 40px 0;
}

/* the first rule on the about page sits right under the title */
.single-content > hr:first-child { margin-top: 24px; }

/* a heading immediately after a rule shouldn't double up on separators */
.single-content hr + h2 { border-top: none; padding-top: 0; margin-top: 0; }

.single-content blockquote {
  margin: 24px 0;
  padding-left: 20px;
  border-left: 2px solid var(--grid-strong);
  color: var(--ink-soft);
  font-style: italic;
}

.single-content code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--paper-edge);
  border: 1px solid var(--grid-strong);
  border-radius: 3px;
  padding: 1px 5px;
}

.single-content pre {
  position: relative;
  margin: 28px 0;
  padding: 22px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--paper-edge);
  border: 1px solid var(--grid-strong);
  border-radius: 8px;
  overflow-x: auto;
}

.single-content pre code {
  background: 0 0;
  border: none;
  padding: 0;
  font-size: inherit;
}

.single-content table {
  border-collapse: collapse;
  margin: 24px 0;
  width: 100%;
  font-size: 16px;
}

.single-content th, .single-content td {
  padding: .5rem .75rem;
  border: 1px solid var(--grid-strong);
  text-align: left;
}

.single-content th { background: var(--paper-edge); font-weight: 600; }

/* hover-reveal heading anchors */
.heading { position: relative; }

.heading .anchor {
  visibility: hidden;
  font-family: var(--mono);
  font-size: .7em;
  color: var(--grid-strong);
  margin-left: .4em;
  border: none;
}

.heading:hover .anchor { visibility: visible; }
.heading .anchor:hover { color: var(--accent); }

.back-to-top {
  font-family: var(--mono);
  font-size: 13px;
  padding-bottom: 60px;
}

.back-to-top a { color: var(--ink-soft); }
.back-to-top a:hover { color: var(--accent); }

.list-container { padding-bottom: 80px; }

.list-container h1 {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.04;
  margin: 8px 0 0;
}

/* --- copy button on code blocks ---------------------------------------- */

.copy-code-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  font-family: var(--grotesk);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--ground);
  border: 1px solid var(--grid-strong);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  transition: color .2s;
}

.copy-code-button:hover { color: var(--accent); }
pre:hover .copy-code-button { display: block; }

/* --- 404 --------------------------------------------------------------- */

.not-found { text-align: center; padding: 120px 0; }

.not-found .turn {
  font-family: var(--math);
  font-style: italic;
  font-size: clamp(60px, 14vw, 120px);
  color: var(--accent);
  display: block;
  line-height: .9;
}

.not-found h1 {
  font-family: var(--hand);
  font-weight: 500;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.05;
  margin: 18px 0 0;
}

.not-found p { color: var(--ink-soft); margin: 14px 0 30px; }

/* --- footer ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--grid-strong);
  padding: 34px 32px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--grotesk);
  font-size: 13.5px;
  color: var(--ink-soft);
  flex-wrap: wrap;
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.site-footer .brand .glyph { font-size: 20px; }
.site-footer .brand .name { font-size: 15px; }
.site-footer .l { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer a:hover { color: var(--accent); }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }

  .site-nav { padding: 22px 22px 0; flex-wrap: wrap; align-items: center; }

  .navlinks {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--ground);
    border-bottom: 1px solid var(--grid-strong);
    box-shadow: 0 16px 30px -20px rgba(19, 33, 60, .3);
    z-index: 20;
    align-items: stretch;
  }

  .navlinks.is-open { display: flex; }
  .navlinks a { padding: 14px 22px; border-top: 1px solid var(--grid); }

  .capabilities, .layers { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 22px; }
  .site-footer { padding: 34px 22px 60px; }
  .hero { padding: 48px 0 24px; }
  .single-content h2 { margin-top: 36px; padding-top: 26px; }
  .cta-row { gap: 16px; }
}

@media (max-width: 480px) {
  body { font-size: 17px; }
  .brand .ver { display: none; }
  .terminal pre { font-size: 12px; padding: 18px 16px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
