@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f4f4f2;
  --ink: #1f2b4d;
  --muted: #5b6275;
  --accent: #f7941d;
  --accent-ink: #1f2b4d;
  --focus-ring: #b45f00;
  --field-light: #e3e1dc;
  --code-bg: #141d34;
  --code-ink: #f4f4f2;
  --code-keyword: #b6c9f0;
  --code-string: #d4dfbc;
  --code-comment: #aab3c6;
  --font: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, SFMono-Regular, Consolas, monospace; /* taste-skill-ignore: this token applies only to pre and code. */
  --small: 14px;
  --body: 18px;
  --lead: 24px;
  --head: clamp(36px, 4.4vw, 52px);
  --gutter: 32px;
  /* The page is a sheet of fixed maximum width. Each clamp() maximum is its vw value at this width. */
  --page: 1200px;
  --backdrop: #dcdad4;
  --page-shadow: 0 0 0 1px rgb(31 43 77 / .06), 0 30px 90px -20px rgb(31 43 77 / .28), 0 8px 24px -12px rgb(31 43 77 / .18);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; background: var(--backdrop); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { max-width: var(--page); min-height: 100svh; margin: 0 auto; box-shadow: var(--page-shadow); background: var(--bg); color: var(--ink); font: 400 var(--body)/1.6 var(--font); font-optical-sizing: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: .07em; }
button, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
summary { min-height: 44px; padding-block: 10px; font-weight: 500; }
button { border: 0; }
button, .button, .toplinks a, .chapter-index a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 5px; }
::selection { color: var(--accent-ink); background: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-weight: 600; line-height: .98; letter-spacing: -.045em; text-wrap: balance; }
h2 { font-size: var(--head); }
h3 { font-size: var(--lead); line-height: 1.2; letter-spacing: -.025em; }
p { max-width: 64ch; text-wrap: pretty; }
p + p { margin-top: 1em; }
pre, code { font-family: var(--font-code); }
pre { scrollbar-width: thin; scrollbar-color: var(--code-comment) var(--code-bg); }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
a[aria-busy="true"] { cursor: progress; }
.skip { position: fixed; z-index: 40; top: 12px; left: 20px; padding: 12px 20px; background: var(--accent); transform: translateY(-180%); }
.skip:focus { transform: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; padding: 18px var(--gutter); background: var(--bg); }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 28px; font-weight: 600; text-decoration: none; letter-spacing: -.055em; line-height: 1; }
.toplinks { display: flex; align-items: center; gap: 32px; font-size: var(--small); }
.toplinks a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 10px; text-decoration: none; }
.toplinks a[aria-current] { text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; min-height: 58px; padding: 16px 24px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-size: var(--body); font-weight: 500; line-height: 1.3; transition: transform 180ms var(--ease-out); }
.button span { font-size: var(--lead); line-height: 1; transition: transform 180ms var(--ease-out); }
.button:active, button:active { transform: scale(.97); }

.hero { position: relative; isolation: isolate; overflow: clip; }
.hero::before { position: absolute; z-index: -1; top: -180px; right: -120px; width: min(720px, 72vw); aspect-ratio: 1; content: ""; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 68%); pointer-events: none; }
.hero-type { display: grid; place-items: end center; padding-top: clamp(48px, 9vw, 120px); pointer-events: none; }
.hero h1 { position: relative; margin-bottom: .1em; font-size: clamp(48px, 10vw, 120px); line-height: .84; letter-spacing: -.05em; text-align: center; }
.hero h1::after { position: absolute; z-index: -1; content: ""; inset: .84em -100vmax -100vmax; background: var(--ink); }
.hero h1 > span { display: block; white-space: nowrap; }
.hero h1 > span + span { color: var(--bg); padding-top: max(.06em, 6px); }
.hero-spark { position: absolute; top: -.36em; right: -.3em; color: var(--accent); font: normal 600 .25em/1 var(--font); letter-spacing: 0; }
.hero-bottom { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; padding: 40px var(--gutter); color: var(--bg); background: var(--ink); }
.subtitle { font-size: var(--lead); line-height: 1.35; max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.hero .button { white-space: nowrap; }
.button.continue-action { white-space: normal; text-align: left; }
.secondary-action { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 2px var(--bg); }
.showcase { padding: 116px var(--gutter) 104px; }
.contract-controls { margin-top: 64px; }
.function-input { display: flex; align-items: center; gap: 16px; max-width: 100%; }
.function-input input { min-width: 0; width: 100%; padding: 0 0 8px; border: 0; background: transparent; font-size: clamp(52px, 8vw, 96px); line-height: 1.1; font-weight: 500; letter-spacing: -.05em; border-radius: 0; }
/* The submit button follows the typed name, so it stays beside the field on a wide screen. */
@supports (field-sizing: content) {
  .function-input input { field-sizing: content; width: auto; min-width: 4ch; max-width: 100%; }
  /* Chrome reserves picker space on a list input. Its UA rule needs !important to override. */
  .function-input input::-webkit-calendar-picker-indicator { display: none !important; }
}
.function-input button { flex: none; font-size: var(--lead); min-width: 58px; min-height: 58px; background: var(--surface); }
.function-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 32px; }
.function-choices button { position: relative; padding: 12px 20px; background: var(--surface); min-height: 48px; transition: transform 180ms var(--ease-out); }
.function-choices button::after { position: absolute; inset: auto 0 0; height: 3px; content: ""; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease-out); }
.function-choices button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.function-choices button[aria-pressed="true"]::after { transform: scaleX(1); }
.contract-result { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: stretch; margin-top: 40px; }
.contract-signal { position: absolute; top: -18px; left: 0; width: 160px; height: 4px; background: var(--accent); opacity: 0; transform: scaleX(0); transform-origin: left; pointer-events: none; }
.contract-result .code { margin: 0; }
.contract-reading { padding: 32px; background: var(--surface); }
.contract-reading dl { display: grid; gap: 24px; margin: 0; }
.contract-reading dt { font-size: var(--small); color: var(--muted); }
.contract-reading dd { font-size: var(--lead); line-height: 1.35; letter-spacing: -.025em; margin: 2px 0 0; overflow-wrap: anywhere; }
#contract-message:not(:empty) { margin-top: 28px; font-size: var(--small); }
.book-index { display: grid; grid-template-columns: 1fr 1.65fr; gap: 80px; padding: 104px var(--gutter); background: var(--ink); color: var(--bg); }
.book-index h2 { margin-bottom: 32px; }
.chapter-index { display: grid; gap: 8px; }
.chapter-index a { position: relative; display: block; padding: 10px 30px 10px 0; font-size: var(--lead); letter-spacing: -.025em; text-decoration: none; line-height: 1.35; }
.chapter-index a::before { position: absolute; inset: auto 0 0; height: 1px; content: ""; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 260ms var(--ease-out); }
.chapter-index a::after { position: absolute; top: 50%; right: 0; content: "↗\FE0E"; content: "↗\FE0E" / ""; color: var(--accent); opacity: 0; transform: translate(-6px, -50%); transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }

.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.contents { position: sticky; top: 100px; align-self: start; max-height: calc(100svh - 116px); overflow-y: auto; padding: 42px 24px 42px var(--gutter); font-size: var(--small); line-height: 1.45; scrollbar-width: thin; }
.contents-title { font-weight: 600; margin-bottom: 20px; }
.contents ol { list-style: none; padding: 0; margin: 0; }
.contents li { margin-bottom: 8px; }
.contents a { display: flex; align-items: center; min-height: 44px; padding-block: 7px; text-decoration: none; }
.contents a[aria-current] { text-decoration: underline; text-decoration-thickness: .13em; }
.resources-title { margin-top: 32px; }
.contents .resource { padding-block: 6px; }
.main { min-width: 0; }
.section { padding: 88px 64px 72px; scroll-margin-top: 90px; }
.section:nth-of-type(even) { background: var(--surface); }
.section#contracts, .section#control, .section#services, .section#ir { background: var(--ink); color: var(--bg); }
.section h2 { margin-bottom: 32px; max-width: 22ch; }
.section p { margin-bottom: 20px; }
.section .lead { font-size: var(--lead); line-height: 1.4; margin-bottom: 28px; max-width: 48ch; letter-spacing: -.02em; }
.section a { overflow-wrap: anywhere; }
/* Long identifiers occur in plain prose, and a narrow screen must break them instead of widening the page. */
.section p, .section li { overflow-wrap: break-word; }
.code { margin: 32px 0; min-width: 0; background: var(--code-bg); color: var(--code-ink); }
.code figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; padding: 18px 24px 0; font-family: var(--font); font-size: var(--small); line-height: 1.4; }
.code figcaption:has(.copy-code) { padding-top: 8px; }
.code figcaption a { display: inline-flex; flex: none; align-items: center; min-height: 44px; }
.code-title, .source-drawer figcaption > span { flex: 1 1 12ch; min-inline-size: 0; overflow-wrap: anywhere; }
.code-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 16px; margin-inline-start: auto; }
.copy-code { min-width: 100px; min-height: 44px; padding: 0 12px; background: transparent; color: var(--code-comment); font-size: var(--small); }
.copy-code:focus-visible { color: var(--code-ink); }
.code pre { margin: 0; padding: 24px; max-block-size: 700px; max-block-size: min(700px, 70svh); overflow: auto; font-size: var(--small); line-height: 1.75; tab-size: 2; }
.code pre code { font: inherit; white-space: pre; }
.code pre:has(> .line-numbers) { display: grid; grid-template-columns: auto 1fr; padding-inline-start: 0; }
/* The gutter sticks to the left edge and covers code that scrolls under it. */
.line-numbers { position: sticky; z-index: 1; inset-inline-start: 0; padding-block: 0; padding-inline: 24px 16px; background: var(--code-bg); color: color-mix(in srgb, var(--code-comment) 62%, transparent); text-align: end; white-space: pre; user-select: none; }
.syntax-keyword { color: var(--code-keyword); }
.syntax-string { color: var(--code-string); }
.syntax-comment { color: var(--code-comment); }
.code-panel::before { display: block; padding: 18px 24px 0; content: attr(data-tab); font-family: var(--font); font-size: var(--small); line-height: 1.4; color: var(--code-comment); }
.tabs-ready .code-panel::before { display: none; }
.code [role="tablist"] { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px 0; }
.code [role="tab"] { min-height: 44px; padding: 0 16px; border-bottom: 3px solid transparent; background: transparent; color: var(--code-comment); font: inherit; font-size: var(--small); line-height: 1.4; }
.code [role="tab"][aria-selected="true"] { color: var(--code-ink); border-bottom-color: var(--accent); }
html:has(.source-drawer[open]) { overflow: hidden; scrollbar-gutter: stable; }
.source-drawer { inset: 0 0 0 auto; inline-size: min(800px, 100%); block-size: 100%; block-size: 100dvh; max-inline-size: none; max-block-size: none; margin: 0; padding: 0; padding-block: env(safe-area-inset-top) env(safe-area-inset-bottom); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); overflow: hidden; border: 0; background: var(--code-bg); color: var(--code-ink); transform: translateX(100%); transition: transform 360ms var(--ease-out), overlay 360ms, display 360ms; transition-behavior: allow-discrete; }
.source-drawer[open] { transform: none; }
.source-drawer::backdrop { background: rgb(20 29 52 / 0); transition: background 360ms var(--ease-out), overlay 360ms, display 360ms; transition-behavior: allow-discrete; }
.source-drawer[open]::backdrop { background: rgb(20 29 52 / .55); }
@starting-style {
  .source-drawer[open] { transform: translateX(100%); }
  .source-drawer[open]::backdrop { background: rgb(20 29 52 / 0); }
}
.source-drawer .code { display: flex; flex-direction: column; block-size: 100%; margin: 0; }
.source-drawer figcaption { flex: none; padding-block-end: 6px; }
.source-drawer .close-drawer { min-height: 44px; padding: 0 16px; background: transparent; box-shadow: inset 0 0 0 2px var(--code-ink); font-size: var(--small); }
.source-drawer .code pre { flex: 1; min-block-size: 0; max-block-size: none; }
.table-wrap { overflow-x: auto; margin: 32px 0; }
table { width: 100%; border-collapse: collapse; font-size: var(--body); text-align: left; line-height: 1.5; color: var(--ink); }
th, td { padding: 16px 20px; vertical-align: top; }
th { font-weight: 500; background: var(--field-light); }
tbody tr:nth-child(odd) { background: var(--surface); }
tbody tr:nth-child(even) { background: var(--bg); }
td:first-child { width: 35%; }
/* Two peer columns split the width, so neither side wraps more than the other. */
.peers td:first-child { width: 50%; }
td code, p code { font-size: .92em; overflow-wrap: anywhere; }
.exercise { padding: 32px; margin: 40px 0; background: var(--field-light); color: var(--ink); }
.exercise h3 { font-size: var(--lead); margin-bottom: 16px; }
.exercise details p, .exercise details pre { margin-top: 16px; }
.exercise pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--small); }
.section-nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 48px; font-size: var(--small); }
.section-nav a { padding-block: 11px; }
.section-nav a + a { text-align: right; }
.document-note { padding: 24px 64px 40px; border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); color: var(--muted); font-size: var(--small); background: var(--surface); }
.contents-menu { display: none; }
.footer { container-type: inline-size; padding: 88px var(--gutter) 0; background: var(--field-light); overflow: hidden; }
.footer-top { display: flex; justify-content: space-between; gap: 64px; }
.footer-top nav { display: flex; flex-direction: column; align-items: flex-start; font-size: var(--body); }
.footer-top nav a { display: inline-flex; align-items: center; min-height: 44px; }
/* The wordmark is about 3.5em wide, so it fills the footer content box from gutter to gutter. */
.footer-name { font-size: calc(100cqi / 3.56); font-weight: 600; letter-spacing: -.05em; line-height: .85; white-space: nowrap; margin: 44px 0 -.18em -.04em; }
.reference-hero { padding: 70px var(--gutter) 64px; background: var(--ink); color: var(--bg); }
.reference-hero h1 { font-size: clamp(64px, 10.1vw, 121px); }
.reference-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-top: 72px; }
.reference-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.edition { font-size: var(--small); }

/* Ambient light. A rare comet crosses a decorative dark surface, and soft shadows shift as the light passes. */
:root { --shadow: color-mix(in srgb, var(--code-bg) 70%, black); }
.hero-bottom, .book-index, .reference-hero { position: relative; isolation: isolate; overflow: clip; }
.comet { position: absolute; z-index: -1; width: clamp(120px, 18vw, 220px); height: 3px; border-radius: 3px; background: linear-gradient(to right, transparent, color-mix(in srgb, var(--accent) 95%, transparent) 75%, var(--bg)); opacity: 0; transform-origin: right center; pointer-events: none; }
.comet::after { position: absolute; top: 50%; right: -3px; width: 6px; height: 6px; content: ""; border-radius: 50%; background: var(--bg); box-shadow: 0 0 18px 6px color-mix(in srgb, var(--accent) 85%, transparent); transform: translateY(-50%); }
.section, .showcase, .footer { isolation: isolate; }
.code, .footer-name { position: relative; }
.source-drawer .code { position: static; }
.code::after { position: absolute; z-index: -1; inset: 16px 12px 0; content: ""; box-shadow: 0 22px 44px -10px var(--shadow); opacity: .34; pointer-events: none; }
.source-drawer .code::after { display: none; }
.footer-name::before { position: absolute; z-index: -1; inset: 0; content: "Effektive." / ""; color: color-mix(in srgb, var(--ink) 16%, transparent); transform: translate(.03em, .04em); pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .code::after { animation: light-pass linear both; animation-timeline: view(); }
    /* The wordmark sits at the page end, so the shadow follows the footer and settles before the last scroll. */
    .footer { view-timeline: --footer block; }
    .footer-name::before { animation: shadow-settle linear both; animation-timeline: --footer; animation-range: entry 0% entry 85%; }
    @keyframes light-pass { from { transform: translate(28px, 18px); opacity: .18; } 50% { transform: translate(0, 4px); opacity: .5; } to { transform: translate(-28px, 18px); opacity: .18; } }
    @keyframes shadow-settle { from { transform: translate(.12em, .1em); opacity: 0; } to { transform: translate(.03em, .04em); opacity: 1; } }
  }
}

@media (hover: hover) and (pointer: fine) {
  .button:hover { transform: translateY(-3px); }
  .button:hover span { transform: translate(3px, -3px); }
  .button[href^="#"]:hover span, .button[href^="#"]:focus-visible span { transform: translateY(3px); }
  .copy-code:hover { color: var(--code-ink); }
  .toplinks a:hover, .contents a:hover, .chapter-index a:hover { text-decoration: underline; }
  .chapter-index a:hover::before { transform: scaleX(1); }
  .chapter-index a:hover::after { opacity: 1; transform: translate(0, -50%); }
  .function-choices button:hover { transform: translateY(-2px); }
  .function-input button:hover { background: var(--field-light); }
}
.button:focus-visible span { transform: translate(3px, -3px); }
.chapter-index a:focus-visible::before { transform: scaleX(1); }
.chapter-index a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
@media (max-width: 1150px) {
  .layout { grid-template-columns: 218px minmax(0, 1fr); }
  .section, .document-note { padding-inline: 40px; }
  .contract-result { gap: 32px; }
  .book-index { gap: 40px; }
  .hero-actions { flex-direction: column; }
}
@media (max-width: 800px) {
  :root { --gutter: 24px; --body: 16px; --head: 44px; }
  html { scroll-padding-top: calc(var(--topbar-height, 116px) + 60px); }
  .topbar { min-height: 76px; }
  .toplinks { gap: 20px; }
  .hero-bottom { display: block; }
  .hero-actions { flex-direction: row; justify-content: flex-start; margin-top: 24px; }
  .showcase, .book-index { padding-block: 80px; }
  .contract-result { grid-template-columns: 1fr; }
  .book-index { grid-template-columns: 1fr; }
  .chapter-index a { padding-block: 12px; }
  .layout { display: block; }
  .layout > .contents { display: none; }
  .contents-menu { position: sticky; z-index: 15; top: var(--topbar-height, 76px); display: block; background: var(--surface); padding: 4px var(--gutter); box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ink) 12%, transparent); }
  .contents-menu summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .contents-menu .contents { position: static; max-block-size: none; padding: 24px 0; }
  .contents-menu[open] .contents { position: absolute; inset: 100% 0 auto; max-block-size: calc(100svh - var(--topbar-height, 76px) - 60px); max-block-size: calc(100dvh - var(--topbar-height, 76px) - 60px); overflow-y: auto; padding: 24px var(--gutter); padding-block-end: calc(24px + env(safe-area-inset-bottom)); padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); background: var(--surface); }
  .mobile-contents ol { columns: 2; column-gap: 28px; }
  .mobile-contents li { break-inside: avoid; }
  .mobile-contents .resource { display: inline-block; margin-right: 24px; }
  .section, .document-note { padding-inline: var(--gutter); }
  .section { padding-block: 64px; scroll-margin-top: calc(var(--topbar-height, 116px) + 60px); }
  .reference-hero h1 { font-size: 10.1vw; }
  .reference-bottom { gap: 32px; }
}
@media (max-width: 520px) {
  :root { --gutter: 20px; --head: 36px; }
  .topbar { flex-wrap: wrap; gap: 14px; padding-block: 18px 12px; }
  .toplinks { gap: 12px; }
  .toplinks a { padding-block: 4px; }
  .hero-bottom { padding-block: 28px; }
  .subtitle { font-size: var(--body); line-height: 1.5; }
  .hero-actions { display: block; }
  .hero .button { width: 100%; min-height: 54px; }
  .hero .button + .button { margin-top: 12px; }
  .showcase, .book-index { padding-block: 64px; }
  .contract-controls { margin-top: 40px; }
  .function-input input { font-size: 13vw; }
  .function-input button { min-height: 48px; min-width: 48px; }
  .function-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .function-choices button { padding: 12px 15px; font-size: var(--small); }
  .contract-result { margin-top: 28px; }
  .contract-reading { padding: 24px 20px; }
  .contract-reading dl { gap: 20px; }
  .contract-reading dd { font-size: var(--body); }
  .book-index { gap: 32px; }
  .book-index h2 { margin-bottom: 20px; }
  .chapter-index { gap: 4px; }
  .section { padding-block: 56px; }
  .section h2 { margin-bottom: 24px; }
  .section .lead { font-size: var(--body); font-weight: 500; }
  .code figcaption { padding: 16px 16px 0; }
  .code [role="tablist"] { padding-inline: 0; }
  .code-panel::before { padding: 16px 16px 0; }
  .code pre { padding: 20px 16px; }
  .line-numbers { padding-inline: 16px 12px; }
  .exercise { padding: 24px; }
  th, td { padding: 12px; font-size: var(--small); }
  .footer { padding-top: 64px; }
  .footer-top { display: block; }
  .footer-top nav { margin-top: 40px; }
  .footer-top .button { width: 100%; }
  .footer-name { margin-top: 40px; }
  .reference-hero { padding-block: 56px 48px; }
  .reference-hero h1 { font-size: 11vw; }
  .reference-bottom { display: block; margin-top: 40px; }
  .reference-bottom .button { width: 100%; margin-top: 28px; }
  .reference-actions { display: block; margin-top: 28px; }
  .reference-actions .button { margin-top: 0; }
  .reference-actions .button + .button { margin-top: 12px; }
}

/* Component widths can differ from the viewport in the reading column and explorer. */
@media screen {
  @supports (container-type: inline-size) {
    .showcase { container: showcase / inline-size; }
    figure.code { container: code-example / inline-size; }
    .function-input input { font-size: clamp(3rem, 8cqi, 6rem); }
    .contract-result { grid-template-columns: minmax(0, 1fr); }

    @container showcase (min-width: 56rem) {
      .contract-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    }
    @container code-example (max-width: 36rem) {
      .code figcaption { flex-direction: column; align-items: stretch; row-gap: 4px; padding: 16px 16px 0; }
      .code-title, .source-drawer figcaption > span { flex: none; }
      .code figcaption a { align-self: flex-start; }
      .code-actions { justify-content: flex-start; margin-inline-start: 0; }
      /* A stacked caption reads down one edge, so the Copy label starts on that edge. */
      .copy-code { padding-inline: 0; text-align: start; }
      .code [role="tablist"] { padding-inline: 0; }
      .code-panel::before { padding: 16px 16px 0; }
      .code pre { padding-block: 20px; padding-inline: 16px; }
      .line-numbers { padding-inline: 16px 12px; }
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .enter-heading { animation: contract-arrive 700ms var(--ease-out) var(--entry-delay, 0ms) both; }
  .enter-copy { animation: quiet-arrive 600ms var(--ease-out) var(--entry-delay, 0ms) both; }
  .enter-code { animation: source-arrive 800ms var(--ease-out) var(--entry-delay, 0ms) both; }
  .hero::before { animation: hero-glow-drift 12s ease-in-out infinite alternate paused; }
  .hero.glow-visible::before { animation-play-state: running; }
  .hero-spark { animation: spark-arrive 850ms var(--ease-out) 360ms both; }
  .hero h1 > span { animation: contract-arrive 1100ms var(--ease-out) both; }
  .hero h1 > span + span { animation-delay: 100ms; }
  .hero-bottom p, .hero-bottom .button { animation: quiet-arrive 850ms var(--ease-out) 200ms both; }
  .reference-hero h1 { animation: contract-arrive 900ms var(--ease-out) both; }
  @keyframes contract-arrive { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes quiet-arrive { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes source-arrive { from { transform: translateX(16px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes hero-glow-drift { from { transform: translate(-40px, -16px); opacity: .55; } to { transform: translate(40px, 28px); opacity: 1; } }
  @keyframes spark-arrive { from { transform: rotate(-40deg) scale(.3); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }
  @supports (animation-timeline: view()) {
    .hero-type { animation: contract-drift linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    @keyframes contract-drift { from { transform: translateY(0); } to { transform: translateY(20px); } }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .button:hover, .function-choices button:hover, .button:hover span, .button:focus-visible span, .button[href^="#"]:hover span, .button[href^="#"]:focus-visible span { transform: none; }
  .chapter-index a::after { transform: translateY(-50%); }
}
@media print {
  html { background: white; }
  body { max-width: none; box-shadow: none; }
  :root { --bg: white; --ink: black; --body: 11pt; --head: 25pt; --code-bg: #f4f4f2; --code-ink: black; --code-keyword: black; --code-string: black; --code-comment: black; }
  .topbar, .skip, .hero, .showcase, .book-index, .contents-menu, .contents, .section-nav, .footer, .source-drawer, .comet, .code::after { display: none; }
  .layout { display: block; }
  .section, .section#contracts, .section#control, .section#services, .section#ir { background: white; color: black; padding: 20pt 0; }
  .section h2 { break-after: avoid; }
  .section p { max-width: none; }
  .code pre { overflow: visible; max-block-size: none; font-size: 9pt; white-space: pre-wrap; }
  .code pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .line-numbers { display: none; }
  .code pre:has(> .line-numbers) { display: block; padding-inline-start: 24px; }
  .code [role="tablist"] { display: none; }
  .code-panel[hidden] { display: block !important; }
  .tabs-ready .code-panel::before { display: block; }
  .exercise { break-inside: avoid; }
  details::details-content { content-visibility: visible; }
  .exercise details:not([open]) > :not(summary) { display: block; }
  .reference-hero { padding: 0 0 20pt; background: white; color: black; }
  .reference-hero h1 { font-size: 36pt; }
  .reference-bottom { margin-top: 20pt; }
  .reference-bottom .button, .copy-code, .continue-action { display: none; }
  .document-note { padding: 16pt 0; }
  .table-wrap { overflow: visible; }
  tr { break-inside: avoid; }
}
