/* Theme: white and red only. White is the same #ffffff as the word "Crimson" on the cover. */
:root {
  --cream: #ffffff;
  --cream-dark: #ffffff;
  --cream-line: rgba(122, 20, 16, .28);
  --crimson: #7a1410;
  --crimson-dark: #4f0c0a;
  --ink: #161616;
  --muted: #5a5a5a;
  --gold: #ffffff;
  --border: 2px solid var(--crimson);
  --radius: 12px;
  --serif: Georgia, "Playfair Display", "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  background: #ffffff;
  font-family: var(--sans); line-height: 1.6; font-size: 16px;
}
a { color: var(--crimson); }
a:hover { color: var(--crimson-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); color: var(--crimson); }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }

/* Header: solid red bar with a red and white candy-stripe edge */
.site-header { position: sticky; top: 0; z-index: 10; background: var(--crimson); }
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; border-bottom: 2px solid var(--crimson);
  background: repeating-linear-gradient(90deg, #7a1410 0 10px, #ffffff 10px 20px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: #fff; text-decoration: none; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.brand span { color: #ffffff; }
nav a { margin-left: 18px; text-decoration: none; color: #fff; font-weight: 600; padding: 6px 0; border-bottom: 2px solid transparent; text-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
nav a:hover, nav a.active { color: #ffffff; border-bottom-color: #ffffff; }
nav a:focus-visible { outline: 2px solid #ffffff; outline-offset: 4px; border-radius: 2px; }

main { min-height: 70vh; }
main.wrap { padding-top: 48px; padding-bottom: 56px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

.search {
  width: 100%; padding: 14px 16px; font-size: 1rem; font-family: inherit;
  border: var(--border); border-radius: var(--radius); background: #fff; margin: 12px 0;
}
.search:focus, .btn:focus-visible, .chip:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(153, 0, 0, .35); outline-offset: 2px; }
.search:focus { border-color: var(--crimson); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
  border: var(--border); background: #fff; color: var(--ink);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .9rem;
}
.chip[aria-pressed="true"] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.count { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  display: block; text-decoration: none; color: inherit; background: var(--cream-dark);
  border: var(--border); border-radius: var(--radius); padding: 16px; transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(122, 20, 16, .18); }
.card h3 { margin-bottom: .3em; color: var(--ink); }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .92rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 9px; border-radius: 999px; background: #fff; border: var(--border); color: var(--crimson); margin-right: 4px; }
.tag.priority { background: var(--crimson); border-color: var(--crimson); color: #fff; }

.back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-size: .95rem; }
.meta { color: var(--muted); font-size: .9rem; }
.desc { white-space: pre-line; }
.panel { background: #fff; border: var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.panel.crimson { border: var(--border); }
.banner { background: #fff; border: var(--border); padding: 10px 14px; border-radius: var(--radius); font-size: .92rem; margin: 10px 0 16px; }

.btn {
  display: inline-block; background: var(--crimson); color: #fff; border: 0; padding: 11px 18px;
  border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; margin: 4px 8px 4px 0;
}
.btn:hover { background: var(--crimson-dark); color: #fff; }
.btn.secondary { background: #fff; color: var(--crimson); border: var(--border); }
.btn.secondary:hover { background: var(--cream-dark); color: var(--crimson-dark); }

details:not(.teaser) { border-top: var(--border); padding: 10px 0; }
details:not(.teaser):first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 500; }
details p { margin: 8px 0 2px; color: var(--muted); font-size: .94rem; }
.qtype { color: var(--crimson); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; margin-right: 8px; }

ol.steps { padding-left: 1.2em; } ol.steps li { margin-bottom: 6px; }
textarea.script { width: 100%; min-height: 220px; font: .85rem/1.5 ui-monospace, Consolas, monospace; padding: 12px; border: var(--border); border-radius: 10px; background: #fff; color: var(--ink); }

.site-footer { border-top: var(--border); background: var(--cream-dark); padding: 20px 0; font-size: .85rem; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; transition: .2s; pointer-events: none; max-width: 90vw; z-index: 20;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sticky-cta { position: sticky; bottom: 12px; text-align: center; margin: 20px 0 0; }
.sticky-cta .btn { box-shadow: 0 6px 16px rgba(0,0,0,.2); margin: 0; }
/* cover (first page): the illustration full-bleed, title and buttons set directly on it, no top bar */
body.is-cover { background: #000000; }
body.is-cover .site-header { display: none; }
main.cover-mode.wrap { max-width: none; width: 100%; padding: 0; min-height: 100vh; min-height: 100svh; }
.cover {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; color: #fff; box-sizing: border-box;
  padding: 48px max(20px, env(safe-area-inset-left, 0px));
  background: #000000 url("gates-autumn.webp") center / cover no-repeat;
}
/* dims the bright photo a little so the white title reads clearly; the image file itself is untouched */
.cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, .64) 75%);
}
.cover > * { position: relative; }
.cover h1 {
  font-size: clamp(2.6rem, 10vw, 6rem); color: #fff; margin: 0 0 16px; letter-spacing: -.01em; line-height: 1;
  text-shadow: 0 3px 22px rgba(0, 0, 0, .65), 0 1px 3px rgba(0, 0, 0, .5);
}
.cover h1 span { color: #ffffff; }
.cover-lede { font-size: clamp(1.02rem, 2.4vw, 1.2rem); color: #fff; margin: 22px auto 32px; max-width: 100%; line-height: 1.95; }
@media (min-width: 720px) { .cover-lede { white-space: nowrap; } }
.cover-lede span { color: #fff; font-weight: 500; text-shadow: 0 2px 10px rgba(0, 0, 0, .85), 0 1px 2px rgba(0, 0, 0, .6); }
.cover-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cover-nav .btn { margin: 0; background: #ffffff; color: var(--crimson); border-color: transparent; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.cover-nav .btn:hover { background: #ffffff; color: var(--crimson-dark); }
.cover-nav .btn.secondary { background: #ffffff; color: var(--crimson); border-color: transparent; }
.cover-nav .btn.secondary:hover { background: #fff; color: var(--crimson); }
@media (max-width: 480px) { .cover-nav .btn { flex: 1 1 140px; } }

/* brain teasers: click a question to open it, then reveal the answer */
.bt-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.bt-bar .count { margin: 0; }
.teaser { background: #fff; border: var(--border); border-radius: var(--radius); padding: 0 16px; margin-bottom: 10px; }
.teaser summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 600; line-height: 1.4; display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.teaser summary::-webkit-details-marker { display: none; }
.teaser summary::after { content: "+"; margin-left: auto; padding-left: 8px; color: var(--crimson); font-size: 1.4rem; line-height: 1; }
.teaser[open] summary::after { content: "\2212"; }
.teaser-n { font-family: var(--serif); color: var(--crimson); min-width: 2ch; }
.teaser-body { padding: 0 0 16px; }
.teaser-answer { margin-top: 12px; padding: 12px 14px; border: var(--border); border-radius: var(--radius); white-space: pre-line; line-height: 1.6; }

/* tools */
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.tools-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.tool { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: var(--border); border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); }
.tool strong { color: var(--crimson); font-family: var(--serif); }
.tool span { color: var(--muted); font-size: .85rem; line-height: 1.4; }
.tool:hover { border-color: var(--crimson); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95rem; }
.field input[type=text], .field select, .field textarea {
  width: 100%; padding: 10px 12px; font: inherit; border: var(--border); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 3px rgba(153, 0, 0, .15); }
.answer { white-space: pre-wrap; background: var(--cream); border-radius: 10px; padding: 14px; margin-bottom: 8px; min-height: 60px; }
.checks, .results { list-style: none; padding: 0; margin: 10px 0; }
.checks li { padding: 6px 0 6px 26px; position: relative; font-size: .92rem; }
.checks li::before { position: absolute; left: 0; font-weight: 700; }
.checks li.ok::before { content: "\2713"; color: var(--crimson); }
.checks li.warn::before { content: "!"; color: var(--crimson); }
.opts { display: grid; gap: 8px; margin-top: 10px; }
.opt { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: var(--border); border-radius: 10px; background: var(--cream); cursor: pointer; }
.opt:hover { border-color: var(--crimson); }
.opt:has(input:checked) { border-color: var(--crimson); background: #fff; box-shadow: 0 0 0 2px rgba(153, 0, 0, .12); }
.opt input { accent-color: var(--crimson); width: 18px; height: 18px; flex: none; }
.progress { height: 6px; background: var(--cream-dark); border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress span { display: block; height: 100%; background: var(--crimson); transition: width .2s; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score .num { font: 700 3rem/1 var(--serif); color: var(--crimson); }
.results li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #fff; border: var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.results .pill { flex: none; min-width: 66px; text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; }
.results .bad .pill { background: var(--crimson); color: #fff; }
.results .pill { border: 1px solid currentColor; }
.results .warn .pill { background: #ffffff; color: var(--crimson); }
.results .good .pill, .results .note .pill { background: #ffffff; color: var(--ink); }
.results li > div { min-width: 0; }
.chips a.chip { display: inline-block; }
.mm-q { font: 700 clamp(1.3rem, 4.5vw, 2rem)/1.3 var(--serif); margin: 14px 0; min-height: 2.6em; }
#mm-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mm-input { flex: 1 1 160px; min-width: 0; padding: 12px 14px; font: 600 1.3rem var(--sans); border: 2px solid var(--crimson); border-radius: 10px; background: var(--surface, #fff); color: var(--ink); }
.mm-input:focus { outline: 3px solid rgba(153, 0, 0, .3); outline-offset: 2px; }
.cc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.cc-layout .panel { margin-top: 0; }
.cc-out { position: sticky; top: 76px; }
.cc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-layout .opt { margin-bottom: 4px; }
@media (max-width: 760px) { .cc-layout { grid-template-columns: 1fr; } .cc-out { position: static; } }
.grid.single { grid-template-columns: 1fr; }
.card .template-note { display: block; margin: 12px 0 0; color: var(--ink); -webkit-line-clamp: unset; }
.grid.single .card h3 { font-size: 1.4rem; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 16px; border: var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; text-align: center; margin: 14px 0; }
.drop strong { color: var(--crimson); font-family: var(--serif); font-size: 1.15rem; }
.drop:hover, .drop.over { background: var(--cream-dark); }
.drop:focus-within { outline: 3px solid rgba(153, 0, 0, .35); outline-offset: 2px; }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* polish */
.header-inner { height: auto; min-height: 60px; flex-wrap: wrap; padding-block: 8px; row-gap: 4px; }
nav { display: flex; flex-wrap: wrap; }
.brand { display: inline-block; -webkit-user-drag: none; user-select: text; }
.site-header ::selection, .site-header *::selection { background: #ffffff; color: var(--crimson); }
.brand::before {
  content: ""; display: inline-block; width: 40px; height: 40px; margin-right: 10px; vertical-align: middle;
  border-radius: 8px; background: #fff url("logo.png") center / contain no-repeat;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.hero h1::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 2px; background: var(--crimson); margin-top: 14px; }
.hero { margin-bottom: 8px; }
h1 { text-wrap: balance; }
.card h3 { font-size: 1.15rem; }
.chip { transition: background .12s, border-color .12s; }
.chip:hover { border-color: var(--crimson); }
.chip[aria-pressed="true"]:hover { background: var(--crimson-dark); }
.panel { box-shadow: 0 1px 0 rgba(122, 20, 16, .06); }
.panel.crimson { background: #fff; box-shadow: 0 6px 20px rgba(153, 0, 0, .08); }
.back { font-weight: 500; }
.site-footer p { max-width: 70ch; margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 520px) { nav a { margin-left: 12px; font-size: .92rem; } .brand { font-size: 1.2rem; } .brand::before { width: 34px; height: 34px; } }
