/*
Theme Name: ImagesWP
Theme URI: https://www.imageswp.com/
Author: Studio build
Description: Hand-coded classic theme for ImagesWP, an image hosting and delivery API. No page builder, no framework, no external requests: three self-hosted font files and plain CSS.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: imageswp
Tags: custom-theme, api, documentation, one-column
*/

/* =========================================================================
   1. Fonts — self hosted, subset to latin, variable where it earns its bytes
   ========================================================================= */

@font-face {
	font-family: "Archivo";
	src: url("assets/fonts/archivo-var.woff2") format("woff2-variations");
	font-weight: 400 800;
	font-stretch: 100% 125%;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Plex Mono";
	src: url("assets/fonts/plexmono-400.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Plex Mono";
	src: url("assets/fonts/plexmono-600.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

/* =========================================================================
   2. Tokens
   ========================================================================= */

:root {
	/* Ground: a cool gallery white, so the photographs carry all the colour. */
	--paper: #fbfbfc;
	--paper-2: #f2f3f6;
	--panel: #ffffff;
	--ink: #0d0f13;
	--ink-2: #565e6b;
	--ink-3: #6b7481;
	--rule: #e3e5ea;
	--rule-2: #eceef2;

	/* Process blue: flat, never gradient. The only chrome colour on the page. */
	--accent: #2438f0;
	--accent-ink: #1b2bc4;
	--accent-wash: #eef0ff;

	/* Registration orange marks values the browser actually measured. */
	--signal: #ff4a1c;
	--signal-ink: #c42e00;

	/* Inverted band — the darkroom next to the light table. */
	--dark: #0d0f13;
	--dark-2: #171a21;
	--dark-3: #1e222b;
	--dark-rule: #272c36;
	--dark-text: #e9ecf1;
	--dark-muted: #9ba4b2;
	--dark-accent: #8c9aff;

	--font-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: "Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--r-sm: 4px;
	--r-md: 8px;
	--r-lg: 14px;

	--pad: clamp(20px, 5vw, 40px);
	--band: clamp(68px, 7.5vw, 104px);
	--maxw: 1200px;

	--shadow-sm: 0 1px 2px rgba(13, 15, 19, .05), 0 1px 1px rgba(13, 15, 19, .04);
	--shadow-md: 0 2px 4px rgba(13, 15, 19, .04), 0 12px 28px -12px rgba(13, 15, 19, .14);
	--shadow-lg: 0 4px 10px rgba(13, 15, 19, .05), 0 30px 60px -24px rgba(13, 15, 19, .24);

	--ease: cubic-bezier(.22, .61, .36, 1);
}

/* =========================================================================
   3. Base
   ========================================================================= */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: 88px;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: 17px;
	line-height: 1.6;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	font-variant-numeric: tabular-nums;
	overflow-x: hidden;
}

img, picture, svg, video { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 {
	margin: 0;
	font-weight: 700;
	letter-spacing: -.022em;
	line-height: 1.08;
}

/* Balance only the hero line. Section headings should fill their column
   rather than collapse into a narrow stack beside the lede. */
h1 { text-wrap: balance; }
h2, h3 { text-wrap: pretty; }

/* The display voice: Archivo pushed wide. Used for headlines only. */
h1, h2, .display {
	font-stretch: 118%;
}

h1 { font-size: clamp(2.55rem, 5.6vw, 4.35rem); }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
h3 { font-size: 1.1875rem; letter-spacing: -.012em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

ul, ol { margin: 0; padding: 0; }

button { font: inherit; color: inherit; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

::selection { background: var(--accent); color: #fff; }

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

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 200;
	background: var(--ink);
	color: #fff;
	padding: 12px 20px;
	border-radius: 0 0 var(--r-md) 0;
	font-size: .9375rem;
	font-weight: 600;
}
.skip:focus { left: 0; color: #fff; }

.vh {
	position: absolute; width: 1px; height: 1px;
	margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* =========================================================================
   4. Layout
   ========================================================================= */

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

.band { padding-block: var(--band); }
.band-tight { padding-block: clamp(52px, 6vw, 84px); }

.band-rule { border-top: 1px solid var(--rule); }

.band-dark {
	background: var(--dark);
	color: var(--dark-text);
}
.band-dark h2, .band-dark h3 { color: #fff; }
.band-dark a { color: var(--dark-accent); }

/* Eyebrows carry the section's real identity: a route, a count, a version. */
.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin-bottom: 20px;
}
.eyebrow::before {
	content: "";
	width: 22px;
	height: 1px;
	background: var(--accent);
	flex: none;
}
.band-dark .eyebrow { color: var(--dark-muted); }
.band-dark .eyebrow::before { background: var(--dark-accent); }

.lede {
	font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
	line-height: 1.62;
	color: var(--ink-2);
	max-width: 58ch;
}
.band-dark .lede { color: var(--dark-muted); }

/* The headline column has to be wide enough for two lines of display type,
   or every section head collapses into a narrow stack. */
.head-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 23rem);
	gap: clamp(24px, 4vw, 56px);
	align-items: end;
	margin-bottom: clamp(32px, 4vw, 52px);
}

/* =========================================================================
   5. Buttons
   ========================================================================= */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 46px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: var(--r-md);
	font-size: .9375rem;
	font-weight: 600;
	letter-spacing: -.005em;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
	background: var(--accent);
	color: #fff;
	box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-ink); color: #fff; }

.btn-ghost {
	background: var(--panel);
	color: var(--ink);
	border-color: var(--rule);
	box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #cfd3db; color: var(--ink); background: var(--panel); }

.btn-sm { min-height: 38px; padding: 0 16px; font-size: .875rem; }

.band-dark .btn-ghost {
	background: transparent;
	color: var(--dark-text);
	border-color: var(--dark-rule);
	box-shadow: none;
}
.band-dark .btn-ghost:hover { border-color: #3c4351; color: #fff; background: var(--dark-2); }

.btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

/* An arrow that leans forward on hover — the page's only decorative motion. */
.btn .arw { transition: transform .2s var(--ease); }
.btn:hover .arw { transform: translateX(3px); }

/* =========================================================================
   6. Header
   ========================================================================= */

.site-head {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(251, 251, 252, .82);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.site-head.is-stuck {
	border-bottom-color: var(--rule);
	background: rgba(251, 251, 252, .92);
}

.head-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	height: 68px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
	font-size: 1.0625rem;
	letter-spacing: -.02em;
	font-stretch: 112%;
	flex: none;
	padding-block: 9px;
}
.brand:hover { color: var(--ink); }
.brand .mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand b { font-weight: 700; }
.brand span { color: var(--ink-3); font-weight: 500; }

.nav { margin-left: auto; }

.nav-list {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
}
.nav-list a {
	display: block;
	padding: 9px 13px;
	border-radius: var(--r-sm);
	font-size: .9375rem;
	font-weight: 500;
	color: var(--ink-2);
	text-decoration: none;
	transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav-list a:hover { color: var(--ink); background: var(--paper-2); }
.nav-list .current-menu-item > a,
.nav-list a[aria-current="page"] { color: var(--ink); }

.head-cta { display: flex; align-items: center; gap: 10px; flex: none; }

/* The in-menu CTA only exists for the mobile drawer. */
.nav > .btn { display: none; }

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid var(--rule);
	border-radius: var(--r-md);
	cursor: pointer;
	margin-left: auto;
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .x { display: none; }
.nav-toggle[aria-expanded="true"] .x { display: block; }
.nav-toggle[aria-expanded="true"] .m { display: none; }

/* =========================================================================
   7. Hero — the console is the thesis
   ========================================================================= */

.hero {
	padding-top: clamp(38px, 4.5vw, 60px);
	padding-bottom: clamp(52px, 6vw, 80px);
	position: relative;
	overflow: hidden;
}

/* A faint contact-sheet grid, the only background texture on the page. */
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(to right, rgba(13, 15, 19, .045) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(13, 15, 19, .045) 1px, transparent 1px);
	background-size: 68px 68px;
	background-position: center top;
	-webkit-mask-image: radial-gradient(120% 78% at 50% 0%, #000 20%, transparent 72%);
	mask-image: radial-gradient(120% 78% at 50% 0%, #000 20%, transparent 72%);
	pointer-events: none;
}
.hero > * { position: relative; }

.hero-head {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: clamp(24px, 5vw, 64px);
	align-items: end;
	margin-bottom: clamp(28px, 3.4vw, 42px);
}

.hero h1 { margin-bottom: 0; }
.hero h1 em {
	font-style: normal;
	color: var(--accent);
}

.hero-sub { padding-bottom: 6px; }
.hero-sub .lede { margin-bottom: 22px; }

.hero-note {
	font-family: var(--font-mono);
	font-size: .75rem;
	color: var(--ink-3);
	letter-spacing: .01em;
	margin-top: 14px;
}

/* --- the console ------------------------------------------------------- */

.console {
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

.console-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	border-bottom: 1px solid var(--rule-2);
	background: linear-gradient(to bottom, #fff, #fcfcfd);
}

.method {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .09em;
	padding: 4px 8px;
	border-radius: var(--r-sm);
	background: var(--accent-wash);
	color: var(--accent-ink);
	flex: none;
}

.url {
	font-family: var(--font-mono);
	font-size: clamp(.8125rem, 1.35vw, .9375rem);
	color: var(--ink-2);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1px 0;
	min-width: 0;
	line-height: 2;
}
.url .u-dim { color: var(--ink-3); }
.url .u-id { color: var(--ink); font-weight: 600; }
.url .u-amp { color: var(--ink-3); }

/* Inline selects: the URL string itself is the control surface. */
.u-sel {
	position: relative;
	display: inline-flex;
	align-items: center;
}
.u-sel select {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-weight: 600;
	color: var(--accent);
	background: var(--accent-wash);
	border: 0;
	border-radius: var(--r-sm);
	padding: 3px 19px 3px 7px;
	margin: 0 1px;
	cursor: pointer;
	line-height: 1.35;
	transition: background-color .16s var(--ease);
}
.u-sel select:hover { background: #e2e6ff; }
.u-sel::after {
	content: "";
	position: absolute;
	right: 7px;
	top: 50%;
	width: 5px;
	height: 5px;
	border-right: 1.5px solid var(--accent);
	border-bottom: 1.5px solid var(--accent);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.console-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 260px;
}

.stage {
	position: relative;
	background: var(--paper-2);
	border-right: 1px solid var(--rule-2);
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

/* The frame the transform renders into — fit= acts on this box. */
.stage-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--paper-2) center/cover no-repeat;
	transition: opacity .34s var(--ease);
}
.stage-img[data-fit="contain"] { object-fit: contain; }
.stage-img[data-fit="fill"] { object-fit: fill; }
.stage.is-loading .stage-img { opacity: .35; }

.stage-progress {
	position: absolute;
	left: 0; top: 0;
	height: 2px;
	width: 0;
	background: var(--signal);
	z-index: 2;
	transition: width .3s var(--ease), opacity .3s var(--ease);
}
.stage.is-loading .stage-progress { width: 72%; }
.stage.is-done .stage-progress { width: 100%; opacity: 0; }

.stage-tag {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 2;
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 500;
	letter-spacing: .04em;
	color: #fff;
	background: rgba(13, 15, 19, .72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	padding: 5px 9px;
	border-radius: var(--r-sm);
}

.readout {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.ro { }
.ro-k {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-3);
	display: block;
	margin-bottom: 3px;
}
.ro-v {
	font-family: var(--font-mono);
	font-size: .9375rem;
	font-weight: 500;
	color: var(--ink);
	display: block;
	line-height: 1.3;
}
.ro-big .ro-v {
	font-family: var(--font-sans);
	font-stretch: 116%;
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: -.025em;
	color: var(--signal-ink);
}
.ro-big .ro-v u {
	font-size: .9375rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--ink-2);
	margin-left: 3px;
	font-stretch: 100%;
}

.ro-delta {
	margin-top: auto;
	border-top: 1px solid var(--rule-2);
	padding-top: 14px;
	font-size: .8125rem;
	line-height: 1.45;
	color: var(--ink-2);
}
.ro-delta b {
	color: var(--signal-ink);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.console-foot {
	border-top: 1px solid var(--rule-2);
	padding: 11px 16px;
	background: #fcfcfd;
	font-family: var(--font-mono);
	font-size: .6875rem;
	color: var(--ink-3);
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	align-items: center;
}
.console-foot .dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--signal);
	display: inline-block;
	margin-right: 6px;
	vertical-align: 1px;
}

/* =========================================================================
   8. Capability strip
   ========================================================================= */

.strip {
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	background: var(--panel);
}
.strip-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.spec {
	padding: 26px 28px 28px;
	border-left: 1px solid var(--rule-2);
}
/* The first value lines up with every other left edge on the page. */
.spec:first-child { border-left: 0; padding-left: 0; }
.spec:last-child { padding-right: 0; }
.spec-v {
	font-stretch: 116%;
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -.028em;
	line-height: 1.1;
	margin-bottom: 5px;
}
.spec-k {
	font-family: var(--font-mono);
	font-size: .6875rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-3);
}

/* =========================================================================
   9. Features
   ========================================================================= */

.features {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--rule);
	border: 1px solid var(--rule);
	border-radius: var(--r-lg);
	overflow: hidden;
}
.feature {
	background: var(--panel);
	padding: clamp(24px, 3vw, 34px);
	transition: background-color .2s var(--ease);
}
.feature:hover { background: #fdfdfe; }
.feature-ico {
	width: 26px; height: 26px;
	color: var(--accent);
	margin-bottom: 18px;
}
.feature h3 { margin-bottom: 8px; }
.feature p {
	font-size: .9375rem;
	color: var(--ink-2);
	line-height: 1.58;
}
.feature code {
	font-family: var(--font-mono);
	font-size: .8125em;
	background: var(--paper-2);
	padding: 1px 5px;
	border-radius: 3px;
	color: var(--ink);
}

/* =========================================================================
   10. Library — the contact sheet
   ========================================================================= */

.search {
	border: 1px solid var(--rule);
	background: var(--panel);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	margin-bottom: 26px;
}
.search-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 16px;
	border-bottom: 1px solid var(--rule-2);
}
.search-row svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search-row input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 1rem;
	padding: 15px 0;
	color: var(--ink);
	outline: none;
}
.search-row input::placeholder { color: var(--ink-3); }
.search-row input:focus-visible { outline: none; }
.search:focus-within { border-color: #c3c9f7; box-shadow: 0 0 0 3px rgba(36, 56, 240, .1); }

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 12px 16px;
}
.chip {
	border: 1px solid var(--rule);
	background: var(--panel);
	border-radius: 100px;
	padding: 6px 13px;
	font-size: .8125rem;
	font-weight: 500;
	font-family: var(--font-mono);
	color: var(--ink-2);
	cursor: pointer;
	transition: all .16s var(--ease);
	min-height: 32px;
}
.chip:hover { border-color: #cfd3db; color: var(--ink); }
.chip[aria-pressed="true"] {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.req-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 18px;
	padding: 11px 16px;
	background: #fcfcfd;
	border-top: 1px solid var(--rule-2);
	font-family: var(--font-mono);
	font-size: .75rem;
	color: var(--ink-2);
	overflow-wrap: anywhere;
}
.req-line .m { color: var(--accent-ink); font-weight: 600; }
.req-line .meta { color: var(--ink-3); flex: none; }
.req-line .meta b { color: var(--signal-ink); font-weight: 600; }

/* Masonry-free contact sheet: portraits simply span two rows. */
.sheet {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 132px;
	gap: 14px;
	list-style: none;
}
.frame {
	position: relative;
	grid-row: span 2;
	border-radius: var(--r-md);
	overflow: hidden;
	background: var(--paper-2);
	border: 1px solid var(--rule);
	opacity: 1;
}
.frame-port { grid-row: span 3; }
.frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background-size: cover;
	background-position: center;
	transition: transform .5s var(--ease), filter .3s var(--ease);
}
.frame picture { display: block; height: 100%; }
.frame:hover img { transform: scale(1.035); }

.frame-meta {
	position: absolute;
	inset: auto 0 0 0;
	padding: 30px 11px 10px;
	/* Dense enough under the text that the caption clears AA over a white sky,
	   not just over a dark one. */
	background: linear-gradient(to top,
		rgba(13, 15, 19, .95) 0%,
		rgba(13, 15, 19, .88) 72%,
		rgba(13, 15, 19, 0) 100%);
	color: #fff;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.frame:hover .frame-meta,
.frame:focus-within .frame-meta { opacity: 1; transform: none; }
.frame-id {
	font-family: var(--font-mono);
	font-size: .6875rem;
	letter-spacing: .04em;
	color: #c7ccff;
	display: block;
}
.frame-title {
	font-size: .8125rem;
	font-weight: 500;
	line-height: 1.3;
	display: block;
	margin-top: 2px;
}
.frame-idx {
	position: absolute;
	top: 8px;
	left: 9px;
	font-family: var(--font-mono);
	font-size: .625rem;
	font-weight: 600;
	letter-spacing: .06em;
	color: #fff;
	background: rgba(13, 15, 19, .55);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-radius: 3px;
	padding: 2px 5px;
	opacity: 0;
	transition: opacity .24s var(--ease);
}
.frame:hover .frame-idx, .frame:focus-within .frame-idx { opacity: 1; }
.frame[hidden] { display: none; }

.sheet-empty {
	grid-column: 1 / -1;
	padding: 44px 0;
	text-align: center;
	color: var(--ink-2);
	font-size: .9375rem;
}
.sheet-empty code {
	font-family: var(--font-mono);
	background: var(--paper-2);
	padding: 2px 6px;
	border-radius: 3px;
}

/* =========================================================================
   11. Code band
   ========================================================================= */

.code-cols {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.tabs {
	display: flex;
	gap: 2px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--dark-rule);
}
.tab {
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 9px 14px;
	font-family: var(--font-mono);
	font-size: .8125rem;
	font-weight: 500;
	color: var(--dark-muted);
	cursor: pointer;
	transition: color .16s var(--ease), border-color .16s var(--ease);
	min-height: 40px;
}
.tab:hover { color: var(--dark-text); }
.tab[aria-selected="true"] {
	color: #fff;
	border-bottom-color: var(--dark-accent);
}

.code {
	background: var(--dark-2);
	border: 1px solid var(--dark-rule);
	border-radius: var(--r-md);
	overflow: hidden;
}
.code-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 10px 8px 14px;
	border-bottom: 1px solid var(--dark-rule);
	background: #13161d;
}
.code-lang {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .1em;
	color: var(--dark-muted);
}
.code-copy {
	background: transparent;
	border: 1px solid var(--dark-rule);
	border-radius: var(--r-sm);
	color: var(--dark-muted);
	font-family: var(--font-mono);
	font-size: .6875rem;
	padding: 5px 9px;
	cursor: pointer;
	transition: all .16s var(--ease);
	min-height: 28px;
}
.code-copy:hover { color: #fff; border-color: #3c4351; }
.code-copy.is-done { color: #7ee2a8; border-color: #2c5b40; }

.code-pre {
	margin: 0;
	padding: 16px 18px;
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: .8125rem;
	line-height: 1.72;
	color: #d7dce4;
	tab-size: 2;
}
.code-pre code { font: inherit; }

/* Hand-marked highlighting — no runtime highlighter ships to the browser. */
.t-com { color: #838c9e; font-style: italic; }
.t-str { color: #9fd7a8; }
.t-key { color: #8c9aff; }
.t-num { color: #f0b37a; }
.t-fn  { color: #7fd4e8; }
.t-var { color: #e6d38a; }
.t-pun { color: #8d95a3; }

.panel-title {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--dark-muted);
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--dark-rule);
	display: block;
	min-height: 42px;
	display: flex;
	align-items: flex-end;
}

.tabpanel[hidden] { display: none; }

/* =========================================================================
   12. Pricing
   ========================================================================= */

.tiers {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	align-items: start;
}
.tier {
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: var(--r-lg);
	padding: 26px 24px 28px;
	display: flex;
	flex-direction: column;
	box-shadow: var(--shadow-sm);
	position: relative;
}
.tier-hot {
	border-color: var(--ink);
	box-shadow: var(--shadow-md);
}
.tier-flag {
	position: absolute;
	top: -1px;
	right: 20px;
	transform: translateY(-50%);
	background: var(--ink);
	color: #fff;
	font-family: var(--font-mono);
	font-size: .625rem;
	font-weight: 600;
	letter-spacing: .11em;
	text-transform: uppercase;
	padding: 4px 9px;
	border-radius: 100px;
}
.tier h3 {
	font-family: var(--font-mono);
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-2);
	margin-bottom: 14px;
}
.tier-price {
	font-stretch: 118%;
	font-size: 2.75rem;
	font-weight: 700;
	letter-spacing: -.035em;
	line-height: 1;
	margin-bottom: 4px;
}
.tier-price small {
	font-size: 1rem;
	font-weight: 500;
	font-stretch: 100%;
	letter-spacing: -.01em;
	color: var(--ink-3);
}
.tier-note {
	font-size: .875rem;
	color: var(--ink-2);
	margin-bottom: 22px;
	min-height: 42px;
}
.tier .btn { width: 100%; margin-bottom: 22px; }
.tier ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: .875rem;
	color: var(--ink-2);
	line-height: 1.45;
}
.tier li { display: flex; gap: 9px; align-items: flex-start; }
.tier li svg { width: 15px; height: 15px; color: var(--accent); flex: none; margin-top: 3px; }
.tier li b { color: var(--ink); font-weight: 600; }
.tier li code {
	font-family: var(--font-mono);
	font-size: .8125em;
	color: var(--ink);
}

.tier-foot {
	margin-top: 22px;
	padding: 15px 18px;
	border: 1px dashed var(--rule);
	border-radius: var(--r-md);
	font-size: .875rem;
	color: var(--ink-2);
	background: var(--panel);
}
.tier-foot b { color: var(--ink); font-weight: 600; }

/* =========================================================================
   13. FAQ
   ========================================================================= */

.faq {
	border-top: 1px solid var(--rule);
	max-width: 78ch;
}
.qa {
	border-bottom: 1px solid var(--rule);
}
.qa summary {
	list-style: none;
	cursor: pointer;
	padding: 21px 44px 21px 0;
	position: relative;
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: -.012em;
	transition: color .16s var(--ease);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--accent-ink); }
.qa summary::after {
	content: "";
	position: absolute;
	right: 8px;
	top: 30px;
	width: 9px;
	height: 9px;
	border-right: 1.6px solid var(--ink-3);
	border-bottom: 1.6px solid var(--ink-3);
	transform: rotate(45deg);
	transition: transform .22s var(--ease);
}
.qa[open] summary::after { transform: rotate(-135deg); }
.qa-body {
	padding: 0 8ch 24px 0;
	color: var(--ink-2);
	font-size: .9375rem;
	line-height: 1.65;
}
.qa-body code {
	font-family: var(--font-mono);
	font-size: .85em;
	background: var(--paper-2);
	padding: 1px 5px;
	border-radius: 3px;
	color: var(--ink);
}

/* =========================================================================
   14. Final CTA + footer
   ========================================================================= */

.cta-band {
	background: var(--dark);
	color: var(--dark-text);
	position: relative;
	overflow: hidden;
}
.cta-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: clamp(24px, 5vw, 60px);
	align-items: center;
}
.cta-band h2 { margin-bottom: 14px; }
.cta-band .lede { color: var(--dark-muted); }
.cta-band .btn-primary { background: #fff; color: var(--ink); }
.cta-band .btn-primary:hover { background: #e6e9f5; color: var(--ink); }

.site-foot {
	background: var(--dark);
	color: var(--dark-muted);
	border-top: 1px solid var(--dark-rule);
	padding-block: clamp(44px, 5vw, 60px) 30px;
	font-size: .875rem;
}
.foot-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
	gap: 32px;
	padding-bottom: 34px;
}
.foot-grid h3 {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #7c8697;
	margin-bottom: 14px;
}
.foot-grid ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.foot-grid a { color: var(--dark-muted); text-decoration: none; transition: color .16s var(--ease); }
.foot-grid a:hover { color: #fff; }
.foot-brand .brand { color: #fff; margin-bottom: 12px; }
.foot-brand .brand .mark { color: var(--dark-accent); }
.foot-brand .brand span { color: #7c8697; }
.foot-brand p { max-width: 34ch; line-height: 1.6; }

.foot-bar {
	border-top: 1px solid var(--dark-rule);
	padding-top: 22px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	justify-content: space-between;
	align-items: center;
	font-family: var(--font-mono);
	font-size: .75rem;
	color: #7c8697;
}
.foot-note {
	max-width: 74ch;
	line-height: 1.6;
}

/* =========================================================================
   15. Docs
   ========================================================================= */

.docs-shell {
	display: grid;
	grid-template-columns: 218px minmax(0, 1fr);
	gap: clamp(28px, 5vw, 64px);
	align-items: start;
	padding-block: clamp(36px, 4vw, 56px) clamp(64px, 8vw, 104px);
}

.docs-side {
	position: sticky;
	top: 88px;
	max-height: calc(100vh - 108px);
	overflow-y: auto;
	padding-right: 8px;
}
.docs-side h4 {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-3);
	margin: 0 0 12px 12px;
}
.docs-side ul { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.docs-side a {
	display: block;
	padding: 7px 12px;
	border-radius: var(--r-sm);
	font-size: .875rem;
	color: var(--ink-2);
	text-decoration: none;
	border-left: 2px solid transparent;
	transition: color .14s var(--ease), background-color .14s var(--ease), border-color .14s var(--ease);
}
.docs-side a:hover { color: var(--ink); background: var(--paper-2); }
.docs-side a.is-active {
	color: var(--accent-ink);
	border-left-color: var(--accent);
	background: var(--accent-wash);
	font-weight: 500;
}

.docs-main { min-width: 0; max-width: 76ch; }

.docs-hero { padding-bottom: 30px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.docs-hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); margin-bottom: 14px; }

.doc-sec { padding-top: clamp(44px, 5vw, 60px); scroll-margin-top: 84px; }
.doc-sec > h2 {
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
	margin-bottom: 14px;
}
.doc-sec > h3 {
	margin-top: 30px;
	margin-bottom: 10px;
}
.doc-sec p { color: var(--ink-2); font-size: .9375rem; line-height: 1.68; }
.doc-sec p code, .doc-sec li code, td code, .doc-sec h3 code {
	font-family: var(--font-mono);
	font-size: .85em;
	background: var(--paper-2);
	border: 1px solid var(--rule-2);
	padding: 1px 5px;
	border-radius: 3px;
	color: var(--ink);
	white-space: nowrap;
}
.doc-sec .code { margin: 18px 0; }
.doc-sec ul.bullets {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 14px 0;
	font-size: .9375rem;
	color: var(--ink-2);
}
.doc-sec ul.bullets li { padding-left: 18px; position: relative; line-height: 1.6; }
.doc-sec ul.bullets li::before {
	content: "";
	position: absolute;
	left: 2px; top: 10px;
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--accent);
	opacity: .5;
}

.endpoint {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: var(--r-md);
	padding: 11px 14px;
	margin: 6px 0 18px;
	font-family: var(--font-mono);
	font-size: .875rem;
	overflow-wrap: anywhere;
	box-shadow: var(--shadow-sm);
}
.endpoint .method { background: #e8f3ec; color: #1d6b3c; }
.endpoint .path { color: var(--ink); font-weight: 500; }
.endpoint .path b { color: var(--accent-ink); font-weight: 600; }

.tbl-scroll { overflow-x: auto; margin: 16px 0 8px; }
table.params {
	width: 100%;
	border-collapse: collapse;
	font-size: .875rem;
	min-width: 480px;
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: var(--r-md);
	overflow: hidden;
}
table.params th {
	text-align: left;
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-3);
	padding: 11px 14px;
	border-bottom: 1px solid var(--rule);
	background: #fcfcfd;
	white-space: nowrap;
}
table.params td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--rule-2);
	color: var(--ink-2);
	vertical-align: top;
	line-height: 1.55;
}
table.params tr:last-child td { border-bottom: 0; }
table.params td:first-child {
	font-family: var(--font-mono);
	color: var(--ink);
	font-weight: 500;
	white-space: nowrap;
}
table.params td.t { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-3); white-space: nowrap; }

.callout {
	border-left: 2px solid var(--accent);
	background: var(--accent-wash);
	padding: 15px 18px;
	border-radius: 0 var(--r-md) var(--r-md) 0;
	margin: 20px 0;
	font-size: .875rem;
	color: #2a3050;
	line-height: 1.6;
}
.callout b { color: var(--ink); }
.callout code { background: rgba(255,255,255,.7); }

.docs-toggle { display: none; }

/* =========================================================================
   16. Motion
   ========================================================================= */

/* Nothing is hidden until app.js has confirmed it can reveal it again. */
.reveal .rise {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal .rise.is-in { opacity: 1; transform: none; }

.hero-anim .hero-head > *,
.hero-anim .console {
	animation: rise-in .7s var(--ease) both;
}
.hero-anim .hero-head > *:nth-child(1) { animation-delay: .04s; }
.hero-anim .hero-head > *:nth-child(2) { animation-delay: .12s; }
.hero-anim .console { animation-delay: .2s; }

@keyframes rise-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

/* =========================================================================
   17. Responsive
   ========================================================================= */

@media (max-width: 1080px) {
	.docs-shell { grid-template-columns: 190px minmax(0, 1fr); }
	.sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
	.hero-head { grid-template-columns: 1fr; align-items: start; gap: 22px; }
	.head-row { grid-template-columns: 1fr; align-items: start; }
	.console-body { grid-template-columns: 1fr; }
	.stage { border-right: 0; border-bottom: 1px solid var(--rule-2); }
	.readout {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 20px;
	}
	.ro-delta { grid-column: 1 / -1; margin-top: 0; }
	.features { grid-template-columns: 1fr; }
	.code-cols { grid-template-columns: minmax(0, 1fr); gap: 26px; }
	.tiers { grid-template-columns: 1fr; }
	.tier-note { min-height: 0; }
	.strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.spec { border-left: 0; border-top: 1px solid var(--rule-2); padding-inline: 0; }
	.strip .wrap { padding-block: 0; }
	.spec:nth-child(1), .spec:nth-child(2) { border-top: 0; }
	.spec:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--rule-2); }
	.cta-inner { grid-template-columns: 1fr; }
	.foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
	.foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.nav-toggle { display: flex; }
	.head-inner { height: 62px; }
	.nav {
		position: absolute;
		left: 0; right: 0;
		top: 100%;
		background: var(--paper);
		border-bottom: 1px solid var(--rule);
		border-top: 1px solid var(--rule);
		padding: 10px var(--pad) 18px;
		margin: 0;
		display: none;
		box-shadow: var(--shadow-md);
	}
	.nav.is-open { display: block; }
	.nav-list { flex-direction: column; align-items: stretch; gap: 0; }
	.nav-list a { padding: 13px 4px; font-size: 1rem; border-bottom: 1px solid var(--rule-2); border-radius: 0; }
	.nav-list li:last-child a { border-bottom: 0; }
	.head-cta .btn { display: none; }
	.nav .btn { display: inline-flex; margin-top: 14px; width: 100%; }

	.docs-shell { grid-template-columns: 1fr; }
	.docs-side {
		position: static;
		max-height: none;
		border: 1px solid var(--rule);
		border-radius: var(--r-md);
		padding: 14px;
		background: var(--panel);
	}
	.docs-side h4 { margin-left: 4px; }
	.docs-side ul {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px;
	}
	.docs-side a {
		border: 1px solid var(--rule);
		border-left-width: 1px;
		border-radius: 100px;
		padding: 7px 12px;
		font-size: .8125rem;
	}
	.docs-side a.is-active { border-color: #c3c9f7; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 10px; }
	.readout { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
	.console-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
	.url { line-height: 2.1; }
	/* The two-up spec grid from the 920px rules still fits at 390px. */
	.spec { padding-block: 20px 22px; }
	.spec-v { font-size: 1.4rem; }
	.foot-grid { grid-template-columns: 1fr; }
	.qa-body { padding-right: 0; }
	.tier-price { font-size: 2.4rem; }
	.chips { padding: 10px 12px; }
	.frame-meta { padding: 26px 9px 8px; }
	.frame-title { font-size: .75rem; }
}

@media (max-width: 380px) {
	.hero h1 { font-size: 2.2rem; }
	.btn { padding: 0 16px; }
}

/* =========================================================================
   18. Reduced motion & print
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
	.reveal .rise { opacity: 1; transform: none; }
	.frame:hover img { transform: none; }
	.hero-anim .hero-head > *, .hero-anim .console { animation: none; }
}

/* Touch devices: nothing tappable falls below the 44px target. */
@media (pointer: coarse) {
	.code-copy { min-height: 44px; padding-inline: 14px; }
	.chip { min-height: 40px; }
	.qa summary { padding-block: 24px; }
	.docs-side a { min-height: 40px; display: flex; align-items: center; }
}

@media print {
	.site-head, .cta-band, .nav-toggle, .code-copy { display: none; }
	body { background: #fff; }
}

/* =========================================================================
   16. Contact page
   ========================================================================= */

.contact-shell { max-width: 680px; padding-top: 64px; padding-bottom: 96px; }
.contact-hero { margin-bottom: 40px; }
.contact-hero h1 { margin: 14px 0 16px; }

.contact-form {
	background: var(--panel);
	border: 1px solid var(--rule);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
	padding: 28px;
	display: grid;
	gap: 20px;
}
.cf-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.cf-field { display: grid; gap: 8px; }
.cf-field label {
	font-family: var(--font-mono);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ink-2);
}
.cf-field input,
.cf-field select,
.cf-field textarea {
	border: 1px solid var(--rule);
	background: var(--paper);
	border-radius: var(--r-md);
	font: inherit;
	font-size: .9375rem;
	color: var(--ink);
	padding: 12px 14px;
	min-height: 46px;
	width: 100%;
}
.cf-field textarea { resize: vertical; min-height: 140px; }
.cf-field input:focus-visible,
.cf-field select:focus-visible,
.cf-field textarea:focus-visible {
	outline: none;
	border-color: #c3c9f7;
	box-shadow: 0 0 0 3px rgba(36, 56, 240, .1);
}
.cf-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cf-status { font-size: .875rem; color: var(--ink-2); margin: 0; }
.cf-status.is-ok { color: #1c7c43; }
.cf-status.is-err { color: #b3261e; }

@media (max-width: 720px) {
	.cf-row { grid-template-columns: minmax(0,1fr); }
	.contact-form { padding: 20px; }
}
