/* Hypersphere public site: the SDK page (sdk.html, specified in docs/site.md, "The SDK page"). Loaded after site.css
   and validation.css, whose hero glow, section heads and figure tiles it shares. A product page on the starfield: the
   promise and one call to action, code beside the scene it makes, what it computes, how accurate it is, where it runs,
   and the request form. Colours come from the site's tokens and are picked with classes (the page's policy forbids
   style attributes). */

.sdk-page { flex: 1 0 auto; }
/* No paragraph ends on a lone word (the wrap style only: a one-line label keeps its nowrap). */
.sdk-page p { text-wrap-style: pretty; }
.sdk-page .site-num { white-space: nowrap; }

/* ----- the hero: centred, on the validation page's glow ------------------------------------------------------------- */

.sdk-hero { position: relative; isolation: isolate; overflow-x: clip; padding: clamp(36px, 4.2vw, 60px) 0 0; text-align: center; }
.sdk-hero::before {
	content: "";
	position: absolute;
	z-index: -1;
	left: 50%;
	top: 0;
	width: min(1100px, 130vw);
	height: min(100%, 620px);
	transform: translateX(-50%);
	background: radial-gradient(closest-side, rgba(86, 211, 218, .14), rgba(67, 155, 247, .05) 55%, transparent);
	pointer-events: none;
}
.sdk-hero .site-kicker { color: var(--site-accent); letter-spacing: .18em; }
.sdk-hero h1 {
	max-width: 24ch;
	margin: 16px auto 0;
	font-size: clamp(36px, 4.4vw, 60px);
	line-height: 1.05;
	letter-spacing: -.02em;
}
.sdk-lede { max-width: 62ch; margin: 20px auto 0; font-size: 19px; line-height: 1.55; }
.sdk-page .sdk-lede { text-wrap-style: balance; }
/* What to build with it: a quiet lead-in, then labels in the analysis colours (not controls: no fill, no highlight). */
.sdk-uses { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 26px auto 0; }
.sdk-uses-label { color: var(--site-text-4); font: 600 12px/1.2 var(--site-font-display); letter-spacing: .16em; text-transform: uppercase; }
.sdk-uses ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; }
.sdk-uses li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 34px;
	padding: 0 14px 0 11px;
	border: 1px solid var(--site-hair-soft);
	border-radius: 999px;
	background: rgba(255, 255, 255, .025);
	color: var(--site-text-2);
	font: 500 14.5px/1.2 var(--site-font-text);
}
.sdk-uses svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--c); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sdk-hero-actions { justify-content: center; align-items: center; gap: 14px 30px; margin-top: 28px; }
.sdk-hero-actions .site-button { min-height: 50px; padding: 0 30px 0 26px; font-size: 16px; }

/* ----- sections ------------------------------------------------------------------------------------------------------- */

.sdk-section { padding-top: clamp(72px, 9vw, 128px); }
#code { padding-top: clamp(48px, 4.4vw, 64px); }
#code .cmp-head { margin-bottom: 26px; }

/* ----- code beside the scene it makes -------------------------------------------------------------------------------------
   One glass panel: the code (a sunken well with its file and the language tabs) and the still, its caption and the
   day's three figures. Long lines wrap with a hanging indent, so no width scrolls sideways: the build puts each line's
   leading spaces or tab in .sdk-ind, capped here at one indent (a continuation aligned under an open parenthesis would
   otherwise sit far right once the line above it wraps), and lets a line break after a "(" or a ".", so a long line
   wraps at a call or a member rather than inside a name. The copied text is the example's, spaces and all. Plumbing a
   reader skips (is-quiet) is drawn dimmer. */

.sdk-demo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0; overflow: hidden; }
.sdk-code { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--site-hair-soft); background: rgba(5, 6, 8, .55); }
.sdk-code-head { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--site-hair-soft); }
.sdk-code-file { min-width: 0; overflow: hidden; color: var(--site-text-3); font: 500 12.5px/1.2 var(--site-font-mono); letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.sdk-tabs { display: flex; flex: none; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--site-hair-soft); border-radius: 999px; background: rgba(0, 0, 0, .35); }
.sdk-tabs button {
	min-height: 32px;
	padding: 0 14px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: none;
	color: var(--site-text-3);
	font: 500 13.5px/1 var(--site-font-text);
	cursor: pointer;
	transition: background-color .12s var(--site-ease), color .12s var(--site-ease);
}
.sdk-tabs button:hover { color: var(--site-text); }
.sdk-tabs button[aria-selected="true"] {
	border-color: rgba(255, 255, 255, .12);
	background: linear-gradient(180deg, #31373d, #22272c);
	color: var(--site-text);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -1px 0 rgba(86, 211, 218, .6);
}
.sdk-code-panel { flex: 1; min-width: 0; }
.sdk-code-panel + .sdk-code-panel { border-top: 1px solid var(--site-hair-soft); }
.sdk-code pre { margin: 0; padding: 18px 20px 22px; color: #dddfe3; font-size: 12px; line-height: 1.7; tab-size: 4; }
.sdk-code pre:focus-visible { outline-offset: -2px; }
.sdk-code code { display: block; white-space: normal; }
.sdk-ln { display: block; padding-left: 4ch; text-indent: -4ch; white-space: pre-wrap; overflow-wrap: break-word; }
.sdk-ln.is-indented { padding-left: 8ch; text-indent: -8ch; }
.sdk-ind { display: inline-block; max-width: 4ch; overflow: hidden; text-indent: 0; white-space: pre; vertical-align: top; }
.sdk-ln.is-quiet { opacity: .55; }
.sdk-nobr { white-space: nowrap; }
.sdk-ln:empty::after { content: " "; }
.tok-k { color: #e7a0ff; }
.tok-s { color: #9ee6b4; }
.tok-n { color: var(--c-transfer); }
.tok-f { color: var(--site-accent); }
.tok-c { color: #f3d9ff; }
.tok-a { color: #a9b4c4; }

.sdk-result { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 14px; }
/* Beside the code the still is the column's hero, square (the globe and its orbits whole, the starfield cut from the
   sides), and under its caption the day's three figures, each label under its number, as on the accuracy tiles. */
.sdk-result .site-viewport { flex: none; aspect-ratio: 1; border-radius: var(--site-r-tile); }
.sdk-result figcaption { margin-top: 14px; padding: 0 4px; color: var(--site-text-3); font-size: 14.5px; line-height: 1.5; }
.sdk-figures-title { padding: 20px 4px 0; color: var(--site-text-4); font: 600 12px/1.2 var(--site-font-display); letter-spacing: .12em; text-transform: uppercase; }
.sdk-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; list-style: none; }
.sdk-figures li { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 13px; border: 1px solid var(--site-hair-soft); border-radius: var(--site-r-tile); background: rgba(0, 0, 0, .24); }
.sdk-figures b { display: flex; flex: none; align-items: baseline; gap: 4px; color: var(--site-text); font: 600 30px/1 var(--site-font-display); letter-spacing: -.02em; }
.sdk-figures b small { color: var(--site-text-3); font: 500 14px/1 var(--site-font-text); letter-spacing: 0; }
.sdk-figures li > span { color: var(--site-text-3); font-size: 13.5px; line-height: 1.35; }

/* ----- what it computes ------------------------------------------------------------------------------------------------- */

.sdk-caps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; list-style: none; }
.sdk-caps li { display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 22px; border-radius: var(--site-r-tile); }
.sdk-caps svg { width: 26px; height: 26px; margin-bottom: 8px; fill: none; stroke: var(--c); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sdk-caps svg .solid { fill: var(--c); stroke: none; }
.sdk-caps h3 { font-size: 17.5px; line-height: 1.2; }
.sdk-caps p { color: var(--site-text-3); font-size: 15px; line-height: 1.5; }
.sdk-more { max-width: 70ch; margin: 28px auto 0; color: var(--site-text-3); font-size: 16px; line-height: 1.6; text-align: center; }

/* ----- accuracy ---------------------------------------------------------------------------------------------------------- */

#accuracy .cmp-proof { margin-top: 0; }
.sdk-accuracy-link { margin-top: 26px; text-align: center; }

/* ----- where it runs ------------------------------------------------------------------------------------------------------ */

/* Three columns of its own (not the landing page's facts row, whose third item has rules for four), each item's text in
   line with the requirements under them at every width. */
.sdk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; }
.sdk-facts li { padding: 26px 28px; border-left: 1px solid var(--site-hair-soft); }
.sdk-facts li:first-child { border-left: 0; }
.sdk-facts h3 { font-size: 18px; line-height: 1.25; }
.sdk-facts p { margin-top: 6px; color: var(--site-text-3); font-size: 15px; line-height: 1.5; }

/* ----- the request form ----------------------------------------------------------------------------------------------------
   One panel: what to expect on the left, the form on the right. Sent, the form goes and its status says so. */

.sdk-request { padding-bottom: 88px; scroll-margin-top: calc(var(--site-topbar) + 16px); }
.sdk-request-panel { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.sdk-request-intro { display: flex; flex-direction: column; gap: 14px; padding: 34px 34px 30px; border-right: 1px solid var(--site-hair-soft); }
.sdk-request-intro h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.1; letter-spacing: -.01em; }
.sdk-request-intro > p { color: var(--site-text-2); font-size: 17px; line-height: 1.55; }
.sdk-request-points { display: grid; gap: 10px; padding-top: 10px; list-style: none; }
.sdk-request-points li { display: flex; align-items: flex-start; gap: 10px; color: var(--site-text-3); font-size: 15px; line-height: 1.45; }
.sdk-request-points svg { flex: none; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: var(--site-accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sdk-request-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 30px 32px 32px; }
.sdk-form { gap: 18px; }
.sdk-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.sdk-form textarea {
	width: 100%;
	min-height: 112px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--site-hair);
	border-radius: var(--site-r-ctl);
	background: var(--site-well);
	color: var(--site-text);
	font: 400 16px/1.5 var(--site-font-text);
	resize: vertical;
	transition: border-color .12s var(--site-ease);
}
.sdk-form textarea:hover { border-color: rgba(255, 255, 255, .24); }
.sdk-form textarea:focus-visible { border-color: transparent; outline-offset: 0; }
.sdk-form textarea[aria-invalid="true"] { border-color: var(--c-high); }

.sdk-topics { min-width: 0; margin: 0; padding: 0; border: 0; }
.sdk-topics legend { margin-bottom: 8px; padding: 0; color: var(--site-text-2); font: 500 14.5px/1.3 var(--site-font-text); }
.sdk-topic-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sdk-topic {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 14px 14px 12px;
	border: 1px solid var(--site-hair);
	border-radius: var(--site-r-tile);
	background: var(--site-well);
	cursor: pointer;
	transition: border-color .12s var(--site-ease), background-color .12s var(--site-ease);
}
.sdk-topic:hover { border-color: rgba(255, 255, 255, .24); }
.sdk-topic:has(input:checked) { border-color: rgba(86, 211, 218, .7); background: rgba(86, 211, 218, .07); box-shadow: inset 0 0 0 1px rgba(86, 211, 218, .25); }
.sdk-topic input {
	display: grid;
	place-content: center;
	flex: none;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	border: 1px solid var(--site-hair);
	border-radius: 50%;
	background: var(--site-well);
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.sdk-topic input::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--site-accent); transform: scale(0); transition: transform .12s var(--site-ease); }
.sdk-topic input:checked { border-color: var(--site-accent); }
.sdk-topic input:checked::before { transform: scale(1); }
.sdk-topic span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sdk-topic b { color: var(--site-text); font: 500 15.5px/1.3 var(--site-font-text); }
.sdk-topic small { color: var(--site-text-4); font-size: 13.5px; line-height: 1.4; }
.sdk-topics[aria-invalid="true"] .sdk-topic { border-color: var(--c-high); }

/* The trap: off screen for people and out of the accessibility tree, while bots that fill every field fill it. */
.sdk-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sdk-form .site-form-actions .site-button { min-height: 48px; padding: 0 28px 0 24px; font-size: 15.5px; }
.sdk-form-note { color: var(--site-text-4); font-size: 14px; line-height: 1.45; }

/* The status line: sending and refusals as text, the request sent as a note with a tick, and a next step under it. */
/* A long address breaks anywhere rather than past the panel. */
.sdk-status { overflow-wrap: anywhere; }
.sdk-status[data-state="invalid"], .sdk-status[data-state="limited"], .sdk-status[data-state="failed"] { color: #ffb4ae; }
.sdk-status[data-state="done"] {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 18px 18px 16px;
	border: 1px solid rgba(76, 214, 138, .4);
	border-radius: var(--site-r-tile);
	background: rgba(76, 214, 138, .07);
	color: var(--site-text);
	font-size: 16.5px;
	line-height: 1.5;
}
.sdk-status[data-state="done"]::before {
	content: "";
	flex: none;
	width: 10px;
	height: 18px;
	margin: 0 6px 0 4px;
	border-right: 2px solid var(--c-link);
	border-bottom: 2px solid var(--c-link);
	transform: rotate(45deg) translate(-2px, -2px);
}
.sdk-sent-next { padding-left: 2px; }

/* ----- narrower windows ------------------------------------------------------------------------------------------------- */

@media (max-width: 1359px) {
	/* The code wraps more beside a narrower still: the figures stand in rows under it, so the column meets the code's end. */
	.sdk-figures { grid-template-columns: minmax(0, 1fr); }
	.sdk-figures li { padding: 14px 16px; }
}
@media (max-width: 1179px) {
	.sdk-caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 999px) {
	/* One column, the result first: a phone sees what the code makes before it reads the code. */
	.sdk-demo { grid-template-columns: minmax(0, 1fr); }
	.sdk-result { order: -1; padding: 16px; }
	.sdk-result .site-viewport { aspect-ratio: 16 / 10; }
	.sdk-figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.sdk-figures li { padding: 14px 14px 13px; }
	.sdk-code { border-right: 0; border-top: 1px solid var(--site-hair-soft); }
	.sdk-code pre { font-size: 12.5px; }
	.sdk-figures { gap: 10px; }
	.sdk-request-panel { grid-template-columns: minmax(0, 1fr); }
	.sdk-request-intro { padding-bottom: 6px; border-right: 0; }
	.sdk-request-points { padding-top: 4px; }
	.sdk-facts { grid-template-columns: minmax(0, 1fr); }
	.sdk-facts li { padding: 20px 24px; border-left: 0; }
	.sdk-facts li + li { border-top: 1px solid var(--site-hair-soft); }
}
@media (max-width: 640px) {
	.sdk-hero { text-align: left; }
	.sdk-hero h1, .sdk-lede { margin-left: 0; }
	.sdk-hero h1 { font-size: 34px; }
	.sdk-lede { margin-top: 16px; font-size: 17px; }
	.sdk-uses { justify-content: flex-start; gap: 8px 10px; margin-top: 20px; }
	.sdk-uses ul { justify-content: flex-start; gap: 6px; }
	.sdk-uses li { gap: 6px; min-height: 30px; padding: 0 10px 0 8px; font-size: 13.5px; }
	.sdk-uses svg { width: 14px; height: 14px; }
	.sdk-hero-actions { margin-top: 22px; }
	.sdk-hero-actions { flex-direction: column; align-items: stretch; }
	.sdk-hero-actions .site-button { width: 100%; }
	.sdk-hero-actions .site-link { align-self: flex-start; min-height: 44px; }
	.sdk-page .cmp-head { text-align: left; }
	.sdk-page .cmp-head p { margin-left: 0; }
	.sdk-code-head { padding-left: 14px; }
	/* The tabs take the head, and the paragraph above names the example the code is from. */
	.sdk-code-head .site-ph-icon, .sdk-code-file { display: none; }
	.sdk-tabs { margin-left: 0; }
	.sdk-code pre { padding: 14px 14px 18px; font-size: 12px; }
	.sdk-result { padding: 12px; }
	.sdk-figures { gap: 8px; }
	.sdk-figures li { gap: 6px; padding: 12px 10px 10px; }
	.sdk-figures b { font-size: 24px; }
	.sdk-caps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.sdk-caps li { padding: 18px 18px 18px; }
	.sdk-more { text-align: left; }
	.sdk-accuracy-link { text-align: left; }
	.sdk-facts li { padding: 18px 20px; }
	.sdk-request { padding-bottom: 64px; }
	.sdk-request-intro { padding: 24px 20px 4px; }
	.sdk-request-body { padding: 20px 20px 24px; }
	.sdk-form-grid, .sdk-topic-options { grid-template-columns: minmax(0, 1fr); }
	.sdk-form .site-form-actions .site-button { width: 100%; }
}

/* ----- preferences --------------------------------------------------------------------------------------------------------- */

@media (forced-colors: active) {
	.sdk-hero::before { display: none; }
	.sdk-uses li, .sdk-tabs, .sdk-figures li, .sdk-topic { border: 1px solid CanvasText; }
	.sdk-tabs button[aria-selected="true"] { border: 1px solid Highlight; }
	.sdk-topic input { -webkit-appearance: auto; appearance: auto; }
	.sdk-topic input::before { display: none; }
	.sdk-uses svg, .sdk-caps svg { forced-color-adjust: none; }
}
