/*
Theme Name: Opethon
Theme URI: https://x.com/Da7_Tech
Author: Da7em
Author URI: https://x.com/Da7_Tech
Description: One-page site for Opethon, a 30-day open-source hackathon for health, learning, and accessibility. Edit the copy in inc/content.php.
Version: 3.0.1
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: opethon
*/

/*
 * System rules:
 * - One font (Geist, SIL OFL 1.1, see assets/fonts/LICENSE-Geist.txt), one accent (sky #7cc7f2), one corner radius (12px).
 * - One bold move: the hero is a full-width block of navy blue. Nothing else is decorative except a static grain texture.
 * - Motion only as feedback (button and link colour) and for smooth anchor scrolling; both stop with reduced motion.
 * - Z-index: skip link 20, grain 30 (never receives pointer events).
 */

@font-face {
	font-family: "Geist";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("assets/fonts/geist-latin-wght-normal.woff2") format("woff2");
}

:root {
	--bg: #0a1427;
	--block: #0f2a5c;
	--surface: #0f1d36;
	--line: rgb(124 199 242 / 0.14);
	--line-strong: rgb(124 199 242 / 0.32);
	--text: #c9d6ea;
	--heading: #f2f6fc;
	--muted: #8fa3c2;
	--muted-on-block: #b8c7de;
	--accent: #7cc7f2;
	--accent-hover: #a5d9f7;
	--radius: 12px;
	--wrap: 76rem;
	--gutter: clamp(1.25rem, 5vw, 3rem);
	--section: clamp(5rem, 10vw, 8rem);
	--header-h: 4rem;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
	--sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	color-scheme: dark;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	background: var(--bg);
	scroll-padding-top: 1.5rem;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 1.125rem;
	line-height: 1.7;
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

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

h1,
h2,
h3 {
	color: var(--heading);
	font-weight: 600;
	text-wrap: balance;
}

p,
li {
	text-wrap: pretty;
}

strong {
	color: var(--heading);
	font-weight: 700;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

a:hover {
	color: var(--accent);
}

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

main:focus {
	outline: none;
}

::selection {
	background: rgb(124 199 242 / 0.3);
	color: var(--heading);
}

.icon {
	width: 1.05em;
	height: 1.05em;
	flex: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.skip-link {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 20;
	padding: 0.75rem 1.25rem;
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--bg);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

.skip-link:hover {
	color: var(--bg);
}

.grain {
	position: fixed;
	inset: 0;
	z-index: 30;
	pointer-events: none;
	opacity: 0.045;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	min-height: 3.25rem;
	padding: 0.8rem 1.5rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.btn-primary {
	background: var(--accent);
	color: var(--bg);
}

.btn-primary:hover {
	background: var(--accent-hover);
	color: var(--bg);
}

.btn-light {
	border-color: rgb(242 246 252 / 0.55);
	color: var(--heading);
}

.btn-light:hover {
	border-color: var(--heading);
	background: rgb(242 246 252 / 0.08);
	color: var(--heading);
}

.btn-sm {
	min-height: 2.5rem;
	padding: 0.5rem 1rem;
	font-size: 0.9375rem;
}

.btn-lg {
	min-height: 3.5rem;
	padding: 0.9rem 1.75rem;
	font-size: 1.0625rem;
}

/* Header: same navy as the hero block, so the two read as one piece. */

/* Not sticky: it never covers content, even with very large text. */
.site-header {
	background: var(--block);
	border-bottom: 1px solid rgb(242 246 252 / 0.08);
}

.nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	min-height: var(--header-h);
}

.nav-brand {
	margin-right: auto;
	padding-block: 0.25rem;
	color: var(--heading);
	font-size: 1.1875rem;
	font-weight: 700;
	letter-spacing: -0.04em;
	text-decoration: none;
}

.nav-brand span {
	color: var(--accent);
}

.nav-brand:hover {
	color: var(--heading);
}

.nav-links {
	display: none;
}

.nav-links a {
	display: inline-flex;
	align-items: center;
	min-height: 2.5rem;
	padding: 0.25rem 0.75rem;
	border-radius: var(--radius);
	color: var(--muted-on-block);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}

.nav-links a:hover {
	color: var(--heading);
}

/* Hero: the one bold move. */

.hero {
	display: flex;
	align-items: flex-end;
	padding-block: 4.5rem 3.5rem;
	background: var(--block);
}

@media (min-width: 48rem) {
	.hero {
		min-height: min(calc(100svh - var(--header-h)), 72vw, 52rem);
		padding-block: 6rem 5rem;
	}
}

.wordmark {
	margin: 0 0 0 -0.05em;
	font-size: clamp(3.5rem, 19vw, 13rem);
	font-weight: 800;
	overflow-wrap: anywhere;
	line-height: 0.88;
	letter-spacing: -0.05em;
}

.wordmark span {
	margin-left: 0.025em;
	color: var(--accent);
}

.hero-line {
	max-width: 30ch;
	margin-top: clamp(1.75rem, 4vw, 2.5rem);
	color: var(--heading);
	font-size: clamp(1.375rem, 2.6vw, 2rem);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.02em;
}

.hero-sub {
	max-width: 44ch;
	margin-top: 1rem;
	color: var(--muted-on-block);
	font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
}

.hero .btn {
	margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* Sections */

.section {
	padding-top: var(--section);
}

.h2 {
	margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
	font-size: clamp(1.75rem, 3.6vw, 2.75rem);
	line-height: 1.1;
	letter-spacing: -0.035em;
}

/* The idea: a statement. */

.idea-lead {
	max-width: 24ch;
	color: var(--heading);
	font-size: clamp(2rem, 5vw, 4rem);
	font-weight: 600;
	line-height: 1.08;
	letter-spacing: -0.045em;
}

.idea-text {
	max-width: 36rem;
	margin-top: clamp(2rem, 4vw, 3rem);
	font-size: clamp(1.125rem, 1.7vw, 1.3125rem);
	line-height: 1.65;
}

/* Three domains: the only cards on the page. */

.domains {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
}

.domain {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: clamp(1.5rem, 3vw, 2.5rem);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}

.domain-head h3 {
	margin-bottom: 0.5rem;
	font-size: 1.375rem;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.domain-fact {
	margin-top: auto;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}

.domain-fact p {
	color: var(--heading);
	font-size: clamp(1.1875rem, 2vw, 1.4375rem);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: -0.012em;
}

.domain-fact strong {
	font-weight: 800;
}

@media (min-width: 48rem) {
	.domain-fact strong {
		white-space: nowrap;
	}
}

.domain-fact a {
	display: inline-block;
	min-height: 1.75rem;
	padding-block: 0.125rem;
	margin-top: 0.75rem;
	color: var(--muted);
	font-size: 0.9375rem;
	text-decoration-line: underline;
}

.domain-fact a .icon {
	margin-left: 0.3rem;
	vertical-align: -0.15em;
}

.domain-fact a:hover {
	color: var(--accent);
}

/* How it works: an ordered row of sentences under a rule. */

.steps {
	display: grid;
	gap: 2rem 2.5rem;
}

.steps li {
	padding-top: 1.25rem;
	border-top: 2px solid var(--line-strong);
}

.steps li {
	font-size: 1.1875rem;
}

/* The basics and When: two columns, no cards. */

.basics-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--section) 3rem;
}

.checks {
	display: grid;
	gap: 1rem;
}

.checks li {
	display: flex;
	gap: 0.875rem;
	align-items: flex-start;
}

.checks .icon {
	width: 1.5rem;
	height: 1.5rem;
	margin-top: 0.1rem;
	color: var(--accent);
}

.when-lead {
	color: var(--heading);
	font-size: clamp(2rem, 4.4vw, 3.5rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.045em;
}

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

/* Sponsors: one large statement and the only message button outside the nav. */

.sponsors .wrap {
	position: relative;
	padding-top: var(--section);
}

.sponsors .wrap::before {
	content: "";
	position: absolute;
	top: 0;
	left: var(--gutter);
	right: var(--gutter);
	border-top: 1px solid var(--line);
}

.sponsors {
	padding-top: var(--section);
}

.sponsors-title {
	font-size: clamp(2.5rem, 7vw, 5rem);
	line-height: 1;
	letter-spacing: -0.05em;
}

.sponsors-text {
	max-width: 40ch;
	margin-top: 1.5rem;
	font-size: clamp(1.125rem, 1.8vw, 1.375rem);
}

.sponsors .btn {
	margin-top: 2.25rem;
}

/* Footer */

.site-footer {
	margin-top: var(--section);
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 0.9375rem;
}

.site-footer .wrap {
	padding-block: 2rem 2.5rem;
}

.footer-name {
	color: var(--heading);
	font-weight: 600;
}

/* Layout */

@media (max-width: 29.99rem) {
	.btn {
		white-space: normal;
		text-align: center;
	}

	.hero .btn,
	.btn-lg {
		width: 100%;
	}

	.btn-lg {
		padding-inline: 0.75rem;
		font-size: 1rem;
	}
}

@media (min-width: 48rem) {
	.idea-grid {
		display: grid;
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	.idea-grid .h2,
	.idea-lead {
		grid-column: 1 / -1;
	}

	.idea-text {
		grid-column: 6 / -1;
	}

	.domains {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.domain-1 {
		grid-column: 1 / -1;
	}

	/* Cards 2 and 3 share rows, so their fact dividers line up whatever the text length. */
	.domain-2,
	.domain-3 {
		display: grid;
		grid-row: span 2;
		grid-template-rows: subgrid;
		gap: 1.5rem;
	}

	.domain-2 .domain-fact,
	.domain-3 .domain-fact {
		margin-top: 0;
	}

	.steps {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.basics-grid {
		grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
	}
}

@media (min-width: 64rem) {
	.nav-links {
		display: flex;
		flex-wrap: wrap;
		gap: 0.125rem;
		margin-right: 0.75rem;
	}

	.domain-1 {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 3rem;
		align-items: end;
	}

	.domain-1 .domain-fact {
		padding-top: 0;
		border-top: 0;
	}

	.domain-1 .domain-fact p {
		font-size: clamp(1.5rem, 2.4vw, 2rem);
	}

	.steps {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Motion: feedback and anchor scrolling only, for people who have not asked for less of it. */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}

	.btn,
	a {
		transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
	}
}

@media print {
	.grain,
	.site-header {
		display: none;
	}
}

@media (forced-colors: active) {
	.btn {
		border-color: ButtonText;
	}
}
