/* Blackwater — swamplink field-journal identity.
   Dark-only: dusk over tannin-stained water. */

/* ---------- Fonts (self-hosted, latin subsets) ---------- */

@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/bitter-v42-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/bitter-v42-latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/alegreya-sans-v28-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/alegreya-sans-v28-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/alegreya-sans-v28-latin-700.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-v20-latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-v20-latin-500.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  --bottom: #151a14;   /* page ground: deep green-black, warm not blue */
  --water:  #1d2419;   /* lifted panels, code blocks */
  --heron:  #ece6d8;   /* primary text: warm off-white */
  --moss:   #93a183;   /* muted text: gray-green */
  --tannin: #cf9242;   /* accent: links, waterline, dates */
  --rust:   #b0603a;   /* hover / secondary accent */
  --rule:   #2b3325;   /* hairlines */

  --font-display: "Bitter", Georgia, "Times New Roman", serif;
  --font-body: "Alegreya Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  max-width: 44rem;
  background: var(--bottom);
  color: var(--heron);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--tannin);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tannin) 45%, transparent);
  text-underline-offset: 0.15em;
}
a:hover {
  color: var(--rust);
  text-decoration-color: var(--rust);
}

:focus-visible {
  outline: 2px solid var(--tannin);
  outline-offset: 3px;
  border-radius: 1px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--heron);
}

/* ---------- Header: above the water ---------- */

.site-header {
  margin-bottom: 2.25rem;
}

.site-header .surface {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--tannin);   /* the waterline */
}

.site-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  color: var(--heron);
  text-decoration: none;
}
.site-title:hover { color: var(--heron); text-decoration: none; }

.site-header nav {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.site-header nav a {
  margin-left: 0.9rem;
  color: var(--moss);
  text-decoration: none;
}
.site-header nav a:hover { color: var(--tannin); }

/* The reflection: wordmark mirrored beneath the waterline. */
.reflection-wrap {
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 85%);
}
.reflection {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--heron);
  opacity: 0.22;
  filter: blur(2px);
  transform: scaleY(-1);
  margin-top: 0.1rem;
}

@media (prefers-reduced-motion: no-preference) {
  .reflection {
    animation: ripple 9s ease-in-out infinite;
  }
  @keyframes ripple {
    0%, 100% { transform: scaleY(-1) skewX(0deg) translateX(0); }
    50%      { transform: scaleY(-1) skewX(1.4deg) translateX(1.5px); }
  }
}

/* ---------- Field-log post list ---------- */

.intro {
  color: var(--moss);
  margin: 0 0 1.75rem;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post-list li {
  margin: 0 0 1.5rem;
}
.post-list time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--tannin);
  margin-bottom: 0.1rem;
}
.post-list a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--heron);
  text-decoration: none;
}
.post-list a:hover {
  color: var(--tannin);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tannin) 45%, transparent);
}
.post-list .empty {
  color: var(--moss);
  font-style: italic;
}

.list-title {
  font-size: clamp(1.5rem, 4vw + 0.75rem, 2.2rem);
  font-weight: 800;
  margin: 0 0 1.5rem;
}

/* ---------- Single post ---------- */

article h1 {
  font-size: clamp(1.5rem, 4vw + 0.75rem, 2.2rem);
  font-weight: 800;
  margin: 0 0 0.35rem;
}
.meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--tannin);
  margin: 0 0 1.75rem;
}

article img { max-width: 100%; height: auto; }

article pre {
  overflow-x: auto;
  background: var(--water);
  border: 1px solid var(--rule);
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.55;
}
article code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--water);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
article pre code { padding: 0; background: none; font-size: inherit; }

article blockquote {
  border-left: 2px solid var(--rule);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--moss);
}

article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

article table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
article th, article td {
  border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0.6rem 0.4rem 0;
  text-align: left;
}
article th {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--moss);
}

/* ---------- Homepage section heads ---------- */

.section-head {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--moss);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
  margin: 2.5rem 0 0.75rem;
}
.section-head a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding-top: 0.85rem;
  color: var(--moss);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.site-footer p { margin: 0; }
