/* owfeed.org — one stylesheet for every page.
 *
 * The layout is a two-column grid: a persistent sidebar and the page. Below
 * 900px the sidebar becomes a collapsed <details> above the content, because a
 * fixed column on a phone costs more width than the navigation is worth. */

:root{
  --canvas:#FAFAF9; --surface-1:#FFFFFF; --surface-2:#F4F4F2;
  --line:#E5E4E1; --line-strong:#C9C7C2;
  --ink:#18181B; --ink-muted:#52525B; --ink-subtle:#8A8A93;
  --accent:#B45309; --ok:#15803D; --warn:#B45309;
}
@media (prefers-color-scheme:dark){
  :root{
    --canvas:#0A0A0B; --surface-1:#131316; --surface-2:#1B1B1F;
    --line:#26262B; --line-strong:#3A3A42;
    --ink:#F4F4F5; --ink-muted:#A1A1AA; --ink-subtle:#71717A;
    --accent:#F59E0B; --ok:#4ADE80; --warn:#FBBF24;
  }
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--canvas); color:var(--ink);
  font:16px/1.65 system-ui,-apple-system,"Segoe UI",sans-serif;
  -webkit-text-size-adjust:100%;
}
code,pre,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

/* ---- layout ---- */

.shell{max-width:74rem;margin:0 auto;display:grid;gap:0;
  grid-template-columns:15rem minmax(0,1fr)}
@media (max-width:900px){.shell{display:block}}

.side{
  position:sticky;top:0;align-self:start;height:100vh;overflow-y:auto;
  padding:2rem 1.25rem 3rem;border-right:1px solid var(--line);
}
@media (max-width:900px){
  .side{position:static;height:auto;border-right:0;border-bottom:1px solid var(--line);
    padding:1rem 1.25rem}
}

.brand{display:block;font-family:ui-monospace,monospace;font-size:.95rem;
  color:var(--ink);text-decoration:none;letter-spacing:-.01em;margin-bottom:.25rem}
.brand b{font-weight:600}
.tagline{font-size:.78rem;color:var(--ink-subtle);margin:0 0 1.75rem;line-height:1.45}
@media (max-width:900px){.tagline{display:none}}

.side h3{font-family:ui-monospace,monospace;font-size:.68rem;text-transform:uppercase;
  letter-spacing:.09em;color:var(--ink-subtle);font-weight:400;margin:1.5rem 0 .5rem}
.side ul{list-style:none;margin:0;padding:0}
.side li{margin:.1rem 0}
.side a{display:block;padding:.28rem .5rem;margin-left:-.5rem;border-radius:.3rem;
  color:var(--ink-muted);text-decoration:none;font-size:.9rem}
.side a:hover{background:var(--surface-2);color:var(--ink)}
.side a.here{color:var(--ink);background:var(--surface-2);
  box-shadow:inset 2px 0 0 var(--accent)}

/* Sub-items under a section: the cookbook is one path in three stages, and a flat
 * list would read as three unrelated pages. */
.side li.sub a{padding-left:1.35rem;font-size:.85rem}
.side li.sub a::before{content:"└ ";color:var(--ink-subtle);margin-left:-.75rem}

.lang{margin-top:2rem;padding-top:1rem;border-top:1px solid var(--line);
  font-family:ui-monospace,monospace;font-size:.78rem;color:var(--ink-subtle)}
.lang a{display:inline;padding:0;margin:0;color:var(--ink-subtle)}
.lang a:hover{color:var(--ink);background:none}
.lang .here{color:var(--ink);background:none;box-shadow:none;display:inline;padding:0}

/* Mobile: the same links become one horizontal scrolling row. No JavaScript
 * and no disclosure widget — a collapsed menu that has to be opened costs a
 * tap on every page, and the link list here is short enough not to need one. */
@media (max-width:900px){
  .side h3{display:none}
  .side nav{display:flex;flex-wrap:nowrap;gap:.25rem;overflow-x:auto;
    padding-bottom:.25rem;-webkit-overflow-scrolling:touch}
  .side ul{display:flex;gap:.25rem}
  .side li{margin:0}
  .side a{white-space:nowrap;margin-left:0;padding:.3rem .6rem}
  .side .lang{margin:0 0 0 auto;padding:.3rem 0 0 .75rem;border-top:0;
    align-self:center;white-space:nowrap}
  /* Source links live in the footer on small screens. */
  .side ul.source{display:none}
}

.page{padding:2.5rem 2rem 6rem;min-width:0}
@media (max-width:900px){.page{padding:2rem 1.25rem 4rem}}
.page>*{max-width:44rem}

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

h1{font-size:1.9rem;line-height:1.2;letter-spacing:-.02em;margin:0 0 .6rem}
h2{font-size:1.2rem;letter-spacing:-.01em;margin:2.75rem 0 .6rem;padding-top:1.25rem;
  border-top:1px solid var(--line)}
h3{font-size:1rem;margin:1.75rem 0 .4rem}
.kicker{font-family:ui-monospace,monospace;font-size:.7rem;text-transform:uppercase;
  letter-spacing:.09em;color:var(--ink-subtle);margin:0 0 .4rem}
.lead{color:var(--ink-muted);font-size:1.05rem;margin:0 0 1.75rem}
p{margin:0 0 1rem}
a{color:var(--accent)}
ul,ol{margin:0 0 1rem;padding-left:1.25rem}
li{margin:.3rem 0}
strong{font-weight:600}

pre{background:var(--surface-1);border:1px solid var(--line);border-radius:.5rem;
  padding:.9rem 1rem;overflow-x:auto;font-size:.82rem;line-height:1.55;margin:0 0 1.25rem}
:not(pre)>code{background:var(--surface-2);border:1px solid var(--line);border-radius:.3rem;
  padding:.08em .35em;font-size:.86em}

table{width:100%;border-collapse:collapse;font-size:.9rem;margin:0 0 1.25rem;
  display:block;overflow-x:auto}
th,td{text-align:left;padding:.5rem .7rem;border-bottom:1px solid var(--line);
  vertical-align:top}
th{font-family:ui-monospace,monospace;font-size:.72rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--ink-subtle);font-weight:400}
td code{white-space:nowrap}

.note{background:var(--surface-2);border:1px solid var(--line);
  border-left:2px solid var(--accent);border-radius:.4rem;
  padding:.8rem 1rem;margin:0 0 1.25rem;font-size:.92rem}
.note strong{color:var(--ink)}
.note>:last-child{margin-bottom:0}

.steps{counter-reset:s;list-style:none;padding:0}
.steps>li{counter-increment:s;position:relative;padding-left:2.2rem;margin:1.4rem 0}
.steps>li::before{content:counter(s);position:absolute;left:0;top:.05rem;
  width:1.5rem;height:1.5rem;border-radius:50%;background:var(--surface-2);
  border:1px solid var(--line-strong);font-family:ui-monospace,monospace;font-size:.75rem;
  display:flex;align-items:center;justify-content:center;color:var(--ink-muted)}

/* Fork cards: "which of these are you" on the landing page. */
.forks{display:grid;gap:.75rem;margin:0 0 1.5rem}
@media(min-width:640px){.forks{grid-template-columns:repeat(3,1fr)}}
.fork{display:block;background:var(--surface-1);border:1px solid var(--line);
  border-radius:.5rem;padding:.9rem;text-decoration:none;color:inherit}
.fork:hover{border-color:var(--line-strong)}
.fork h4{margin:0 0 .3rem;font-size:.9rem;font-family:ui-monospace,monospace;
  color:var(--accent)}
.fork p{margin:0;font-size:.85rem;color:var(--ink-muted)}

dl.glossary{margin:0 0 1.25rem}
dl.glossary dt{font-family:ui-monospace,monospace;font-size:.85rem;color:var(--ink);
  margin:1rem 0 .2rem}
dl.glossary dd{margin:0;font-size:.93rem;color:var(--ink-muted)}

footer{margin-top:4rem;padding-top:1.25rem;border-top:1px solid var(--line);
  font-size:.85rem;color:var(--ink-subtle)}
footer a{color:var(--ink-muted)}
