/* Layout: one 720px column. Details, colours and fonts as cards, then three signature
   proofs on white "email paper", then Gmail steps and a plain-text version. */
:root {
  --bg: #f2f5f4;
  --surface: #ffffff;
  --fg: #162120;
  --muted: #5b6a68;
  --line: #d6dfdc;
  --accent: #0f5c63;
  --accent-ink: #ffffff;
  --accent-soft: #e3efee;
  --warn: #9a5b00;
  --danger: #b42318;
  --paper: #ffffff;
  --paper-edge: #d6dfdc;
  --paper-ink: #7a848d;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514;
    --surface: #172020;
    --fg: #e4ebe9;
    --muted: #98a8a5;
    --line: #2a3533;
    --accent: #6cc0c6;
    --accent-ink: #0b1414;
    --accent-soft: #1d2f2f;
    --warn: #e0a84a;
    --danger: #f08b80;
    --paper: #ffffff;
    --paper-edge: #2a3533;
    --paper-ink: #7a848d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 40px 64px;
  display: grid;
  gap: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(30px, 6.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.015em;
  text-wrap: balance;
}
h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.lede { margin: 12px 0 0; color: var(--muted); max-width: 56ch; }

section { display: grid; gap: 14px; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 18px;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 14px;
}

/* Fields */
.field, .cfield { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field label, .cfield label, .seg-field legend, .mini-label {
  font-size: 13px;
  font-weight: 600;
}
label small { font-weight: 400; color: var(--muted); }
.field input, .field select, .hex {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 42px;
}
.field input:focus-visible, .field select:focus-visible, .hex:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}
.hex { font-family: var(--mono); font-size: 14px; text-transform: lowercase; }
.hex[aria-invalid="true"] { border-color: var(--danger); }

.cinput { display: flex; gap: 8px; align-items: stretch; }
.cinput input[type="color"] {
  flex: none;
  width: 46px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}
.cinput input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cinput input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.cinput input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.cinput input[type="color"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.warn { margin: 0; font-size: 12px; color: var(--warn); }
.warn.err { color: var(--danger); }

/* Presets */
.presets-wrap { display: grid; gap: 8px; }
.mini-label { margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--fg);
  padding: 6px 12px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
}
.preset i { width: 18px; height: 18px; border-radius: 50%; display: block; }
.preset[aria-pressed="true"] { border-color: var(--fg); font-weight: 600; }
.preset:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Segmented controls */
.seg-field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 5px; }
.seg-field legend { padding: 0; margin-bottom: 5px; }
.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 3px;
  gap: 3px;
}
.seg label { flex: 1 1 0; min-width: 0; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  font-size: 13px;
  padding: 7px 6px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.link-btn {
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Proofs */
.proof { display: grid; gap: 10px; }
.proof + .proof { margin-top: 14px; }
.proof-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.proof-head span { font-size: 13px; color: var(--muted); }
.paper {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  padding: 20px 22px 22px;
  overflow-x: auto;
}
.ctx { margin: 0 0 14px; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color: var(--paper-ink); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  transition: filter .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--accent); }
.status { font-size: 13px; color: var(--muted); }
.status.ok { color: var(--accent); font-weight: 600; }

/* Steps and plain text */
.steps ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li { padding-left: 4px; }
.steps li::marker { font-family: var(--display); font-weight: 700; color: var(--accent); }
kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre;
}
.note { margin: 0; font-size: 13px; color: var(--muted); max-width: 62ch; }

.foot { border-top: 1px solid var(--line); padding-top: 18px; }
.foot p { margin: 0; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
