/* Hedster site styles, shared by every page.
   Layout: sticky brand bar, then each page's content in one centered column, then the footer. */
:root {
  --bg: #faf7f6;
  --surface: #ffffff;
  --surface-2: #f5efee;
  --ink: #15161f;          /* Hedster hat navy, deepened */
  --muted: #6c6366;
  --line: #ece4e2;
  --brand: #a3191f;        /* Hedster wordmark red */
  --brand-ink: #ffffff;
  --brand-soft: #fbeae9;
  --ok: #17803d;
  --warn: #b45309;
  --danger: #d4161c;
  --danger-soft: #fde4e3;
  --violent: #c25400;
  --violent-soft: #fdebd9;
  --fix: #15803d;
  --fix-soft: #dcf3e4;
  --coffee: #5f7fff;       /* Buy Me a Coffee button color */
  --coffee-ink: #ffffff;
  --shadow: 0 1px 2px rgb(21 22 31 / .04), 0 18px 40px -18px rgb(21 22 31 / .18);
  --sans: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121012; --surface: #1b181a; --surface-2: #242022; --ink: #f4efef; --muted: #a89c9e; --line: #2f2a2c;
    --brand: #ef4f47; --brand-ink: #1a0909; --brand-soft: #3a1b1b;
    --ok: #5cc98d; --warn: #f0a548; --danger: #ff5a52; --danger-soft: #4a1c1b;
    --violent: #ff9a3d; --violent-soft: #4a2c12; --fix: #5ccf85; --fix-soft: #183a26; --coffee: #8199ff; --coffee-ink: #0d1330;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -18px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] {
  --bg: #121012; --surface: #1b181a; --surface-2: #242022; --ink: #f4efef; --muted: #a89c9e; --line: #2f2a2c;
  --brand: #ef4f47; --brand-ink: #1a0909; --brand-soft: #3a1b1b;
  --ok: #5cc98d; --warn: #f0a548; --danger: #ff5a52; --danger-soft: #4a1c1b;
  --violent: #ff9a3d; --violent-soft: #4a2c12; --fix: #5ccf85; --fix-soft: #183a26; --coffee: #8199ff; --coffee-ink: #0d1330;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 18px 40px -18px rgb(0 0 0 / .6);
  color-scheme: dark;
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.gutter {
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.inner { max-width: 820px; margin: 0 auto; }

/* brand bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.logo { display: block; height: 45px; width: auto; max-width: 60vw; }
.logo-dark { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.cross { font-size: 20px; font-weight: 500; color: var(--muted); line-height: 1; }
.partner { display: block; height: 28px; width: auto; }
.badge {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); padding: 4px 8px; border-radius: 999px;
}
/* hamburger menu */
.menu { position: relative; }
.menu-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-content: center; gap: 4px; cursor: pointer; padding: 0;
}
.menu-btn:hover { border-color: var(--brand); }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .18s ease, opacity .18s ease; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 220px;
  margin: 0; padding: 6px; list-style: none; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.menu-list a {
  display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
}
.menu-list a:hover { background: var(--surface-2); color: var(--brand); }
.menu-list a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

main { padding-block: 48px 56px; }
main .inner { display: grid; gap: 40px; }

/* promise */
.hero { display: grid; gap: 14px; }
.eyebrow {
  justify-self: start; font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft); padding: 5px 10px; border-radius: 999px;
}
.hero h1 {
  margin: 0; font-weight: 900; font-size: clamp(34px, 6.4vw, 58px); line-height: 1.02; letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { margin: 0; font-size: clamp(16px, 2.2vw, 18.5px); color: var(--muted); max-width: 58ch; text-wrap: pretty; }

/* editor card */
.editor {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  overflow: hidden;
}
.editor-in { display: grid; gap: 8px; padding: 22px 24px 18px; }
.editor-out { display: grid; gap: 16px; padding: 22px 24px 24px; background: var(--surface-2); border-top: 1px solid var(--line); }
.label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
/* the typing box: a transparent textarea over a copy of its text that shows flagged words */
.typebox { position: relative; }
.typebox textarea, .typebox .backdrop {
  font: 500 clamp(19px, 2.6vw, 22px)/1.4 var(--sans); letter-spacing: normal;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; padding: 0; margin: 0; border: 0;
}
.typebox .backdrop { position: absolute; inset: 0; overflow: hidden; color: var(--ink); pointer-events: none; }
.typebox .backdrop mark { color: inherit; border-radius: 4px; text-decoration-line: underline; text-decoration-style: wavy; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.typebox .backdrop .violent { color: var(--violent); background: var(--violent-soft); text-decoration-color: var(--violent); }
.typebox .backdrop .sexual { color: var(--danger); background: var(--danger-soft); text-decoration-color: var(--danger); }
textarea {
  position: relative; display: block; width: 100%; resize: none; min-height: 62px; overflow: hidden; background: transparent;
  color: transparent; caret-color: var(--ink);
}
textarea::selection { color: transparent; background: color-mix(in srgb, var(--brand) 25%, transparent); }
textarea::placeholder { color: var(--muted); opacity: .7; }
textarea:focus { outline: none; }
.editor:focus-within { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.out-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.result {
  margin: 0; font-weight: 800; font-size: clamp(24px, 4.2vw, 34px); line-height: 1.16; letter-spacing: -0.02em;
  text-wrap: balance; overflow-wrap: anywhere; min-width: 0;
}
.result .empty { color: var(--muted); font-weight: 600; opacity: .75; }
.result .fixed, .result .violent, .result .sexual { border-radius: 5px; padding: 0 .1em; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.result .fixed { color: var(--fix); background: var(--fix-soft); text-decoration-line: underline; text-decoration-style: solid; }
.result .violent { color: var(--violent); background: var(--violent-soft); text-decoration-line: underline; text-decoration-style: wavy; }
.result .sexual { color: var(--danger); background: var(--danger-soft); text-decoration-line: underline; text-decoration-style: wavy; }

.btn-primary {
  font: 700 15px/1 var(--sans); cursor: pointer; border: 0; border-radius: 999px; padding: 12px 20px;
  background: var(--brand); color: var(--brand-ink); white-space: nowrap;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .12s ease, filter .12s ease;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; transform: none; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
#count {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
#count .good { color: var(--ok); }
#count .long { color: var(--warn); }
#count:has(.long) { border-color: var(--warn); }
.key { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.key i { width: 14px; height: 0; border-bottom: 2px solid; display: inline-block; }
.key .k-fix { border-color: var(--fix); }
.key .k-violent { border-bottom-style: dotted; border-color: var(--violent); }
.key .k-sexual { border-bottom-style: dotted; border-color: var(--danger); }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 2px; }
.editor-in .meta { justify-content: flex-end; }

.copy-note {
  margin: 0; padding: 11px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  color: var(--warn); background: var(--surface); border: 1px solid var(--warn);
}
.alert {
  display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; font-size: 14.5px;
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); color: var(--ink);
}
.alert strong { color: var(--danger); font-weight: 800; font-size: 15.5px; }
.alert.violent-only { background: var(--violent-soft); border-color: color-mix(in srgb, var(--violent) 45%, transparent); }
.alert.violent-only strong { color: var(--violent); }
.alert ul, .fixes ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.alert b.sexual { color: var(--danger); }
.alert b.violent { color: var(--violent); }
.fixes {
  display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; font-size: 14.5px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
}
.fixes .label { color: var(--fix); }
.fixes del { color: var(--muted); }
.fixes ins { color: var(--fix); font-weight: 700; text-decoration: underline solid 2px var(--fix); text-underline-offset: 3px; }



/* subpages */
.doc { display: grid; gap: 28px; }
.doc header { display: grid; gap: 12px; }
.doc h1 { margin: 0; font-weight: 900; font-size: clamp(32px, 5.6vw, 48px); line-height: 1.05; letter-spacing: -0.03em; }
.doc section {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px;
  display: grid; gap: 10px;
}
.doc h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; display: flex; justify-content: space-between; gap: 12px; }
.doc h2 small { font-weight: 500; font-size: 13.5px; color: var(--muted); }
.doc ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; color: var(--muted); }
.doc li::marker { color: var(--brand); }
.doc p { margin: 0; color: var(--muted); max-width: 68ch; }
.doc b { color: var(--ink); }
.swatch { font-weight: 700; border-radius: 4px; padding: 0 .2em; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-line: underline; }
.swatch.fix { color: var(--fix); background: var(--fix-soft); }
.swatch.violent { color: var(--violent); background: var(--violent-soft); text-decoration-style: wavy; }
.swatch.sexual { color: var(--danger); background: var(--danger-soft); text-decoration-style: wavy; }

/* Buy Me a Coffee */
.support { padding-block: 0 44px; }
.support .inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
}
.support p { margin: 0; flex: 1 1 340px; min-width: 0; color: var(--muted); font-size: 15.5px; max-width: 60ch; }
.support p b { color: var(--ink); }
.coffee-btn {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 12px 20px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 15px;
  background: var(--coffee); color: var(--coffee-ink);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--coffee) 75%, transparent);
}
.coffee-btn:hover { filter: brightness(1.07); }
.coffee-btn svg { width: 20px; height: 20px; flex: none; }

/* footer */
footer { border-top: 1px solid var(--line); padding-block: 26px 40px; }
footer .inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.footer-meta { display: grid; gap: 2px; font-size: 13px; color: var(--muted); text-align: right; }
.footer-meta p { margin: 0; }
.version { font-family: var(--mono); font-size: 11.5px; }

@media (max-width: 560px) {
  main { padding-block: 32px 44px; }
  .editor-in, .editor-out { padding-inline: 18px; }
  .logo { height: 34px; }
  .partner { height: 20px; }
  .cross { font-size: 15px; }
  .brand { gap: 7px; }
  .footer-meta { text-align: left; }
  .doc section { padding: 18px; }
}
/* the logo lockup needs the room on phones; the hero eyebrow already says beta */
@media (max-width: 400px) {
  .brand .badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
