/* Both/And Games. Two halves, one page: the edge between them is the slash. */

@font-face {
	font-family: "Varela Round";
	src: url("/fonts/VarelaRound-Regular.ttf") format("truetype");
	font-display: swap;
}

:root {
	--night: #1b1d26;
	--day: #e6e8f0;
	--teal: #4ecdc4;
	--tealOnDay: #236660;
	--mutedOnNight: #a3a8bd;
	--mutedOnDay: #4c5166;
	--lean: 15deg;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
	margin: 0;
	font-family: "Varela Round", "Nunito", "Trebuchet MS", system-ui, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
}

a { color: inherit; text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; }
a:focus-visible { outline: 0.15em solid currentColor; outline-offset: 0.2em; border-radius: 0.15em; }

/* ---------- Landing ---------- */

.landing { background: var(--night); }

/* The split and the words are drawn in the same box, so the edge always
   passes through the centre the words are laid out around. A background
   fixed to the screen does not: on a phone the screen's centre moves when
   the address bar shows or hides, and the edge slid off the words. */
.stage {
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	place-items: center;
	overflow: hidden;
	color: var(--day);
	/* The boundary runs through the centre of the box, leaning like a slash. */
	background: linear-gradient(calc(90deg + var(--lean)), var(--night) 50%, var(--day) 50%);
}

/* Skewing the rows and unskewing each cell keeps the letters upright while
   every row follows the slanted edge. */
.rows {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: clamp(1.1rem, 5vw, 2.4rem);
	row-gap: 0;
	transform: skewX(calc(-1 * var(--lean)));
}

.rows > * { transform: skewX(var(--lean)); margin: 0; white-space: nowrap; }
.night { justify-self: end; text-align: right; color: var(--day); }
.day { justify-self: start; text-align: left; color: var(--night); }

.word {
	font-size: clamp(2.5rem, 13vw, 7.5rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	/* By eye: the h stands off its side of the edge and the A's foot reaches
	   toward it, so the pair sits a touch right to even the two gaps. */
	position: relative;
	left: 0.04em;
}

.small {
	font-size: clamp(0.82rem, 3.6vw, 1.15rem);
	/* A margin, not padding: each cell is set upright about the centre of
	   its own box, and padding above the words put that centre above them,
	   which slid the words sideways off the edge. */
	margin-top: 1.5em;
}
.night.small { color: var(--mutedOnNight); }
.day.small { color: var(--mutedOnDay); }
.night.small a { color: var(--teal); }
.day.small a { color: var(--tealOnDay); }
.small + .small + .small, .small + .small + .small + .small { margin-top: 0.5em; }

.visuallyHidden {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Reading pages ---------- */

.reading { background: var(--day); color: var(--night); }

.masthead {
	background: var(--night);
	color: var(--day);
	padding: 1.6rem 1.25rem 3.4rem;
	/* The same lean, as the bottom edge of the header. */
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.4rem), 0 100%);
}
.masthead a { text-decoration: none; font-size: 1.35rem; }
.masthead .slash { color: var(--teal); }

.column { max-width: 34rem; margin: 0 auto; }

main.column { padding: 1.2rem 1.25rem 4rem; }

h1 { font-size: clamp(2rem, 8vw, 2.9rem); line-height: 1.1; margin: 0 0 0.3em; font-weight: normal; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.2em 0 0.4em; font-weight: normal; color: var(--tealOnDay); }
p, ul { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
li { margin-bottom: 0.35em; }
.updated { color: var(--mutedOnDay); }
.plain {
	font-size: 1.3rem; line-height: 1.4;
	border-left: 0.3rem solid var(--teal);
	padding-left: 0.9rem; margin: 1.6rem 0;
}
main a { color: var(--tealOnDay); }
