@charset "utf-8";

/* ==========================================================================
   Fertilizer Recommendation — mentoring deck
   Sober editorial style. White ground, near-black text, one accent.
   No gradients, no shadows, no dark mode, no icon fonts.
   ========================================================================== */

:root {
  --ink:        #111111;
  --ink-soft:   #3d3d3d;
  --ink-mute:   #6b6b6b;
  --rule:       #d8d4cf;
  --rule-firm:  #111111;
  --paper:      #ffffff;
  --accent:     #8c2f1f;   /* used ONLY in rules, underlines, figure numbers */

  --serif: "Source Serif 4", "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", "Inter", -apple-system, BlinkMacSystemFont,
           "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34em;          /* ~62 characters at body size */
  --slide-pad: 5.5vmin;
}

/* ---------- reset-ish ---------- */

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body { margin: 0; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, table, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

/* ---------- typography scale (few sizes, clear hierarchy) ---------- */

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5.6vmin, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.9vmin, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.008em;
  text-wrap: balance;
  max-width: 22em;
}

h3 {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.78rem;
  line-height: 1.3;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
}

p, li, dd, td, th {
  font-size: clamp(0.95rem, 1.85vmin, 1.12rem);
  line-height: 1.62;
}

p { max-width: var(--measure); }

strong { font-weight: 650; }

em { font-style: italic; }

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

code, .num {
  font-family: var(--mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

/* Accent is allowed here: hairlines, underlines, figure numbers. */
.lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.3vmin, 1.4rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 30em;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.eyebrow .fig { color: var(--accent); }

/* ---------- deck shell ---------- */

.deck { display: block; }

.slide {
  position: relative;
  padding: var(--slide-pad) var(--slide-pad) calc(var(--slide-pad) + 2rem);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.slide__inner {
  max-width: 60rem;
  margin: 0 auto;
  width: 100%;
}

.slide > .slide__inner > * + * { margin-top: 1.15rem; }
.slide > .slide__inner > * + h2 { margin-top: 1.6rem; }
.slide > .slide__inner > h3 + * { margin-top: 0.6rem; }

/* Slide number, bottom-left. Accent only on the numeral. */
.slide__num {
  position: absolute;
  left: var(--slide-pad);
  bottom: calc(var(--slide-pad) * 0.5);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.slide__num b { color: var(--accent); font-weight: 500; }

/* ---------- title slide ---------- */

.slide--title { border-top: none; }
.slide--title .rule-accent {
  width: 4.5rem; height: 2px;
  background: var(--accent);
  border: 0;
  margin: 1.6rem 0;
}
.slide--title .byline {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- boxes: 1px rule, square corners. Max two per slide. ---------- */

.box {
  border: 1px solid var(--rule-firm);
  padding: 1.15rem 1.3rem;
  max-width: 44rem;
}
.box > * + * { margin-top: 0.7rem; }
.box p, .box li { max-width: 40em; }

.box--warn { border-color: var(--accent); }
.box--warn .box__label { color: var(--accent); }

.box__label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.formula {
  font-family: var(--mono);
  font-size: clamp(0.82rem, 1.6vmin, 1rem);
  line-height: 1.85;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
}

/* ---------- lists ---------- */

.list > li {
  padding-left: 1.4rem;
  position: relative;
  max-width: var(--measure);
}
.list > li + li { margin-top: 0.55rem; }
.list > li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 0.62rem; height: 1px;
  background: var(--accent);
}

.list--plain > li { padding-left: 0; }
.list--plain > li::before { display: none; }

ol.list--num { counter-reset: n; }
ol.list--num > li { counter-increment: n; padding-left: 2rem; }
ol.list--num > li::before {
  content: counter(n);
  background: none;
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--accent);
  top: 0.15em; width: auto; height: auto;
}

/* ---------- two-column layout ---------- */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem 2.2rem;
  align-items: start;
}
.cols > * { min-width: 0; }
.cols p, .cols li { max-width: 30em; }

.cols--3 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; max-width: 100%; }

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 26rem;
}
caption {
  text-align: left;
  font-size: 0.78rem;
  color: var(--ink-mute);
  padding-bottom: 0.5rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.9rem 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  font-size: clamp(0.85rem, 1.6vmin, 1rem);
  line-height: 1.45;
}
thead th {
  border-bottom: 1px solid var(--rule-firm);
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- source citations ---------- */

.src {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 46em;
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}
.src b { font-weight: 600; color: var(--ink-soft); }

.gap {
  font-size: 0.8rem;
  color: var(--accent);
  border-left: 2px solid var(--accent);
  padding-left: 0.7rem;
  max-width: 40em;
}

/* ---------- chrome (JS only) ---------- */

.chrome { display: none; }

html.js .chrome {
  display: flex;
  position: fixed;
  right: 1rem; bottom: 0.85rem;
  gap: 0.5rem;
  align-items: center;
  z-index: 20;
}

.chrome__btn {
  font: inherit;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-firm);
  cursor: pointer;
}
.chrome__btn:hover { background: var(--ink); color: var(--paper); }
.chrome__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.chrome__count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  padding-right: 0.3rem;
}

/* progress hairline, accent */
.progress {
  display: none;
  position: fixed;
  left: 0; top: 0;
  height: 2px;
  background: var(--accent);
  z-index: 21;
  width: 0;
}
html.js .progress { display: block; }

/* ---------- single-slide mode (JS + wide viewport) ---------- */

html.js .slide { display: none; }
html.js .slide.is-active { display: flex; }

html.js .slide {
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  border-top: none;
  animation: fade 180ms ease-out;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html.js .slide { animation: none; }
}

/* ---------- narrow viewport: continuous vertical scroll ---------- */

@media (max-width: 900px) {
  :root { --slide-pad: 7vw; }

  html { font-size: 16px; }

  /* Override single-slide mode — the deck becomes a document. */
  html.js .slide {
    display: block;
    min-height: 0;
    border-top: 1px solid var(--rule);
    animation: none;
  }
  html.js .slide.is-active { display: block; }

  html.js .chrome { right: 0.7rem; bottom: 0.7rem; }
  html.js .chrome__count { display: none; }
  .progress { display: none !important; }

  .slide { padding-bottom: 3rem; }
  .slide__num { position: static; display: block; margin-bottom: 0.9rem; }
  .slide--title { padding-top: 12vh; }

  .box { padding: 1rem; }
  .formula { font-size: 0.78rem; }
}

/* ---------- focus: real, visible ---------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 50;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- print: one slide per page ---------- */

@media print {
  @page { size: A4 landscape; margin: 12mm; }

  :root { --slide-pad: 0mm; }

  html { font-size: 11pt; background: #fff; }

  html.js .slide,
  .slide {
    display: block !important;
    min-height: 0;
    page-break-after: always;
    break-after: page;
    border-top: none;
    padding: 0;
    animation: none;
  }
  .slide:last-child { page-break-after: auto; break-after: auto; }

  .chrome, .progress, .skip { display: none !important; }

  .slide__num { position: static; display: block; margin-bottom: 6mm; }

  h1 { font-size: 26pt; }
  h2 { font-size: 18pt; }
  p, li, td, th { font-size: 10.5pt; }

  a { text-decoration: none; }

  .box, table { break-inside: avoid; }
}
