/* =============================================================================
   ReferReady — "Owner's field-notes" editorial column
   Archetype: a single narrow reading column, like a personal essay. Expressive
   literary serif (Charter family), confident heading scale, drop-cap intro,
   inline code chips instead of a boxed card, and a slim sticky order bar.
   Clean cool off-white (NOT warm cream). Light + dark. System fonts only →
   no render-blocking fetch, zero CLS from webfonts.
   Class vocabulary is bespoke to this site — no shared component names.
   ============================================================================= */

:root {
  /* cool editorial off-white base */
  --page:    #fbfbfd;
  --page-2:  #f3f3f7;
  --surface: #ffffff;
  --ink:     #17171f;
  --ink-soft:#56555f;
  --rule:    #e6e6ec;
  --rule-2:  #d4d4de;

  /* indigo brand + green "verified" + rust flag */
  --brand:    #4b3ff0;
  --brand-2:  #6a4ff2;
  --brand-ink:#ffffff;
  --mark:     #0f8a4d;
  --flag:     #c0492b;
  --accent:   #ece9ff;   /* soft indigo wash for the code chip */

  --shadow: 0 1px 2px rgba(23,23,31,.05), 0 8px 30px rgba(23,23,31,.07);

  --radius:   10px;
  --radius-sm:7px;
  --measure:  700px;     /* the reading column */
  --frame:    1080px;    /* header / footer / dock width */

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:    #101014;
    --page-2:  #17171d;
    --surface: #191921;
    --ink:     #ecebf2;
    --ink-soft:#a4a3af;
    --rule:    #26262f;
    --rule-2:  #35353f;
    --brand:   #9a8dff;
    --brand-2: #b7a6ff;
    --brand-ink:#101014;
    --mark:    #4bc487;
    --flag:    #f08b6f;
    --accent:  #232038;
    --shadow: 0 1px 2px rgba(0,0,0,.45), 0 10px 34px rgba(0,0,0,.55);
  }
}

/* ── base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 74px; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--serif); font-size: 1.14rem; line-height: 1.72;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.1;
  letter-spacing: -.015em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.2vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.35rem); margin-top: 2.3rem; }
h3 { font-size: 1.36rem; margin-top: 1.7rem; }
p  { margin: 0 0 1.15rem; }
strong { color: var(--ink); font-weight: 700; }
.dim { color: var(--ink-soft); }
.tiny { font-size: .82rem; line-height: 1.55; }
.fine { font-size: .74rem; line-height: 1.5; color: var(--ink-soft); }

/* small-caps sans labels — the editorial "dateline" voice */
.label { font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

/* ── layout: the reading column ───────────────────────────────────────────── */
.frame { width: min(100% - 2rem, var(--frame)); margin-inline: auto; }
.read  { width: min(100% - 2rem, var(--measure)); margin-inline: auto;
  padding: 2.4rem 0 1rem; }
.read > :first-child { margin-top: 0; }

/* wide desktop: optional slim table-of-contents rail to the left */
.layout { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.toc { display: none; }
@media (min-width: 1200px) {
  .layout { display: grid; grid-template-columns: 210px minmax(0, var(--measure));
    gap: 3.2rem; justify-content: center; align-items: start; }
  .layout .read { width: auto; margin-inline: 0; padding-top: 2.4rem; }
  .toc { display: block; position: sticky; top: 90px; padding-top: 2.9rem; }
  .toc-h { font-family: var(--sans); font-size: .7rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
    margin: 0 0 .7rem; }
  .toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem;
    border-left: 2px solid var(--rule); }
  .toc a { display: block; font-family: var(--sans); font-size: .86rem;
    line-height: 1.35; color: var(--ink-soft); text-decoration: none;
    padding: .38rem 0 .38rem .9rem; margin-left: -2px;
    border-left: 2px solid transparent; }
  .toc a:hover { color: var(--brand); border-left-color: var(--brand); }
}

.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--surface);
  padding: .6rem 1rem; border-radius: 8px; box-shadow: var(--shadow); }
.skip:focus { left: .5rem; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }

/* ── top bar ──────────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule); }
.bar-inner { display: flex; align-items: center; gap: 1rem; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--serif); font-size: 1.22rem; font-weight: 700; letter-spacing: -.01em; }
.brand-name b { color: var(--brand); }
.menu { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.menu a { font-family: var(--sans); color: var(--ink-soft); text-decoration: none;
  padding: .5rem .68rem; border-radius: 7px; font-weight: 600; font-size: .92rem; }
.menu a:hover { color: var(--ink); background: var(--page-2); }
.menu a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.nav-cta { color: var(--brand-ink) !important; background: var(--brand);
  padding: .46rem .95rem !important; border-radius: 999px !important; font-weight: 700 !important; }
.nav-cta:hover { background: var(--brand-2) !important; color: var(--brand-ink) !important; }
.menu-btn { display: none; }

/* ── essay opener ─────────────────────────────────────────────────────────── */
.dateline { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--sans);
  font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mark); }
.dateline svg { flex: none; }
.opener h1 { margin-top: .55rem; }
.standfirst { font-size: 1.28rem; line-height: 1.55; color: var(--ink); margin-top: .3rem; }
/* drop-cap on the very first paragraph of a column */
.dropcap::first-letter { float: left; font-family: var(--serif); font-weight: 700;
  font-size: 3.5em; line-height: .78; padding: .04em .09em 0 0; color: var(--brand); }

/* ── byline + hand-drawn avatar ───────────────────────────────────────────── */
.byline { display: flex; align-items: center; gap: .8rem; font-family: var(--sans);
  font-size: .9rem; color: var(--ink-soft); margin: 1.5rem 0 1.9rem;
  padding: .95rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.byline .face { width: 46px; height: 46px; flex: none; border-radius: 999px;
  background: var(--accent); }
.byline b { color: var(--ink); }

/* ── the "facts" line under the opener (was pills) ────────────────────────── */
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 1.3rem 0; }
.facts li { font-family: var(--sans); font-size: .82rem; font-weight: 600;
  padding: .34rem .72rem; border-radius: 999px; border: 1px solid var(--rule-2);
  background: var(--surface); }
.facts .lead-fact { background: var(--mark); border-color: transparent; color: #fff; }

/* ── assurances row ───────────────────────────────────────────────────────── */
.assurances { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem 1.4rem;
  padding: 0; margin: 1.3rem 0 0; font-family: var(--sans); font-size: .86rem;
  font-weight: 600; color: var(--ink-soft); }
.assurances li { display: inline-flex; align-items: center; gap: .4rem; }
.assurances svg { flex: none; color: var(--mark); }

/* ── inline code CHIP (the signature code unit) ───────────────────────────── */
.chip { display: inline-flex; align-items: stretch; vertical-align: baseline;
  border: 1px solid var(--brand); border-radius: 7px; overflow: hidden;
  background: var(--accent); line-height: 1.2; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(75,63,240,.12); }
.chip-code { font-family: var(--mono); font-weight: 700; font-size: .92em;
  padding: .12em .5em; color: var(--brand); letter-spacing: .01em;
  display: inline-flex; align-items: center; min-width: 7.5ch; justify-content: center; }
@media (prefers-color-scheme: dark) { .chip-code { color: var(--brand-2); } }
.chip-copy { font-family: var(--sans); font-size: .78em; font-weight: 700; cursor: pointer;
  border: 0; border-left: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  padding: .12em .55em; display: inline-flex; align-items: center; gap: .25em; }
.chip-copy:hover { background: var(--brand-2); }
.chip-copy.copied { background: var(--mark); border-left-color: var(--mark); }
.chip-copy svg { width: 12px; height: 12px; }

/* ── "grab a code" editorial callout (replaces the boxed card) ────────────── */
.grab { margin: 1.9rem 0; padding: 1.1rem 1.25rem; border-left: 3px solid var(--brand);
  background: var(--page-2); border-radius: 0 var(--radius) var(--radius) 0; }
.grab-line { font-size: 1.12rem; margin: 0 0 .2rem; }
.grab-meta { display: flex; align-items: center; gap: .7rem 1rem; flex-wrap: wrap; margin: .7rem 0 0; }
.grab-fine { margin: .7rem 0 0; }

/* ── buttons (actions) ────────────────────────────────────────────────────── */
.act { display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--sans); font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none; padding: .62rem 1.15rem; border-radius: 999px;
  border: 1.5px solid transparent; transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
.act:active { transform: translateY(1px); }
.act-fill { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow); }
.act-fill:hover { background: var(--brand-2); color: var(--brand-ink); }
.act-line { background: transparent; border-color: var(--rule-2); color: var(--ink); }
.act-line:hover { border-color: var(--brand); color: var(--brand); }
.act-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0; }

/* ── verified stamp ───────────────────────────────────────────────────────── */
.stamp { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--sans);
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--mark);
  border: 1px dashed var(--mark); border-radius: 6px; padding: .2rem .5rem; text-transform: uppercase; }
.stamp svg { flex: none; }

/* ── sticky order dock ────────────────────────────────────────────────────── */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-top: 1px solid var(--rule-2); box-shadow: 0 -6px 24px rgba(23,23,31,.10);
  transform: translateY(115%); visibility: hidden; transition: transform .24s ease; }
.dock.is-visible { transform: translateY(0); visibility: visible; }
.dock-inner { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; }
.dock-tag { font-family: var(--sans); font-size: .82rem; font-weight: 700; color: var(--ink-soft);
  margin-right: auto; display: inline-flex; align-items: baseline; gap: .5rem; }
.dock-tag code { font-family: var(--mono); font-weight: 700; color: var(--brand);
  background: var(--accent); padding: .1em .5em; border-radius: 6px; min-width: 7.5ch;
  display: inline-block; text-align: center; }
@media (prefers-color-scheme: dark) { .dock-tag code { color: var(--brand-2); } }
.dock .act { padding: .5rem 1rem; font-size: .88rem; }
main { padding-bottom: 4.5rem; }  /* room so the dock never covers content */

/* ── tables ───────────────────────────────────────────────────────────────── */
.scrollx { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius);
  margin: 1.6rem 0; }
table { border-collapse: collapse; width: 100%; min-width: 480px; background: var(--surface);
  font-family: var(--sans); }
th, td { text-align: left; padding: .78rem 1rem; border-bottom: 1px solid var(--rule); font-size: .93rem; }
thead th { background: var(--page-2); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
.yes { color: var(--mark); font-weight: 700; } .noo { color: var(--flag); font-weight: 700; }

/* ── ordered "how-to" numerals ────────────────────────────────────────────── */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.5rem 0; display: grid; gap: 1.1rem; }
.steps li { position: relative; padding-left: 3rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink); font-family: var(--sans);
  font-weight: 800; font-size: 1rem; }
.steps h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .98rem; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq { display: grid; gap: .55rem; margin: 1.5rem 0; }
.faq details { border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden; }
.faq summary { cursor: pointer; list-style: none; padding: .95rem 1.1rem; font-weight: 700;
  font-size: 1.08rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--brand); line-height: 1; flex: none; }
.faq details[open] summary::after { content: "\2013"; }
.faq-a { padding: 0 1.1rem 1.1rem; color: var(--ink-soft); }
.faq-a :is(p):last-child { margin-bottom: 0; }

/* ── callouts ─────────────────────────────────────────────────────────────── */
.callout { border-left: 4px solid var(--brand); background: var(--page-2);
  padding: 1rem 1.15rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 1.5rem 0; }
.callout.warn { border-color: #d1961f; }
.callout.stale { border-color: var(--flag); }
.callout :last-child { margin-bottom: 0; }

/* ── figures / screenshots ────────────────────────────────────────────────── */
.shot { margin: 1.7rem 0; }
.shot svg { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rule); }
.shot img { width: 100%; height: auto; display: block; border-radius: var(--radius); border: 1px solid var(--rule); }
.shot figcaption { font-family: var(--sans); font-size: .84rem; color: var(--ink-soft); margin-top: .55rem; }
.shot figcaption .credit { display: block; font-size: .78rem; margin-top: .2rem; color: var(--ink-soft); opacity: .8; }
.shot figcaption .credit a { color: inherit; }

/* ── sources ──────────────────────────────────────────────────────────────── */
.sources { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .35rem;
  font-family: var(--sans); }
.sources li { padding-left: 1.35rem; position: relative; font-size: .9rem; }
.sources li::before { content: "\2197"; position: absolute; left: 0; color: var(--ink-soft); }

/* ── breadcrumb ───────────────────────────────────────────────────────────── */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0;
  margin: 0 0 1.3rem; font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--rule-2); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

/* ── blog list "entries" + related "jumps" ────────────────────────────────── */
.entries { display: grid; gap: .2rem; margin: 1.6rem 0; }
.entry { display: block; text-decoration: none; color: inherit; padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule); }
.entry:first-child { border-top: 1px solid var(--rule); }
.entry:hover h3 { color: var(--brand); }
.entry .when { font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--mark); }
.entry h3 { margin: .25rem 0 .3rem; font-size: 1.28rem; }
.entry p { margin: 0; color: var(--ink-soft); font-size: .96rem; }

.jumps { display: grid; gap: .5rem; margin: 1.1rem 0; }
.jump { display: block; text-decoration: none; color: inherit; padding: .9rem 1.1rem;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--surface);
  font-family: var(--sans); transition: border-color .12s, transform .12s; }
.jump:hover { border-color: var(--brand); transform: translateX(3px); }
.jump b { display: block; color: var(--ink); font-size: 1.02rem; }
.jump span { color: var(--ink-soft); font-size: .86rem; }
.jump .pillar-tag { color: var(--brand); font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em; }

/* ── prose rhythm inside the column ───────────────────────────────────────── */
.read ul, .read ol { padding-left: 1.3rem; }
.read li { margin: .4rem 0; }
.read code { font-family: var(--mono); background: var(--page-2); padding: .1em .35em;
  border-radius: 5px; font-size: .88em; }
.read form label { font-family: var(--sans); }
.read form { display: grid; gap: 1rem; margin: 1.4rem 0; }
input, textarea { font: inherit; font-family: var(--sans); width: 100%; padding: .65rem .75rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }

/* ── footer ───────────────────────────────────────────────────────────────── */
.colophon { background: var(--page-2); border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 2.6rem; }
.foot-cols { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 1.6rem; }
.foot-cols nav { display: flex; flex-direction: column; gap: .35rem; }
.foot-cols nav a { font-family: var(--sans); color: var(--ink-soft); text-decoration: none; font-size: .9rem; }
.foot-cols nav a:hover { color: var(--brand); }
.foot-lead .brand { margin-bottom: .5rem; }
.foot-h { font-family: var(--sans); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink); margin: 0 0 .4rem; font-weight: 700; }
.foot-end { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  border-top: 1px solid var(--rule); margin-top: 2.2rem; padding: 1.2rem 0; }
.foot-end p { font-family: var(--sans); font-size: .84rem; color: var(--ink-soft); margin: 0; }

/* ── responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: inline-flex; flex-direction: column; gap: 4px; margin-left: auto;
    background: transparent; border: 1px solid var(--rule-2); border-radius: 9px; padding: 9px 8px; cursor: pointer; }
  .menu-btn span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .menu { position: fixed; inset: 60px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--page); border-bottom: 1px solid var(--rule); padding: .75rem 1rem 1.25rem;
    gap: .25rem; transform: translateY(-120%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .menu.open { transform: translateY(0); }
  .menu a { padding: .75rem .5rem; }
  .nav-cta { margin-top: .4rem; text-align: center; }
  .dock-tag { display: none; }
  .dock .act { flex: 1; }
}
@media (max-width: 480px) {
  body { font-size: 1.08rem; }
  .foot-cols { grid-template-columns: 1fr; }
  .foot-end { flex-direction: column; }
  .grab-meta { gap: .6rem; }
}
