/*
 * status.privatecrates.dev. The design tokens are copied from website/src/app.css ("harbour at dawn" light,
 * "night watch" dark); keep them in step when the site's change. No framework, no third-party requests.
 */

@font-face {
	font-family: 'Big Shoulders Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url('/fonts/big-shoulders-latin-opsz-normal.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Atkinson Hyperlegible Next Variable';
	font-style: normal;
	font-display: swap;
	font-weight: 200 800;
	src: url('/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
		U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--text-sm: 0.875rem;
	--text-base: 1.0625rem;
	--text-lg: 1.25rem;
	--text-xl: 1.6rem;
	--text-2xl: 2.25rem;
	--text-3xl: clamp(2.4rem, 6vw, 3.6rem);
	--font-display: 'Big Shoulders Variable', 'Arial Narrow', sans-serif;
	--font-sans: 'Atkinson Hyperlegible Next Variable', system-ui, sans-serif;
	--font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Segoe UI Mono', Menlo, Consolas, monospace;
	--container-page: 72rem;

	color-scheme: light;
	--fog: #edf1ef;
	--deck: #f9fbfa;
	--ink: #0f2830;
	--ink-soft: #3a555e;
	--harbour: #125c6c;
	--signal: #f2b233;
	--signal-ink: #0f2830;
	--container: #b93a22;
	--rule: #c5d2cf;
	--ok: #1f6b45;
	--ok-bg: #dcefe3;
	--warn-bg: #fbe9d6;
	--danger: #a3301b;
	--danger-bg: #f9e1dc;
	--shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgb(15 40 48 / 0.35);
	/* Status page only: the lamp amber darkened to 3:1 against --deck, for the degraded bars and icons. */
	--warn: #9a6200;
	--nodata: #c5d2cf;
}

:root[data-theme='dark'] {
	color-scheme: dark;
	--fog: #0a1c22;
	--deck: #10272f;
	--ink: #e4eeec;
	--ink-soft: #a8bec1;
	--harbour: #82cfdb;
	--signal: #f5bf47;
	--signal-ink: #0a1c22;
	--container: #e0664e;
	--rule: #25444e;
	--ok: #7fd4a4;
	--ok-bg: #12352a;
	--warn-bg: #3a2a14;
	--danger: #f59a86;
	--danger-bg: #3d1c16;
	--shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgb(0 0 0 / 0.6);
	--warn: #f5bf47;
	--nodata: #2f525d;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		color-scheme: dark;
		--fog: #0a1c22;
		--deck: #10272f;
		--ink: #e4eeec;
		--ink-soft: #a8bec1;
		--harbour: #82cfdb;
		--signal: #f5bf47;
		--signal-ink: #0a1c22;
		--container: #e0664e;
		--rule: #25444e;
		--ok: #7fd4a4;
		--ok-bg: #12352a;
		--warn-bg: #3a2a14;
		--danger: #f59a86;
		--danger-bg: #3d1c16;
		--shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgb(0 0 0 / 0.6);
		--warn: #f5bf47;
		--nodata: #2f525d;
	}
}

/* Base */
*,
*::before,
*::after {
	box-sizing: border-box;
}
* {
	margin: 0;
}
html {
	-webkit-text-size-adjust: 100%;
}
body {
	background: var(--fog);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: var(--text-base);
	line-height: 1.6;
	overflow-x: clip;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
main {
	flex: 1;
}
main:focus {
	outline: none;
}
h1,
h2,
h3 {
	font-family: var(--font-display);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: 0.005em;
	text-wrap: balance;
}
h4 {
	font-weight: 700;
}
ul,
ol {
	padding: 0;
	list-style: none;
}
a {
	color: var(--harbour);
	text-decoration-line: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}
a:hover {
	color: var(--ink);
	text-decoration-thickness: 3px;
	text-decoration-color: var(--signal);
}
:focus-visible {
	outline: 3px solid var(--harbour);
	outline-offset: 3px;
	border-radius: 2px;
}
code {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	background: color-mix(in srgb, var(--ink) 8%, transparent);
	padding: 0.08em 0.35em;
	border-radius: 4px;
	overflow-wrap: anywhere;
}
::selection {
	background: var(--signal);
	color: var(--signal-ink);
}

.page {
	width: 100%;
	max-width: var(--container-page);
	margin-inline: auto;
	padding-inline: 1rem;
}
@media (min-width: 40rem) {
	.page {
		padding-inline: 1.5rem;
	}
}
.panel {
	background: var(--deck);
	border: 1px solid var(--rule);
	border-radius: 10px;
	box-shadow: var(--shadow);
}

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

/* Header */
.site-header {
	border-bottom: 2px solid var(--ink);
	background: var(--fog);
}
.site-header .header-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: 1rem;
	padding-block: 0.5rem;
}
.logo {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	min-height: 2.75rem;
	color: var(--ink);
	text-decoration: none;
}
.logo .mark {
	width: 2.1rem;
	height: auto;
	overflow: visible;
}
.crate-body {
	fill: var(--signal);
	stroke: var(--ink);
	stroke-width: 2.5;
	stroke-linejoin: round;
}
.crate-batten {
	fill: none;
	stroke: var(--ink);
	stroke-width: 2;
	stroke-linecap: round;
}
.word {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: var(--text-xl);
	line-height: 1;
	letter-spacing: 0.01em;
}
.word-status {
	color: var(--ink-soft);
}
.logo:hover .word {
	text-decoration: underline;
	text-decoration-color: var(--signal);
	text-decoration-thickness: 3px;
	text-underline-offset: 0.2em;
}
.site-header nav ul {
	display: flex;
	gap: 0.25rem;
}
.site-header nav a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding-inline: 0.7rem;
	border-radius: 6px;
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
}
.site-header nav a:hover {
	background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.site-header nav a[aria-current='page'] {
	text-decoration: underline;
	text-decoration-thickness: 3px;
	text-decoration-color: var(--signal);
	text-underline-offset: 0.35em;
}

/* Main */
main.page {
	padding-block: 2rem 3rem;
	display: flex;
	flex-direction: column;
	gap: 2.25rem;
}
h1 {
	font-size: var(--text-3xl);
}
main h2 {
	font-size: var(--text-2xl);
	margin-bottom: 0.75rem;
}
main h3 {
	font-size: var(--text-xl);
}
.hint,
.gloss,
.detail,
.checked,
.meta,
.axis {
	color: var(--ink-soft);
}
.hint {
	margin-bottom: 1rem;
	font-size: var(--text-sm);
}

.env-notice {
	margin-top: -1.25rem;
	padding: 0.85rem 1rem;
	border: 2px dashed var(--ink);
	border-radius: 10px;
	background: var(--warn-bg);
}

/* State pills and icons: shape and text, never colour alone. */
.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.15rem 0.6rem 0.15rem 0.4rem;
	border-radius: 999px;
	border: 1.5px solid currentColor;
	font-family: var(--font-sans);
	font-size: var(--text-sm);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0;
	white-space: nowrap;
	vertical-align: middle;
}
.icon {
	width: 1em;
	height: 1em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.pill-operational {
	color: var(--ok);
	background: var(--ok-bg);
}
.pill-degraded {
	color: var(--ink);
	border-color: var(--warn);
	background: var(--warn-bg);
}
.pill-degraded .icon {
	color: var(--warn);
}
.pill-outage {
	color: var(--danger);
	background: var(--danger-bg);
}
.pill-nodata {
	color: var(--ink-soft);
	background: transparent;
}

/* Current state */
.banner {
	padding: 1.25rem;
	border: 2px solid var(--ink);
	border-radius: 10px;
	background: var(--deck);
	box-shadow: 4px 4px 0 var(--ink);
}
.banner h2 {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	margin-bottom: 0.5rem;
}
.banner .pill {
	font-size: var(--text-base);
}
.banner-operational {
	border-left: 10px solid var(--ok);
}
.banner-degraded {
	border-left: 10px solid var(--warn);
	background: var(--warn-bg);
}
.banner-outage {
	border-left: 10px solid var(--danger);
	background: var(--danger-bg);
}
.banner > * + * {
	margin-top: 0.5rem;
}
.affected li + li {
	margin-top: 0.35rem;
}
.checked {
	font-size: var(--text-sm);
}

/* Components */
.components {
	display: grid;
	gap: 1rem;
}
.component {
	padding: 1rem 1rem 0.75rem;
	min-width: 0;
}
@media (min-width: 40rem) {
	.component {
		padding: 1.25rem 1.5rem 1rem;
	}
}
.component-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}
.gloss {
	font-size: var(--text-sm);
	margin-top: 0.2rem;
}
.reasons,
.notes {
	margin-top: 0.6rem;
}
.reasons li,
.notes li {
	position: relative;
	padding-left: 1.1rem;
}
.reasons li::before,
.notes li::before {
	content: '';
	position: absolute;
	left: 0.2rem;
	top: 0.62em;
	width: 0.4rem;
	height: 0.4rem;
	border-radius: 50%;
	background: currentColor;
}
.notes {
	font-size: var(--text-sm);
	color: var(--ink-soft);
}
.detail {
	font-size: var(--text-sm);
}

/* Daily bars */
.history {
	margin-top: 0.9rem;
}
.bars {
	position: relative;
	display: flex;
	gap: 2px;
	height: 2.25rem;
}
.bars li {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
}
.bar {
	flex: 1;
	border-radius: 2px;
	background: var(--nodata);
	cursor: default;
}
.bar-operational {
	background: var(--ok);
}
.bar-degraded {
	background: var(--warn);
}
.bar-outage {
	background: var(--danger);
}
.bar:hover,
.bar:focus-visible {
	transform: scaleY(1.15);
}
.bar:focus-visible {
	outline-offset: 2px;
}
.tip {
	display: none;
	position: absolute;
	z-index: 5;
	top: calc(100% + 0.5rem);
	left: 0;
	right: 0;
	padding: 0.55rem 0.75rem;
	background: var(--ink);
	color: var(--fog);
	border-radius: 6px;
	font-size: var(--text-sm);
	line-height: 1.45;
	pointer-events: none;
}
.bar:hover + .tip,
.bar:focus + .tip {
	display: block;
}
.axis {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: 0.35rem;
	font-size: var(--text-sm);
}
.uptime {
	font-weight: 700;
	color: var(--ink);
}
.narrow {
	display: none;
}
@media (max-width: 40rem) {
	.bars li:nth-child(-n + 60) {
		display: none;
	}
	.wide {
		display: none;
	}
	.narrow {
		display: inline;
	}
}

/* Upstream */
.upstream {
	display: grid;
	gap: 1rem;
}
@media (min-width: 48rem) {
	.upstream {
		grid-template-columns: 1fr 1fr;
	}
}
.upstream > li {
	padding: 1rem 1.25rem;
	background: var(--deck);
	border: 1px solid var(--rule);
	border-radius: 10px;
}
.upstream > li > * + * {
	margin-top: 0.4rem;
}
.upstream ul {
	list-style: disc;
	padding-left: 1.25rem;
}

/* Incidents */
.incident {
	padding: 1.25rem;
}
.incident + .incident {
	margin-top: 1rem;
}
.incident-active {
	border: 2px solid var(--ink);
}
.incident .meta {
	margin-top: 0.4rem;
	font-size: var(--text-sm);
}
.updates {
	margin-top: 0.85rem;
	border-left: 3px solid var(--rule);
	padding-left: 1rem;
}
.updates > li + li {
	margin-top: 0.85rem;
}
.update-head {
	font-size: var(--text-sm);
}
.writeup {
	margin-top: 1rem;
}
.writeup > * + *,
.updates li > * + * {
	margin-top: 0.5rem;
}
.writeup ul,
.updates ul {
	list-style: disc;
	padding-left: 1.25rem;
}
.writeup ol,
.updates ol {
	list-style: decimal;
	padding-left: 1.4rem;
}

/* Footer */
.site-footer {
	border-top: 2px solid var(--ink);
	padding-block: 1.5rem 2rem;
	font-size: var(--text-sm);
	color: var(--ink-soft);
}
.site-footer .links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
	.bar:hover,
	.bar:focus-visible {
		transform: none;
	}
}

@media (forced-colors: active) {
	.bar {
		border: 1px solid CanvasText;
	}
	.bar-operational {
		background: CanvasText;
	}
}
