/* Mining Research Log: a field-notebook look with strata accents */

:root {
  --paper: #f7f4ee;
  --paper-2: #efeae0;
  --ink: #23201b;
  --ink-2: #5b554b;
  --ink-3: #8a8378;
  --rule: #ddd5c6;
  --accent: #b4532a;      /* oxidized iron */
  --accent-2: #2f6f6a;    /* copper patina */
  --code-bg: #ece6da;
  --s1: #c9a77c; --s2: #a9774f; --s3: #7d6a55; --s4: #5d6b63; --s5: #3e4a4f;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181614;
    --paper-2: #211e1b;
    --ink: #ece6dc;
    --ink-2: #b7ae9f;
    --ink-3: #857d71;
    --rule: #34302a;
    --accent: #e0855a;
    --accent-2: #6fb3ab;
    --code-bg: #24211d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* strata band across the top */
.strata { display: flex; height: 6px; }
.strata span { flex: 1; }
.strata span:nth-child(1) { background: var(--s1); }
.strata span:nth-child(2) { background: var(--s2); flex: 1.6; }
.strata span:nth-child(3) { background: var(--s3); flex: .7; }
.strata span:nth-child(4) { background: var(--s4); flex: 1.3; }
.strata span:nth-child(5) { background: var(--s5); flex: .9; }

/* header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; flex: none;
  background:
    linear-gradient(var(--s1) 0 25%, var(--s2) 25% 50%, var(--s4) 50% 75%, var(--s5) 75%);
  clip-path: polygon(0 0, 100% 0, 75% 100%, 25% 100%);
}
.brand-text { font-family: var(--sans); font-weight: 600; font-size: 1rem; letter-spacing: .01em; }
nav { display: flex; gap: 1.25rem; font-family: var(--sans); font-size: .95rem; }
nav a { color: var(--ink-2); text-decoration: none; }
nav a:hover { color: var(--accent); }

/* hero */
.hero { padding: 3rem 0 1.5rem; }
.hero.compact { padding-bottom: .5rem; }
.eyebrow {
  font-family: var(--mono); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--accent-2); margin: 0 0 .75rem;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 1rem;
  font-weight: 700; letter-spacing: -.01em; text-wrap: balance;
}
.lede { color: var(--ink-2); margin: 0 0 1rem; font-size: 1.2rem; }
.stats { font-family: var(--mono); font-size: .82rem; color: var(--ink-3); margin: 0; }
.stats span { color: var(--ink); font-weight: 500; }

/* month groups and entry list */
.month { margin-top: 2.25rem; }
.month-label {
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3);
  border-bottom: 1px solid var(--rule); padding-bottom: .5rem; margin: 0;
}
.entries { list-style: none; margin: 0; padding: 0; }
.entry a {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem;
  padding: 1.1rem 0; border-bottom: 1px dashed var(--rule);
  color: inherit; text-decoration: none;
}
.entry a:hover h3 { color: var(--accent); }
.entry-date { text-align: center; padding-top: .15rem; }
.entry-date .day { display: block; font-family: var(--mono); font-size: 1.6rem; line-height: 1; font-weight: 500; }
.entry-date .dow { display: block; font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-top: .3rem; }
.entry-main h3 { margin: 0 0 .25rem; font-size: 1.25rem; line-height: 1.3; transition: color .15s; }
.entry-main p { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; }

/* tags */
.tags { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li, .tags a {
  font-family: var(--mono); font-size: .75rem; color: var(--accent-2);
  text-decoration: none;
}
.tags li { border: 1px solid var(--rule); border-radius: 3px; padding: .05rem .45rem; background: var(--paper-2); }
.tags.small { margin-top: .5rem; }
.post ul.tags { padding-left: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-cloud a {
  font-family: var(--mono); font-size: .85rem; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule); background: var(--paper-2); border-radius: 3px; padding: .2rem .6rem;
}
.tag-cloud a span { color: var(--ink-3); margin-left: .25rem; }
.simple-list { list-style: none; padding: 0; margin: .5rem 0 0; }
.simple-list li { display: flex; gap: 1rem; padding: .4rem 0; }
.simple-list time { font-family: var(--mono); font-size: .85rem; color: var(--ink-3); flex: none; padding-top: .15rem; }

/* single post */
.post { padding: 2.5rem 0 1rem; }
.post-header { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.post-date { font-family: var(--mono); font-size: .82rem; color: var(--ink-3); margin: 0 0 .6rem; }
.post-date .dot { margin: 0 .4rem; }
.post h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); line-height: 1.2; margin: 0; text-wrap: balance; }
.post-body h2, .post h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.post-body h3, .post h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; font-family: var(--sans); font-weight: 600; }
.post-body p, .post p { margin: 0 0 1.1rem; }
.post ul, .post ol { padding-left: 1.4rem; }
.post li { margin-bottom: .3rem; }
.post img { max-width: 100%; height: auto; display: block; margin: 1.5rem auto; border: 1px solid var(--rule); border-radius: 4px; }
.post blockquote {
  margin: 1.5rem 0; padding: .25rem 0 .25rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--ink-2); font-style: italic;
}
.post hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* code */
code, pre { font-family: var(--mono); font-size: .86em; }
:not(pre) > code { background: var(--code-bg); padding: .1em .35em; border-radius: 3px; }
pre {
  background: var(--code-bg); padding: 1rem 1.1rem; border-radius: 4px;
  overflow-x: auto; line-height: 1.5; border: 1px solid var(--rule);
}
.highlight .c, .highlight .c1, .highlight .cm { color: var(--ink-3); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kc { color: var(--accent); }
.highlight .s, .highlight .s1, .highlight .s2 { color: var(--accent-2); }
.highlight .mi, .highlight .mf { color: #8b5fbf; }
.highlight .nf, .highlight .nc { font-weight: 500; }

/* tables */
.post table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
  font-family: var(--sans); font-size: .92rem; display: block; overflow-x: auto;
}
.post th, .post td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.post th { font-weight: 600; border-bottom: 2px solid var(--ink-3); white-space: nowrap; }
.post td { font-variant-numeric: tabular-nums; }

mjx-container { overflow-x: auto; overflow-y: hidden; }

/* prev / next */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}
.post-nav a { text-decoration: none; color: var(--ink); font-size: 1rem; line-height: 1.35; }
.post-nav a span {
  display: block; font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-3); margin-bottom: .25rem;
}
.post-nav a:hover { color: var(--accent); }
.post-nav .next { text-align: right; grid-column: 2; }

/* footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule); }
.site-footer .wrap {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.25rem; padding-bottom: 2rem;
  font-family: var(--sans); font-size: .85rem; color: var(--ink-3);
}
.site-footer a { color: var(--ink-3); }

@media (max-width: 520px) {
  body { font-size: 1.05rem; }
  .entry a { grid-template-columns: 2.75rem 1fr; gap: .75rem; }
  .entry-date .day { font-size: 1.35rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; text-align: left; }
}

/* figures and callouts */
.figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0; align-items: start; }
.figs.three { grid-template-columns: repeat(3, 1fr); }
.figs figure { margin: 0; }
.post .figs img { margin: 0; width: 100%; background: #fff; }
.figs figcaption, figure figcaption {
  font-family: var(--sans); font-size: .82rem; line-height: 1.45; color: var(--ink-2); margin-top: .5rem;
}
.callout {
  background: var(--paper-2); border: 1px solid var(--rule); border-left: 4px solid var(--accent-2);
  border-radius: 4px; padding: 1.1rem 1.25rem .4rem; margin: 0 0 2rem;
}
.callout p:first-child { margin-bottom: .5rem; font-family: var(--sans); }
.callout ul { margin-top: 0; }
@media (max-width: 640px) {
  .figs, .figs.three { grid-template-columns: 1fr; }
}

/* expandable details */
.post details {
  border: 1px solid var(--rule); border-radius: 4px; background: var(--paper-2);
  padding: .6rem 1rem; margin: 1.25rem 0;
}
.post details summary {
  cursor: pointer; font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--accent-2);
}
.post details[open] summary { margin-bottom: .75rem; }
.post details > *:last-child { margin-bottom: .4rem; }

/* site logo */
.brand-logo { width: 28px; height: 28px; flex: none; object-fit: contain; }
