/* Toolshed site. One stylesheet, no build step.
   Colors: a cool morning mist with cedar used only for the action and the house.
   Utility tints follow docs/design.md (one system hue per utility). */

:root {
  color-scheme: light dark;

  --bg: #f1f3ef;
  --surface: #ffffff;
  --panel: #e6e9e3;
  --ink: #1c221e;
  --muted: #545d57;
  --line: #d4d9d2;
  --cedar: #b4441c;
  --cedar-ink: #ffffff;
  --cedar-hover: #9c3914;
  --cedar-text: #a03d18;
  --house: #fbf3ea;
  --bar: rgba(255, 255, 255, 0.78);
  --bar-ink: #1c221e;
  --glyph: #3a423d;
  --shadow: 0 1px 0 rgba(28, 34, 30, 0.04), 0 18px 40px -24px rgba(28, 34, 30, 0.35);

  --blue: #007aff;
  --teal: #2ea7bd;
  --orange: #ff9500;
  --purple: #af52de;
  --indigo: #5856d6;
  --pink: #ff2d55;
  --green: #34c759;
  --mint: #00c7be;

  --display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 34rem;
  --wide: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d211e;
    --surface: #262b27;
    --panel: #2a302b;
    --ink: #eceee9;
    --muted: #a7aea8;
    --line: #3a413b;
    --cedar: #c4532a;
    --cedar-ink: #ffffff;
    --cedar-hover: #a9461f;
    --cedar-text: #ee9a6c;
    --house: #f6e9db;
    --bar: rgba(52, 58, 54, 0.85);
    --bar-ink: #eceee9;
    --glyph: #d5dad5;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 18px 40px -20px rgba(0, 0, 0, 0.7);

    --blue: #0a84ff;
    --teal: #40c3d9;
    --orange: #ff9f0a;
    --purple: #bf5af2;
    --indigo: #5e5ce6;
    --pink: #ff375f;
    --green: #30d158;
    --mint: #63e6e2;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

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

:focus-visible {
  outline: 3px solid var(--cedar-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* ---------- Header ---------- */

.site-header { padding: 20px 0; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.125rem/1 var(--display);
}
.brand img { width: 36px; height: 36px; }

.header-links { display: flex; align-items: center; gap: 20px; }
.header-links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.header-links a:hover { color: var(--cedar-text); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--cedar);
  color: var(--cedar-ink);
  font: 600 1.0625rem/1 var(--text);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 24px -14px var(--cedar);
}
.button:hover { background: var(--cedar-hover); }
.button svg { width: 18px; height: 18px; flex: none; }

.button-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.button-quiet:hover { color: var(--cedar-text); text-decoration: underline; }

/* ---------- Hero ---------- */

.hero { padding: clamp(32px, 7vw, 88px) 0 0; }

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.25rem);
  letter-spacing: -0.03em;
  line-height: 1.0;
  max-width: 12ch;
}

.hero .lede {
  margin-top: 24px;
  max-width: var(--measure);
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 32px;
}

.requirements {
  margin-top: 16px;
  max-width: 40rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* The menu bar picture: the one bold thing on the page. */
.menubar-stage {
  margin-top: clamp(40px, 5vw, 64px);
  padding-bottom: clamp(48px, 8vw, 96px);
}

.menubar {
  width: 100%;
  height: auto;
  color: var(--bar-ink);
  filter: drop-shadow(0 22px 30px rgba(28, 34, 30, 0.16));
}
.menubar .bar { fill: var(--bar); stroke: var(--line); }
.menubar .notch { fill: #000; }
.menubar .ink { fill: var(--bar-ink); }
.menubar .ink-stroke { stroke: var(--bar-ink); fill: none; }
.menubar .soft { fill: var(--bar-ink); opacity: 0.55; }
.menubar .house-closed,
.menubar .house-open { fill: var(--house); stroke: var(--cedar); }
.menubar .house-mark { fill: var(--cedar); }

.menubar .house-open { opacity: 0; fill: none; }
.menubar .hidden-icons { opacity: 0; transform: translateX(60px); }

@media (prefers-reduced-motion: no-preference) {
  .menubar .house-closed { animation: house-close-out 0.35s ease 1.1s forwards; }
  .menubar .house-open { animation: house-open-in 0.35s ease 1.1s forwards; }
  .menubar .hidden-icons { animation: icons-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 1.25s forwards; }
}

@media (prefers-reduced-motion: reduce) {
  .menubar .house-closed { opacity: 0; }
  .menubar .house-open { opacity: 1; }
  .menubar .hidden-icons { opacity: 1; transform: none; }
}

@keyframes house-close-out { to { opacity: 0; } }
@keyframes house-open-in { to { opacity: 1; } }
@keyframes icons-in { to { opacity: 1; transform: none; } }

.menubar-caption {
  margin-top: 18px;
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 40rem;
}

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 9vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head { max-width: var(--measure); margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
.section-head p { margin-top: 16px; color: var(--muted); font-size: 1.125rem; }

/* Utilities: rows, text on the left, a drawing on the right. */

.utilities { list-style: none; margin: 0; padding: 0; }

.utility {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 4vw, 44px) 0;
}
.utility + .utility { border-top: 1px dashed var(--line); }

.utility-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.utility-title h3 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }

.tile { width: 46px; height: 34px; flex: none; }
.tile .body { fill: var(--tint); stroke: var(--tint); stroke-width: 4; stroke-linejoin: round; }
.tile .sym { stroke: #fff; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile .sym-fill { fill: #fff; }

.t-blue { --tint: var(--blue); }
.t-teal { --tint: var(--teal); }
.t-orange { --tint: var(--orange); }
.t-purple { --tint: var(--purple); }
.t-indigo { --tint: var(--indigo); }
.t-pink { --tint: var(--pink); }
.t-green { --tint: var(--green); }
.t-mint { --tint: var(--mint); }

.utility-text { max-width: var(--measure); }
.utility-text p { color: var(--ink); }

.note {
  margin-top: 14px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.drawing {
  background: var(--panel);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 32px);
  color: var(--glyph);
}
.drawing svg { width: 100%; height: auto; }

/* Shared drawing vocabulary: currentColor lines, tint fills. */
.d-line { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-thin { stroke: currentColor; fill: none; stroke-width: 1.25; stroke-linecap: round; opacity: 0.45; }
.d-dash { stroke: currentColor; fill: none; stroke-width: 1.25; stroke-dasharray: 3 5; opacity: 0.55; }
.d-face { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.d-plain { fill: var(--surface); }
.d-ink { fill: currentColor; }
.d-soft { fill: currentColor; opacity: 0.18; }
.d-tint { fill: var(--tint); }
.d-tint-line { stroke: var(--tint); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.d-tint-soft { fill: var(--tint); opacity: 0.18; }
.d-house { fill: var(--house); stroke: var(--cedar); stroke-width: 1.5; }
.d-cedar { fill: var(--cedar); }
.d-label { fill: currentColor; font: 500 13px/1 var(--text); opacity: 0.8; }

.switch-off-note {
  margin-top: clamp(24px, 4vw, 40px);
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--surface);
  max-width: 46rem;
  box-shadow: var(--shadow);
}

/* ---------- Safety ---------- */

.promises {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 72px);
}
.promises h3 { font-size: 1.3rem; margin-bottom: 10px; }
.promises p { color: var(--muted); }
.promise-mark { width: 38px; height: 28px; margin-bottom: 14px; }
.promise-mark .body { fill: var(--house); stroke: var(--cedar); stroke-width: 1.5; stroke-linejoin: round; }
.promise-mark .sym { stroke: var(--cedar); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.fineprint { margin-top: clamp(32px, 5vw, 48px); color: var(--muted); font-size: 0.9375rem; max-width: 46rem; }

/* ---------- Install ---------- */

.install-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  font: 700 0.95rem/1 var(--display);
  color: var(--cedar-text);
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}
.steps strong { display: block; font-family: var(--display); font-size: 1.15rem; margin-bottom: 4px; }
.steps p { color: var(--muted); }

.fan-helper {
  background: var(--surface);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: var(--shadow);
}
.fan-helper h3 { font-size: 1.35rem; margin-bottom: 12px; }
.fan-helper p { color: var(--muted); }
.fan-helper .path {
  color: var(--ink);
  font-weight: 600;
}

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; overflow-wrap: anywhere; }

kbd {
  font: 600 0.85em/1 var(--text);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
}

/* ---------- Closing ---------- */

.closing { text-align: left; }
.closing .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.closing h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); max-width: 18ch; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--cedar-text); }

/* ---------- 404 ---------- */

.lost { padding: clamp(48px, 12vw, 140px) 0; }
.lost svg { width: 140px; height: auto; margin-bottom: 32px; }
.lost-mark { fill: none; stroke: var(--cedar); stroke-width: 6; stroke-linecap: round; }
.lost h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: 14ch; }
.lost p { margin-top: 18px; color: var(--muted); max-width: var(--measure); font-size: 1.125rem; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .utility,
  .install-grid,
  .promises { grid-template-columns: minmax(0, 1fr); }
  .utility { gap: 24px; }
  .header-links .hide-small { display: none; }
  .menubar-stage .wrap { padding-right: 0; }
  .menubar-scroll { overflow: hidden; padding: 8px 0 24px; }
  .menubar.wide { width: 270%; max-width: none; margin-left: -170%; filter: none; }
  .menubar-caption { padding-right: var(--gutter); }
}
