/* =================================================================
   Customputing — Engineering Notebook Theme
   -----------------------------------------------------------------
   Visual language: graph-paper background, technical drawing
   sensibility, blueprint blues with a warm amber accent. Heavy on
   monospace; serif headlines for editorial weight on long-form posts.
   ================================================================= */

:root {
  /* Paper & ink */
  --paper:       #f6f4ee;     /* warm off-white, like a sketchbook page */
  --paper-deep:  #ece9dd;
  --grid:        #d8e3eb;     /* graph-paper rule color, faint */
  --grid-strong: #b8cbd7;     /* major rule every 5 squares */
  --ink:         #0e1e2b;     /* near-black with a blue undertone */
  --ink-soft:    #3a4a5a;
  --rule:        #c8d0d8;
  --rule-soft:   #e2e6ea;

  /* Brand */
  --blueprint:   #1d4e89;     /* primary blueprint blue */
  --blueprint-2: #2e6eb5;
  --amber:       #d97a1f;     /* warm accent — annotations, links */
  --amber-soft:  #f3d9bd;
  --success:     #2d6a4f;
  --error-bg:    #fbe2dc;
  --error-fg:    #8e1f0f;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --font-body:    'Inter Tight', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Layout */
  --max-w:    1200px;
  --max-w-prose: 720px;
  --pad-x:    clamp(20px, 4vw, 56px);
  --radius:   4px;
  --shadow-card: 0 1px 0 var(--rule), 0 12px 24px -20px rgba(14, 30, 43, .35);
}

/* =================================================================
   Reset
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--blueprint); }
a:hover { color: var(--amber); }
button { font: inherit; cursor: pointer; }

::selection { background: var(--blueprint); color: var(--paper); }

/* Graph-paper background — fixed so it doesn't scroll. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    /* major lines every 100px */
    linear-gradient(to right,  var(--grid-strong) 0, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-strong) 0, var(--grid-strong) 1px, transparent 1px),
    /* minor lines every 20px */
    linear-gradient(to right,  var(--grid) 0, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 0, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  opacity: .45;
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,.6) 70%, rgba(0,0,0,.3) 100%);
}

.main { flex: 1; position: relative; z-index: 1; }

/* =================================================================
   Topbar
   ================================================================= */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 244, 238, .92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px var(--pad-x);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand__mark {
  width: 24px; height: 24px;
  border: 1.5px solid var(--blueprint);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--blueprint);
  position: relative;
}
.brand__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px dashed var(--blueprint);
  border-radius: 2px;
  opacity: .5;
}
.brand__name {
  display: inline-flex;
  gap: 1px;
}
.brand__name b { color: var(--blueprint); font-weight: 700; }

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.topbar__link {
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--ink-soft);
  transition: color .15s ease;
}
.topbar__link:hover { color: var(--amber); }
.topbar__link.is-current { color: var(--ink); }

/* =================================================================
   Buttons
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--solid {
  background: var(--blueprint);
  color: var(--paper);
  border-color: var(--blueprint);
}
.btn--solid:hover { background: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn--accent {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
}
.btn--accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--lg { padding: 13px 22px; font-size: 14px; }
.btn--block { width: 100%; padding: 13px 18px; font-size: 14px; }

/* =================================================================
   Hero / landing
   ================================================================= */
.hero {
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,.4) 100%);
}
.hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 112px) var(--pad-x) clamp(40px, 6vw, 80px);
  position: relative;
}

/* Annotation labels like "FIG. 01" — give the design technical-drawing energy. */
.fig-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blueprint);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fig-label::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--blueprint);
}

.hero__eyebrow { margin-bottom: 28px; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.04;
  letter-spacing: -.025em;
  margin: 0 0 22px;
  max-width: 16ch;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
}
.hero__title .accent {
  color: var(--blueprint);
  position: relative;
}
.hero__title .accent::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 8px;
  background: var(--amber-soft);
  z-index: -1;
}

.hero__lede {
  font-size: clamp(17px, 1.6vw, 19px);
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Floating coordinate labels — pure decoration, technical-drawing vibe. */
.hero__coords {
  position: absolute;
  top: 24px; right: var(--pad-x);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-soft);
  opacity: .7;
  text-align: right;
}
.hero__coords span { display: block; }
@media (max-width: 800px) { .hero__coords { display: none; } }

/* =================================================================
   Highlights ribbon
   ================================================================= */
.highlights {
  border-bottom: 1px solid var(--rule);
  background: var(--paper-deep);
}
.highlights__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--pad-x);
}
.highlights__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.highlights__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.highlight {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--amber);
  background: var(--paper);
  padding: 14px 16px;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, transform .12s ease;
}
.highlight:hover { border-color: var(--ink); transform: translateY(-1px); }
.highlight__kind {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--amber);
}
.highlight__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin: 6px 0 4px;
  line-height: 1.25;
}
.highlight__body {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0;
}
.highlights__empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  opacity: .7;
}

/* =================================================================
   Sections grid (the directory of corners)
   ================================================================= */
.grid-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--pad-x);
}
.grid-wrap__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 32px;
}
.grid-wrap__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-style: italic;
  font-size: 28px;
  margin: 0;
}
.grid-wrap__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.grid {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
}
.card__link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  position: relative;
  overflow: hidden;
}
/* Corner ticks — like marking a technical drawing's bounds. */
.card__link::before,
.card__link::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--blueprint);
  border-style: solid;
  opacity: 0;
  transition: opacity .2s ease;
}
.card__link::before { top: 6px; left: 6px; border-width: 1.5px 0 0 1.5px; }
.card__link::after  { bottom: 6px; right: 6px; border-width: 0 1.5px 1.5px 0; }
.card__link:hover {
  border-color: var(--blueprint);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.card__link:hover::before,
.card__link:hover::after { opacity: 1; }

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card__icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 20px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blueprint);
}
.card__access { margin-top: 4px; }

.card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.18;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.card__desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}
.card__url {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.card__arrow {
  font-size: 16px;
  color: var(--blueprint);
  transition: transform .2s ease;
}
.card__link:hover .card__arrow { transform: translateX(4px); }

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.pill--open  { color: var(--success);    border-color: rgba(45, 106, 79, .35); }
.pill--gated { color: var(--blueprint);  border-color: rgba(29, 78, 137, .35); }
.pill--new   { color: var(--amber); border-color: var(--amber); background: var(--paper-deep); }

/* =================================================================
   CTA
   ================================================================= */
.cta {
  border-top: 1px solid var(--rule);
  background: var(--ink);
  color: var(--paper);
  position: relative;
}
.cta__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--pad-x);
  text-align: center;
  position: relative;
  z-index: 1;
}
.cta__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 5vw, 52px);
  margin: 0 0 14px;
  letter-spacing: -.02em;
}
.cta__lede { margin: 0 auto 28px; color: rgba(246,244,238,.7); max-width: 50ch; }
.cta__actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cta .btn--solid { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.cta .btn--solid:hover { background: var(--amber); color: var(--paper); border-color: var(--amber); }
.cta .btn--ghost { color: var(--paper); border-color: rgba(246,244,238,.3); }
.cta .btn--ghost:hover { border-color: var(--paper); }

/* =================================================================
   Long-form prose pages (blog / DIY posts)
   ================================================================= */
.post {
  max-width: var(--max-w-prose);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad-x);
}
.post__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
.post__meta a { color: var(--ink-soft); text-decoration: none; }
.post__meta a:hover { color: var(--amber); }
.post__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}
.post__lede {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 32px;
}
.post__divider {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 32px 0;
}
.post__body {
  font-size: 17px;
  line-height: 1.7;
}
.post__body h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  margin: 48px 0 14px;
  letter-spacing: -.01em;
}
.post__body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  margin: 32px 0 10px;
}
.post__body p { margin: 0 0 18px; }
.post__body ul, .post__body ol { margin: 0 0 18px; padding-left: 22px; }
.post__body li { margin-bottom: 6px; }
.post__body code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 6px;
}
.post__body pre {
  background: var(--ink);
  color: #cfe2f0;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 22px;
  border: 1px solid var(--ink-soft);
}
.post__body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}
.post__body blockquote {
  border-left: 3px solid var(--amber);
  padding: 4px 0 4px 18px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-style: italic;
}
.post__body img {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin: 22px 0;
}
.post__body a { text-decoration: underline; text-underline-offset: 3px; }

/* Post index pages */
.post-index {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--pad-x);
}
.post-index__head {
  margin-bottom: 32px;
}
.post-index__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -.02em;
  margin: 8px 0 4px;
}
.post-index__lede {
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 56ch;
  margin: 0;
}
.post-list {
  list-style: none;
  padding: 0; margin: 32px 0 0;
  display: grid;
  gap: 12px;
}
.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .18s ease, transform .12s ease;
}
.post-card:hover {
  border-color: var(--blueprint);
  transform: translateY(-1px);
}
.post-card__meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}
.post-card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}
.post-card__desc {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}

/* =================================================================
   Footer
   ================================================================= */
.footer {
  border-top: 1px solid var(--rule);
  padding: 24px var(--pad-x);
  position: relative;
  z-index: 1;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  color: var(--ink-soft);
}
.footer__brand { font-family: var(--font-mono); }
.footer__brand b { color: var(--blueprint); }
.footer__meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 600px) {
  .topbar__inner { flex-wrap: wrap; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .hero__title { max-width: none; }
}
