@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --ground: #efede4;
  --surface: #f8f6ef;
  --surface-2: #f1efe6;
  --ink: #23241f;
  --ink-soft: #5b5b4f;
  --ink-faint: #6b6857; /* darkened from #8c8a7a for AA contrast (~4.8:1) on --ground */
  --line: #d9d5c6;
  --line-strong: #c3bfae;
  --orchard: #35502f;
  --orchard-ink: #233620;
  --harvest: #b9702f;
  --signal: #3e6178;
  --bad: #9c4a3a;

  /* legacy variable names kept so nothing else on the page silently breaks */
  --article-bg: var(--ground);
  --article-panel: var(--surface);
  --article-panel-border: var(--line);
  --article-text: var(--ink);
  --article-muted: var(--ink-soft);
  --article-accent: var(--harvest);
  --article-accent-strong: var(--orchard-ink);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #14160f;
    --surface: #1b1e14;
    --surface-2: #20241a;
    --ink: #ece8da;
    --ink-soft: #a7a48f;
    --ink-faint: #8a8570; /* lightened from #726f5d for AA contrast (~4.9:1) on --ground */
    --line: #34362a;
    --line-strong: #454735;
    --orchard: #86b573;
    --orchard-ink: #a9d296;
    --harvest: #e3a05a;
    --signal: #82b3cc;
    --bad: #d97a64;
  }
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--harvest);
  outline-offset: 2px;
  border-radius: 2px;
}

body.article-page {
  background-color: var(--ground);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
  background-position: center;
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.article-page h1,
.article-page h2,
.article-page h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  text-wrap: balance;
  letter-spacing: -0.01em;
}

.article-page ::selection {
  background: var(--harvest);
  color: #fff;
}

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

.article-header {
  padding-top: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: none;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.75rem;
  max-width: 1080px;
}

.back-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  color: var(--orchard-ink, var(--orchard));
  font-weight: 500;
  transition: 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--harvest);
  transform: translateX(-2px);
}

.article-kicker {
  font-family: "IBM Plex Mono", monospace;
  color: var(--harvest);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--harvest);
  display: inline-block;
}

.article-hero {
  padding-top: 0;
  max-width: 1080px;
}

.section__subtitle {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: var(--harvest);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}

.section__subtitle::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--harvest);
  display: inline-block;
}

.article-hero h1 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  max-width: 20ch;
}

.lead {
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: 1.14rem;
  line-height: 1.65;
  font-weight: 400;
}

.article-meta {
  margin-top: 2.25rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.article-meta div {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-meta span {
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0;
  order: 2;
}

.article-meta strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  order: 1;
  font-family: "IBM Plex Mono", monospace;
}

.article-toc {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.toc-label {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
}

.article-toc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.article-toc-nav a {
  font-family: "IBM Plex Mono", monospace;
  padding: 0.5rem 0.85rem;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  transition: 0.2s ease;
}

.article-toc-nav a:hover,
.article-toc-nav a:focus-visible {
  background: var(--surface-2);
  border-color: var(--harvest);
  color: var(--harvest);
  transform: translateY(-1px);
}

/* ---------- body content ---------- */

.article-content {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
  max-width: 1080px;
}

.article-block {
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 2.75rem 0;
  margin-bottom: 0;
  scroll-margin-top: 90px;
}

.article-section-heading {
  margin-bottom: 1rem;
}

.section-tag {
  display: inline-block;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--harvest);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.article-block h2 {
  margin-top: 0.2rem;
  margin-bottom: 0.7rem;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  max-width: 28ch;
}

.article-block p {
  color: var(--ink);
  line-height: 1.7;
  margin-bottom: 0;
  text-align: left;
  max-width: 70ch;
}

.article-block p + p {
  margin-top: 14px;
}

.article-block ul,
.article-block li {
  text-align: left;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.article-aside {
  border: none;
  border-left: 3px solid var(--harvest);
  background: var(--surface);
  border-radius: 0 2px 2px 0;
  padding: 18px 20px;
}

.article-aside h3 {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.article-aside ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  line-height: 1.9;
  font-size: 14.5px;
}

.article-aside li strong {
  color: var(--ink);
}

.article-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.article-card {
  background: var(--surface);
  border: none;
  border-radius: 0;
  padding: 20px 22px;
}

.article-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.article-card p {
  color: var(--ink-soft);
  text-align: left;
}

/* ---------- gallery ---------- */

.article-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 6px;
}

.article-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  display: block;
  background: var(--surface);
}

.gallery-placeholder {
  min-height: 220px;
  border: 1px dashed var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
}

/* ---------- footer / project nav ---------- */

.article-footer-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding-top: 2rem;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.project-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1.1rem;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 76px;
  transition: 0.2s ease;
}

.project-nav:hover,
.project-nav:focus-visible {
  border-color: var(--harvest);
  transform: translateY(-2px);
}

.project-nav span {
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-nav strong {
  font-size: 1rem;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
}

.project-nav--prev {
  text-align: left;
}

.project-nav--next {
  text-align: right;
}

.back-link--project {
  justify-self: center;
  padding: 0.75rem 1.2rem;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--orchard-ink, var(--orchard));
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 0.85rem;
}

.back-link--project:hover {
  border-color: var(--harvest);
  color: var(--harvest);
}

/* ---------- small reusable pieces new content can use ---------- */

.article-finding {
  border-left: 3px solid var(--harvest);
  background: var(--surface);
  padding: 16px 18px;
  border-radius: 0 2px 2px 0;
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--ink);
}

.article-finding strong {
  color: var(--ink);
}

.article-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.article-chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--ink-soft);
  background: var(--surface);
}

@media screen and (max-width: 768px) {
  .article-meta,
  .split-layout,
  .two-col,
  .article-gallery {
    grid-template-columns: 1fr;
  }

  .article-block {
    padding: 1.75rem 0;
  }
}

/* =====================================================================
   AgriDrone-style "field report" flow — native classes used by the
   restructured project pages (hero / numbered sections / findings).
   ===================================================================== */

.article-page .wrap { max-width: 920px; margin-inline: auto; }
.article-page .wrap-wide { max-width: 1080px; margin-inline: auto; }

.article-page .topnav {
  max-width: 1080px;
  margin-inline: auto;
  padding-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.article-page .topnav-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* "All Projects" dropdown — lets a reader jump straight to any other
   project, or back to the portfolio, without leaving the article page. */
.article-page .projects-menu {
  position: relative;
}

.article-page .projects-menu-trigger {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

.article-page .projects-menu-trigger i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.article-page .projects-menu-trigger:hover,
.article-page .projects-menu.open .projects-menu-trigger {
  border-color: var(--harvest);
  color: var(--harvest);
}

.article-page .projects-menu.open .projects-menu-trigger i {
  transform: rotate(180deg);
}

.article-page .projects-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 300px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 8px;
  display: none;
  z-index: 200;
}

.article-page .projects-menu.open .projects-menu-panel {
  display: block;
}

.article-page .projects-menu-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 13.5px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.4;
}

.article-page .projects-menu-panel a:hover {
  background: var(--surface-2);
  color: var(--harvest);
}

.article-page .projects-menu-panel a.current {
  color: var(--harvest);
  font-weight: 600;
}

@media (max-width: 560px) {
  .article-page .projects-menu-panel {
    left: auto;
    right: 0;
    min-width: 260px;
  }
}

.article-page header.hero {
  max-width: 1080px;
  margin-inline: auto;
  padding-block: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-page .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--harvest);
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-page .eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--harvest);
  display: inline-block;
}

.article-page h1.title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin: 0;
}

.article-page h1.title em {
  font-style: italic;
  color: var(--orchard-ink, var(--orchard));
}

.article-page .dek {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 62ch;
  font-weight: 400;
  margin: 0;
  line-height: 1.6;
}

.article-page .hero-media {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
}

.article-page .hero-media img,
.article-page .hero-media video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

.article-page .hero-media-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
  padding: 8px 2px 0;
}

.article-page .readout-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.article-page .readout {
  background: var(--surface);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.article-page .readout .num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.article-page .readout .num small {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--ink-soft);
}

.article-page .readout .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.article-page section.report {
  max-width: 920px;
  margin-inline: auto;
  padding-block: 44px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 90px;
}

.article-page section.report.wide { max-width: 1080px; }

.article-page section.report .kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.article-page section.report h2 {
  font-size: 1.7rem;
  margin-bottom: 14px;
  max-width: 26ch;
}

.article-page section.report h2 .idx {
  color: var(--harvest);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.55em;
  vertical-align: middle;
  margin-right: 10px;
  font-weight: 600;
}

.article-page section.report p {
  max-width: 68ch;
  color: var(--ink);
  line-height: 1.7;
}

.article-page section.report p.lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
}

.article-page section.report p + p { margin-top: 12px; }

.article-page .two-col-report {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 760px) {
  .article-page .two-col-report { grid-template-columns: 1fr; }
}

.article-page .finding {
  border-left: 3px solid var(--harvest);
  background: var(--surface);
  padding: 16px 18px;
  border-radius: 0 2px 2px 0;
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--ink);
}

.article-page .finding strong { color: var(--ink); }

.article-page .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 20px;
  border-radius: 2px;
  overflow: hidden;
}

@media (max-width: 600px) {
  .article-page .compare { grid-template-columns: 1fr; }
}

.article-page .compare > div { background: var(--surface); padding: 18px 20px; }

.article-page .compare h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.article-page .compare .bad h4 { color: var(--bad); }
.article-page .compare .good h4 { color: var(--orchard-ink, var(--orchard)); }
.article-page .compare .sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

.article-page figure.report-figure { margin: 22px 0 0; }

.article-page figure.report-figure img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.article-page figure.report-figure figcaption {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 68ch;
}

.article-page .report-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 6px;
}

@media (max-width: 760px) {
  .article-page .report-gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .article-page .report-gallery { grid-template-columns: 1fr; }
}

.article-page .report-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line-strong);
  display: block;
  background: var(--surface);
}

.article-page .log {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}

.article-page .log li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .article-page .log li { grid-template-columns: 1fr; gap: 4px; }
}

.article-page .log .tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--bad);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 2px;
}

.article-page .log .tag.fix { color: var(--orchard-ink, var(--orchard)); }
.article-page .log .body { font-size: 14.5px; color: var(--ink-soft); }
.article-page .log .body b { color: var(--ink); font-weight: 600; }

.article-page .stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.article-page .chip {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--ink-soft);
  background: var(--surface);
}

.article-page footer.report-footer {
  max-width: 920px;
  margin-inline: auto;
  padding-block: 40px 60px;
  border-top: 1px solid var(--line);
}

.article-page footer.report-footer .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 600px) {
  .article-page footer.report-footer .grid { grid-template-columns: 1fr; }
}

.article-page footer.report-footer h3 { font-size: 1rem; margin-bottom: 8px; }

.article-page footer.report-footer p {
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 44ch;
}

.article-page footer.report-footer .note {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-family: "IBM Plex Mono", monospace;
}

.article-page .report-footer-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
}
