/*
Theme Name: Smidgen Gate
Version: 1.0.0
Description: The theme of Smidgen: a charcoal console, a chrome shift gate and an ivory knob.
Author: Smidgen
Text Domain: smidgen-gate
License: GPL-2.0-or-later
Fonts: Unbounded and Readex Pro, SIL Open Font License 1.1 (assets/fonts).
*/


@font-face {
	font-family: "Unbounded";
	src: url("assets/fonts/unbounded-var.woff2") format("woff2");
	font-weight: 200 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Readex Pro";
	src: url("assets/fonts/readexpro-var.woff2") format("woff2");
	font-weight: 160 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--vinyl: #1d2024;
	--strip: #181a1e;
	--raised: #2a2e33;
	--raised-hi: #31363c;
	--socket: #15171a;
	--chrome: #c0c4c8;
	--chrome-dim: #7d848c;
	--hairline: #4a5057;
	--ivory: #f1ede4;
	--ivory-shade: #d8d2c4;
	--text: #eef0f2;
	--muted: #a9afb6;

	--display: "Unbounded", "Trebuchet MS", sans-serif;
	--reading: "Readex Pro", "Segoe UI", system-ui, sans-serif;

	--step--1: 0.875rem;
	--step-0: 1.125rem;
	--step-1: 1.3125rem;
	--step-2: 1.625rem;
	--step-3: 2.125rem;

	--gutter: clamp(1rem, 4vw, 2.5rem);
	--wide: 74rem;
	--measure: 40rem;
	--corner: 6px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--vinyl);
	color: var(--text);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--reading);
	font-size: var(--step-0);
	line-height: 1.6;
	font-weight: 360;
	background: var(--vinyl);
	color: var(--text);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--ivory);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--chrome-dim);
}

a:hover {
	text-decoration-color: var(--ivory);
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 3px solid var(--ivory);
	outline-offset: 3px;
	border-radius: 2px;
}

h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.012em;
	color: var(--ivory);
	margin: 0 0 0.6em;
	text-wrap: balance;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p {
	margin: 0 0 1em;
}

.skip-to {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--ivory);
	color: var(--socket);
	padding: 0.5rem 1rem;
	z-index: 20;
}

.skip-to:focus {
	left: 1rem;
	top: 1rem;
}

.bezel {
	width: 100%;
	max-width: var(--wide);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Header strip */

.dash-strip {
	background: var(--strip);
	border-bottom: 1px solid var(--hairline);
}

.dash-strip .bezel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 4rem;
}

.brand-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.brand-link img {
	display: block;
	height: clamp(1.7rem, 1.2rem + 2.2vw, 2.1rem);
	width: auto;
}

.trim ul {
	list-style: none;
	display: flex;
	gap: clamp(0.75rem, 3vw, 2rem);
	margin: 0;
	padding: 0;
}

.trim a {
	display: inline-block;
	padding-block: 0.6rem;
	font-weight: 500;
	font-size: 1rem;
	letter-spacing: 0.01em;
	text-decoration-color: var(--hairline);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.45em;
}

.trim .current-menu-item > a,
.trim a[aria-current] {
	text-decoration-color: var(--chrome);
	text-decoration-thickness: 2px;
}

main {
	flex: 1 0 auto;
}

/* Console panels */

.console {
	position: relative;
	background: var(--raised);
	border-radius: var(--corner);
	border-top: 1px solid var(--chrome-dim);
	padding: clamp(1.25rem, 4vw, 2.5rem);
}

.console + .console,
.console + .bay,
.bay + .console {
	margin-top: clamp(1.25rem, 3vw, 2rem);
}

/* The gate plate drawing */

.plate-drawing {
	display: block;
	width: 100%;
	height: auto;
}

.plate-drawing .plate-knob {
	animation: knob-settle 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

@keyframes knob-settle {
	0% { transform: translate(60px, 80px); }
	45% { transform: translate(0, 80px); }
	100% { transform: translate(0, 0); }
}

/* Home */

.plate-hero {
	padding-block: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
}

.plate-hero .bezel {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: center;
}

.plate-figure {
	max-width: 15rem;
}

@media (min-width: 52rem) {
	.plate-figure {
		max-width: 26rem;
	}
}

.plate-hero h1 {
	font-size: clamp(2rem, 1.1rem + 3.6vw, 3.9rem);
	line-height: 1.08;
	font-weight: 600;
	margin: 0 0 0.5em;
}

.plate-hero p {
	color: var(--muted);
	max-width: 30rem;
	margin: 0;
}

@media (min-width: 52rem) {
	.plate-hero .bezel {
		grid-template-columns: minmax(16rem, 5fr) 7fr;
	}
}

.console-deck {
	padding-bottom: clamp(2rem, 6vw, 4rem);
}

.lever-card {
	display: grid;
	gap: 1.25rem;
	align-items: center;
}

.lever-card h2 {
	font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem);
	margin: 0 0 0.4em;
}

.lever-card h2 a {
	text-decoration: none;
	color: var(--ivory);
}

.lever-card h2 a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--corner);
}

.lever-card h2 a:focus-visible {
	outline: none;
}

.lever-card:has(h2 a:focus-visible) {
	outline: 3px solid var(--ivory);
	outline-offset: 3px;
}

.lever-card p {
	color: var(--muted);
	margin: 0;
	max-width: 36rem;
}

.lever-card .lever {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	min-height: 3rem;
	padding: 0.5rem 1.25rem 0.5rem 0.6rem;
	border: 1px solid var(--chrome-dim);
	border-radius: 999px;
	font-weight: 500;
	color: var(--ivory);
}

.lever .socket-dot {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--ivory);
	box-shadow: inset 0 -3px 0 var(--ivory-shade), 0 0 0 2px var(--socket);
}

@media (min-width: 52rem) {
	.lever-card {
		grid-template-columns: 1fr auto;
		column-gap: 3rem;
	}
}

.lever-card:hover {
	background: var(--raised-hi);
}

.copy-plate {
	max-width: var(--measure);
}

.copy-plate h2 {
	font-size: var(--step-1);
	margin-top: 1.8em;
}

.copy-plate h3 {
	font-size: 1.125rem;
	margin-top: 1.6em;
}

.copy-plate ul,
.copy-plate ol {
	padding-left: 1.25em;
	margin: 0 0 1em;
}

.copy-plate li + li {
	margin-top: 0.35em;
}

.copy-plate li::marker {
	color: var(--chrome);
}

.copy-plate strong {
	font-weight: 600;
	color: var(--ivory);
}

.copy-plate > :first-child {
	margin-top: 0;
}

.copy-plate > :last-child {
	margin-bottom: 0;
}

.copy-plate table {
	border-collapse: collapse;
	width: 100%;
	font-size: 1rem;
}

.copy-plate th,
.copy-plate td {
	text-align: left;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--hairline);
	vertical-align: top;
}

.copy-plate th {
	color: var(--ivory);
	font-weight: 600;
	border-bottom-color: var(--chrome-dim);
}

.copy-plate aside,
.copy-plate blockquote {
	margin: 1.5em 0;
	padding: 1rem 1.25rem;
	border-left: 2px solid var(--chrome);
	background: var(--socket);
	border-radius: 0 var(--corner) var(--corner) 0;
}

.copy-plate code {
	font-size: 0.9em;
	background: var(--socket);
	padding: 0.1em 0.35em;
	border-radius: 3px;
}

/* Advertising: plain bays, apart from the console */

.bay {
	background: transparent;
	border: 1px dashed var(--hairline);
	border-radius: var(--corner);
	padding: 0.75rem;
}

.bay-end {
	margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.gate {
	display: block;
	width: 100%;
	margin: 0;
}

.gate-plate {
	display: block;
	font-size: 0.8125rem;
	letter-spacing: 0.02em;
	color: var(--muted);
	margin: 0 0 0.5rem;
}

.bay .gate > iframe {
	max-width: 100%;
	border: 0;
	margin: 0 auto;
	display: block;
	background: var(--socket);
}

/* Page heads with their small gate */

.trim-head {
	padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 1.75rem);
}

.trim-head .bezel {
	display: flex;
	align-items: flex-start;
	gap: clamp(1rem, 3vw, 1.75rem);
}

.trim-head .mini-gate {
	flex: 0 0 auto;
	width: clamp(3rem, 8vw, 4.25rem);
}

.trim-head h1 {
	margin: 0.1em 0 0.3em;
	font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
	overflow-wrap: break-word;
}

.trim-head p {
	color: var(--muted);
	margin: 0;
	max-width: 36rem;
}

.trim-body {
	padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

/* Archive */

.niche-plate {
	margin-top: clamp(2rem, 5vw, 3.5rem);
	display: flex;
	gap: clamp(1rem, 3vw, 2rem);
	align-items: center;
}

.niche-plate .mini-gate {
	flex: 0 0 auto;
	width: clamp(3.5rem, 9vw, 5rem);
}

.niche-plate h1 {
	margin: 0 0 0.3em;
	font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
}

.niche-plate p {
	margin: 0;
	color: var(--muted);
	max-width: 36rem;
}

.knob-list {
	list-style: none;
	margin: clamp(1.25rem, 3vw, 2rem) 0 0;
	padding: 0;
	display: grid;
	gap: clamp(1rem, 2.5vw, 1.5rem);
}

.gear-pager {
	margin-top: 2rem;
	display: flex;
	gap: 1.5rem;
}

/* Footer footwell */

.footwell {
	background: var(--strip);
	border-top: 1px solid var(--chrome-dim);
	padding-block: clamp(1.75rem, 5vw, 2.75rem) clamp(2rem, 5vw, 3rem);
	font-size: 0.9375rem;
	color: var(--muted);
}

.footwell .bezel {
	display: grid;
	gap: 1.25rem;
}

.footwell-id {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.footwell-id img {
	width: 2.75rem;
	height: 2.75rem;
	flex: 0 0 auto;
}

.footwell-id strong {
	display: block;
	font-family: var(--display);
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--ivory);
}

.footwell p {
	margin: 0;
}

.footwell ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.4rem;
}

.footwell ul a {
	display: inline-block;
	padding-block: 0.3rem;
}

/* wide windows: the cookie notice is one short line, so less room is kept for it */
/* room under the footer only while the cookie notice is open */
body:has(.gaiter) .footwell {
	padding-bottom: 10.5rem;
}

@media (min-width: 48.0625rem) {
	body:has(.gaiter) .footwell {
		padding-bottom: 6rem;
	}
}

@media (min-width: 52rem) {
	.footwell .bezel {
		grid-template-columns: auto 1fr;
		align-items: start;
		column-gap: 3rem;
	}

	.footwell .footwell-links {
		grid-column: 1 / -1;
	}
}

/* The question screen */

.shift-screen {
	min-height: 100vh;
	min-height: 100svh;
}

.shift-screen .bezel {
	max-width: 64rem;
}

.shift-top {
	padding-block: 1rem 0;
}

.shift-top .brand-link img {
	height: 1.6rem;
	width: auto;
}

.shift-screen main {
	display: flex;
	align-items: center;
	padding-block: clamp(1.25rem, 5vh, 3.5rem);
}

.shift-screen .entry-content > :not(.selector) {
	max-width: var(--measure);
	color: var(--muted);
}

.shift-screen .selector {
	--rail: 2.2rem;
	--row-gap: 1rem;
	--col-gap: 1.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.shift-screen .selector legend {
	float: left;
	width: 100%;
	padding: 0;
	margin: 0 0 0.55em;
	font-family: var(--display);
	font-weight: 600;
	font-size: clamp(1.7rem, 1rem + 3.1vw, 3.25rem);
	line-height: 1.12;
	letter-spacing: -0.015em;
	color: var(--ivory);
	text-wrap: balance;
}

.shift-screen .selector legend + * {
	clear: left;
}

.shift-screen #selector-description {
	color: var(--muted);
	margin: 0 0 1.25rem;
	max-width: 36rem;
}

/* The answer rows sit in the gate: one rail on phones, the H on wide screens. */

.shift-screen .selector > p:has(> button) {
	position: relative;
	margin: 0;
	padding-block: calc(var(--row-gap) / 2);
}

.shift-screen .selector button {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 4.5rem;
	margin: 0;
	padding: 0.85rem 1.25rem 0.85rem calc(var(--rail) + 2.4rem);
	font: inherit;
	font-weight: 560;
	font-size: 1.25rem;
	line-height: 1.25;
	text-align: left;
	color: var(--ivory);
	background-color: var(--raised);
	background-image: linear-gradient(105deg, transparent 38%, rgba(192, 196, 200, 0.16) 50%, transparent 62%);
	background-size: 260% 100%;
	background-position: 140% 0;
	background-repeat: no-repeat;
	border: 0;
	border-top: 1px solid var(--chrome-dim);
	border-radius: var(--corner);
	cursor: pointer;
	touch-action: manipulation;
	animation: chrome-glint 8s ease-in-out 2.5s 3 both;
}

.shift-screen .selector > p:nth-child(2 of :has(> button)) button { animation-delay: 3.1s; }
.shift-screen .selector > p:nth-child(3 of :has(> button)) button { animation-delay: 3.7s; }
.shift-screen .selector > p:nth-child(4 of :has(> button)) button { animation-delay: 4.3s; }

@keyframes chrome-glint {
	0% { background-position: 140% 0; }
	16% { background-position: -40% 0; }
	100% { background-position: -40% 0; }
}

/* the rail through every socket */
.shift-screen .selector button::after {
	content: "";
	position: absolute;
	left: calc(var(--rail) - 1.5px);
	top: calc(var(--row-gap) / -2 - 1px);
	bottom: calc(var(--row-gap) / -2 - 1px);
	width: 3px;
	background: var(--chrome);
	pointer-events: none;
}

.shift-screen .selector > p:nth-child(1 of :has(> button)) button::after {
	top: 50%;
}

.shift-screen .selector > p:nth-last-child(1 of :has(> button)) button::after {
	bottom: 50%;
}

/* the empty socket, and the knob it receives */
.shift-screen .selector button::before {
	content: "";
	position: absolute;
	z-index: 1;
	left: calc(var(--rail) - 0.85rem);
	top: 50%;
	width: 1.7rem;
	height: 1.7rem;
	margin-top: -0.85rem;
	border-radius: 50%;
	background: var(--socket);
	box-shadow: inset 0 0 0 2px var(--chrome);
}

.shift-screen .selector button:hover {
	background-color: var(--raised-hi);
}

.shift-screen .selector button:hover::before {
	box-shadow: inset 0 0 0 2px var(--ivory);
}

.shift-screen .selector button:focus-visible {
	outline: 3px solid var(--ivory);
	outline-offset: 3px;
}

.shift-screen .selector button[aria-busy="true"]::before {
	background: var(--ivory);
	box-shadow: inset 0 -3px 0 var(--ivory-shade), 0 0 0 2px var(--socket);
	animation: knob-travel 0.9s ease-in-out infinite alternate;
}

@keyframes knob-travel {
	from { transform: translateY(-0.4rem); }
	to { transform: translateY(0.4rem); }
}

.shift-screen .selector button:disabled {
	cursor: progress;
}

.shift-screen .selector button:disabled:not([aria-busy="true"]) {
	color: var(--muted);
}

.shift-screen .selector [role="status"] {
	min-height: 1.6em;
	margin: 0.75rem 0 0;
	color: var(--muted);
	font-size: 1rem;
}

@media (min-width: 44rem) {
	.shift-screen .selector {
		--row-gap: 1.25rem;
	}

	.shift-screen .selector:is(:has(> #selector-description):has(> :nth-child(6)), :not(:has(> #selector-description)):has(> :nth-child(5))) {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: var(--col-gap);
	}

	:where(.shift-screen .selector:is(:has(> #selector-description):has(> :nth-child(6)), :not(:has(> #selector-description)):has(> :nth-child(5)))) > * {
		grid-column: 1 / -1;
	}

	/* answers fill the H in reading order: the top row first, then the row below */
	.shift-screen .selector > p:has(> button) {
		grid-column: auto;
	}

	/* the top row's rails run down to the crossbar; the lower row's rails start there */
	.shift-screen .selector:is(:has(> #selector-description):has(> :nth-child(6)), :not(:has(> #selector-description)):has(> :nth-child(5))) > p:nth-child(2 of :has(> button)) button::after {
		top: 50%;
	}

	.shift-screen .selector:is(:has(> #selector-description):has(> :nth-child(6)), :not(:has(> #selector-description)):has(> :nth-child(5))) > p:nth-child(3 of :has(> button)) button::after {
		bottom: 50%;
	}

	/* the crossbar joins the two rails between the rows */
	.shift-screen .selector:is(:has(> #selector-description):has(> :nth-child(6)), :not(:has(> #selector-description)):has(> :nth-child(5))) > p:nth-child(3 of :has(> button))::before {
		content: "";
		position: absolute;
		top: -1.5px;
		left: calc(var(--rail) - 1.5px);
		width: calc(100% + var(--col-gap) + 3px);
		height: 3px;
		background: var(--chrome);
		pointer-events: none;
	}

	.shift-screen .selector:not(:has(> :nth-child(5))) > p:has(> button),
	.shift-screen .selector:has(> #selector-description):not(:has(> :nth-child(6))) > p:has(> button) {
		max-width: 31rem;
	}
}

.shift-foot {
	padding-block: 1rem 1.5rem;
	border-top: 1px solid var(--hairline);
	font-size: 0.875rem;
	color: var(--muted);
}

.shift-foot .bezel {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	align-items: baseline;
}

.shift-foot p {
	margin: 0;
}

.shift-foot ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0;
	padding: 0;
}

.shift-foot a {
	display: inline-block;
	padding-block: 0.25rem;
}

/* Cookies page: the choice sits in a recessed socket panel */

.copy-plate .selector {
	margin: 1.25rem 0 1.5rem;
	padding: 1.25rem;
	background: var(--socket);
	border-radius: var(--corner);
	border-top: 1px solid var(--chrome-dim);
}

.copy-plate .selector p {
	margin: 0 0 0.75rem;
}

.copy-plate .selector .detent {
	min-height: 1.5em;
	color: var(--muted);
	font-size: 0.9375rem;
}

.copy-plate .selector button {
	margin: 0.25rem 0.5rem 0 0;
}

/* Measurement notice: a quiet strip */

.gaiter {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 30;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding: 0.6rem var(--gutter);
	background: var(--raised);
	border-top: 1px solid var(--chrome-dim);
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--text);
}

.gaiter p {
	margin: 0;
	flex: 1 1 22rem;
}

.gaiter button,
.copy-plate .selector button {
	min-height: 2.75rem;
	min-width: 6.5rem;
	padding: 0.4rem 1rem;
	font: inherit;
	font-weight: 500;
	color: var(--ivory);
	background: var(--socket);
	border: 1px solid var(--chrome-dim);
	border-radius: var(--corner);
	cursor: pointer;
}

.gaiter button:hover {
	border-color: var(--ivory);
}

/* below tablet width the notice takes its own line and both buttons share the next one */
@media (max-width: 48rem) {
	.gaiter p {
		flex-basis: 100%;
	}
}

@media (max-width: 30rem) {
	.gaiter {
		gap: 0.4rem 0.6rem;
		padding-block: 0.5rem;
		font-size: 0.8125rem;
	}

	.gaiter button {
		flex: 1 1 0;
	}
}


/* Home console-deck, crew-line, search */

.console-cards {
	display: grid;
	gap: clamp(1rem, 2.5vw, 1.5rem);
}

.console-cards + .console {
	margin-top: clamp(1.25rem, 3vw, 2rem);
}

.crew-niche {
	margin: 0 0 0.4rem;
	font-size: 0.9375rem;
	font-weight: 500;
}

.crew-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1rem;
	margin-top: 1rem !important;
	font-size: 0.9375rem;
}

.crew-line img {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 4px;
}

.lead-figure {
	margin: 0 0 1.5rem;
}

.lead-figure img {
	display: block;
	width: 100%;
	border-radius: var(--corner);
}

.seek {
	margin: 0 0 clamp(1.25rem, 3vw, 2rem);
	max-width: 34rem;
}

.seek label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.9375rem;
	color: var(--muted);
}

.seek-row {
	display: flex;
	gap: 0.6rem;
}

.seek input {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 2.9rem;
	padding: 0.4rem 0.8rem;
	font: inherit;
	color: var(--text);
	background: var(--socket);
	border: 1px solid var(--chrome-dim);
	border-radius: var(--corner);
}

.seek button {
	min-height: 2.9rem;
	padding: 0.4rem 1.1rem;
	font: inherit;
	font-weight: 500;
	color: var(--socket);
	background: var(--ivory);
	border: 0;
	border-radius: var(--corner);
	cursor: pointer;
}

.console .seek {
	margin-top: 1.25rem;
	margin-bottom: 0;
}

/* Still hands: no knob slide, no glint, no travel */
@media (prefers-reduced-motion: reduce) {
	.plate-drawing .plate-knob,
	.shift-screen .selector button,
	.shift-screen .selector button[aria-busy="true"]::before {
		animation: none;
	}
}
