/* One stylesheet for every page on nib.orzech.me. The direction is recorded as the
   "Frontend Theme" block in AGENTS.md: sage paper, nib-green ink, one highlighter yellow-green,
   Literata for reading, the system sans for controls. */

:root {
  --paper: #eef2ec;
  --sheet: #ffffff;
  --ink: #11241b;
  --muted: #475a50;
  --nib: #1b4332;
  --leaf: #276a4b;
  --mark: #ddf27a;
  --rule: #c9d3cb;
  --on-nib: #f1f7f2;
  --on-nib-muted: #bcd5c5;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 66ch;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1813;
    --sheet: #13231b;
    --ink: #e6efe8;
    --muted: #a3b7ab;
    --nib: #143627;
    --leaf: #93d3af;
    --rule: #283d32;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--leaf); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip {
  position: absolute; left: 12px; top: -60px;
  background: var(--mark); color: #11241b; padding: 8px 14px;
  font: 600 15px var(--sans); z-index: 10;
}
.skip:focus { top: 12px; }

/* --- top bar ---------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0;
  font-family: var(--sans);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.brand span { font: 700 22px/1 var(--serif); letter-spacing: -0.02em; }
.topbar .play-small {
  font-size: 15px; font-weight: 600; color: inherit;
  text-decoration: none; border: 1.5px solid currentColor; border-radius: 8px;
  padding: 7px 12px; white-space: nowrap;
}
.topbar .play-small:hover { background: var(--mark); color: #11241b; border-color: var(--mark); }

/* --- hero: the nib-green band ------------------------------------------------- */

.hero { background: var(--nib); color: var(--on-nib); }
.hero .topbar a { color: var(--on-nib); }
.hero-grid {
  display: grid; gap: 40px; align-items: center;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  padding: 36px 0 64px;
}
.hero h1 {
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  font-weight: 650;
  margin: 0 0 22px;
  max-width: 14ch;
  text-wrap: balance;
}
.hero .lede { color: var(--on-nib-muted); }
.hero .lede strong { color: var(--on-nib); font-weight: 600; }

.cta {
  display: inline-block;
  background: var(--mark);
  color: #11241b;
  font: 650 17px/1.2 var(--sans);
  text-decoration: none;
  padding: 15px 22px;
  border-radius: 8px;
}
.cta:hover { background: #eefa9f; }
.cta-note { font: 15px/1.5 var(--sans); color: var(--muted); margin: 12px 0 0; }
.hero .cta-note { color: var(--on-nib-muted); }

/* The phone and the delivery slip beside it: a post's three states from the offline queue. */
.stage { position: relative; display: flex; justify-content: center; }
.phone {
  width: min(300px, 78vw);
  border-radius: 28px;
  border: 7px solid #0b1f16;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  background: #fff;
  display: block;
}
.slip {
  position: absolute; left: -8px; bottom: 36px;
  width: 250px;
  margin: 0; padding: 14px 16px;
  list-style: none;
  background: var(--sheet); color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.5);
  font: 15px/1.35 var(--sans);
}
.slip li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; }
.slip li + li { border-top: 1px solid var(--rule); }
.slip .dot {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--leaf); transform: translateY(1px);
}
.slip li:last-child .dot { background: var(--leaf); }
.slip b { font-weight: 650; }
.slip small { display: block; color: var(--muted); font-size: 13px; }
.slip mark {
  background: linear-gradient(var(--mark), var(--mark)) no-repeat 0 0 / 100% 100%; border-radius: 2px;
  color: #11241b; padding: 0 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .slip li { animation: slip-in 0.5s ease-out both; }
  .slip li:nth-child(2) { animation-delay: 0.7s; }
  .slip li:nth-child(3) { animation-delay: 1.4s; }
  .slip mark { animation: mark-sweep 0.6s 1.9s ease-out both; }
  @keyframes slip-in { from { opacity: 0; transform: translateY(6px); } }
  @keyframes mark-sweep { from { background-size: 0% 100%; color: var(--ink); } }
}

/* --- type ------------------------------------------------------------------ */

h1, h2, h3 { font-family: var(--serif); text-wrap: balance; }
h1 { font-size: clamp(34px, 5.4vw, 56px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 650; margin: 12px 0 22px; max-width: 20ch; }
h2 { font-size: clamp(27px, 3.6vw, 38px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; margin: 0 0 14px; max-width: 26ch; }
h3 { font-size: 20px; line-height: 1.3; font-weight: 650; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lede { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.55; color: var(--muted); max-width: 52ch; margin: 0 0 30px; }
.prose { max-width: var(--measure); }
.prose p, .intro { color: var(--muted); }
.intro { max-width: var(--measure); margin-bottom: 8px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: var(--sheet); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

main section { padding: 64px 0 0; }
main section:last-of-type { padding-bottom: 72px; }

/* --- facts strip ----------------------------------------------------------- */

.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0; margin: 0; padding: 0;
  border-bottom: 1px solid var(--rule);
}
.facts div { padding: 22px 24px 22px 0; }
.facts dt { font: 600 15px/1.4 var(--sans); color: var(--muted); margin-bottom: 4px; }
.facts dd { margin: 0; font-size: 18px; line-height: 1.45; }

/* --- feature groups: ruled columns, not cards ------------------------------- */

.groups {
  display: grid; gap: 36px 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  margin-top: 30px;
}
.groups > div { border-top: 3px solid var(--ink); padding-top: 14px; }
.groups ul { list-style: none; margin: 10px 0 0; padding: 0; }
.groups li { padding: 7px 0; border-top: 1px solid var(--rule); font-size: 17px; line-height: 1.5; color: var(--muted); }
.groups li:first-child { border-top: 0; }
.groups li strong { color: var(--ink); font-weight: 600; }
.groups p { font-size: 17px; color: var(--muted); margin: 0; }

/* Older markup name kept so every intent page shares one pattern. */
.grid { display: grid; gap: 30px 40px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); margin-top: 28px; }
.card { border-top: 3px solid var(--ink); padding-top: 14px; }
.card p { margin: 0; color: var(--muted); font-size: 17px; }

/* --- screenshots ----------------------------------------------------------- */

.shots {
  display: flex; gap: 22px;
  margin: 36px 0 0; padding: 4px 20px 18px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.shots > figure:first-child { margin-left: auto; }
.shots > figure:last-child { margin-right: auto; }
.shots figure { margin: 0; flex: 0 0 196px; scroll-snap-align: center; }
.shots img {
  display: block; width: 196px; height: auto;
  border-radius: 18px; border: 5px solid #0b1f16; background: #fff;
}
.shots figcaption { font: 14px/1.4 var(--sans); color: var(--muted); margin-top: 10px; }

/* --- sequences: numbered because the content is a sequence ------------------ */

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 28px 0 0; max-width: 760px; }
ol.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 52px 1fr; gap: 0 14px;
  padding: 18px 0; border-top: 1px solid var(--rule);
}
ol.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font: 650 34px/1 var(--serif); color: var(--leaf);
}
ol.steps h3 { margin: 2px 0 4px; }
ol.steps p { margin: 0; color: var(--muted); }

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

.scroll-x { overflow-x: auto; margin-top: 26px; }
table { width: 100%; border-collapse: collapse; font: 16px/1.5 var(--sans); }
/* Text tables stack into one block per row on phones; the Free/Pro grid stays a grid. */
@media (max-width: 560px) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: auto; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { border-bottom: 1px solid var(--rule); padding: 12px 0; }
  table.stack th, table.stack td { border: 0; padding: 2px 0; }
  table.stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 650; color: var(--muted); }
  td.yes, td.no { width: 4em; padding-right: 0; }
}
caption { text-align: left; font: 600 15px var(--sans); color: var(--muted); padding-bottom: 8px; }
th, td { text-align: left; padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-size: 14px; font-weight: 650; color: var(--muted); border-bottom: 2px solid var(--ink); }
tbody th { font-weight: 600; }
td.yes, td.no { text-align: center; width: 5.5em; font-weight: 650; }
td.yes { color: var(--leaf); }
td.no { color: var(--muted); font-weight: 400; }

/* --- answer and notes (intent pages) --------------------------------------- */

.answer {
  border-left: 6px solid var(--mark);
  background: var(--sheet);
  padding: 20px 24px;
  margin: 0 0 8px;
  max-width: 760px;
  font-size: 19px;
}
.answer p { margin: 0; }
.answer p + p { margin-top: 12px; }

.note {
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: 18px 0; margin-top: 30px; max-width: 760px;
  color: var(--muted); font-size: 17px;
}
.note strong { color: var(--ink); }

/* --- FAQ -------------------------------------------------------------------- */

.faq { max-width: 780px; margin-top: 18px; }
details { border-top: 1px solid var(--rule); padding: 16px 0 16px 1.3em; }
details:last-child { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; font-weight: 600; font-size: 19px; list-style-position: outside; }
summary::marker { color: var(--leaf); }
details p { color: var(--muted); margin: 10px 0 0; }

/* --- guides list, CTA block, crumb, footer ---------------------------------- */

.guides { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 0 40px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.guides li { border-top: 1px solid var(--rule); padding: 14px 0; }
.guides a { font-weight: 600; font-size: 19px; }
.guides span { display: block; color: var(--muted); font-size: 16px; }

.more { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 26px; font: 16px var(--sans); }

.getit { background: var(--nib); color: var(--on-nib); padding: 48px 0; }
main .getit:last-child { padding-bottom: 52px; }
.getit h2 { color: var(--on-nib); }
.getit p { color: var(--on-nib-muted); max-width: 60ch; }
.getit .cta-note { color: var(--on-nib-muted); }
.getit a:not(.cta) { color: var(--on-nib); }

.crumb { font: 15px var(--sans); color: var(--muted); padding-top: 8px; }
.crumb a { color: var(--muted); }
.crumb span { padding: 0 6px; }

footer { border-top: 1px solid var(--rule); padding: 28px 0 56px; color: var(--muted); font: 15px/1.6 var(--sans); }
footer ul { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer a { color: var(--muted); }
footer p { margin: 0; }

/* --- small screens ---------------------------------------------------------- */

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; padding-bottom: 48px; }
  /* The slip moves under the phone and overlaps its lower edge, so both stay readable. */
  .stage { flex-direction: column; align-items: center; }
  .slip { position: relative; left: auto; bottom: auto; margin-top: -110px; width: min(320px, 100%); }
}
@media (max-width: 480px) {
  body { font-size: 17px; }
  .topbar .play-small { font-size: 14px; padding: 6px 10px; }
  .phone { width: 240px; }
  .slip { font-size: 14px; }
  .facts div { padding: 14px 0; }
  .answer { padding: 16px 18px; font-size: 18px; }
  main section { padding-top: 52px; }
}

.intro.after { margin-top: 22px; }
.hero :focus-visible, .getit :focus-visible { outline-color: var(--mark); }
