/* Brand font, self-hosted (see privacy policy section 2). One monospace
   face for everything, headings included. */
@font-face {
	font-family: 'Geist Mono';
	src: url('/fonts/geist-mono.woff2') format('woff2');
	font-weight: 400 700;
	font-display: swap;
}

/* Brand tokens, taken from the logo and key-visual boards.
   Dark is the default: the inverted hero panel (paper on ink). Light is
   paper with ink, chosen with the header toggle (data-theme on <html>,
   see /js/theme.js). The original OARI blue marks what is live or
   actionable: links, the chosen route, value in transit, the main action.
   The original green marks a settled route. On paper both use deeper
   shades of the same hue so they stay readable.
   The canvases in /js read these tokens too, so colours live in one place. */
:root {
	--bg: #0a0a0a;
	--field: #121211;
	--fg: #f2f2f0;
	--fg-soft: #bdbdb8;
	--muted: #9a9a96;
	--faint: #6e6e6a;
	--rule: #33332f;
	--primary: #009dff;
	--primary-hover: #55bcff;
	--success: #00dcb9;
	--on-primary: #0a0a0a;
	--error: #ff8a80;
	--backdrop: rgb(0 0 0 / 0.7);
	--net-alpha: 1;
	--mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

	font-family: var(--mono);
	font-synthesis: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	color-scheme: dark;
}

:root[data-theme='light'] {
	--bg: #f2f2f0;
	--field: #fbfbfa;
	--fg: #0a0a0a;
	--fg-soft: #4a4a4a;
	--muted: #5b5b5b;
	--faint: #8c8c8c;
	--rule: #c4c4bf;
	--primary: #006fb5;
	--primary-hover: #00578f;
	--success: #007a66;
	--on-primary: #f2f2f0;
	--error: #b3261e;
	--backdrop: rgb(10 10 10 / 0.55);
	--net-alpha: 0.8;

	color-scheme: light;
}

* {
	box-sizing: border-box;
}

html,
body {
	min-width: 350px;
	min-height: 100%;
	background: var(--bg);
	color: var(--fg);
	width: min(100%, 50rem);
	margin: 0 auto;
	line-height: 1.6;
}

body {
	position: relative;
	overflow-x: hidden;
}

/* Agent network: full-bleed ASCII blobs behind the bottom third of the page */
.network-bg {
	position: absolute;
	bottom: 0;
	left: 50%;
	z-index: 0;
	display: block;
	width: 100vw;
	height: clamp(32rem, 58%, 46rem);
	transform: translateX(-50%);
	pointer-events: none;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 100%);
	mask-image: linear-gradient(to bottom, transparent, #000 100%);
	opacity: 0.5;
}

main {
	position: relative;
	z-index: 1;
	display: flex;
	width: 100%;
	padding: 1rem clamp(1rem, 5vw, 4rem);
	flex-direction: column;
	/* Halo keeps copy legible where it sits over the blobs */
	text-shadow:
		0 0 3px var(--bg),
		0 0 8px var(--bg),
		0 0 14px var(--bg);
}

/* Header: the OARI lockup (mark + wordmark, Shift proportions) */
.site-header {
	display: flex;
	max-width: 36rem;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: clamp(3rem, 9vw, 5.5rem);
}

.brand,
.brand:visited {
	display: inline-flex;
	color: var(--fg);
	text-decoration: none;
}

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

.theme-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.3rem 0;
	font: inherit;
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
	background: none;
	border: 0;
	cursor: pointer;
	text-shadow: none;
}

.theme-toggle:hover {
	color: var(--fg);
}

.theme-toggle svg {
	width: 0.9rem;
	height: 0.9rem;
}

.logo {
	display: block;
	width: auto;
	height: 1.75rem;
}

h1,
h2,
p {
	margin: 0;
}

h1 {
	max-width: 36rem;
	margin-bottom: 1rem;
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

h2 {
	margin-bottom: 1rem;
	font-size: 1.1rem;
	font-weight: 700;
	overflow-wrap: anywhere;
}

/* Key-visual line under the title */
.tagline {
	margin-bottom: 2.5rem;
	font-size: 1rem;
	font-weight: 500;
	color: var(--fg-soft);
}

p {
	max-width: 36rem;
	margin-bottom: 1.25rem;
	overflow-wrap: anywhere;
	font-size: 0.9rem;
}

.route {
	max-width: 36rem;
	margin: 0 0 2rem;
}

.route canvas {
	display: block;
	width: 100%;
	height: 14rem;
}

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

.use-cases {
	max-width: 36rem;
	margin: 0 0 2.5rem;
}

.use-cases ol {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: uc;
	font-size: 0.9rem;
	border-top: 1px solid var(--fg);
}

.use-cases li {
	display: grid;
	grid-template-columns: 2.5ch 10rem 1fr;
	gap: 1rem;
	padding: 0.55rem 0;
	border-bottom: 1px dashed var(--rule);
	counter-increment: uc;
}

.use-cases li::before {
	content: counter(uc, decimal-leading-zero);
	color: var(--faint);
}

.uc-name {
	color: var(--primary);
	font-weight: 700;
}

.uc-text {
	color: var(--fg-soft);
}

@media (max-width: 560px) {
	.use-cases li {
		grid-template-columns: 2.5ch 1fr;
		gap: 0.1rem 1rem;
	}

	.uc-text {
		grid-column: 1 / -1;
		font-size: 0.85rem;
	}
}

.more {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
}

/* Back link on text pages */
.back,
.back:visited {
	margin-bottom: 2rem;
	font-size: 0.8rem;
	text-decoration: none;
}

.back:hover {
	text-decoration: underline;
}

/* Ecosystem figures: technical drawings in the site's mono type */
.product,
.readout,
.arch {
	max-width: 36rem;
	margin: 0 0 1.5rem;
	text-shadow: none;
}

.product {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.75rem;
	align-items: center;
}

.product svg {
	display: block;
	width: clamp(9rem, 26vw, 11rem);
	height: auto;
}

.wd-frame {
	fill: var(--bg);
	stroke: var(--faint);
	stroke-width: 1.5;
}

.wd-screen {
	fill: var(--field);
}

.wd-island {
	fill: #000;
}

.wd-bar {
	fill: color-mix(in srgb, var(--fg) 34%, transparent);
}

.wd-strong {
	fill: color-mix(in srgb, var(--fg) 80%, transparent);
}

.wd-dim {
	opacity: 0.55;
}

.wd-card,
.wd-action {
	fill: var(--primary);
}

.wd-card-mark,
.wd-card-line,
.wd-qr {
	fill: var(--on-primary);
}

.wd-card-line {
	opacity: 0.8;
}

.wd-check circle {
	fill: var(--success);
}

.wd-check path {
	fill: none;
	stroke: var(--bg);
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.wd-tile {
	fill: color-mix(in srgb, var(--fg) 7%, transparent);
}

.wd-callout path {
	fill: none;
	stroke: var(--faint);
	stroke-dasharray: 3 3;
}

.wd-callout circle {
	fill: var(--bg);
	stroke: var(--fg);
}

.wd-callout text {
	fill: var(--fg);
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 700;
	text-anchor: middle;
}

.callouts {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: co;
	font-size: 0.82rem;
}

.callouts li {
	padding: 0.55rem 0;
	border-bottom: 1px dashed var(--rule);
	color: var(--fg-soft);
	counter-increment: co;
}

.callouts li::before {
	content: counter(co) '  ';
	color: var(--fg);
	font-weight: 700;
	white-space: pre;
}

.callouts b {
	color: var(--fg);
}

.callouts b::after {
	content: '\A';
	white-space: pre;
}

.readout {
	padding: 0.9rem 1rem;
	border: 1px solid var(--rule);
	font-size: 0.82rem;
}

.readout figcaption,
.arch figcaption {
	margin-bottom: 0.6rem;
	color: var(--muted);
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.page .readout dl {
	margin: 0;
	font-size: inherit;
}

.page .readout dl div {
	grid-template-columns: 7.5rem 1fr;
	padding: 0.25rem 0;
	border: 0;
}

.readout .hl {
	color: var(--primary);
}

.readout .ok {
	color: var(--success);
}

.arch svg {
	display: block;
	width: 100%;
	height: auto;
}

.arch figcaption {
	margin: 0.6rem 0 0;
}

.arch-links {
	fill: none;
	stroke: var(--faint);
	stroke-dasharray: 4 4;
}

.arch-box {
	fill: var(--bg);
	stroke: var(--fg-soft);
}

.arch-core {
	stroke: var(--primary);
	stroke-width: 1.5;
}

.arch-names text,
.arch-labels text {
	font-family: var(--mono);
	text-anchor: middle;
}

.arch-names text {
	fill: var(--fg);
	font-size: 12px;
	dominant-baseline: middle;
}

.arch-core-name {
	fill: var(--primary) !important;
	font-weight: 700;
}

.arch-labels text {
	fill: var(--muted);
	font-size: 10px;
}

@media (max-width: 560px) {
	.product {
		grid-template-columns: 1fr;
		justify-items: center;
	}

	.page .readout dl div {
		grid-template-columns: 1fr;
		gap: 0;
		padding: 0.3rem 0;
	}

	/* Keep diagram text legible; the drawing scrolls instead of shrinking */
	.arch {
		overflow-x: auto;
	}

	.arch svg {
		min-width: 30rem;
	}
}

/* Spec values on text pages */
.page code {
	font: inherit;
	color: var(--fg-soft);
}

a,
a:visited {
	display: inline-block;
	color: var(--primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible {
	outline: 1px solid var(--primary);
	outline-offset: 2px;
}

.actions {
	display: flex;
	gap: 1.25rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.actions button,
.contact-submit,
dialog button {
	font: inherit;
	color: var(--primary);
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.actions button:hover,
dialog button:hover {
	color: var(--primary-hover);
}

#contact-close {
	color: var(--muted);
}

/* Primary action: a solid tile, like the app icon on the logo board */
.actions #contact-trigger {
	padding: 0.45rem 0.9rem;
	color: var(--on-primary);
	background: var(--primary);
	text-decoration: none;
	text-shadow: none;
}

.actions #contact-trigger:hover {
	color: var(--on-primary);
	background: var(--primary-hover);
}

.actions li {
	display: flex;
	align-items: center;
}

dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	margin: 0;
	width: min(100% - 2rem, 27rem);
	padding: 1.5rem;
	border: 1px solid var(--fg);
	background: var(--bg);
	color: var(--fg);
	font-size: 0.85rem;
}

dialog::backdrop {
	background: var(--backdrop);
}

#contact-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	font-size: 1.1rem;
	text-decoration: none;
}

dialog h2 {
	margin: 0 2rem 1.25rem 0;
}

dialog form {
	display: grid;
	gap: 0.8rem;
}

dialog label {
	display: grid;
	gap: 0.25rem;
	font-size: 0.75rem;
}

dialog label small {
	color: var(--muted);
}

dialog input,
dialog textarea {
	width: 100%;
	padding: 0.65rem;
	font: inherit;
	color: var(--fg);
	background: var(--field);
	border: 1px solid var(--faint);
	border-radius: 0;
}

dialog input::placeholder,
dialog textarea::placeholder {
	color: var(--faint);
}

dialog input:focus,
dialog textarea:focus {
	outline: 1px solid var(--primary);
	border-color: var(--primary);
}

dialog textarea {
	resize: vertical;
}

.contact-error {
	margin: 0;
	color: var(--error);
}

dialog form button {
	justify-self: end;
}

footer {
	display: flex;
	max-width: 36rem;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.25rem;
	margin-top: 3rem;
	padding-top: 1rem;
	border-top: 1px solid var(--fg);
	color: var(--muted);
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

footer a,
footer a:visited {
	color: var(--muted);
	text-decoration: none;
}

footer a:hover,
footer a[aria-current='page'] {
	color: var(--fg);
	text-decoration: underline;
}

.contact-notice {
	margin: 0;
	color: var(--muted);
	font-size: 0.7rem;
}

.contact-notice a {
	display: inline;
}

/* Simple text pages: ecosystem, imprint, privacy */
.page h1 {
	margin-bottom: 1.25rem;
}

.page h2 {
	margin: 2.25rem 0 0.75rem;
	font-size: 0.95rem;
}

.page ul,
.page dl {
	max-width: 36rem;
	margin: 0 0 1.25rem;
	font-size: 0.9rem;
}

.page ul {
	padding-left: 1.25rem;
}

.page dl div {
	display: grid;
	grid-template-columns: 10rem 1fr;
	gap: 1rem;
	padding: 0.4rem 0;
	border-bottom: 1px dashed var(--rule);
}

.page dt {
	color: var(--muted);
}

.page dd {
	margin: 0;
	overflow-wrap: anywhere;
}

.page dd a,
.page p a {
	display: inline;
}

.page .muted {
	color: var(--muted);
	font-size: 0.75rem;
}

@media (max-width: 560px) {
	.page dl div {
		grid-template-columns: 1fr;
		gap: 0.1rem;
	}
}

::selection {
	color: var(--on-primary);
	background: var(--primary);
}

@media (max-width: 560px) {
	.logo {
		height: 1.5rem;
	}

	.route canvas {
		height: 18rem;
	}
}
