/*
 * IELTS Drill — base styles.
 *
 * 1. Reset            Tailwind v4 preflight subset (the Next landing rendered on top of it), in a
 *                     cascade layer so every unlayered rule — core blocks, global styles, ours — beats it.
 * 2. Tokens           --id-* custom properties (the landing's literal colours, fonts, shadows, gutters).
 * 3. PAGE_CSS port    global link/selection/summary rules, the reveal animation, keyframes (prefixed
 *                     id-), reduced motion, and the hover/press classes (lh1..lh9 → id-lh1..id-lh9,
 *                     la1/la2 → id-la1/id-la2).
 * 4. Site root        what the landing's root <div> carried.
 * 5. Header           parts/header.html → patterns/header.php
 * 6. Story            the #how wrapper, its thread, and the shared chapter shell (.id-ch*)
 * 7. Footer           parts/footer.html → patterns/footer.php
 * 8. Simple pages     page.html / index.html / 404.html (legal-page layout from the app)
 *
 * Breakpoints: the React component switched layouts on a ResizeObserver —
 * wide = width >= 900, xl = width >= 1180. Here: mobile-first, then
 * @media (min-width: 900px) and @media (min-width: 1180px).
 */

/* ---------------------------------------------------------------------------
 * 1. Reset
 * ------------------------------------------------------------------------ */
@layer ieltsdrill-reset {
	*,
	::before,
	::after,
	::backdrop {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
		border: 0 solid;
	}
	html {
		line-height: 1.5;
		-webkit-text-size-adjust: 100%;
		tab-size: 4;
		-webkit-tap-highlight-color: transparent;
	}
	h1, h2, h3, h4, h5, h6 {
		font-size: inherit;
		font-weight: inherit;
	}
	a {
		color: inherit;
		text-decoration: inherit;
	}
	b, strong {
		font-weight: bolder;
	}
	ol, ul, menu {
		list-style: none;
	}
	img, svg, video, canvas, audio, iframe, embed, object {
		display: block;
		vertical-align: middle;
	}
	img, video {
		max-width: 100%;
		height: auto;
	}
	button, input, select, optgroup, textarea {
		font: inherit;
		color: inherit;
		background-color: transparent;
		border-radius: 0;
	}
	summary {
		display: list-item;
	}
	[hidden]:where(:not([hidden="until-found"])) {
		display: none !important;
	}
	/* The app's base layer (src/app/globals.css: `* { @apply outline-ring/50 }`):
	   every focus ring — the browser's own "auto" outline included — is the
	   ring colour at 50%: #1668D9 on light pages, #4DA2FF where the legal
	   pages follow a dark system setting (.id-legal-shell--auto, legal.css).
	   The legal header's 2px [data-press-sm] rings are in legal.css. */
	* {
		outline-color: rgba(22, 104, 217, 0.5);
		outline-color: color-mix(in oklab, #1668D9 50%, transparent);
	}
	@media (prefers-color-scheme: dark) {
		.id-legal-shell--auto,
		.id-legal-shell--auto * {
			outline-color: rgba(77, 162, 255, 0.5);
			outline-color: color-mix(in oklab, #4DA2FF 50%, transparent);
		}
	}
}

/* ---------------------------------------------------------------------------
 * 2. Tokens
 * ------------------------------------------------------------------------ */
:root {
	--id-ink: #0B1120;
	--id-ink-2: #4E5F7C;          /* body copy on light */
	--id-ink-3: #586A87;          /* labels, captions */
	--id-canvas: #F7F9FD;
	--id-white: #FFFFFF;
	--id-blue: #1668D9;
	--id-blue-hover: #1259BD;
	--id-sky: #4DA2FF;
	--id-select: #CFE0FA;
	--id-surface-2: #F1F5FC;
	--id-surface-3: #E7EEF9;
	--id-track: #EDF2FA;
	--id-tick: #DCE4F2;
	--id-rule: #D5E0F0;
	--id-thread: #E3EAF5;
	--id-listen: #1668D9;
	--id-listen-soft: #EEF4FD;
	--id-read: #C4531B;
	--id-read-soft: #FBF0EA;
	--id-write: #0E8F5E;
	--id-write-ink: #0A6E48;
	--id-good-soft: #E7F5EE;
	--id-good-hl: #DDF2E7;
	--id-good-bar: #2FA36B;
	--id-speak: #6D3FCB;
	--id-speak-soft: #F1ECFA;
	--id-warn: #E9A23B;
	--id-warn-ink: #8A5600;
	--id-bad: #AE2126;
	--id-bad-soft: #FBE3E3;
	--id-tense-soft: #DCE8FB;
	--id-night: #0B1120;
	--id-night-2: #182238;
	--id-night-3: #2A3653;
	--id-night-ink: #EEF3FB;
	--id-night-muted: #9AA9C4;
	--id-coin: #FFC55A;
	--id-mint: #4ADE9B;
	--id-mint-ink: #04101F;
	--id-legal-bg: #E9EEF7;
	--id-legal-line: rgba(9, 20, 40, 0.09);

	--id-font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
	--id-font-mono: 'Geist Mono', monospace;

	--id-max: 1200px;
	--id-gutter: clamp(16px, 4vw, 40px);
	--id-ch-pad: clamp(64px, 11vh, 130px);

	--id-ease-out: cubic-bezier(.16, 1, .3, 1);
	--id-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
	--id-ease-inout: cubic-bezier(.65, 0, .35, 1);

	/* The landing's recurring box-shadows. */
	--id-shadow-card: 0 1px 2px rgba(9, 20, 40, 0.05), inset 0 0 0 1px rgba(9, 20, 40, 0.06);
	--id-shadow-panel: 0 1px 2px rgba(9, 20, 40, 0.05), 0 40px 80px -56px rgba(9, 20, 40, 0.45), inset 0 0 0 1px rgba(9, 20, 40, 0.06);
	--id-shadow-tile: inset 0 0 0 1px rgba(9, 20, 40, 0.05);
	--id-shadow-hairline: inset 0 0 0 1px rgba(9, 20, 40, 0.06);
	--id-shadow-node-on: 0 0 0 6px #F7F9FD, inset 0 0 0 2px #1668D9;
	--id-shadow-node-off: 0 0 0 6px #F7F9FD, inset 0 0 0 2px #D5E0F0;
}

/* ---------------------------------------------------------------------------
 * 3. PAGE_CSS port (src/features/landing/landing-page.tsx)
 * ------------------------------------------------------------------------ */
html {
	scroll-behavior: smooth;
}
body {
	margin: 0;
	background: #F7F9FD;
}
a {
	color: #1668D9;
	text-decoration: none;
}
a:hover {
	color: #1259BD;
}
::selection {
	background: #CFE0FA;
}
summary::-webkit-details-marker {
	display: none;
}
summary {
	list-style: none;
}

/* The reveal. [data-anim] is set on <body> by landing.js only once
   requestAnimationFrame has proven it runs; until then every [data-rise]
   element shows in its finished state. */
[data-anim] [data-rise]:not([data-in]) {
	opacity: 0;
	transform: translateY(18px);
}
[data-rise] {
	transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1);
}

/* Keyframes, prefixed: eq → id-eq, scan → id-scan, type → id-type, ring → id-ring,
   float → id-float, halo → id-halo, dots → id-dots. */
@keyframes id-eq { 0%, 100% { transform: scaleY(.22); } 50% { transform: scaleY(1); } }
@keyframes id-scan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(44px); } }
@keyframes id-type { 0% { transform: scaleX(0); } 55%, 100% { transform: scaleX(1); } }
@keyframes id-ring { 0% { transform: scale(.7); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes id-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes id-halo { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(2.8); opacity: 0; } }
@keyframes id-dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
	}
	[data-anim] [data-rise]:not([data-in]) {
		opacity: 1;
		transform: none;
	}
}

/*
 * Hover and press classes. Put the class on the element itself (raw HTML), or
 * on a core block's wrapper: a core/paragraph <p> whose child is the link, or
 * a core/button's .wp-block-button (its child is a.wp-block-button__link).
 * ":root" lifts specificity so a section's own base rule (≤ 3 classes) never
 * cancels the hover.
 *
 * Only the transforms are ported. PAGE_CSS also gave lh1/lh2/lh3/lh9 a hover
 * colour or background and lh4..lh7 a coloured ring, but every element that
 * carried those classes set the same property inline, and an inline style
 * beats a stylesheet rule — so on the live page none of that ever showed:
 * nav links, footer links and both CTAs keep their colours, the module cards
 * keep their resting shadow, and hover only lifts. lh1, lh2 and lh9 therefore
 * do nothing on hover (lh2 keeps its press scale through la1); the class
 * names stay in the markup so the port can be read against the TSX.
 */
:root a.id-lh3:hover,
:root .id-lh3 > a:hover {
	transform: translateY(-1px);
}
:root .id-lh4:hover,
:root .id-lh5:hover,
:root .id-lh6:hover,
:root .id-lh7:hover {
	transform: translateY(-4px);
}
:root a.id-lh8:hover,
:root .id-lh8 > a:hover {
	transform: translateY(-2px);
}
:root a.id-la1:active,
:root .id-la1 > a:active {
	transform: scale(.96);
}
:root a.id-la2:active,
:root .id-la2 > a:active {
	transform: scale(.97);
}

/* ---------------------------------------------------------------------------
 * 4. Site root — what the landing's root <div> carried
 * ------------------------------------------------------------------------ */
body {
	color-scheme: light;
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	background: #F7F9FD;
	color: #0B1120;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
.wp-site-blocks {
	overflow-x: clip;
}
.id-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ---------------------------------------------------------------------------
 * 5. Header (front page). The template-part wrapper IS the sticky <header>,
 *    so it sticks for the whole page, not just inside its own wrapper.
 * ------------------------------------------------------------------------ */
.id-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 60;
	background: rgba(247, 249, 253, 0.82);
	-webkit-backdrop-filter: saturate(1.4) blur(16px);
	backdrop-filter: saturate(1.4) blur(16px);
	box-shadow: 0 1px 0 rgba(9, 20, 40, 0.06);
}
.id-nav {
	max-width: 1200px;
	margin: 0 auto;
	height: 68px;
	padding: 0 clamp(16px, 4vw, 40px);
	display: flex;
	align-items: center;
	gap: clamp(12px, 2vw, 28px);
}
.id-brand,
.id-brand:hover {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #0B1120;
	flex: none;
}
.id-brand__mark {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: #1668D9;
	box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 2.5px;
	padding-bottom: 8px;
	box-sizing: border-box;
}
.id-brand__mark > span {
	width: 3px;
	height: 7px;
	border-radius: 2px;
	background: #FFFFFF;
}
.id-brand__mark > span:nth-child(2) {
	height: 14px;
}
.id-brand__mark > span:nth-child(3) {
	height: 10px;
}
.id-brand__name {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.03em;
}
.id-nav__links {
	display: none;
	align-items: center;
	gap: 26px;
	font-size: 14px;
	font-weight: 600;
}
.id-nav__links a {
	color: #4E5F7C;
}
.id-nav__cta {
	margin-left: auto;
	flex: none;
}
.id-nav__cta .wp-block-button__link {
	height: 44px;
	padding: 0 20px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: 999px;
	background: #0B1120;
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 700;
	line-height: inherit;
	transition: background 200ms, transform 200ms cubic-bezier(.16, 1, .3, 1);
}
@media (min-width: 900px) {
	.id-nav__links {
		display: flex;
	}
}

/* ---------------------------------------------------------------------------
 * 6. Story — the #how wrapper (templates/front-page.html), its thread, and
 *    the chapter shell every story pattern uses.
 * ------------------------------------------------------------------------ */
.id-story {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 40px);
}
.id-story__thread {
	position: absolute;
	top: 0;
	bottom: 0;
	left: calc(clamp(16px, 4vw, 40px) + 20px);
	width: 2px;
	margin-left: -1px;
	background: #E3EAF5;
	border-radius: 1px;
}
.id-story__fill {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: #1668D9;
	border-radius: 1px;
	transform-origin: 0 0;
}
.id-story__head {
	position: absolute;
	left: 50%;
	top: 100%;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border-radius: 50%;
	background: #1668D9;
}
.id-story__head > span {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #1668D9;
	animation: id-halo 1.8s ease-out infinite;
}

/* One chapter: <section class="id-ch"> = rail column + body. */
.id-ch {
	display: grid;
	grid-template-columns: 40px minmax(0, 1fr);
	padding: clamp(64px, 11vh, 130px) 0;
}
.id-ch--last {
	padding-bottom: clamp(72px, 12vh, 140px);
}
.id-ch__rail {
	position: relative;
}
/* Finished state = "on". landing.js toggles it inline from scroll. */
.id-ch__node {
	position: absolute;
	left: 50%;
	top: -4px;
	width: 30px;
	height: 30px;
	margin-left: -15px;
	border-radius: 50%;
	background: #1668D9;
	color: #FFFFFF;
	box-shadow: 0 0 0 6px #F7F9FD, inset 0 0 0 2px #1668D9;
	display: grid;
	place-items: center;
	font-family: 'Geist Mono', monospace;
	font-size: 11px;
	font-weight: 600;
	transition: background .35s, color .35s, box-shadow .35s, transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.id-ch__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(28px, 5vw, 80px);
	align-items: start;
}
.id-eyebrow {
	display: block;
	font-family: 'Geist Mono', monospace;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #1668D9;
}
.id-ch__title {
	font-size: clamp(30px, 3.8vw, 52px);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.042em;
	margin: 12px 0 0;
	max-width: 14ch;
	text-wrap: balance;
}
.id-ch__lede {
	font-size: clamp(16px, 1.4vw, 18px);
	line-height: 1.55;
	color: #4E5F7C;
	margin: 16px 0 0;
	max-width: 30ch;
}
@media (min-width: 900px) {
	.id-story__thread {
		left: calc(clamp(16px, 4vw, 40px) + 36px);
	}
	.id-ch {
		grid-template-columns: 72px minmax(0, 1fr);
	}
	.id-ch__body {
		grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
	}
}

/* ---------------------------------------------------------------------------
 * 7. Footer. The template-part wrapper is the <footer class="id-footer">.
 * ------------------------------------------------------------------------ */
.id-footer {
	box-shadow: 0 -1px 0 rgba(9, 20, 40, 0.06);
}
.id-footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 28px clamp(16px, 4vw, 40px) 40px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: center;
	font-size: 14px;
	color: #586A87;
}
.id-footer__brand {
	font-weight: 800;
	color: #0B1120;
	letter-spacing: -0.02em;
}
.id-footer__inner a {
	color: #586A87;
}
.id-footer__note {
	margin-left: auto;
}

/* ---------------------------------------------------------------------------
 * 8. Simple pages — the app's legal-page shell (src/features/legal/legal-page.tsx)
 *    in its light theme: page.html, index.html, 404.html.
 * ------------------------------------------------------------------------ */
.id-legal-shell {
	min-height: 100vh;
	min-height: 100dvh;
	background: #E9EEF7;
	color: #0B1120;
}
.id-legal-header {
	display: flex;
	height: 64px;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(9, 20, 40, 0.09);
	background: #F7F9FD;
	padding: 0 16px;
}
.id-legal-brand,
.id-legal-brand:hover {
	display: flex;
	align-items: center;
	gap: 10px;
	border-radius: 12px;
	color: #0B1120;
	transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.id-legal-brand__mark {
	display: grid;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	place-items: center;
	border-radius: 11px;
	background: #1668D9;
	color: #FFFFFF;
}
.id-legal-brand__mark svg {
	width: 18px;
	height: 18px;
}
.id-legal-brand__name {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: -0.02em;
}
.id-legal-nav {
	display: flex;
	align-items: center;
	gap: 16px;
}
.id-legal-nav a {
	display: inline-block;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	color: #4E5F7C;
	transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.id-legal-nav a:hover {
	color: #1668D9;
}
.id-legal-nav__home a {
	font-size: 14px;
}
.id-legal-brand:active,
.id-legal-nav a:active {
	transform: scale(0.982) translateY(1px);
	transition-duration: 70ms;
}
.id-legal {
	margin: 0 auto;
	width: 100%;
	max-width: 720px;
	padding: 48px 20px;
}
.id-legal__title {
	font-size: clamp(28px, 3.6vw, 40px);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.035em;
}
/* "Last updated: …" — the first paragraph of a legal page's content. */
.id-legal__updated {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #586A87;
}
.id-legal__title + .id-legal__body {
	margin-top: 12px;
}
.id-legal__body > * + * {
	margin-top: 28px;
}
.id-legal__body > .id-legal__updated + * {
	margin-top: 32px;
}
.id-legal__section > h2,
.id-legal__body > h2 {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #0B1120;
}
.id-legal__section > :not(h2) {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.7;
	color: #4E5F7C;
}
.id-legal__section > * + * {
	margin-top: 12px;
}
.id-legal__section > h2 + * {
	margin-top: 8px;
}
.id-legal__section ul,
.id-legal__body > ul {
	list-style: disc;
	padding-left: 20px;
}
.id-legal__section li + li,
.id-legal__body > ul li + li {
	margin-top: 6px;
}
.id-legal a,
.id-legal a:hover {
	font-weight: 700;
	color: #1668D9;
}
.id-legal__actions {
	margin-top: 24px;
	font-size: 15px;
}
@media (min-width: 640px) {
	.id-legal-header {
		padding: 0 32px;
	}
	.id-legal {
		padding: 64px 32px;
	}
}
