/*
 * rock-pool.app public site.
 * Values copied from packages/design-tokens/tokens.css; keep in sync
 * (checked by apps/site/scripts/check-tokens.mjs).
 */

@font-face {
	font-family: 'Instrument Serif';
	src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Instrument Serif';
	src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: 'Literata';
	src: url('/fonts/literata-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Literata';
	src: url('/fonts/literata-latin-400-italic.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: 'Literata';
	src: url('/fonts/literata-latin-600-normal.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'IBM Plex Mono';
	src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--rp-abyss: #090a0d;
	--rp-midnight: #11131b;
	--rp-deep-ocean: #171d35;
	--rp-blue: #514bdb;
	--rp-green: #397c60;
	--rp-ember: #f16b43;
	--rp-amber: #e5a34e;
	--rp-pearl: #e9e5dc;
	--rp-mist: #96959a;
	--rp-stone: #55545a;

	--rp-font-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
	--rp-font-reading: 'Literata', 'Source Serif 4', Charter, Georgia, serif;
	--rp-font-interface: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

	--rp-reading-width: 38rem;
	--rp-page-width: 64rem;
}

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

html {
	background: var(--rp-abyss);
	color: var(--rp-pearl);
	font-family: var(--rp-font-reading);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body {
	margin: 0;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
	line-height: 1.65;
}

a {
	color: inherit;
	text-decoration-color: var(--rp-blue);
	text-underline-offset: 0.2em;
}
a:hover {
	text-decoration-thickness: 2px;
}
:focus-visible {
	outline: 2px solid var(--rp-blue);
	outline-offset: 3px;
}

.skip {
	position: absolute;
	left: -9999px;
}
.skip:focus {
	left: 1rem;
	top: 1rem;
	background: var(--rp-midnight);
	padding: 0.5rem 1rem;
}

header,
main,
footer {
	width: 100%;
	max-width: var(--rp-page-width);
	margin: 0 auto;
	padding: 0 1.5rem;
}

header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.5rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid color-mix(in srgb, var(--rp-stone) 50%, transparent);
}

.wordmark {
	font-family: var(--rp-font-display);
	font-size: 1.5rem;
	text-decoration: none;
}

nav a,
.meta,
footer {
	font-family: var(--rp-font-interface);
	font-size: 0.8125rem;
	color: var(--rp-mist);
}
nav a {
	text-decoration: none;
	margin-left: 1.25rem;
}
nav a:hover,
nav a[aria-current='page'] {
	color: var(--rp-pearl);
}

.meta {
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-size: 0.75rem;
}

main {
	flex: 1;
	padding-top: 3rem;
	padding-bottom: 4rem;
}

h1,
h2 {
	font-family: var(--rp-font-display);
	font-weight: 400;
	line-height: 1.15;
}
h1 {
	font-size: clamp(2.25rem, 5vw, 3rem);
	margin: 0.25rem 0 1.5rem;
}
h2 {
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin: 3rem 0 1rem;
}

.reading {
	max-width: var(--rp-reading-width);
}
.lede {
	font-size: 1.15em;
	color: var(--rp-mist);
}

/* Home: the tidal cycle, in three moments. */
.tides {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	margin: 3rem 0;
	padding: 0;
	list-style: none;
}
.tides li {
	border-top: 2px solid var(--rp-stone);
	padding-top: 1rem;
}
.tides .meta {
	display: block;
	margin-bottom: 0.5rem;
}
/* Each moment keeps its colour meaning (visual_identity §3.2). */
.tides li.low {
	border-top-color: var(--rp-green);
}
.tides li.high {
	border-top-color: var(--rp-ember);
}
.tides li.receding {
	border-top-color: var(--rp-amber);
}

.not-list {
	padding-left: 1.2em;
	color: var(--rp-mist);
}

.cta {
	display: inline-block;
	margin-top: 1rem;
	font-family: var(--rp-font-interface);
	font-size: 0.875rem;
	text-decoration: none;
	color: var(--rp-pearl);
	background: var(--rp-deep-ocean);
	border: 1px solid var(--rp-blue);
	border-radius: 2px;
	padding: 0.75rem 1.25rem;
}

/* Legal pages */
.legal h2 {
	font-size: clamp(1.35rem, 2.5vw, 1.6rem);
	margin-top: 2.5rem;
}
.legal table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
	margin: 1rem 0;
}
.legal th,
.legal td {
	text-align: left;
	vertical-align: top;
	padding: 0.6rem 0.75rem 0.6rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--rp-stone) 60%, transparent);
}
.legal th {
	font-family: var(--rp-font-interface);
	font-weight: 400;
	font-size: 0.8125rem;
	color: var(--rp-mist);
}

/* Unwritten text. Must all be gone before launch or brand verification. */
.todo {
	background: color-mix(in srgb, var(--rp-ember) 20%, transparent);
	outline: 1px dashed var(--rp-ember);
	padding: 0 0.2em;
}

footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	padding-top: 1.5rem;
	padding-bottom: 2rem;
	border-top: 1px solid color-mix(in srgb, var(--rp-stone) 50%, transparent);
}
footer a {
	text-decoration-color: var(--rp-stone);
}

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