/* didthishelp.com, shared by the three Home page directions. Tokens, type and the rating block follow the app's
   docs/BRAND.md. Brand files in assets/brand and assets/fonts are copied unchanged from the app. */

/* Overpass with the app's metric fix, so capitals sit centred in pills. */
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap; ascent-override: 96%; descent-override: 26%; src: url("fonts/overpass-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Overpass"; font-style: normal; font-weight: 100 900; font-display: swap; ascent-override: 96%; descent-override: 26%; src: url("fonts/overpass-latin-extended.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Overpass Mono"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/overpass-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
	--sans: "Overpass", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "Overpass Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--system: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--asphalt: #282d31;
	--asphalt-2: #3a4047;
	--asphalt-line: #4a5058;
	--on-asphalt: #ffffff;
	--on-asphalt-muted: #c3c9d1;
	--paint: #f3f1e8;
	--road-yellow: #ffd100;
	--lamp-g: #2eaf5b;
	--lamp-a: #f4b223;
	--lamp-r: #ea4738;
	--lamp-ink: #0f1113;
	--housing-outline: #7d848d;

	--page: #f6f7f9;
	--surface: #ffffff;
	--text: #1b1f24;
	--muted: #5b6573;
	--ink: #282d31;
	--on-ink: #ffffff;
	--line: #d5dae1;
	--tint: #eceef2;
	--yes: #1a7f37;
	--mid: #946200;
	--no: #c0392b;
	--yes-tint: #e6f4ea;
	--ok: #1a7f37;
	--on-ok: #ffffff;
	--go: #1a7f37;
	--go-hover: #166c2f;
	--mail-dim: #6b7480;
	--road: #282d31;
	--tile: #ffffff;
	--brake-box: #fcebe9;
	--lamp-rim: #4a5058;

	--gutter: 16px;
	--wrap: 1120px;
	--split-gap: 56px;
	--split-l: calc((100% - var(--split-gap)) * 5 / 11);
	--sec-l: clamp(64px, 9vw, 104px);
	--sec-m: clamp(48px, 7vw, 80px);
	--sec-s: clamp(40px, 5vw, 56px);
	color-scheme: light;
}
/* Dark tokens live twice, once for the system setting and once for the visitor's choice. Keep both blocks identical. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--page: #14171a;
		--surface: #1c2025;
		--text: #e8eaed;
		--muted: #a0a8b3;
		--ink: #e6e9ed;
		--on-ink: #14171b;
		--line: #353b43;
		--tint: #23282e;
		--yes: #56c271;
		--mid: #e3b341;
		--no: #f47067;
		--yes-tint: #1a2e22;
		--ok: #2eaf5b;
		--on-ok: #14171a;
		--go: #238636;
		--go-hover: #1a7f37;
		--mail-dim: #8b94a0;
		--road: #3a4047;
		--tile: #14171a;
		--brake-box: #321b1a;
		--lamp-rim: #7d848d;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--page: #14171a;
	--surface: #1c2025;
	--text: #e8eaed;
	--muted: #a0a8b3;
	--ink: #e6e9ed;
	--on-ink: #14171b;
	--line: #353b43;
	--tint: #23282e;
	--yes: #56c271;
	--mid: #e3b341;
	--no: #f47067;
	--yes-tint: #1a2e22;
	--ok: #2eaf5b;
	--on-ok: #14171a;
	--go: #238636;
	--go-hover: #1a7f37;
	--mail-dim: #8b94a0;
	--road: #3a4047;
	--tile: #14171a;
	--brake-box: #321b1a;
	--lamp-rim: #7d848d;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font: 17px/1.55 var(--sans); overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--ink); text-underline-offset: 0.18em; }
.icon { width: 1em; height: 1em; flex: none; }
.wrap { width: min(100% - var(--gutter) * 2, var(--wrap)); margin-inline: auto; }
.muted { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Top bar */
.top { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand img { width: 56px; height: 23px; }
.brand .for-dark { display: none; }
.top nav { display: flex; gap: 20px; font-size: 15px; }
.top nav a { color: var(--text); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
@media (max-width: 719px) { .top nav { display: none; } }
@media (max-width: 479px) { .top { gap: 8px; } .top > .btn { display: none; } .theme button { width: 28px; height: 28px; } }

/* Buttons are pills at a normal height. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; background: var(--go); color: #ffffff; font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--go-hover); }
.btn.small { min-height: 36px; padding: 0 14px; gap: 0; font-size: 14px; }
.btn.quiet { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.quiet:hover { background: var(--tint); }

/* System, Light, Dark */
.theme { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--tint); color: var(--text); }
.no-js .theme { display: none; }

/* Our logo on a dark surface takes the outlined file. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .brand .for-light { display: none; }
	:root:not([data-theme="light"]) .brand .for-dark { display: block; }
}
:root[data-theme="dark"] .brand .for-light { display: none; }
:root[data-theme="dark"] .brand .for-dark { display: block; }
.on-asphalt .brand .for-light { display: none; }
.on-asphalt .brand .for-dark { display: block; }

/* The three answers: the logo's housing and lamps as image files, sized from the logo's own drawing (see the app's
   answers.css). Labels sit outside the housing. */
.opts {
	--lamp: 72px;
	--u: calc(var(--lamp) / 40.98);
	--ans-label: var(--muted);
	--ans-ink: var(--text);
	position: relative;
	isolation: isolate;
	list-style: none;
	margin: 0;
	padding: 0 0 0 calc(var(--u) * 9.6);
	width: calc(var(--u) * 163.54);
	max-width: 100%;
	display: grid;
	grid-template-columns: repeat(3, calc(var(--u) * 47.26));
}
/* --ho is 1 where the housing wears its outline (dark surfaces): the outlined file has one unit of room all round. The
   outline is in the image file, not a CSS filter, so it cannot go missing on first paint. */
.opts::before { content: ""; position: absolute; z-index: -1; left: calc(var(--u) * var(--ho, 0) * -1); top: calc(var(--u) * var(--ho, 0) * -1); width: calc(var(--u) * (163.54 + 2 * var(--ho, 0))); height: calc(var(--u) * (64.4 + 2 * var(--ho, 0))); background: url(brand/housing.svg) 0 0 / 100% 100% no-repeat; }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .opts { --ho: 1; }
	:root:not([data-theme="light"]) .opts::before { background-image: url(brand/housing-outlined.svg); }
}
:root[data-theme="dark"] .opts { --ho: 1; }
:root[data-theme="dark"] .opts::before { background-image: url(brand/housing-outlined.svg); }
.opts li { margin: 0; padding: 0; min-width: 0; }
.opts .opt { display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 12.11 + 8px); height: 100%; padding: calc(var(--u) * 11.31) 0 4px; color: var(--ans-label); font-size: 15px; font-weight: 400; line-height: 1.25; text-align: center; text-decoration: none; }
.opts .lamp { position: relative; display: block; width: var(--lamp); height: var(--lamp); flex: none; border-radius: 50%; }
.opts .lamp::before { content: ""; position: absolute; inset: 0; background: center / contain no-repeat; opacity: .4; }
.opts [data-v="1"] .lamp::before { background-image: url(brand/lamp-green.svg); }
.opts [data-v="2"] .lamp::before { background-image: url(brand/lamp-amber.svg); }
.opts [data-v="3"] .lamp::before { background-image: url(brand/lamp-red.svg); }
.opts .opt.sel, .opts li:target .opt { color: var(--ans-ink); font-weight: 600; }
.opts .opt.sel .lamp::before, .opts li:target .lamp::before { opacity: 1; }
@media (hover: hover) {
	.opts a.opt:hover { color: var(--ans-ink); }
	.opts a.opt:hover .lamp::before { opacity: 1; }
}
.opts a.opt:focus-visible { outline: none; color: var(--ans-ink); text-decoration: underline; }
.opts a.opt:focus-visible .lamp { outline: 3px solid #ffffff; outline-offset: -1px; }
.opts a.opt:focus-visible .lamp::before { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
	.opts .lamp::before { transition: opacity .15s ease; }
	/* A chosen lamp warms up before it lights, the way a bulb does. */
	.opts .opt.warm .lamp::before { animation: warm .5s ease-out both; }
}
@keyframes warm { 0% { opacity: .4; } 30% { opacity: .68; } 48% { opacity: .56; } 100% { opacity: 1; } }
.opts.on-dark, .on-asphalt .opts { --ans-label: #c3c9d1; --ans-ink: #ffffff; }
.on-asphalt .opts { --ho: 1; }
:root .on-asphalt .opts::before { background-image: url(brand/housing-outlined.svg); }

/* What follows a click: the saved mark and one plain line per answer. */
.after { display: grid; justify-items: center; gap: 4px; text-align: center; }
.saved-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 50%; color: transparent; }
.saved-mark .icon { width: 22px; height: 22px; stroke-width: 3; }
.msg { display: none; }
.msg strong { display: block; font-weight: 600; }
.msg span { display: block; color: var(--muted); font-size: 15px; }
.rate[data-answer="0"] .m0, .rate[data-answer="1"] .m1, .rate[data-answer="2"] .m2, .rate[data-answer="3"] .m3 { display: block; }
.rate[data-answer="0"] .saved-mark { display: none; }
.no-js .rate:has(li:target) .saved-mark { display: grid; }
.rate:not([data-answer="0"]) .saved-mark { border-color: var(--ok); background: var(--ok); color: var(--on-ok); }
/* With no script the links are plain anchors and :target shows the same state. */
.no-js .rate:has(#yes:target) .m0, .no-js .rate:has(#somewhat:target) .m0, .no-js .rate:has(#no:target) .m0 { display: none; }
.no-js .rate:has(#yes:target) .m1, .no-js .rate:has(#somewhat:target) .m2, .no-js .rate:has(#no:target) .m3 { display: block; }
.no-js .rate:has(li:target) .saved-mark { border-color: var(--ok); background: var(--ok); color: var(--on-ok); }
@media (prefers-reduced-motion: no-preference) {
	.rate.pop .saved-mark { animation: mark-pop .4s cubic-bezier(.2, .9, .3, 1.25) both; }
	.rate.pop .saved-mark path { stroke-dasharray: 23; animation: mark-draw .3s .22s ease-out both; }
}
@keyframes mark-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes mark-draw { from { stroke-dashoffset: 23; } to { stroke-dashoffset: 0; } }
.on-asphalt .saved-mark { border-color: var(--asphalt-line); }
.on-asphalt .rate:not([data-answer="0"]) .saved-mark { border-color: var(--lamp-g); background: var(--lamp-g); color: #14171a; }
.on-asphalt .msg span { color: var(--on-asphalt-muted); }

/* Answer marker: a lamp image on a housing disc, with its word beside it. */
.mk { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.mk::before { content: ""; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--asphalt) center / 14px 14px no-repeat; }
.mk.y { color: var(--yes); } .mk.y::before { background-image: url(brand/lamp-green.svg); }
.mk.s { color: var(--mid); } .mk.s::before { background-image: url(brand/lamp-amber.svg); }
.mk.n { color: var(--no); } .mk.n::before { background-image: url(brand/lamp-red.svg); }

/* Sections: three paddings, two heavy heading sizes, a lead that is visibly larger than body. */
.sec { padding-block: var(--sec-m); }
.sec.l { padding-block: var(--sec-l); }
.sec.s { padding-block: var(--sec-s); }
.sec h2 { max-width: 18em; font-size: clamp(27px, 3.2vw, 38px); font-weight: 800; line-height: 1.1; letter-spacing: -0.012em; }
.lead { max-width: 30em; margin-top: 16px; font-size: 19px; line-height: 1.5; color: var(--text); }
.note { max-width: 40em; font-size: 14px; line-height: 1.45; color: var(--muted); }
code, .code { font-family: var(--mono); font-size: 13px; }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
@media (min-width: 480px) { :root { --gutter: 24px; } }
@media (max-width: 479px) { .lead { font-size: 17px; } }

/* Bar at the foot of each direction, so they can be compared. */
.dir-foot { padding: 20px 0 28px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.dir-foot .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; }
