/* ═══════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════ */

:root {
  --bg: #0f0f10;
  --panel: rgba(255, 255, 255, 0.02);
  --ink: #e7e3da;
  --muted: rgba(231, 227, 218, 0.65);
  --hairline: rgba(231, 227, 218, 0.16);
  --hairline-2: rgba(231, 227, 218, 0.09);

  --copper: #b87333;
  --brass: #c6a15b;

  --grid-h: rgba(255, 255, 255, 0.0605);
  --grid-v: rgba(255, 255, 255, 0.0385);

  --max: 980px;
  --col: 760px;
}

/* ═══════════════════════════════════════
   RESET
   ═══════════════════════════════════════ */

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

/* ═══════════════════════════════════════
   BODY — lab notebook grid
   ═══════════════════════════════════════ */

html {
  background-color: var(--bg);
}

body {
  font-family: "IBM Plex Serif", "Libre Baskerville", Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 29px,
      var(--grid-h) 30px
    ),
    repeating-linear-gradient(
      to right,
      transparent,
      transparent 119px,
      var(--grid-v) 120px
    );
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.00) 0%,
    rgba(0, 0, 0, 0.25) 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  opacity: 0.75;
  z-index: 100;
}

/* ═══════════════════════════════════════
   MARGIN SCRIBBLES
   ═══════════════════════════════════════ */

.margin-scribbles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  pointer-events: none;
  z-index: 101;
  overflow: hidden;
}

.margin-scribbles span {
  position: absolute;
  font-family: "IBM Plex Serif", Georgia, serif;
  font-style: italic;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.12;
  white-space: nowrap;
  user-select: none;
}

.margin-scribbles .sketch {
  font-size: 0;
}

.margin-scribbles .sketch svg {
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1100px) {
  .margin-scribbles span {
    opacity: 0.07;
    font-size: 0.6rem;
  }
}

/* ═══════════════════════════════════════
   LINKS — copper accent + instrument glow
   ═══════════════════════════════════════ */

a {
  color: var(--copper);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 115, 51, 0.25);
  transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}

a:hover {
  color: var(--brass);
  border-bottom-color: rgba(198, 161, 91, 0.45);
  text-shadow: 0 0 7px rgba(184, 115, 51, 0.25);
}

a:focus-visible {
  outline: 1px solid var(--copper);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════
   MAIN COLUMN
   ═══════════════════════════════════════ */

.main-col {
  max-width: var(--col);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════
   HEADER — engraved instrument plate
   ═══════════════════════════════════════ */

.site-header {
  max-width: var(--col);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
  position: relative;
  z-index: 1;
}

.header-plate {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 32px 0 22px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.00));
}

.site-title {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: none;
  display: block;
}

.site-title:hover {
  color: var(--copper);
  border-bottom: none;
  text-shadow: 0 0 12px rgba(184, 115, 51, 0.15);
}

.site-subtitle {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 0;
  position: relative;
  z-index: 1;
}

.site-nav a {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  padding: 6px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.site-nav a:hover {
  color: var(--brass);
  background: rgba(184, 115, 51, 0.06);
  box-shadow: inset 0 0 0 1px rgba(184, 115, 51, 0.14);
  border-bottom: none;
  text-shadow: none;
}

.nav-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--hairline);
  display: inline-block;
}

/* ═══════════════════════════════════════
   HOME PAGE — selected posts
   ═══════════════════════════════════════ */

.section-heading {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.home-more {
  margin-top: 2rem;
  padding-top: 1.5rem;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

/* ═══════════════════════════════════════
   INSTRUMENT DIVIDER
   ═══════════════════════════════════════ */

.instrument-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 28px 0;
  color: rgba(184, 115, 51, 0.75);
  letter-spacing: 0.35em;
  user-select: none;
}

.instrument-divider::before,
.instrument-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, transparent, rgba(184, 115, 51, 0.5), transparent);
}

.div-line {
  display: none;
}

.div-dot {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(184, 115, 51, 0.4);
  border: 1px solid var(--copper);
  opacity: 0.9;
}

/* ═══════════════════════════════════════
   POST PAGE
   ═══════════════════════════════════════ */

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--hairline);
}

.post-date {
  display: block;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.6rem;
}

.post-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════
   POST BODY
   ═══════════════════════════════════════ */

.post-body {
  font-size: 18px;
  line-height: 1.7;
}

.post-body h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2.5rem 0 0.8rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.post-body h3 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.6rem;
  color: var(--ink);
}

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

.post-body ul,
.post-body ol {
  margin: 0 0 1.1rem 1.4rem;
}

.post-body li {
  margin-bottom: 0.3rem;
}

.post-body blockquote {
  border-left: 2px solid rgba(184, 115, 51, 0.55);
  padding: 10px 0 10px 18px;
  margin: 28px 0;
  color: var(--muted);
  font-style: italic;
  background: var(--panel);
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body pre {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--ink);
}

.post-body code {
  font-size: 0.87em;
  background: var(--panel);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--brass);
}

.post-body pre code {
  background: none;
  padding: 0;
  color: var(--ink);
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.25rem 0;
  border: 1px solid var(--hairline);
}

.post-body a {
  border-bottom: 1px solid rgba(184, 115, 51, 0.25);
}

.post-body a:hover {
  border-bottom-color: rgba(198, 161, 91, 0.45);
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2.5rem 0;
}

/* ═══════════════════════════════════════
   SKETCH / DIAGRAM BLOCKS
   ═══════════════════════════════════════ */

.sketch svg {
  stroke: var(--brass);
  fill: none;
  stroke-width: 1.5;
}

/* ═══════════════════════════════════════
   POST META — filed under
   ═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   POST NAV
   ═══════════════════════════════════════ */

.post-nav {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.post-nav-item {
  font-size: 0.88rem;
}

.post-nav-item a {
  border-bottom: none;
}

.post-nav-item a:hover {
  border-bottom: none;
}

.nav-label {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 0.15rem;
}

/* ═══════════════════════════════════════
   PAGE BODY (about, etc.)
   ═══════════════════════════════════════ */

.page-body h1 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.page-body p {
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline-2);
}

.page-body p:last-child {
  border-bottom: none;
}

/* ═══════════════════════════════════════
   ARCHIVE
   ═══════════════════════════════════════ */

.archive-body h1 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.archive-year {
  margin-bottom: 2.5rem;
}

.archive-year h2 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--hairline);
}

.archive-year ul {
  list-style: none;
}

.archive-year li {
  display: flex;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.92rem;
  align-items: baseline;
  border-bottom: 1px solid var(--hairline-2);
}

.archive-year li:last-child {
  border-bottom: none;
}

.archive-year time {
  flex-shrink: 0;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  width: 6rem;
}

.archive-year a {
  color: var(--ink);
  border-bottom: none;
}

.archive-year a:hover {
  color: var(--copper);
  border-bottom: none;
}

/* ═══════════════════════════════════════
   FOOTER — equipment label plate
   ═══════════════════════════════════════ */

.site-footer {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 1.5rem 2.5rem;
  position: relative;
  z-index: 1;
}

.footer-plate {
  border-top: 1px solid var(--hairline-2);
  padding-top: 1.25rem;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: var(--muted);
  border-bottom: none;
}

.footer-nav a:hover {
  color: var(--copper);
  border-bottom: none;
}

.footer-credit {
  font-size: 0.72rem;
  color: rgba(231, 227, 218, 0.25);
  letter-spacing: 0.02em;
}

.footer-credit a {
  color: var(--muted);
  border-bottom: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .site-header {
    padding: 1.5rem 1rem 0;
  }

  .site-nav {
    gap: 0.25rem;
  }

  .site-nav a {
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 6px 5px;
  }

  .main-col {
    padding: 1.5rem 1rem 3rem;
  }

  .post-title {
    font-size: 1.35rem;
  }

  .site-footer {
    padding: 0 1rem 2rem;
  }

  .archive-year li {
    flex-direction: column;
    gap: 0.15rem;
  }

  .archive-year time {
    width: auto;
  }

  body::before {
    opacity: 0;
  }
}

/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */

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