/* Copedal shared styles.
   Layout: a workshop-style site. Sticky header, hero with an illustrated hold console,
   a numbered first path, a pitfall-to-fix table, tool cards, the Brake products, a short quiz,
   and article pages for the six steps plus the required About / Privacy / Contact pages. */
:root {
  --bg: #edf0f3;
  --surface: #f8fafb;
  --fg: #14202b;
  --muted: #51606e;
  --line: #cbd3db;
  --accent: #f2b705;
  --on-accent: #14202b;
  --link: #1f4e8c;
  --panel: #14202b;
  --panel-fg: #e4eaf0;
  --panel-muted: #8fa0b0;
  --ok: #3fa36b;
  --moved: #5b9be0;
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1418;
    --surface: #161d23;
    --fg: #e6ebf0;
    --muted: #9aa8b5;
    --line: #27313a;
    --link: #8db8f2;
    --panel: #0a0e11;
    --panel-fg: #e4eaf0;
    --panel-muted: #8fa0b0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1418;
  --surface: #161d23;
  --fg: #e6ebf0;
  --muted: #9aa8b5;
  --line: #27313a;
  --link: #8db8f2;
  --panel: #0a0e11;
  --panel-fg: #e4eaf0;
  --panel-muted: #8fa0b0;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: 30;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }
img { max-width: 100%; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
[hidden]:not([hidden=until-found i]) { display: none !important; }
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Header */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }
.brand span { background: var(--accent); color: var(--on-accent); padding: 0 6px; margin-right: 2px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; }
.nav a { color: var(--fg); text-decoration: none; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }

/* Hero */
.hero { padding-block: 56px 48px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 62px); font-weight: 700; letter-spacing: -0.02em; }
.hero p.lede { margin-top: 20px; font-size: 18px; max-width: 34em; color: var(--muted); }
.cta-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  font: 600 15px/1 var(--font-body);
  padding: 14px 20px;
  text-decoration: none;
  border: 2px solid var(--fg);
  color: var(--fg);
  background: transparent;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn:hover { border-color: var(--accent); }
.console {
  background: var(--panel);
  color: var(--panel-fg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 18px 20px;
  min-width: 0;
}
.console .head { display: flex; justify-content: space-between; gap: 12px; color: var(--panel-muted); border-bottom: 1px solid #ffffff22; padding-bottom: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.console .row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 4px 0; }
.console .verb { color: var(--panel-muted); }
.console .path { overflow-wrap: anywhere; }
.console .state { display: block; font-size: 12px; margin-top: 2px; color: var(--panel-muted); }
.console .state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--ok); }
.console .state.moved::before { background: var(--moved); }
.console .state.held::before { background: var(--accent); }
.console .state.held { color: var(--accent); }
.console .foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid #ffffff22; color: var(--panel-muted); font-size: 12px; }
.tape {
  height: 12px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, var(--panel) 14px 28px);
}

/* Sections */
section.band { padding-block: 72px; }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.sec-head { max-width: 40em; margin-bottom: 36px; display: grid; gap: 12px; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.015em; }
.sec-head p { color: var(--muted); font-size: 17px; }

/* Path */
ol.path-list { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
ol.path-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 15em);
  gap: 8px 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
ol.path-list li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  padding-top: 4px;
}
ol.path-list h3 { font-size: 21px; font-weight: 600; margin-bottom: 6px; }
ol.path-list h3 a { color: var(--fg); text-decoration: none; }
ol.path-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
ol.path-list p { color: var(--muted); max-width: 38em; }
.saves { font-size: 14px; border-left: 3px solid var(--accent); padding-left: 12px; align-self: start; }
.saves b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

/* Table */
.scroll-x { overflow-x: auto; border: 1px solid var(--line); background: var(--bg); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 15px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; width: 28%; }

/* Tools */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); padding: 20px; display: grid; gap: 10px; align-content: start; min-width: 0; }
section.alt .card { background: var(--bg); }
.card h3 { font-size: 20px; font-weight: 600; }
.card p { color: var(--muted); font-size: 15px; }
.chip { justify-self: start; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border: 1px solid var(--line); color: var(--muted); }
.chip.ready { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.keys { display: grid; gap: 6px; font-size: 14px; }
.keys div { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
kbd { font-family: var(--font-mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--bg); color: var(--fg); }
.template { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.template .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.template pre { margin: 0; padding: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; overflow-x: auto; color: var(--fg); }
.copy { font: 500 13px/1 var(--font-body); padding: 8px 12px; border: 1px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer; }
.copy:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* Brake */
.brake { background: var(--panel); color: var(--panel-fg); padding-block: 72px; }
.brake .sec-head p, .brake .label { color: var(--panel-muted); }
.brake h2, .brake h3 { color: var(--panel-fg); }
.brake .pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.brake .prod { border: 1px solid #ffffff2a; padding: 24px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.brake .prod h3 { font-size: 24px; }
.brake ul { margin: 0; padding-left: 18px; color: var(--panel-fg); display: grid; gap: 6px; font-size: 15px; }
.brake .rule { margin-top: 28px; padding: 16px 20px; border-left: 4px solid var(--accent); font-size: 17px; max-width: 42em; }
.brake .chip { border-color: #ffffff3a; color: var(--panel-muted); }
.brake .btn { color: var(--panel-fg); border-color: var(--panel-fg); }
.brake .btn:hover { border-color: var(--accent); color: var(--accent); }
.brake .status { font-size: 13px; color: var(--panel-muted); }
.brake .prod .btn { justify-self: start; margin-top: 4px; }

/* Quiz */
.quiz { background: var(--surface); border: 1px solid var(--line); padding: 24px; max-width: 720px; }
.quiz fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.quiz legend { font-family: var(--font-display); font-weight: 600; font-size: 19px; margin-bottom: 10px; padding: 0; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.opt input { margin-top: 5px; accent-color: var(--accent); }
.result { margin-top: 24px; padding: 18px 20px; border-left: 4px solid var(--accent); background: var(--bg); }
.result h3 { font-size: 22px; margin-bottom: 6px; }
.result p { color: var(--muted); margin-bottom: 10px; }

/* Footer */
footer { padding-block: 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* ---------- Article pages (six steps, About, Privacy, Contact) ---------- */
.page { padding-block: 28px 64px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.article { max-width: 46em; }
.article > .label { margin-bottom: 10px; }
.article h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 700; letter-spacing: -0.02em; }
.article .lede { margin-top: 16px; font-size: 19px; color: var(--muted); }
.article h2 { font-size: 25px; font-weight: 600; margin-top: 44px; letter-spacing: -0.01em; }
.article h3 { font-size: 19px; font-weight: 600; margin-top: 26px; }
.article p { margin-top: 14px; }
.article ul, .article ol { margin: 14px 0 0; padding-left: 22px; }
.article li { margin-top: 8px; }
.article code { font-family: var(--font-mono); font-size: 14px; background: var(--surface); border: 1px solid var(--line); padding: 1px 5px; }
.meta-row { display: flex; gap: 8px 20px; flex-wrap: wrap; margin-top: 18px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 16px 20px; margin-top: 26px; }
.callout p { margin-top: 8px; }
.callout p:first-child { margin-top: 0; }
.pending { border: 1px dashed var(--line); padding: 16px 20px; margin-top: 16px; color: var(--muted); font-size: 15px; }
.pending b { color: var(--fg); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.checklist { list-style: none; padding: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.checklist li { display: flex; gap: 10px; align-items: flex-start; border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0; }
.checklist input { margin-top: 5px; accent-color: var(--accent); flex: none; }
.dl { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid var(--fg); text-decoration: none; color: var(--fg); font-weight: 600; font-size: 15px; margin-top: 16px; }
.dl:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.prevnext { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; }
.prevnext a { text-decoration: none; font-weight: 600; }
.prevnext a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.prevnext .next { margin-left: auto; text-align: right; }

/* ---------- Forms ---------- */
.subscribe { display: grid; gap: 10px; max-width: 480px; margin-top: 18px; }
.subscribe .row { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe input[type=email] { flex: 1 1 240px; }
.subscribe .fineprint { font-size: 13px; color: var(--muted); }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field > span, .field > label { font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  font: 400 16px/1.45 var(--font-body);
  padding: 11px 13px;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  min-width: 0;
  width: 100%;
}
.field textarea { min-height: 92px; resize: vertical; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.form-note { margin-top: 14px; font-size: 14px; padding: 12px 14px; border-left: 4px solid var(--accent); background: var(--surface); }
.form-note.error { border-left-color: #c0453b; }
.form-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Subscribe band ---------- */
.sub-band { background: var(--panel); color: var(--panel-fg); padding-block: 56px; }
.sub-band h2 { color: var(--panel-fg); font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; max-width: 26em; }
.sub-band p { color: var(--panel-muted); margin-top: 12px; max-width: 34em; }
.sub-band .subscribe { max-width: 560px; }
.sub-band input[type=email] { background: #ffffff10; border-color: #ffffff33; color: var(--panel-fg); }
.sub-band input[type=email]::placeholder { color: var(--panel-muted); }
.sub-band .fineprint { color: var(--panel-muted); }
.sub-band .form-note { background: #ffffff0d; color: var(--panel-fg); border-left-color: var(--accent); }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  ol.path-list li { grid-template-columns: 40px minmax(0, 1fr); }
  ol.path-list li .saves { grid-column: 2; }
  section.band, .brake { padding-block: 52px; }
}

/* ---------- Language switch ---------- */
.nav a.lang {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  margin-left: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Skills library ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skill-tools { display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; margin-top: 28px; }
.skill-tools input[type=search] {
  flex: 1 1 240px; max-width: 340px;
  font: 400 15px/1.4 var(--font-body);
  padding: 10px 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--fg);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: 500 13px/1 var(--font-body);
  padding: 9px 12px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--fg); border-color: var(--fg); }
.chip.is-on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.skill-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 18px; text-transform: uppercase; letter-spacing: 0.08em; }
.skill-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 16px; }
.skill-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px; border: 1px solid var(--line); background: var(--surface);
  text-decoration: none; color: var(--fg);
  transition: border-color .15s ease, transform .15s ease;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.skill-card h3 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.skill-card p { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 0; }
.skill-card code { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: auto; padding-top: 6px; }
.skill-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.note-line { margin-top: 14px; max-width: 45em; color: var(--muted); font-size: 15px; }
.outline { margin: 16px 0 0; padding-left: 22px; }
.outline li { margin-top: 9px; font-size: 16px; }

@media (max-width: 640px) {
  .nav { gap: 12px; font-size: 13px; }
  .nav a.lang { padding-left: 12px; }
}

/* survey + feedback (added 2026-11-13) */
.survey-block { margin-top: 30px; }
.survey-q { border: 1px solid var(--line); background: var(--surface); padding: 20px 22px; margin-top: 16px; }
.survey-q .qnum { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.survey-q .qtext { display: block; font-weight: 600; font-size: 17px; line-height: 1.4; }
.survey-q fieldset { border: 0; padding: 0; margin: 0; }
.survey-q textarea { width: 100%; min-height: 84px; margin-top: 10px; font: inherit; padding: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.survey-q .hint { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.scale-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.scale-row label { border: 1px solid var(--line); padding: 8px 16px; cursor: pointer; font-family: var(--font-mono); }
.scale-row input { margin-right: 6px; accent-color: var(--accent); }
.survey-prefill { border-left: 4px solid var(--accent); background: var(--surface); padding: 12px 14px; margin-top: 22px; font-size: 15px; }
.survey-loading { color: var(--muted); margin-top: 24px; }
.survey-done { border: 1px solid var(--line); padding: 24px; margin-top: 24px; }
.survey-done h2 { margin-top: 0; }
.survey-done p { margin-top: 10px; }
.survey-done .btn { margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Tool cards link out from their heading; keep the heading looking like a heading
   and let the underline appear only on hover, so the card does not look like a link block. */
.card h3 a{color:inherit;text-decoration:none}
.card h3 a:hover,.card h3 a:focus-visible{text-decoration:underline}
.card p a{color:inherit;text-decoration:underline;text-underline-offset:2px}

/* Skill pages: the pitfalls list is prose with a lead-in phrase, not bullets. */
.article .pit{list-style:none;padding-left:0;margin-top:16px}
.article .pit li{margin-top:18px}
.article .pit strong{display:block;font-weight:600;margin-bottom:2px}

/* Original content is read, not copied. Article prose cannot be selected, printing
   collapses to a notice, and the share row under each article is the supported way to
   pass it on. Blocks the page hands out on purpose carry data-copy-ok and stay copyable. */
.article{-webkit-user-select:none;-moz-user-select:none;user-select:none}
.article [data-copy-ok]{-webkit-user-select:text;-moz-user-select:text;user-select:text}
body[data-allow-copy] .article{-webkit-user-select:text;-moz-user-select:text;user-select:text}
.sharebar{margin-top:46px;padding-top:18px;border-top:1px solid var(--line)}
.sharebar .note{margin:0;font-size:15px;color:var(--muted)}
.sharebar .links{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.sharebar .links a,.sharebar .links button{font:inherit;font-size:14px;line-height:1.2;padding:7px 12px;border:1px solid var(--line);background:var(--surface);color:inherit;text-decoration:none;cursor:pointer}
.sharebar .links a:hover,.sharebar .links button:hover{border-color:var(--fg)}
.toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);max-width:88vw;padding:10px 16px;background:var(--panel);color:var(--panel-fg);font-size:14px;opacity:0;pointer-events:none;transition:opacity .18s;z-index:90}
.toast.on{opacity:1}
.print-note{display:none}
@media print{.article>*:not(.print-note){display:none!important}.print-note{display:block!important}}
