/* =========================================================================
   autofarm — main.css
   Night farm: deep forest charcoal, electric lime, Outfit / Source Sans 3 /
   IBM Plex Mono. Motif ◆
   ========================================================================= */

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../fonts/Outfit-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg:       #0A0F0D;
  --card:     #121A16;
  --line:     #1E2B24;
  --ink:      #E7F0EA;
  --ink-soft: #8AA396;
  --lime:     #A3E635;
  --lime-bg:  #1A2E14;
  --ok:       #4ADE80;
  --warn:     #EAB308;
  --code-bg:  #060A08;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 8px;
  --wrap: 1120px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.has-cookie-bar { padding-bottom: 120px; }

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }

a {
  color: var(--lime);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: #c4f05a; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(1.85rem, 5vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.85rem); font-weight: 600; margin-top: 0; }
h3 { font-size: 1.12rem; font-weight: 600; }

p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .3em 0; }
strong, b { font-weight: 500; }

.mono { font-family: var(--font-mono); font-size: .92em; }
::selection { background: var(--lime); color: var(--bg); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Hard guarantee on narrow screens (in case another rule resets padding). */
@media (max-width: 860px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.site-header {
  width: 100%;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: .2px;
}
.site-header__logo:hover { color: var(--ink); }
.site-header__mark { color: var(--lime); }

.site-header__links {
  display: flex;
  align-items: center;
  gap: 4px 18px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}
.site-header__links a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
}
.site-header__links a:hover { color: var(--lime); }

.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.site-header__burger span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

.site-footer {
  width: 100%;
  background: var(--card);
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 40px 0 28px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.site-footer__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-footer__tag {
  color: var(--ink-soft);
  font-size: .92rem;
  margin: 0;
  max-width: 32ch;
}
.site-footer__head {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__col a {
  color: var(--ink);
  font-size: .95rem;
}
.site-footer__col a:hover { color: var(--lime); }
.site-footer__legal {
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .88rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding: 48px 0 28px;
  background:
    radial-gradient(70% 80% at 80% -10%, rgba(163, 230, 53, .12), transparent 55%),
    var(--bg);
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--lime);
  margin: 0 0 12px;
}
.hero h1 { margin-bottom: 14px; }
.hero__lead {
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 58ch;
  margin-bottom: 22px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--ink-soft);
  font-size: .9rem;
}
.hero__facts span::before {
  content: '◆ ';
  color: var(--lime);
  font-size: .7em;
}
.hero__updated { font-family: var(--font-mono); font-size: .85rem; }

.freshness {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .2px;
}

/* ── Single script page ───────────────────────────────────────────────── */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin: 0 0 18px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--lime); }

.single-script__cover {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
}
.single-script__cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-script__head { margin-bottom: 8px; }
.single-script__sub {
  color: var(--ink-soft);
  margin: -4px 0 12px;
  font-size: 1.02rem;
}
.single-script__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.single-script__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 8px;
}

.feat-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-soft);
}
.feat-list li { margin: .4em 0; }

.single-script__back {
  margin: 28px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.single-script .longread { border-top: 1px solid var(--line); }
.single-script .longread:first-of-type { border-top: 0; }

/* ── Sections / pages ─────────────────────────────────────────────────── */

.section { padding: 36px 0; }
.section__head { margin-bottom: 18px; }
.section__note { color: var(--ink-soft); margin: 0; max-width: 60ch; }

/* Only vertical padding — never reset .wrap side gutters (mobile edge bleed). */
.page-shell {
  padding-top: 36px;
  padding-bottom: 48px;
  min-height: 50vh;
}
.page-shell__lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 62ch;
  margin-bottom: 28px;
}
.folio .section { padding-top: 8px; }

.callout {
  background: var(--lime-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
}
.callout p { margin: 0; color: var(--ink); }

/* ── Longread blocks ──────────────────────────────────────────────────── */

.longread {
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.longread:first-of-type { border-top: 0; }
.longread h2 { margin-bottom: 12px; }
.longread > p,
.longread > ul,
.longread > ol { max-width: 72ch; }
.lead-line {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 68ch;
  margin: 0 0 1.2em;
}

.longread--split {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.longread--split > div { flex: 1 1 280px; max-width: 60ch; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .15s ease;
}
.tile:hover { border-color: var(--lime); }
.tile__ico {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--lime);
  background: var(--lime-bg);
  border-radius: 999px;
  padding: 3px 8px;
  margin-bottom: 10px;
}
.tile h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.tile p {
  margin: 0;
  color: var(--ink-soft);
  font-size: .93rem;
}

.ledger-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
}
.ledger th,
.ledger td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ledger th {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: #0e1612;
}
.ledger tr:last-child td { border-bottom: 0; }
.ledger td:first-child {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.ledger td { color: var(--ink-soft); }

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.duo__col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.duo__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--lime);
  margin-bottom: 8px;
}
.duo__col h3 { margin: 0 0 8px; }
.duo__col p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.termmap {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}
.termmap__group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.termmap__cat {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .88rem;
  color: var(--lime);
  margin: 0 0 6px;
  letter-spacing: .2px;
}
.termmap__list {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.55;
}

.specs {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.specs li {
  display: grid;
  grid-template-columns: minmax(100px, 140px) 1fr;
  gap: 12px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0;
}
.specs b {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}
.specs span { color: var(--ink-soft); font-size: .95rem; }

.glossary {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.glossary__row {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: 10px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.glossary__term {
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--lime);
  margin: 0;
}
.glossary__def {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
}

.myth {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 10px;
}
.myth__claim {
  font-weight: 500;
  margin: 0 0 6px;
  color: var(--ink);
}
.myth__claim::before {
  content: '✗ ';
  color: var(--warn);
}
.myth__truth {
  margin: 0;
  color: var(--ink-soft);
  font-size: .95rem;
}
.myth__truth::before {
  content: '✓ ';
  color: var(--ok);
}

.cta-end {
  background:
    radial-gradient(80% 120% at 50% 0%, rgba(163, 230, 53, .1), transparent 60%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin: 28px 0 8px;
}
.cta-end h2 { margin-bottom: 10px; }
.cta-end p {
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0 auto 18px;
}
.cta-end__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 640px) {
  .specs li { grid-template-columns: 1fr; }
  .glossary__row { grid-template-columns: 1fr; gap: 4px; }
  .ledger td:first-child { white-space: normal; }
}

.empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--ink-soft);
}

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  display: flex;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0;
}
.steps__n {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--lime-bg);
  color: var(--lime);
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 999px;
}
.steps p { margin: 4px 0 0; color: var(--ink-soft); }

/* ── FAQ / TOC ────────────────────────────────────────────────────────── */

.faq-list { display: grid; gap: 8px; }
.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}
.faq summary {
  cursor: pointer;
  font-weight: 500;
  padding: 14px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq[open] summary { color: var(--lime); }
.faq p { color: var(--ink-soft); margin: 0 0 14px; }

.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 16px 12px;
  margin: 0 0 28px;
}
.toc__head {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-family: var(--font-display);
  font-weight: 600;
  list-style: none;
}
.toc__head::-webkit-details-marker { display: none; }
.toc__chevron::before {
  content: '▾';
  color: var(--lime);
  font-size: .85rem;
}
.toc:not([open]) .toc__chevron::before { content: '▸'; }
.toc__list {
  margin: 0 0 8px;
  padding-left: 1.2em;
  color: var(--ink-soft);
}
.toc__list a { color: var(--ink); }
.toc__list a:hover { color: var(--lime); }

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  .site-header__burger { display: flex; }
  .site-header__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
    margin: 0;
  }
  .site-header__links.is-open { display: flex; }
  .site-header__links a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .site-header { position: sticky; }
  .site-header__nav { position: relative; }
}

@media (max-width: 520px) {
  .site-footer__grid { grid-template-columns: 1fr; }
  body.has-cookie-bar { padding-bottom: 150px; }
}
