/* ==========================================================================
   Maidware Project
   Plain page, plain words. Colour is the only thing that changes.
   ========================================================================== */

:root {
  /* HOME - warm paper */
  --bg: #faf7f2;
  --bg-soft: #f3ede4;
  --surface: #ffffff;
  --text: #2e2a26;
  --muted: #756c63;
  --accent: #a55d3d;
  --link: #8c4f34;
  --border: #e6ded3;
  --border-strong: #d5cabb;
  --shadow: rgba(60, 46, 34, 0.08);
  --code-bg: #2b2723;
  --code-text: #ece4d9;
  --prompt: #9cbb86;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 980px;
}

[data-theme="lamplight"] {
  --bg: #1e1a17;
  --bg-soft: #251f1c;
  --surface: #2b2523;
  --text: #e8e0d8;
  --muted: #9d938a;
  --accent: #d18a5c;
  --link: #dda279;
  --border: #372f2b;
  --border-strong: #4b413c;
  --shadow: rgba(0, 0, 0, 0.35);
  --code-bg: #16130f;
  --code-text: #e8e0d8;
  --prompt: #9cbb86;
}

[data-theme="paper"] {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --surface: #ffffff;
  --text: #1b1f23;
  --muted: #6a737d;
  --accent: #0969da;
  --link: #0969da;
  --border: #e4e6ea;
  --border-strong: #d4d9de;
  --shadow: rgba(140, 149, 159, 0.18);
  --code-bg: #24292f;
  --code-text: #f6f8fa;
  --prompt: #7ee787;
}

[data-theme="tokyo"] {
  --bg: #16161e;
  --bg-soft: #1a1b26;
  --surface: #1f2130;
  --text: #c0caf5;
  --muted: #8089b0;
  --accent: #7aa2f7;
  --link: #7dcfff;
  --border: #2b2f44;
  --border-strong: #3b4261;
  --shadow: rgba(0, 0, 0, 0.5);
  --code-bg: #101018;
  --code-text: #c0caf5;
  --prompt: #ff9e64;
}

[data-theme="mallow"] {
  --bg: #fdf5f9;
  --bg-soft: #f9ecf3;
  --surface: #ffffff;
  --text: #3f3444;
  --muted: #7a6b80;
  --accent: #a55680;
  --link: #a54e7d;
  --border: #f2e4ed;
  --border-strong: #e2ccdb;
  --shadow: rgba(120, 80, 105, 0.1);
  --code-bg: #322a36;
  --code-text: #f4eaf1;
  --prompt: #9fd9b4;
}

[data-theme="meadow"] {
  --bg: #f5f8f3;
  --bg-soft: #edf2e9;
  --surface: #ffffff;
  --text: #26302a;
  --muted: #657469;
  --accent: #4a7a45;
  --link: #3f6c3b;
  --border: #e2eae0;
  --border-strong: #cfdac9;
  --shadow: rgba(50, 75, 50, 0.1);
  --code-bg: #1e2a1c;
  --code-text: #e6f0e2;
  --prompt: #a3cf8e;
}

[data-theme="harbor"] {
  --bg: #f4f7fa;
  --bg-soft: #eaf0f5;
  --surface: #ffffff;
  --text: #22303a;
  --muted: #5e7283;
  --accent: #3a7291;
  --link: #2f6585;
  --border: #dfe7ee;
  --border-strong: #ccd8e2;
  --shadow: rgba(45, 70, 90, 0.1);
  --code-bg: #152230;
  --code-text: #dde9f2;
  --prompt: #7fd0c0;
}

[data-theme="crt"] {
  --bg: #0c110d;
  --bg-soft: #101711;
  --surface: #141c16;
  --text: #b6e8bd;
  --muted: #6b9c74;
  --accent: #4ade80;
  --link: #6fdc94;
  --border: #1f2e24;
  --border-strong: #2e4536;
  --shadow: rgba(0, 0, 0, 0.6);
  --code-bg: #070c08;
  --code-text: #a8dfa9;
  --prompt: #d7c94a;
}

/* catppuccin - the four flavours */

[data-theme="latte"] {
  --bg: #eff1f5;
  --bg-soft: #e6e9ef;
  --surface: #ffffff;
  --text: #4c4f69;
  --muted: #686b82;
  --accent: #8839ef;
  --link: #2363e6;
  --border: #dce0e8;
  --border-strong: #bcc0cc;
  --shadow: rgba(76, 79, 105, 0.16);
  --code-bg: #11111b;
  --code-text: #cdd6f4;
  --prompt: #a6e3a1;
}

[data-theme="frappe"] {
  --bg: #303446;
  --bg-soft: #292c3c;
  --surface: #363a4f;
  --text: #c6d0f5;
  --muted: #a5adce;
  --accent: #ca9ee6;
  --link: #8caaee;
  --border: #414559;
  --border-strong: #51576d;
  --shadow: rgba(0, 0, 0, 0.35);
  --code-bg: #232634;
  --code-text: #c6d0f5;
  --prompt: #a6d189;
}

[data-theme="macchiato"] {
  --bg: #24273a;
  --bg-soft: #1e2030;
  --surface: #363a4f;
  --text: #cad3f5;
  --muted: #a5adcb;
  --accent: #c6a0f6;
  --link: #8aadf4;
  --border: #363a4f;
  --border-strong: #494d64;
  --shadow: rgba(0, 0, 0, 0.4);
  --code-bg: #181926;
  --code-text: #cad3f5;
  --prompt: #a6da95;
}

[data-theme="mocha"] {
  --bg: #1e1e2e;
  --bg-soft: #181825;
  --surface: #313244;
  --text: #cdd6f4;
  --muted: #a6adc8;
  --accent: #cba6f7;
  --link: #89b4fa;
  --border: #313244;
  --border-strong: #45475a;
  --shadow: rgba(0, 0, 0, 0.4);
  --code-bg: #11111b;
  --code-text: #cdd6f4;
  --prompt: #a6e3a1;
}

/* maidware - this is the one i actually run. plasma's TokyoNight scheme with a teal accent. */

[data-theme="maidware"] {
  --bg: #1a1b26;
  --bg-soft: #16161d;
  --surface: #2c2d37;
  --text: #d7dae0;
  --muted: #9295ac;
  --accent: #5cb9ae;
  --link: #5cb9ae;
  --border: #2c2d37;
  --border-strong: #454654;
  --shadow: rgba(0, 0, 0, 0.45);
  --code-bg: #16161d;
  --code-text: #d7dae0;
  --prompt: #b3e1a3;
}

/* scrollbars, form controls and the like follow the theme */

:root { color-scheme: light; }

[data-theme="lamplight"],
[data-theme="tokyo"],
[data-theme="crt"],
[data-theme="frappe"],
[data-theme="macchiato"],
[data-theme="mocha"],
[data-theme="maidware"] { color-scheme: dark; }

/* --------------------------------------------------------------------- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: var(--bg); }

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

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

code, pre, kbd, .mono { font-family: var(--mono); }

:not(pre) > code {
  font-size: 0.86em;
  color: var(--accent);
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(18px, 4.5vw, 32px); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 10px; top: 10px; z-index: 100; background: var(--surface); padding: 8px 14px; }

h1, h2, h3, h4 { line-height: 1.35; letter-spacing: -0.01em; margin: 0; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.5rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 16px; }

/* header - just a line of links, nothing more */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--mono);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .sub { color: var(--muted); font-weight: 400; }

.site-nav { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.site-nav a { color: var(--muted); font-size: 0.93rem; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

.header-tools { display: flex; align-items: center; gap: 8px; }

/* pickers - theme and language */

.menu-wrap { position: relative; }

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.tool-btn:hover { color: var(--text); border-color: var(--accent); }
.tool-btn[aria-expanded="true"] { color: var(--text); border-color: var(--accent); }

.nav-toggle { display: none; width: 34px; justify-content: center; padding: 0; }

.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 226px;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 10px 34px var(--shadow);
  padding: 6px;
  z-index: 70;
}
.theme-menu[hidden] { display: none; }
.theme-menu p {
  margin: 6px 10px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
}
.theme-menu p:not(:first-child) {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  margin: 1px 0;
  /* each row wears its own theme: that theme's background behind its own
     name, in that theme's text colour, so the menu previews the colours
     instead of only naming them. */
  background: var(--opt-bg, transparent);
  border: none;
  border-radius: 8px;
  color: var(--opt-fg, var(--text));
  font-family: inherit;
  font-size: 0.89rem;
  text-align: left;
  cursor: pointer;
}
/* the current theme's accent may clash with a different row's background,
   so hover and checked use each row's own accent. */
.theme-option:hover,
.theme-option:focus-visible {
  outline: 2px solid var(--opt-accent, var(--accent));
  outline-offset: -2px;
}
.theme-option[aria-checked="true"] {
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--opt-accent, var(--accent));
}
.theme-option .swatches { display: inline-flex; gap: 3px; }
.theme-option .sw {
  width: 12px; height: 12px; border-radius: 50%;
  /* the first dot is the row's own colour, so ring the dots to keep them
     visible on every theme. */
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.55);
}

/* per-theme colours the rows above paint themselves with */
.theme-option[data-theme="maidware"]  { --opt-bg: #1a1b26; --opt-fg: #d7dae0; --opt-accent: #5cb9ae; }
.theme-option[data-theme="home"]      { --opt-bg: #faf7f2; --opt-fg: #2e2a26; --opt-accent: #a55d3d; }
.theme-option[data-theme="lamplight"] { --opt-bg: #1e1a17; --opt-fg: #e8e0d8; --opt-accent: #d18a5c; }
.theme-option[data-theme="mallow"]    { --opt-bg: #fdf5f9; --opt-fg: #3f3444; --opt-accent: #a55680; }
.theme-option[data-theme="meadow"]    { --opt-bg: #f5f8f3; --opt-fg: #26302a; --opt-accent: #4a7a45; }
.theme-option[data-theme="paper"]     { --opt-bg: #ffffff; --opt-fg: #1b1f23; --opt-accent: #0969da; }
.theme-option[data-theme="harbor"]    { --opt-bg: #f4f7fa; --opt-fg: #22303a; --opt-accent: #3a7291; }
.theme-option[data-theme="tokyo"]     { --opt-bg: #16161e; --opt-fg: #c0caf5; --opt-accent: #7aa2f7; }
.theme-option[data-theme="crt"]       { --opt-bg: #0c110d; --opt-fg: #b6e8bd; --opt-accent: #4ade80; }
.theme-option[data-theme="latte"]     { --opt-bg: #eff1f5; --opt-fg: #4c4f69; --opt-accent: #8839ef; }
.theme-option[data-theme="frappe"]    { --opt-bg: #303446; --opt-fg: #c6d0f5; --opt-accent: #ca9ee6; }
.theme-option[data-theme="macchiato"] { --opt-bg: #24273a; --opt-fg: #cad3f5; --opt-accent: #c6a0f6; }
.theme-option[data-theme="mocha"]     { --opt-bg: #1e1e2e; --opt-fg: #cdd6f4; --opt-accent: #cba6f7; }

/* hero */

.hero { padding: 80px 0 56px; }
.hero .kicker {
  font-family: var(--mono);
  font-size: 0.79rem;
  color: var(--muted);
  margin-bottom: 22px;
}
.hero h1 { max-width: 18ch; margin-bottom: 18px; }
.hero .lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; margin-bottom: 30px; }
.hero .lede strong { color: var(--text); font-weight: 600; }

.lang-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  max-width: 60ch;
  margin: -30px 0 0;
}
.lang-note:empty { display: none; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-primary:hover { color: var(--bg); opacity: 0.9; }

/* sections - separated by air, not by frames */

.section { padding: 70px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { max-width: 64ch; margin-bottom: 40px; }
.section-head .kicker {
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
}
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--muted); margin: 0; }

.breadcrumb { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); padding-top: 28px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .here { color: var(--accent); }

/* a plain single-column page - help, and anything else that isn't a guide */

.page-narrow { max-width: 68ch; padding: 30px 0 80px; }
.page-narrow h1 { margin-bottom: 16px; }
.page-narrow p { color: var(--muted); }
.page-narrow p strong { color: var(--text); }
.page-narrow .lead { font-size: 1.12rem; color: var(--text); margin-bottom: 22px; }

/* principles - six small boxes, because they hold up on their own */

.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 18px; }

.rule {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px var(--shadow), 0 6px 18px var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.rule:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px var(--shadow), 0 14px 30px var(--shadow);
}
.rule .glyph { color: var(--accent); display: block; margin-bottom: 10px; }
.rule h3 { font-size: 1.03rem; margin-bottom: 6px; }
.rule p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* projects - open, no frames */

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 40px 48px; }

.project { display: flex; flex-direction: column; }

.project-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.project-icon { color: var(--accent); display: inline-flex; }
.project h3 { font-size: 1.25rem; }
.project h3 a { color: var(--text); }
.project h3 a:hover { color: var(--accent); }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.tag.cat { color: var(--accent); }

.project .tagline { color: var(--accent); font-size: 0.93rem; font-weight: 600; margin: 0 0 12px; }
.project .blurb { color: var(--muted); font-size: 0.94rem; margin-bottom: 14px; }

.project ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.project li { position: relative; padding-left: 16px; font-size: 0.91rem; color: var(--muted); }
.project li::before { content: "·"; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }

.project .cmd { margin-top: auto; margin-bottom: 14px; }

.project-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
}

/* code */

.code {
  position: relative;
  display: block;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 12px 46px 12px 16px;
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
.code .prompt { color: var(--prompt); user-select: none; }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  color: var(--code-text);
  border: 1px solid rgba(160, 160, 160, 0.35);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.75;
}
.copy-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.08); }
.copy-btn.copied { color: var(--prompt); border-color: var(--prompt); }

pre.code-block {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.83rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0 0 18px;
}
pre.code-block .c { color: color-mix(in srgb, var(--code-text) 50%, transparent); }
pre.code-block .p { color: var(--prompt); }

/* a day here */

.day { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 34px 42px; }
.moment .time {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}
.moment h3 { font-size: 1.02rem; margin-bottom: 6px; }
.moment p { margin: 0; font-size: 0.91rem; color: var(--muted); }

/* cost - what each tool spends while it runs */
.perf-wrap { overflow-x: auto; }
.perf { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.perf th, .perf td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.perf thead th { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--border-strong); }
.perf tbody th { font-weight: 600; white-space: nowrap; }
.perf .idle { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }
.perf tbody tr:last-child th, .perf tbody tr:last-child td { border-bottom: 0; }
.perf-note { margin: 18px 0 0; color: var(--muted); font-size: 0.86rem; max-width: 70ch; }
.perf-why { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; max-width: 70ch; }
.perf-why li { position: relative; padding-left: 16px; font-size: 0.92rem; color: var(--muted); }
.perf-why li::before { content: "·"; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }
[dir="rtl"] .perf-why li { padding-left: 0; padding-right: 16px; }
[dir="rtl"] .perf-why li::before { left: auto; right: 3px; }

/* guide links */

.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 34px 44px; }
.guide-card { display: block; color: var(--text); }
.guide-card:hover { text-decoration: none; }
.guide-card .kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.guide-card h3 { font-size: 1.1rem; margin: 8px 0 6px; }
.guide-card:hover h3 { color: var(--accent); }
.guide-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* callout */

.callout {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 18px;
  margin: 22px 0;
}
.callout p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.callout strong { color: var(--text); }

/* per-tool requirements - stacked rows, never a horizontal scroll */

.req-group { margin-top: 32px; }
.req-group h3 { font-size: 1rem; margin-bottom: 6px; }
.req-group > p { margin: 0; color: var(--muted); font-size: 0.92rem; max-width: 62ch; }

.reqs { margin: 0; }
.req {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 3px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.req:first-child { border-top: none; }
.req dt { font-size: 0.93rem; font-weight: 600; }
.req dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }

.pkg {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 7px;
  font-size: 0.86rem;
}
.pkg b {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.pkg code { font-size: 0.84rem; }
.pkg em { font-style: normal; color: var(--muted); opacity: 0.85; }

/* cta - just words and two buttons */

.cta { text-align: center; padding: 20px 0 8px; }
.cta h2 { margin-bottom: 12px; }
.cta p { color: var(--muted); max-width: 50ch; margin: 0 auto 24px; }
.cta .hero-actions { justify-content: center; margin-bottom: 0; }

/* footer */

.site-footer { border-top: 1px solid var(--border); padding: 44px 0 36px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 28px; }
.footer-cols h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.footer-cols p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.footer-cols li a { font-size: 0.88rem; color: var(--muted); }
.footer-cols li a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

/* guide page */

.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; align-items: start; padding: 26px 0 80px; }

.toc { position: sticky; top: 86px; }
.toc h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 4px 10px; color: var(--muted); font-size: 0.87rem; border-radius: 6px; }
.toc a:hover { color: var(--accent); text-decoration: none; }
.toc a.sub { padding-left: 22px; font-size: 0.83rem; }
.toc a.here { color: var(--accent); font-weight: 600; }

.guide-content h1 { margin-bottom: 14px; }
.guide-content h2 { margin-top: 8px; scroll-margin-top: 86px; }
.guide-content h3 { scroll-margin-top: 86px; }
.guide-content p { color: var(--muted); }
.guide-content p strong, .guide-content li strong { color: var(--text); }
.guide-content ul, .guide-content ol { color: var(--muted); padding-left: 22px; margin: 0 0 16px; }
.guide-content li { margin-bottom: 7px; }
.guide-content .lead { font-size: 1.07rem; }

.divider { border-top: 1px solid var(--border); margin: 10px 0 28px; }

.steps { list-style: none; counter-reset: step; padding-left: 0 !important; margin: 0 0 18px !important; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 16px 44px;
  margin-bottom: 0 !important;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 50%;
  z-index: 1;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 2px;
  border-left: 2px solid var(--border);
}
.steps li strong { display: block; }

.tool-block { padding: 6px 0; margin-bottom: 30px; scroll-margin-top: 86px; }
.tool-block h3 { margin-bottom: 10px; }
.tool-block .meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.tool-block ul { margin-bottom: 14px; }

/* ==========================================================================
   responsive - one fluid column that grows into a layout, never the reverse
   ========================================================================== */

/* tablets and small laptops: drop the sidebar to chips */

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; gap: 22px; padding-top: 18px; }
  .toc { position: static; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
  .toc ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .toc a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.83rem; }
  .toc a.sub { padding-left: 12px; }
  .projects { gap: 34px 36px; }
}

@media (max-width: 780px) {
  .header-inner { min-height: 54px; }
  .projects { grid-template-columns: 1fr; gap: 38px; }
  .section-head { margin-bottom: 30px; }
}

/* phones */

@media (max-width: 720px) {
  body { font-size: 16px; line-height: 1.7; }
  .hero { padding: 44px 0 34px; }
  .hero h1 { max-width: none; }
  .hero .lede { font-size: 1.03rem; margin-bottom: 26px; }
  .section { padding: 44px 0; }
  .cta { padding: 8px 0; }

  .nav-toggle { display: inline-flex; }
  .header-tools { order: 1; }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0 -4px 8px;
    padding: 6px 4px 10px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    order: 3;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    font-size: 1rem;
    color: var(--text);
    padding: 12px 10px;
    border-radius: 8px;
  }
  .site-nav a:hover { background: var(--bg-soft); text-decoration: none; }
  .site-nav a[aria-current="page"] { background: var(--bg-soft); }

  .theme-menu { right: 0; left: auto; width: min(78vw, 240px); }
  .theme-option { padding: 10px; }

  pre.code-block, .code { font-size: 0.79rem; }
  .code { padding-right: 42px; }

  .req { grid-template-columns: 1fr; gap: 4px; }

  .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { justify-content: flex-start; }
}

/* small phones */

@media (max-width: 520px) {
  .brand .sub { display: none; }
  .hero-actions { gap: 8px; }
  .btn { flex: 1 1 auto; justify-content: center; }
  .rules, .day { grid-template-columns: 1fr; gap: 14px; }
  .projects { gap: 34px; }
  .project-top { flex-wrap: wrap; }
  .steps li { padding-left: 38px; }
  .steps li::before { width: 26px; height: 26px; }
  .steps li:not(:last-child)::after { left: 13px; }
  .footer-cols { grid-template-columns: 1fr; }
  .callout { padding-left: 14px; }
}

@media (max-width: 380px) {
  .tool-btn { padding: 0 10px; }
  .tool-btn span { display: none; }
  .lang-btn span { display: inline; }
  h1 { font-size: 1.75rem; }
}

/* big screens: a little more room, nothing more */

@media (min-width: 1240px) {
  :root { --maxw: 1040px; }
}

/* only lift boxes where a pointer can hover */

@media (hover: none) {
  .rule:hover { transform: none; box-shadow: 0 1px 2px var(--shadow), 0 6px 18px var(--shadow); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   right to left - for hebrew
   ========================================================================== */

[dir="rtl"] .theme-menu { right: auto; left: 0; }
[dir="rtl"] .theme-option { text-align: right; }
[dir="rtl"] .project li { padding-left: 0; padding-right: 16px; }
[dir="rtl"] .project li::before { left: auto; right: 3px; }
[dir="rtl"] .callout { border-left: none; border-right: 3px solid var(--accent); padding: 2px 18px 2px 0; }
[dir="rtl"] .steps li { padding: 0 44px 16px 0; }
[dir="rtl"] .steps li::before { left: auto; right: 0; }
[dir="rtl"] .steps li:not(:last-child)::after { left: auto; right: 14px; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] pre.code-block, [dir="rtl"] .code, [dir="rtl"] code { direction: ltr; text-align: left; }
[dir="rtl"] .breadcrumb { direction: rtl; }

@media (min-width: 901px) {
  [dir="rtl"] .toc a.sub { padding-left: 12px; padding-right: 22px; }
}
