/* GCSE Theory landing page. Colours and fonts match the apps (ios/GCSETheory/Theme.swift). */

@font-face {
	font-family: "Atkinson Hyperlegible Next";
	src: url("/fonts/AtkinsonHyperlegibleNext.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

@font-face {
	font-family: "Atkinson Hyperlegible Mono";
	src: url("/fonts/AtkinsonHyperlegibleMono.woff2") format("woff2");
	font-weight: 200 800;
	font-display: swap;
}

:root {
	--night: #1C2340;
	--night2: #283156;
	--ghost: #49537F;
	--paper: #F5F7FB;
	--white: #FFFFFF;
	--ink: #1C2340;
	--muted: #5A617E;
	--line: #DCE1EC;
	--board: #E6E9F1;
	--highlight: #FFE45C;
	--right: #1B7550;
	--right-tint: #E6F6EF;
	--wrong: #B93C1A;
	--wrong-tint: #FDEDE8;
	--wrong-text: #9A3412;
	--explain: #39405C;
	--soft: #AEB5D3;
	--pale: #C3C9E3;
	--conf-text: #DDE2F5;
	--sans: "Atkinson Hyperlegible Next", system-ui, sans-serif;
	--mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
	--wrap: 72rem;
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.6;
}

h1,
h2,
h3,
p,
ol,
ul {
	margin: 0;
}

ol,
ul {
	padding: 0;
	list-style: none;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

button:disabled {
	cursor: default;
}

a {
	color: inherit;
	text-underline-offset: 0.2em;
}

/* Two rings, so focus shows on the navy and the paper backgrounds alike. */
:focus-visible {
	outline: 3px solid var(--night);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--highlight);
}

/* The highlighter the apps draw behind key terms. */
mark {
	background: linear-gradient(transparent 10%, var(--highlight) 10%, var(--highlight) 90%, transparent 90%);
	color: var(--ink);
	padding: 0 0.12em;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

code {
	font-family: var(--mono);
	font-weight: 500;
	font-size: 0.95em;
}

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 10;
	padding: 0.6rem 1rem;
	border-radius: 0.75rem;
	background: var(--highlight);
	color: var(--ink);
	font-weight: 700;
}

.skip:focus {
	top: 1rem;
}

/* Header */

.top {
	background: var(--night);
	color: var(--white);
}

.top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	text-decoration: none;
	font-weight: 800;
	font-size: 1.25rem;
	letter-spacing: -0.01em;
}

.brand-mark {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.7rem;
	background: var(--highlight);
	color: var(--ink);
	font-family: var(--mono);
	font-weight: 800;
	font-size: 1rem;
}

/* Hero */

.hero {
	background: var(--night);
	color: var(--white);
	padding: 2.5rem 0 5rem;
	overflow: hidden;
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	gap: 4rem;
	align-items: start;
}

.eyebrow {
	font-family: var(--mono);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--highlight);
	letter-spacing: 0.02em;
	margin-bottom: 1.25rem;
}

h1 {
	font-size: clamp(2.4rem, 5.2vw, 4.1rem);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.lede {
	margin-top: 1.5rem;
	max-width: 34rem;
	font-size: 1.2rem;
	color: var(--conf-text);
}

.courses-short {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 2rem;
}

.courses-short li {
	padding: 0.45rem 0.9rem;
	border: 2px solid var(--ghost);
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.95rem;
}

.stores {
	margin-top: 1.5rem;
	color: var(--soft);
}

/* The try-a-card panel. The two shapes behind the card are the next cards in the feed. */

.try {
	position: relative;
	z-index: 0;
	padding-top: 0.5rem;
}

.try-label {
	font-family: var(--mono);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--soft);
	margin-bottom: 0.9rem;
}

.card {
	position: relative;
	background: var(--white);
	color: var(--ink);
	border-radius: 1.75rem;
	padding: 1.5rem;
	box-shadow: 0 1.5rem 3rem rgb(8 12 30 / 0.35);
}

/* Kept fully below the card, so they never cover it while it moves. */
.card::before,
.card::after {
	content: "";
	position: absolute;
	left: 1.25rem;
	right: 1.25rem;
	bottom: -0.75rem;
	height: 0.75rem;
	border-radius: 0 0 1.25rem 1.25rem;
	background: var(--pale);
}

.card::after {
	left: 2.5rem;
	right: 2.5rem;
	bottom: -1.5rem;
	background: var(--ghost);
}

.card.leaving {
	animation: leave 0.28s ease-in forwards;
}

.card.arriving {
	animation: arrive 0.32s ease-out;
}

@keyframes leave {
	to {
		transform: translateY(-2.5rem);
		opacity: 0;
	}
}

@keyframes arrive {
	from {
		transform: translateY(2.5rem);
		opacity: 0;
	}
}

.card-head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 1rem;
}

.spec {
	padding: 0.15rem 0.55rem;
	border-radius: 0.45rem;
	background: var(--night);
	color: var(--white);
	font-family: var(--mono);
	font-weight: 700;
	font-size: 0.85rem;
}

.area {
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 600;
}

.question {
	font-size: 1.4rem;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.hint {
	margin-top: 0.4rem;
	color: var(--muted);
	font-weight: 600;
}

.options {
	display: grid;
	gap: 0.6rem;
	margin-top: 1.25rem;
}

.option {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	width: 100%;
	min-height: 3.25rem;
	padding: 0.6rem 0.9rem;
	border: 2px solid var(--line);
	border-radius: 0.9rem;
	background: var(--white);
	text-align: left;
	font-weight: 600;
	font-size: 1.05rem;
	transition: border-color 0.15s;
}

.option:not(:disabled):hover {
	border-color: var(--soft);
}

.letter {
	flex: none;
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 0.45rem;
	background: var(--board);
	color: var(--muted);
	font-family: var(--mono);
	font-weight: 700;
	font-size: 0.85rem;
}

.option[aria-pressed="true"] {
	border-color: var(--ink);
	box-shadow: inset 0 0 0 1px var(--ink);
}

.option[aria-pressed="true"] .letter {
	background: var(--ink);
	color: var(--white);
}

.check {
	width: 100%;
	margin-top: 1rem;
	min-height: 3.25rem;
	border: 0;
	border-radius: 0.9rem;
	background: var(--night);
	color: var(--white);
	font-weight: 700;
}

.check:disabled {
	opacity: 0.45;
}

.noscript {
	margin-top: 1rem;
	color: var(--muted);
}

.confidence {
	margin-top: 1rem;
	padding: 1rem;
	border-radius: 1.1rem;
	background: var(--night);
	color: var(--white);
}

.confidence-title {
	font-weight: 700;
	margin-bottom: 0.7rem;
}

.confidence-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.5rem;
}

.confidence-row button {
	min-height: 3rem;
	padding: 0.4rem;
	border: 0;
	border-radius: 0.75rem;
	background: var(--night2);
	color: var(--conf-text);
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.2;
}

.confidence-row button:hover {
	background: var(--ghost);
}

.confidence-row button:last-child {
	background: var(--highlight);
	color: var(--ink);
}

/* Result */

.verdict {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 1.35rem;
	font-weight: 800;
}

.verdict::before {
	display: grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	color: var(--white);
	font-size: 1rem;
	font-weight: 800;
}

.verdict.is-right::before {
	content: "\2713";
	background: var(--right);
}

.verdict.is-wrong::before {
	content: "\2715";
	background: var(--wrong);
}

.result .options {
	margin-top: 1rem;
}

.marked li {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-height: 3rem;
	padding: 0.5rem 0.9rem;
	border: 2px solid var(--line);
	border-radius: 0.9rem;
	font-weight: 600;
}

.marked .tag {
	margin-left: auto;
	font-size: 0.8rem;
	font-weight: 700;
	white-space: nowrap;
}

.marked .is-answer {
	border-color: var(--right);
	background: var(--right-tint);
}

.marked .is-answer .letter {
	background: var(--right);
	color: var(--white);
}

.marked .is-answer .tag {
	color: var(--right);
}

.marked .is-wrong-pick {
	border-color: var(--wrong);
	background: var(--wrong-tint);
}

.marked .is-wrong-pick .letter {
	background: var(--wrong);
	color: var(--white);
}

.marked .is-wrong-pick .tag {
	color: var(--wrong-text);
}

.explanation {
	margin-top: 1rem;
	color: var(--explain);
}

.misconception {
	margin-top: 0.9rem;
	padding: 0.7rem 0.9rem;
	border-radius: 0.75rem;
	background: var(--wrong-tint);
	color: var(--wrong-text);
	font-weight: 700;
	font-size: 0.95rem;
}

.rail-wrap {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
}

.rail-status {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: 600;
}

.rail-status span:first-child {
	color: var(--ink);
	font-weight: 700;
}

.rail {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 0.4rem;
	margin-top: 0.6rem;
}

.rail li {
	display: grid;
	justify-items: center;
	padding: 0.35rem 0.2rem;
	border: 1.5px solid var(--line);
	border-radius: 0.6rem;
	color: var(--muted);
	font-size: 0.7rem;
	line-height: 1.3;
	white-space: nowrap;
}

.rail b {
	font-family: var(--mono);
	font-size: 0.95rem;
	color: var(--ink);
}

.rail .is-up {
	background: var(--right);
	border-color: var(--right);
	color: var(--white);
}

.rail .is-back {
	background: var(--wrong);
	border-color: var(--wrong);
	color: var(--white);
}

.rail .is-same {
	background: var(--night);
	border-color: var(--night);
	color: var(--white);
}

.rail .is-up b,
.rail .is-back b,
.rail .is-same b {
	color: var(--white);
}

.another {
	width: 100%;
	margin-top: 1.25rem;
	min-height: 3.25rem;
	border: 2px solid var(--night);
	border-radius: 0.9rem;
	background: var(--white);
	font-weight: 700;
}

.another:hover {
	background: var(--board);
}

.try-note {
	margin-top: 2.25rem;
	color: var(--soft);
	font-size: 0.9rem;
}

/* Sections */

.boxes,
.screens,
.subjects {
	padding: 5rem 0;
}

h2 {
	font-size: clamp(1.8rem, 3.4vw, 2.6rem);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.section-lede {
	margin-top: 1rem;
	max-width: 42rem;
	font-size: 1.15rem;
	color: var(--explain);
}

/* The 5 boxes, each step taller because the gap before a card comes back grows. */
.ladder {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	align-items: end;
	gap: 0.75rem;
	height: 15rem;
	margin-top: 3rem;
}

.ladder li {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 0.9rem;
	border-radius: 1rem 1rem 0.4rem 0.4rem;
	background: var(--night);
	color: var(--white);
}

.ladder li:nth-child(1) { height: 38%; background: var(--wrong); }
.ladder li:nth-child(2) { height: 52%; }
.ladder li:nth-child(3) { height: 66%; }
.ladder li:nth-child(4) { height: 82%; }
.ladder li:nth-child(5) { height: 100%; background: var(--right); }

.ladder-box {
	font-family: var(--mono);
	font-weight: 700;
	font-size: 1rem;
}

.ladder-due {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.25;
}

.rules {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	margin-top: 3rem;
}

.rule h3,
.subject h3,
.promise-list h3 {
	font-size: 1.2rem;
	font-weight: 800;
	line-height: 1.3;
	margin-bottom: 0.5rem;
}

.rule p {
	color: var(--explain);
}

.screens {
	background: var(--white);
}

.shots {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
	margin-top: 2.5rem;
}

.shots img {
	border-radius: 1.75rem;
	border: 1px solid var(--line);
	box-shadow: 0 0.75rem 2rem rgb(28 35 64 / 0.12);
}

.shots p {
	margin-top: 0.9rem;
	color: var(--explain);
	font-size: 0.95rem;
}

.subject-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
	margin-top: 2.5rem;
}

.subject {
	padding: 1.75rem;
	border-radius: 1.5rem;
	background: var(--white);
	border: 1px solid var(--line);
}

.subject-code {
	display: inline-block;
	margin-bottom: 0.9rem;
	padding: 0.15rem 0.6rem;
	border-radius: 0.45rem;
	background: var(--highlight);
	font-family: var(--mono);
	font-weight: 700;
	font-size: 0.85rem;
}

.subject p:last-child {
	color: var(--explain);
}

.subjects-note {
	margin-top: 1.5rem;
	color: var(--muted);
}

.promises {
	background: var(--night);
	color: var(--white);
	padding: 4.5rem 0;
}

.promise-list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 2rem;
}

.promise-list li {
	padding-top: 1.1rem;
	border-top: 4px solid var(--highlight);
}

.promise-list p {
	color: var(--conf-text);
}

.foot {
	padding: 2rem 0 2.5rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.foot-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
}

/* Narrower screens */

@media (max-width: 60rem) {
	.hero-grid {
		grid-template-columns: 1fr;
		gap: 3rem;
	}

	.try {
		max-width: 32rem;
	}

	.promise-list {
		grid-template-columns: repeat(2, 1fr);
	}

	.shots {
		grid-template-columns: repeat(4, minmax(13rem, 1fr));
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		padding-bottom: 1rem;
	}

	.shots li {
		scroll-snap-align: start;
	}
}

@media (max-width: 40rem) {
	.hero {
		padding-top: 1.5rem;
	}

	.card {
		padding: 1.15rem;
	}

	.rules,
	.subject-grid,
	.promise-list {
		grid-template-columns: 1fr;
	}

	.ladder {
		gap: 0.4rem;
		height: 13rem;
	}

	.ladder li {
		padding: 0.6rem 0.45rem;
	}

	.ladder-box,
	.ladder-due {
		font-size: 0.8rem;
	}

	.rail li {
		font-size: 0.62rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

/* The result takes focus so screen readers read it, but it isn't a control, so it needs no ring. */
.result:focus,
.question:focus {
	outline: none;
	box-shadow: none;
}
