/* Statusseite im Stil der blub-Website („Telefonnotiz“): Papier, Tinte, Stempel. Farben wie in
   apps/web/src/lib/site/landing/theme.css der Plattform; Zustandsfarben eigens für die Striche. */
/* Schriften wie auf blub.ai, selbst gehostet (OFL, Lizenztexte in assets/fonts/). Nichts wird von
   fremden Servern geladen. */
@font-face {
	font-family: 'Blub Text';
	src: url('fonts/instrument-sans.woff2') format('woff2');
	font-weight: 400 700;
	font-stretch: 75% 100%;
	font-display: optional;
}
@font-face {
	font-family: 'Blub Mono';
	src: url('fonts/jetbrains-mono.woff2') format('woff2');
	font-weight: 100 800;
	font-display: optional;
}
@font-face {
	font-family: 'Blub Display';
	src: url('fonts/fraunces-soft.woff2') format('woff2');
	font-weight: 350 620;
	font-display: swap;
}
@font-face {
	font-family: 'Blub Hand';
	src: url('fonts/playwrite-de-va.woff2') format('woff2');
	font-weight: 300;
	font-display: swap;
}

:root {
	--bg: #ece7dc;
	--surface: #f6f2ea;
	--paper: #f9f6f0;
	--line: #d3ccbe;
	--line-strong: #bdb5a5;
	--text: #24221e;
	--muted: #66615a;
	--ink: #2b4a8b;
	--ink-deep: #213a6e;
	--ink-print: #4a64a0;
	--marker: #f2df73;
	--shadow: rgb(36 34 30 / 0.4);

	/* Striche brauchen 3:1 gegen das Papier, Text in Zustandsfarbe 4,5:1 (WCAG AA) */
	--bar-ok: #3f7d49;
	--bar-degraded: #b5800f;
	--bar-outage: #b13a2e;
	--bar-none: #cbc3b3;
	--text-ok: #285530;
	--text-degraded: #7a4f0c;
	--text-outage: #a3342a;
	--text-none: #66615a;

	--f-display: 'Blub Display', 'Iowan Old Style', Georgia, serif;
	--f-text: 'Blub Text', 'Helvetica Neue', Arial, sans-serif;
	--f-mono: 'Blub Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
	--f-hand: 'Blub Hand', 'Segoe Print', 'Bradley Hand', cursive;

	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--gutter: clamp(16px, 4.4vw, 64px);
	--maxw: 1280px;
	color-scheme: light;
}

/* Dunkel wie die Nachtseiten von blub.ai (Notdienst): Tinte statt Papier, Licht in Markergelb */
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #141d31;
		--surface: #172238;
		--paper: #1f2c47;
		--line: #34425f;
		--line-strong: #4a5a7c;
		--text: #ece7dc;
		--muted: #a9b2c4;
		--ink: #9db4ec;
		--ink-deep: #c3d1f5;
		--ink-print: #8ea3d6;
		--shadow: rgb(0 0 0 / 0.75);
		--bar-ok: #5fae6b;
		--bar-degraded: #e2ac3c;
		--bar-outage: #ec6f5f;
		--bar-none: #4a587a;
		--text-ok: #7fcc8a;
		--text-degraded: #f0c25a;
		--text-outage: #ff8f80;
		--text-none: #a9b2c4;
		color-scheme: dark;
	}
}

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

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

body {
	margin: 0;
	min-height: 100vh;
	background-color: var(--bg);
	/* Papierrauschen wie auf blub.ai, 4 % Deckkraft */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
	color: var(--text);
	font-family: var(--f-text);
	font-size: 17px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

::selection {
	background: var(--marker);
	color: #24221e;
}

a {
	color: inherit;
	text-underline-offset: 3px;
}

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

.wrap {
	width: 100%;
	max-width: var(--maxw);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.display {
	font-family: var(--f-display);
	font-weight: 380;
	letter-spacing: -0.022em;
	line-height: 1.02;
	text-wrap: balance;
}

.mono {
	font-family: var(--f-mono);
	font-variant-ligatures: none;
	letter-spacing: -0.01em;
}

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

.skip {
	position: absolute;
	left: 16px;
	top: -60px;
	z-index: 10;
	padding: 10px 14px;
	background: var(--ink);
	color: var(--paper);
	border-radius: 6px;
}
.skip:focus {
	top: 12px;
}

/* Kopf ---------------------------------------------------------------------------------------- */

.top {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding-block: 22px;
}
.mark {
	font-family: var(--f-display);
	font-weight: 600;
	font-size: 30px;
	line-height: 1;
	letter-spacing: -0.03em;
	text-decoration: none;
}
.hand {
	font-family: var(--f-hand);
	font-weight: 300;
	font-size: 19px;
	color: var(--ink);
	transform: rotate(-4deg) translateY(-2px);
}
.site-link {
	margin-left: auto;
	font-weight: 500;
	font-size: 15px;
}

/* Einstieg mit Betriebsnotiz -------------------------------------------------------------------- */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: clamp(32px, 6vw, 96px);
	align-items: center;
	padding-block: clamp(28px, 6vw, 88px) clamp(48px, 7vw, 104px);
}
.kicker {
	margin: 0 0 14px;
	font-size: 13.5px;
	color: var(--ink);
}
.hero h1 {
	margin: 0;
	max-width: 15ch;
	font-size: clamp(40px, 6vw, 84px);
	overflow-wrap: break-word;
	hyphens: auto;
}
.lead {
	margin: 22px 0 0;
	max-width: 52ch;
	font-size: clamp(17px, 1.35vw, 20px);
	color: var(--muted);
	text-wrap: pretty;
}
.detail {
	margin: 10px 0 0;
	max-width: 52ch;
	font-weight: 500;
}
.stale {
	display: inline-block;
	margin: 14px 0 0;
	padding: 2px 6px;
	background: var(--marker);
	color: #24221e;
	font-weight: 600;
}

.note {
	position: relative;
	padding: 24px 26px 20px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 2px;
	box-shadow: 0 24px 48px -30px var(--shadow);
	transform: rotate(-1deg);
}
.note-org {
	margin: 0;
	font-stretch: 78%;
	font-weight: 600;
	font-size: 12.5px;
	letter-spacing: 0.04em;
	color: var(--ink-print);
}
.note-title {
	margin: 2px 0 10px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--ink-print);
	font-family: var(--f-display);
	font-weight: 440;
	font-size: clamp(32px, 3.4vw, 40px);
	line-height: 1;
	color: var(--ink-print);
}
.note dl {
	margin: 0;
}
.note dl div {
	display: flex;
	align-items: baseline;
	gap: 10px;
	min-height: 38px;
	border-bottom: 1px dashed color-mix(in oklab, var(--ink-print) 42%, transparent);
}
.note dt,
.label {
	flex: 0 0 88px;
	font-stretch: 78%;
	font-weight: 500;
	font-size: 13px;
	color: var(--ink-print);
}
.note dd {
	margin: 0;
	padding: 8px 0 5px;
	min-width: 0;
	font-family: var(--f-mono);
	font-size: 14.5px;
	overflow-wrap: anywhere;
}
.note-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	min-height: 48px;
}
.note-foot .label {
	flex: none;
}
.bubble {
	padding: 3px 11px 5px;
	background: var(--ink);
	color: var(--paper);
	border-radius: 14px 14px 14px 3px;
	font-family: var(--f-display);
	font-weight: 560;
	font-size: 15px;
	line-height: 1;
}

/* blub schaut über den Rand der Notiz */
.figure {
	position: absolute;
	top: -54px;
	right: -18px;
	width: 96px;
	height: 90px;
	transform: rotate(8deg);
}
.figure .shape {
	fill: var(--ink);
}
.figure .white {
	fill: var(--paper);
}
.figure .pupil {
	fill: var(--text);
}
.figure .line {
	fill: none;
	stroke: var(--paper);
	stroke-width: 3.5;
	stroke-linecap: round;
}
.figure .arc {
	stroke-width: 4.5;
}

/* Stempel wie auf blub.ai: doppelter Rand, leicht gedreht, ausgefranst */
.stamp {
	--rot: -7deg;
	display: inline-flex;
	align-items: baseline;
	gap: 0.6em;
	margin: 0 0 0 auto;
	padding: 0.42em 0.8em 0.38em;
	color: var(--ink);
	border: 2px solid currentColor;
	outline: 1px solid currentColor;
	outline-offset: 2px;
	border-radius: 7px;
	font-stretch: 80%;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0.9;
	transform: rotate(var(--rot));
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='80'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
	animation: press 280ms var(--ease) both;
}
.stamp .time {
	font-family: var(--f-mono);
	font-stretch: 100%;
	font-weight: 600;
	letter-spacing: 0;
}
.stamp.s-degraded {
	color: var(--text-degraded);
}
.stamp.s-outage {
	color: var(--text-outage);
}
.stamp.s-none {
	color: var(--text-none);
}
@keyframes press {
	0% {
		opacity: 0;
		transform: rotate(var(--rot)) scale(1.4);
	}
	65% {
		opacity: 0.9;
		transform: rotate(var(--rot)) scale(0.97);
	}
	100% {
		opacity: 0.9;
		transform: rotate(var(--rot)) scale(1);
	}
}

/* Bereiche mit Tagesstrichen ---------------------------------------------------------------------- */

.sheet {
	scroll-margin-top: 16px;
}
.sheet-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 32px;
	margin-bottom: 18px;
}
.sheet-head h2,
.method h2 {
	margin: 0;
	font-size: clamp(34px, 4vw, 56px);
}
.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--muted);
}
.legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.swatch {
	width: 8px;
	height: 18px;
	border-radius: 2px;
}

.components {
	margin: 0;
	padding: clamp(6px, 1.5vw, 14px) clamp(18px, 3vw, 40px);
	list-style: none;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 2px;
	box-shadow: 0 30px 60px -44px var(--shadow);
}
.component {
	padding-block: clamp(20px, 2.4vw, 30px);
}
.component + .component {
	border-top: 1px dashed color-mix(in oklab, var(--ink-print) 42%, transparent);
}
.head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 16px;
}
.name {
	margin: 0;
	font-family: var(--f-display);
	font-weight: 420;
	font-size: clamp(22px, 2.2vw, 28px);
	line-height: 1.15;
	letter-spacing: -0.01em;
}
.now {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-family: var(--f-mono);
	font-size: 14px;
	font-weight: 500;
}
.dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: currentColor;
}
.now.s-ok {
	color: var(--text-ok);
}
.now.s-degraded {
	color: var(--text-degraded);
}
.now.s-outage {
	color: var(--text-outage);
}
.now.s-none {
	color: var(--text-none);
}
.now.s-none .dot {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px currentColor;
}
.pct {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin: 0 0 0 auto;
	text-align: right;
}
.pct .num {
	font-family: var(--f-mono);
	font-variant-numeric: tabular-nums;
	font-size: 19px;
	font-weight: 600;
	line-height: 1.2;
}
.pct .label {
	flex: none;
	color: var(--muted);
}
.about {
	margin: 4px 0 14px;
	max-width: 70ch;
	font-size: 14.5px;
	color: var(--muted);
}

.strip {
	position: relative;
}
.days {
	display: flex;
	gap: clamp(1px, 0.22vw, 3px);
	margin: 0;
	padding: 0;
	list-style: none;
	touch-action: pan-y;
}
.days li {
	flex: 1 1 0;
	min-width: 0;
}
.day {
	display: block;
	width: 100%;
	height: clamp(34px, 3.2vw, 44px);
	padding: 0;
	border: 0;
	border-radius: 2px;
	cursor: pointer;
	transition: transform 120ms var(--ease);
	transform-origin: bottom;
}
.day {
	position: relative;
}
/* Tag mit eingetragenem Vorfall: Tintenpunkt über dem Strich */
.day.has-incident::before {
	content: '';
	position: absolute;
	top: -9px;
	left: 50%;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--ink);
	transform: translateX(-50%);
}
.day:hover,
.day.is-active {
	transform: scaleY(1.12);
}
.day:focus-visible {
	outline-offset: 2px;
}
.s-ok.day,
.swatch.s-ok {
	background: var(--bar-ok);
}
.s-degraded.day,
.swatch.s-degraded {
	background: var(--bar-degraded);
}
.s-outage.day,
.swatch.s-outage {
	background: var(--bar-outage);
}
/* Keine Messung: schraffiert, damit grau auch ohne Farbsehen nicht wie ein Zustand wirkt */
.s-none.day,
.swatch.s-none {
	background: repeating-linear-gradient(
		135deg,
		var(--bar-none) 0 2px,
		color-mix(in oklab, var(--bar-none) 45%, transparent) 2px 4px
	);
}
/* Notiz zum Tag: über dem Streifen, Pfeil zeigt auf den Strich */
.tip {
	position: absolute;
	bottom: calc(100% + 12px);
	z-index: 5;
	width: min(290px, 100%);
	padding: 11px 14px 12px;
	background: var(--paper);
	border: 1px solid var(--line-strong);
	border-radius: 2px;
	box-shadow: 0 18px 36px -18px var(--shadow);
	font-size: 14px;
	line-height: 1.4;
	pointer-events: none;
}
.tip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: var(--arrow, 50%);
	width: 11px;
	height: 11px;
	background: var(--paper);
	border-right: 1px solid var(--line-strong);
	border-bottom: 1px solid var(--line-strong);
	transform: translate(-50%, -5px) rotate(45deg);
}
.tip p {
	margin: 0;
}
.tip-date {
	font-stretch: 78%;
	font-weight: 600;
	font-size: 13px;
	color: var(--ink-print);
}
.tip-state {
	font-family: var(--f-mono);
	font-weight: 600;
}
.tip.s-ok .tip-state {
	color: var(--text-ok);
}
.tip.s-degraded .tip-state {
	color: var(--text-degraded);
}
.tip.s-outage .tip-state {
	color: var(--text-outage);
}
.tip.s-none .tip-state {
	color: var(--text-none);
}
.tip-counts {
	font-size: 13px;
	color: var(--muted);
}
.tip-incident {
	margin-top: 6px !important;
	padding-top: 6px;
	border-top: 1px dashed var(--line-strong);
	font-weight: 500;
}
.axis {
	display: flex;
	justify-content: space-between;
	margin: 8px 0 0;
	font-family: var(--f-mono);
	font-size: 12px;
	color: var(--muted);
}

/* Vorfälle ------------------------------------------------------------------------------------ */

.open-incidents {
	margin-top: 22px;
	padding: 12px 16px;
	max-width: 52ch;
	background: var(--paper);
	border-left: 3px solid var(--ink);
}
.open-incidents .label {
	display: block;
	margin: 0 0 4px;
}
.open-incidents ul {
	margin: 0;
	padding-left: 18px;
}

.incidents {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	gap: 20px clamp(32px, 6vw, 96px);
	padding-block: clamp(56px, 8vw, 120px) 0;
}
.incidents h2 {
	margin: 0;
	font-size: clamp(34px, 4vw, 56px);
}
.incident-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
}
.incident {
	position: relative;
	padding: 20px clamp(18px, 2.4vw, 28px) 18px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 2px;
	box-shadow: 0 20px 40px -30px var(--shadow);
	scroll-margin-top: 16px;
}
.incident:nth-child(odd) {
	transform: rotate(-0.35deg);
}
.incident:nth-child(even) {
	transform: rotate(0.3deg);
}
.incident .when {
	margin: 0 0 6px;
	padding-right: 120px;
	font-family: var(--f-mono);
	font-size: 13px;
	color: var(--ink-print);
}
.incident h3 {
	margin: 0;
	padding-right: 110px;
	overflow-wrap: break-word;
	font-size: clamp(24px, 2.4vw, 30px);
	line-height: 1.12;
}
.incident .meta {
	margin: 10px 0 0;
}
.severity {
	font-family: var(--f-mono);
	font-size: 13.5px;
	font-weight: 600;
}
.severity.s-degraded {
	color: var(--text-degraded);
}
.severity.s-outage {
	color: var(--text-outage);
}
.affected {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}
.affected li {
	padding: 1px 9px 2px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	font-size: 13.5px;
}
.incident .text {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px dashed color-mix(in oklab, var(--ink-print) 42%, transparent);
}
.incident .text p,
.incident .text ul {
	margin: 0 0 10px;
	max-width: 62ch;
}
.incident .text h4 {
	margin: 14px 0 4px;
	font-family: var(--f-mono);
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-print);
}
.incident .stamp {
	position: absolute;
	top: 18px;
	right: 16px;
	margin: 0;
	font-size: 14px;
}
.incident .stamp.s-ok {
	color: var(--text-ok);
}
.empty {
	margin: 0;
	color: var(--muted);
}

/* So wird gemessen ---------------------------------------------------------------------------- */

.method {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	gap: 20px clamp(32px, 6vw, 96px);
	padding-block: clamp(56px, 8vw, 120px);
}
.method-text p {
	margin: 0 0 14px;
	max-width: 62ch;
	color: var(--text);
}

/* Fuß ----------------------------------------------------------------------------------------- */

.foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px 40px;
	padding-block: 26px 40px;
	border-top: 1px solid var(--line);
	font-size: 14.5px;
	color: var(--muted);
}
.foot p {
	margin: 0;
}
.foot ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.wm {
	font-family: var(--f-display);
	font-weight: 600;
	color: var(--text);
}

@media (max-width: 900px) {
	.hero,
	.incidents,
	.method {
		grid-template-columns: minmax(0, 1fr);
	}
	.note {
		max-width: 460px;
	}
}

@media (max-width: 520px) {
	.pct {
		flex-direction: row;
		align-items: baseline;
		gap: 8px;
		width: 100%;
		margin: 2px 0 0;
		text-align: left;
	}
	.pct .num {
		font-size: 16px;
	}
	.note {
		padding: 20px 18px 16px;
	}
	.note dt {
		flex-basis: 74px;
	}
	.figure {
		right: 0;
		width: 76px;
		height: 71px;
	}
	.incident .when,
	.incident h3 {
		padding-right: 0;
	}
	.incident .stamp {
		position: static;
		margin-top: 6px;
	}
}

/* Große Monitore ohne Skalierung (3840 px bei 100 %): Spalte und Schrift wachsen mit, sonst steht
   die Seite als schmaler Streifen in der Mitte. */
@media (min-width: 2200px) {
	:root {
		--maxw: 1720px;
	}
	body {
		font-size: 20px;
	}
	.day {
		height: 56px;
	}
	.note {
		max-width: 620px;
		justify-self: end;
	}
}

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