/* devcmds — shared styles
   Sister site to Layman Terms: same font, hand-drawn squiggles, tape and
   Aayush as the menu. Different setting: a developer's desk at night.
   Graph-paper background, a warm desk-lamp amber as the one accent, and
   commands always shown on dark terminal panels. */
:root {
  --bg: #e3e9ed;
  --doodle: rgba(30, 62, 88, .11);
  --panel: #d5dee4;
  --paper: #f5f8fa;
  --ink: #12202b;
  --body: #33444f;
  --muted: #586976;
  --line: #bfcbd4;
  --accent: #9a4f00;          /* amber, dark enough to read on paper */
  --accent-soft: #f6dcae;
  --lamp: #f5b34a;            /* solid amber blocks: logo tape, Menu tag */
  --on-lamp: #1a1712;
  --term: #0d151d;            /* terminal panels, same in light and dark */
  --term-line: #1e2b37;
  --term-text: #e4ebf1;
  --term-dim: #7f8f9c;
  --ok: #1d7a54;
  --grain: .3;
  --tape: rgba(255, 250, 236, .7); --tape-edge: rgba(110, 120, 130, .2);
  --font: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='10'%3E%3Cpath d='M0 5 Q 10 1.5 20 5 T 40 5.4 T 60 4.6 T 80 5.3 T 100 4.8 T 120 5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  --scribble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='10' viewBox='0 0 80 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6.5 C 18 2.5, 34 8.5, 50 4.5 S 72 3.5, 78 5.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1821; --doodle: rgba(170, 200, 225, .075); --panel: #16222d; --paper: #182531; --ink: #eef3f6;
    --body: #c3cdd5; --muted: #8696a3; --line: #263544; --accent: #f5b34a; --accent-soft: #4a3512;
    --term: #0a1016; --term-line: #22303d; --ok: #4fd1a1; --grain: .1;
    --tape: rgba(236, 226, 200, .2); --tape-edge: rgba(236, 226, 200, .1);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1821; --doodle: rgba(170, 200, 225, .075); --panel: #16222d; --paper: #182531; --ink: #eef3f6;
  --body: #c3cdd5; --muted: #8696a3; --line: #263544; --accent: #f5b34a; --accent-soft: #4a3512;
  --term: #0a1016; --term-line: #22303d; --ok: #4fd1a1; --grain: .1;
  --tape: rgba(236, 226, 200, .2); --tape-edge: rgba(236, 226, 200, .1);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { background: var(--bg); }
body { margin: 0; color: var(--body); font-family: var(--font); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
/* Doodles: a hand-drawn tile of developer things (public/doodles.svg) used as
   a stencil and painted in --doodle, so the same lines are faint ink on light
   paper and faint chalk on the dark desk. Fixed size on every screen. */
html::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--doodle);
  -webkit-mask: url("/doodles.svg") 0 0 / 640px 640px repeat; mask: url("/doodles.svg") 0 0 / 640px 640px repeat;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: var(--grain); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .38 0 0 0 0 .45 0 0 0 .2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { mix-blend-mode: screen; } }
:root[data-theme="dark"] body::before { mix-blend-mode: screen; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent-soft); }
code { font-family: var(--mono); font-size: .84em; color: var(--ink); background: var(--panel); padding: 2px 6px; border-radius: 4px; }

.label { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.label.accent, a.label { color: var(--accent); text-decoration: none; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.squiggle { display: block; height: 10px; border: 0; margin: 0; background: var(--line);
  -webkit-mask: var(--squiggle) repeat-x left center; mask: var(--squiggle) repeat-x left center; }
.scribbled { position: relative; white-space: nowrap; }
.scribbled::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.08em; height: .2em; background: var(--lamp);
  -webkit-mask: var(--scribble) no-repeat left center / 100% 100%; mask: var(--scribble) no-repeat left center / 100% 100%; z-index: -1; }

/* ---------- Header: masking-tape logo + Aayush as the menu ---------- */
.top { max-width: 1040px; height: 92px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 20; }
.tape-logo {
  position: absolute; top: 26px; left: 16px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 9px 20px 10px; background: var(--lamp); color: var(--on-lamp);
  font-size: 21px; font-weight: 650; letter-spacing: -.02em; line-height: 1; transform: rotate(-2deg);
  /* torn tape ends */
  clip-path: polygon(0 8%, 3% 0, 6% 10%, 9% 0, 91% 0, 94% 9%, 97% 0, 100% 10%, 100% 90%, 97% 100%, 94% 91%, 91% 100%, 9% 100%, 6% 90%, 3% 100%, 0 92%);
  filter: drop-shadow(0 4px 4px rgba(10, 20, 30, .25)); transition: transform .2s ease;
}
.tape-logo span { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.tape-logo:hover { transform: rotate(0deg); }
.tape-logo:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.guide { position: fixed; top: 14px; right: max(16px, calc((100vw - 1040px) / 2 + 16px)); z-index: 60; transition: transform .25s ease, opacity .25s ease; }
.guide.tuck { transform: translateY(-90px); opacity: 0; pointer-events: none; }
.guide-btn { position: relative; display: block; width: 62px; height: 62px; padding: 0; cursor: pointer; border-radius: 50%;
  background: var(--paper); border: 1.6px solid var(--ink); box-shadow: 0 8px 18px -10px rgba(10, 20, 30, .6); transition: transform .2s ease; }
.guide-btn img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.guide-btn:hover, .guide-btn[aria-expanded="true"] { transform: rotate(-6deg) scale(1.05); }
.guide-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.guide-tag { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font-size: 11.5px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; background: var(--lamp); color: var(--on-lamp); padding: 2px 7px; border-radius: 999px; }
.guide-menu { position: absolute; top: calc(100% + 18px); right: 0; width: min(270px, calc(100vw - 32px)); background: var(--paper); color: var(--ink);
  border: 1.6px solid var(--ink); border-radius: 22px 18px 24px 16px / 16px 24px 18px 22px; padding: 14px 16px 12px; box-shadow: 0 18px 40px -20px rgba(10, 20, 30, .55); }
.guide-menu[hidden] { display: none; }
.guide-menu::before { content: ""; position: absolute; top: -9px; right: 24px; width: 16px; height: 16px; background: var(--paper);
  border-left: 1.6px solid var(--ink); border-top: 1.6px solid var(--ink); transform: rotate(45deg) skew(6deg, 6deg); }
.guide-hi { margin: 0 0 6px; font-size: 13px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.guide-menu ul { list-style: none; margin: 0; padding: 0; }
.guide-menu li a { display: block; padding: 7px 0; font-size: 18px; font-weight: 550; color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--line); }
.guide-menu li a:hover, .guide-menu li a[aria-current="page"] { color: var(--accent); }
.guide-menu.pop { animation: bubble .22s cubic-bezier(.3, 1.4, .5, 1); transform-origin: top right; }
@keyframes bubble { from { opacity: 0; transform: scale(.85) translateY(-6px); } }

.theme-pick { display: flex; gap: 4px; margin-top: 12px; padding: 3px; border: 1.4px solid var(--line); border-radius: 999px; }
.theme-pick button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted); background: none; border: 0; border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.theme-pick button:hover { color: var(--ink); }
.theme-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-pick button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme-pick svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- OS picker (segmented, used on home and command pages) ---------- */
.os-pick { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper); border: 1.6px solid var(--ink); border-radius: 999px; }
.os-pick button { font: inherit; font-size: 15px; font-weight: 600; color: var(--body); background: none; border: 0; border-radius: 999px;
  padding: 6px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.os-pick button svg { width: 16px; height: 16px; fill: currentColor; }
.os-pick button:hover { color: var(--ink); }
.os-pick button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-os="mac"] .os-pick [data-os="mac"],
:root[data-os="linux"] .os-pick [data-os="linux"],
:root[data-os="windows"] .os-pick [data-os="windows"] { background: var(--ink); color: var(--paper); }

/* Only the chosen machine's commands are shown */
:root[data-os="mac"] [data-panel]:not([data-panel="mac"]),
:root[data-os="linux"] [data-panel]:not([data-panel="linux"]),
:root[data-os="windows"] [data-panel]:not([data-panel="windows"]) { display: none !important; }

/* ---------- Terminal panel ---------- */
.term { position: relative; background: var(--term); color: var(--term-text); border-radius: 10px; border: 1px solid var(--term-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 28px -20px rgba(5, 10, 20, .7); }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--term-line);
  font-size: 12.5px; color: var(--term-dim); }
.term-bar .dots { display: inline-flex; gap: 6px; }
.term-bar .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3946; }
.term-bar .shell { flex: 1; }
.term pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-family: var(--mono); font-size: 14.5px; line-height: 1.6; white-space: pre; }
.term pre::before { content: attr(data-prompt) " "; color: var(--lamp); user-select: none; -webkit-user-select: none; }
.term pre, .term code { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
.term code { font: inherit; color: inherit; background: none; padding: 0; border-radius: 0; }
.term pre[data-typer]::before { content: none; }
.copy { font: inherit; font-size: 13px; font-weight: 600; color: var(--term-text); background: #1b2733; border: 1px solid #2c3c4b;
  border-radius: 6px; padding: 4px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.copy:hover { background: #24333f; border-color: var(--lamp); }
.copy:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
.copy svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.copy.done { color: #4fd1a1; border-color: #4fd1a1; }
/* fill-in fields inside commands */
.v { color: var(--lamp); background: rgba(245, 179, 74, .14); border-bottom: 1.5px dashed var(--lamp); border-radius: 3px; padding: 0 2px; }
.v.empty { font-style: italic; opacity: .85; }

/* ---------- Home ---------- */
.home-hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-top: 36px; }
.home-hero h1 { font-weight: 680; color: var(--ink); font-size: clamp(44px, 6.4vw, 70px); line-height: 1.02; letter-spacing: -.04em; margin: 12px 0 18px; position: relative; z-index: 0; }
.home-hero .sub { font-size: 19px; line-height: 1.55; margin: 0 0 26px; max-width: 30em; }
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 19px; color: var(--ink); background: var(--paper); border: 1.6px solid var(--ink);
  border-radius: 14px; padding: 15px 56px 15px 50px; box-shadow: 4px 4px 0 var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; box-shadow: 4px 4px 0 var(--lamp); border-color: var(--ink); }
.search .icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2.2; }
.search kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 8px; background: var(--bg); }
.on-row { display: flex; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.on-row .label { margin: 0; }

.desk { position: relative; padding: 18px 0 30px; }
.desk .term { transform: rotate(1.2deg); }
.desk .term pre { min-height: 168px; white-space: pre-wrap; }
.desk .taped-tape { position: absolute; top: 6px; width: 96px; height: 28px; z-index: 2; background: var(--tape); border: 1px solid var(--tape-edge); }
.desk .taped-tape.l { left: 26px; transform: rotate(-8deg); }
.desk .taped-tape.r { right: 26px; transform: rotate(7deg); }
.desk .sticker { position: absolute; right: -10px; bottom: -22px; width: 116px; height: 116px; transform: rotate(6deg); filter: drop-shadow(0 8px 10px rgba(5, 10, 20, .35)); }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--lamp); vertical-align: -.18em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.out { color: var(--term-dim); }
.out .ok { color: #4fd1a1; }

.topics { margin-top: 64px; }
.topics-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.topics-head h2 { margin: 0; color: var(--ink); font-size: 30px; letter-spacing: -.025em; font-weight: 650; }
.topics-head p { margin: 0; color: var(--muted); font-size: 15px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.topic { background: var(--paper); border: 1.6px solid var(--ink); border-radius: 16px 12px 18px 12px / 12px 18px 12px 16px; padding: 18px 20px 10px; }
.topic h3 { margin: 0; font-size: 21px; color: var(--ink); letter-spacing: -.015em; font-weight: 650; }
.topic .blurb { margin: 2px 0 8px; font-size: 14.5px; color: var(--muted); }
.topic ul { list-style: none; margin: 0; padding: 0; }
.topic li a { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px dashed var(--line); text-decoration: none; color: var(--ink); font-weight: 550; }
.topic li:first-child a { border-top: 0; }
.topic li a::before { content: ">"; font-family: var(--mono); color: var(--accent); font-weight: 600; }
.topic li a:hover { color: var(--accent); }
.topic li[hidden], .topic[hidden] { display: none; }
.no-match { text-align: center; padding: 40px 16px; }
.no-match img { width: 110px; }
.no-match p { margin: 6px 0 0; color: var(--ink); font-size: 19px; }

/* ---------- Command page ---------- */
.cmd-head { max-width: 800px; margin: 0 auto; padding: 30px 16px 0; }
.cmd-head h1 { color: var(--ink); font-weight: 680; font-size: clamp(36px, 5.6vw, 54px); line-height: 1.05; letter-spacing: -.035em; margin: 10px 0 12px; }
.cmd-head .summary { font-size: 20px; line-height: 1.5; color: var(--body); margin: 0; }
.tested { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.tested svg { width: 17px; height: 17px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.picker-bar { position: sticky; top: 0; z-index: 30; padding: 12px 16px; margin-top: 22px;
  background: linear-gradient(var(--bg) 70%, transparent); }
.picker-bar .inner { max-width: 768px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.copy-all { font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--paper); border: 1.6px solid var(--ink);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.copy-all:hover { box-shadow: 2px 2px 0 var(--lamp); }
.copy-all.done { color: var(--ok); }

.cmd-body { max-width: 800px; margin: 0 auto; padding: 4px 16px 0; }
.vars { background: var(--paper); border: 1.6px solid var(--ink); border-radius: 14px; padding: 16px 18px 6px; margin: 8px 0 30px; }
.vars .label { display: block; margin-bottom: 8px; }
.vars label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.vars input { display: block; width: 100%; margin-top: 4px; font-family: var(--mono); font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1.4px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.vars input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.vars-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }

.section-h { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 24px; letter-spacing: -.02em; font-weight: 650; margin: 40px 0 14px; width: fit-content; }
.section-h img { width: 40px; height: 40px; }
ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 26px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  border: 1.6px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 650; font-size: 15px; display: grid; place-items: center; }
ol.steps.check > li::before { content: "✓"; color: var(--ok); }
.step-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 1px 0 9px; color: var(--ink); font-weight: 600; font-size: 18px; }
.badge { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); }
.step-note { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.skip { background: var(--paper); border: 1.6px dashed var(--line); border-radius: 12px; padding: 16px 18px; color: var(--ink); }

details.undo { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 14px; }
details.undo summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 18px; }
details.undo summary::marker { color: var(--accent); }
details.undo ol { margin-top: 18px; }

.explain { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: center; margin-top: 44px; }
.explain img { width: 70px; height: 70px; }
.explain .bubble { position: relative; background: var(--paper); color: var(--ink); padding: 13px 18px; margin: 0;
  border: 1.6px solid var(--ink); border-radius: 22px 18px 24px 16px / 16px 24px 18px 22px; font-size: 16.5px; line-height: 1.5; }
.explain .bubble::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; background: var(--paper);
  border-left: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); transform: translateY(-50%) rotate(45deg) skew(8deg, 8deg); }
.explain a { color: var(--accent); font-weight: 600; }

.related { margin-top: 48px; }
.related ul { list-style: none; padding: 0; margin: 12px 0 0; }
.related li a { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 550; font-size: 18px; }
.related li a::after { content: "→"; color: var(--accent); }
.related li a:hover { color: var(--accent); }

footer.site { max-width: 1040px; margin: 80px auto 0; padding: 22px 16px 40px; font-size: 13px; color: var(--muted); position: relative;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.site::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 10px; background: var(--line);
  -webkit-mask: var(--squiggle) repeat-x left center; mask: var(--squiggle) repeat-x left center; }
footer.site img { width: 22px; height: 22px; vertical-align: -6px; margin-left: 2px; }

@media (max-width: 860px) {
  .home-hero { grid-template-columns: 1fr; gap: 24px; padding-top: 18px; }
  .desk .sticker { width: 88px; height: 88px; right: -4px; }
}
@media (max-width: 760px) {
  .top { height: 76px; }
  .tape-logo { top: 20px; font-size: 18px; padding: 8px 16px 9px; }
  .guide { top: 10px; right: 12px; }
  .guide-btn { width: 54px; height: 54px; }
  .os-pick button { padding: 6px 11px; font-size: 14px; }
  .os-pick button svg { display: none; }
  ol.steps > li { padding-left: 0; }
  ol.steps > li::before { position: static; display: inline-grid; margin-bottom: 6px; }
  .term pre { font-size: 13.5px; }
  .search kbd { display: none; }
  .search input { padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } .guide, .guide-menu.pop { transition: none; animation: none; } }
