/* thingsim.com — concept G "Punch-out".
   Grey card-stock ground, near-black ink, one cobalt, and the gold of a SIM chip. */

:root {
  --bg: #e7e7e2;
  --bg-2: #f4f4f0;
  --surface: #ffffff;
  --ink: #14161c;
  --muted: #4d5059;
  --line: #d6d6d0;
  --cobalt: #2437d6;
  --cobalt-dark: #1a2aa8;
  --cobalt-tint: #d6dbff;
  --gold: #d8b25a;
  --gold-dark: #9a7527;
  --dark: #14161c;
  --dark-muted: #c4c8d2;
  --error: #b42318;
  --error-tint: #fdecea;

  --logo-thing: #4a5256;
  --logo-sim: var(--cobalt);

  /* code blocks on the Developers pages */
  --code-bg: var(--dark);
  --code-ink: #e7e7e2;
  --code-muted: #8a8f9c;
  --code-key: #aab6ff;
  --code-str: var(--gold);
  --code-num: #f2a07b;

  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-lg: 28px;
  --gutter: 48px;
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 8px; padding: 8px 14px; background: var(--ink); color: #fff; z-index: 10; border-radius: 8px; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.stack { display: flex; flex-direction: column; gap: 22px; }

/* ---------- type ---------- */
.display { font-size: 60px; line-height: 0.98; font-weight: 800; letter-spacing: -0.03em; }
.display--page { font-size: 52px; }
.h2 { font-size: 38px; line-height: 1.02; font-weight: 800; letter-spacing: -0.02em; }
.h3 { font-size: 24px; line-height: 1.1; font-weight: 800; }
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 600px; }
.muted { color: var(--muted); }
.link-strong { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--cobalt); text-decoration: none; }
.link-strong:hover { text-decoration: underline; }
.icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px; border-radius: 23px; border: 0;
  background: var(--cobalt); color: #fff; font: 700 15px var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--cobalt-dark); color: #fff; }
.btn--small { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn--inverse { background: #fff; color: var(--cobalt); }
.btn--inverse:hover { background: var(--cobalt-tint); color: var(--cobalt-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 18px 22px; align-items: center; }

/* ---------- logo ---------- */
.logo { display: block; height: 32px; width: auto; }
.logo .logo-thing { fill: var(--logo-thing); }
.logo .logo-sim { fill: var(--logo-sim); }
.logo--footer { height: 28px; }

/* ---------- header ---------- */
.site-header { padding: 16px 0; }
.site-header__inner { display: flex; align-items: center; gap: 36px; }
.site-header__brand { display: flex; }
.site-nav { display: flex; align-items: center; gap: 26px; flex: 1; font-size: 15px; }
.site-nav a { font-weight: 600; color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--cobalt); }
.site-nav__end { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.site-nav__end .btn { color: #fff; border-bottom: 0; padding: 0 18px; }
.nav-toggle { display: none; margin-left: auto; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 2px solid var(--ink); background: transparent; font: 700 15px var(--font); color: var(--ink); cursor: pointer; }

/* ---------- sections ---------- */
.band { padding: 72px 0; }
.band--tight { padding: 0 0 72px; }
.band--light { background: var(--bg-2); }
.band--dark { background: var(--dark); color: #fff; }
.band--dark .lede { color: var(--dark-muted); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.page-head { padding: 48px 0 56px; }
.page-head .wrap { display: flex; flex-direction: column; gap: 18px; }
.page-head .display { max-width: 820px; }

.cards { display: grid; gap: 20px; }
.cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- hero ---------- */
.hero { padding: 28px 0 56px; overflow: hidden; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 22px; }
.hero__card { transform: rotate(-7deg); filter: drop-shadow(0 24px 32px rgba(20, 22, 28, 0.2)); width: 100%; max-width: 680px; margin-left: auto; }

.carrier { width: 100%; height: auto; display: block; }
.carrier-body { fill: var(--cobalt); }
.carrier-cut { fill: none; stroke: #fff; stroke-opacity: 0.55; stroke-width: 2; stroke-dasharray: 10 6; }
.carrier-cut--nano { stroke-opacity: 0.8; stroke-dasharray: none; }
.carrier-chip { fill: var(--gold); }
.carrier-chip-lines { fill: none; stroke: var(--gold-dark); stroke-width: 2; }
.carrier-logo { fill: #fff; }
.carrier-headline { font: 800 52px var(--font); fill: #fff; }
.carrier-sub { font: 500 22px var(--font); fill: #fff; fill-opacity: 0.85; }
.carrier-iccid { font: 500 18px var(--font); letter-spacing: 3px; fill: #fff; fill-opacity: 0.8; }
.carrier-bars { fill: #fff; }

/* ---------- plans ---------- */
.plans { padding: 56px 0 68px; }
.plans .wrap { display: flex; flex-direction: column; gap: 22px; }
.plans__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; }
.plans__head > div:first-child { display: flex; flex-direction: column; gap: 12px; }
.plans__switches { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.plans__note { color: var(--muted); margin-bottom: 16px; font-size: 15px; }
.plans__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.plans__included { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 14px; }
.plans__included li::before { content: "✓"; color: var(--cobalt); font-weight: 800; margin-right: 8px; }

.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 26px; background: var(--surface); }
.segmented button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 22px; background: transparent; color: var(--ink); font: 700 14px var(--font); cursor: pointer; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--cobalt); color: #fff; }

/* a hang-tag: punched hole at the top */
.tag { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 48px 22px 22px; background: var(--surface); border-radius: 18px 18px 6px 6px; }
.tag::before { content: ""; position: absolute; top: 16px; left: 50%; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--bg-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12); }
.tag--popular { box-shadow: inset 0 0 0 2px var(--cobalt); }
/* the highlight follows the pointer (or keyboard focus); "A good start" keeps it otherwise */
.tag { transition: box-shadow 0.15s ease; }
.tag:hover, .tag:focus-within { box-shadow: inset 0 0 0 2px var(--cobalt); }
.plans__grid:has(.tag:hover, .tag:focus-within) .tag--popular:not(:hover):not(:focus-within) { box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .tag { transition: none; } }
.tag__flag { position: absolute; top: 13px; right: 13px; padding: 3px 9px; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; }
.tag__size { font-size: 34px; line-height: 1; font-weight: 800; }
.tag__size { padding-bottom: 12px; border-bottom: 1px solid var(--bg); }
.plans__request { display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap; padding: 28px; background: var(--surface); border-radius: var(--radius); }
.plans__request h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.plans__request p { color: var(--muted); font-size: 15px; max-width: 620px; }
.plans__networks { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.plans__networks .plans__note { margin: 0; }
.networks { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 18px; }
.networks li { display: flex; align-items: center; height: 28px; }
.networks__logo { height: 26px; width: auto; }
.networks__logo--vodafone { height: 20px; }
.tag__price { font-size: 26px; font-weight: 800; color: var(--cobalt); line-height: 1.1; }
.tag__price small { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.tag__order { margin-top: auto; }

/* ---------- sector cards ---------- */
.sector-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.sector-card:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 16px 32px rgba(20, 22, 28, 0.1); }
.sector-card img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.sector-card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 20px 22px; flex: 1; }
.sector-card__title { font-size: 19px; font-weight: 800; }
.sector-card__text { color: var(--muted); font-size: 15px; flex: 1; }
.cards--2 .sector-card img { aspect-ratio: 16 / 9; }

/* ---------- portal ---------- */
.portal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 48px; align-items: start; }
.portal__copy { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.portal__points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.point { padding-top: 16px; border-top: 2px solid var(--cobalt); }
.band--dark .point { border-top-color: #5b6cf0; }
.point h3 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.point p { font-size: 14px; color: var(--dark-muted); }
.portal__shots { display: flex; flex-direction: column; gap: 24px; }
.portal__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.browser { margin: 0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35); }
.browser__bar { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; background: #f0f0ec; border-bottom: 1px solid var(--line); }
.browser__bar i { width: 11px; height: 11px; border-radius: 50%; background: #d0d0ca; }
.browser__bar span { margin-left: 12px; padding: 3px 12px; border-radius: 6px; background: #fff; font-size: 12px; color: var(--muted); }

/* ---------- sizes ---------- */
.sizes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; align-items: center; }
.sizes__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.size svg { width: 100%; max-width: 120px; height: auto; fill: #fff; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; margin-bottom: 14px; }
.size svg .fill { fill: var(--ink); stroke: none; }
.size h3 { font-size: 17px; font-weight: 800; }
.size p { font-size: 14px; color: var(--muted); }

/* ---------- extras, terms ---------- */
.extra-teaser { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--radius); background: var(--bg-2); color: var(--ink); text-decoration: none; }
.extra-teaser:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--cobalt); }
.extra-teaser h3 { font-size: 19px; font-weight: 800; }
.extra-teaser p { color: var(--muted); font-size: 15px; }
.band:not(.band--light) .extra-teaser { background: var(--surface); }
.card-back { display: flex; flex-direction: column; gap: 24px; padding: 36px 40px; background: var(--surface); border-radius: var(--radius-lg); }
.term h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.term p { color: var(--muted); font-size: 15px; }

.extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 56px; align-items: center; }
.extra__price { font-size: 17px; font-weight: 800; }
.extra__big { display: flex; align-items: center; justify-content: center; min-height: 200px; font-size: 56px; font-weight: 800; letter-spacing: 2px; color: var(--cobalt); }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 16px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--cobalt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 15px; border-radius: 19px; background: var(--surface); font-weight: 700; font-size: 14px; color: var(--ink); text-decoration: none; }
.chip:hover { color: var(--cobalt); }

/* ---------- diagram ---------- */
.diagram { margin: 0; max-width: 720px; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram__box { fill: var(--surface); }
.diagram__box--core { fill: var(--cobalt); }
.diagram__title { font: 800 19px var(--font); fill: var(--ink); text-anchor: middle; }
.diagram__sub { font: 500 14px var(--font); fill: var(--muted); text-anchor: middle; }
.diagram__title--core, .diagram__sub--core { fill: #fff; }
.diagram__link { stroke: var(--cobalt); stroke-width: 3; stroke-dasharray: 8 6; fill: none; }
.diagram__link--solid { stroke-dasharray: none; }
.diagram__label { font: 600 13px var(--font); fill: var(--cobalt); text-anchor: middle; }
.diagram__label--muted { fill: var(--muted); }
.diagram__blocked { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 5; }
.band--light .diagram__box:not(.diagram__box--core) { fill: var(--surface); }
.band:not(.band--light) .diagram__box:not(.diagram__box--core) { fill: var(--bg-2); }

/* ---------- sector page ---------- */
.sector-hero { padding: 28px 0 64px; }
.sector-hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 48px; align-items: center; }
.sector-hero__img { width: 100%; aspect-ratio: 32 / 26; object-fit: cover; border-radius: 22px; }
.crumbs { font-size: 14px; font-weight: 500; color: var(--muted); }
.crumbs a { color: var(--muted); }
.panel { display: flex; flex-direction: column; gap: 8px; padding: 22px; background: var(--surface); border-radius: var(--radius); }
.panel h3 { font-size: 18px; font-weight: 800; }
.panel p { color: var(--muted); font-size: 15px; }
.setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; padding: 36px 40px; background: var(--cobalt); border-radius: var(--radius-lg); color: #fff; }
.setup p { color: var(--cobalt-tint); }
.setup__kicker { font-size: 14px; font-weight: 700; color: var(--cobalt); }
.setup .setup__kicker { color: var(--cobalt-tint); }
.setup__order { display: flex; flex-direction: column; gap: 12px; padding: 22px; font-size: 15px; background: var(--surface); border-radius: 20px; color: var(--ink); align-self: start; }
.setup__line { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; }
.setup__line--optional { color: var(--muted); }
.setup__order .btn { margin-top: 8px; }
.related { display: flex; gap: 18px; align-items: center; padding: 16px; background: var(--surface); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 800; }
.related:hover { color: var(--cobalt); }
.related img { width: 100px; height: 70px; object-fit: cover; border-radius: 10px; }

/* ---------- prose ---------- */
.prose { max-width: 720px; font-size: 16px; }
.prose h2 { font-size: 26px; font-weight: 800; margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; font-weight: 800; margin: 28px 0 6px; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose code { font-size: 15px; }

/* ---------- at a glance ---------- */
.glance { display: flex; flex-direction: column; gap: 20px; }
.glance__block { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); border-radius: var(--radius); }
.glance__tables { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.glance__table { width: 100%; border-collapse: collapse; font-size: 15px; }
.glance__table caption { text-align: left; padding-bottom: 8px; display: flex; flex-direction: column; gap: 2px; }
.glance__table caption span { color: var(--muted); font-size: 13px; }
.glance__table th, .glance__table td { text-align: left; padding: 8px 0; border-top: 1px solid var(--line); }
.glance__table thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
.glance__table td { font-weight: 700; color: var(--cobalt); }
.glance__list { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 24px; font-size: 15px; }
.glance__list dt { font-weight: 700; }
.glance__list dd { margin: 0; }
.plans__updated { font-size: 13px; color: var(--muted); }

/* ---------- developers ---------- */
code, pre { font-family: var(--mono); }
.prose code, .field__desc code, .muted code, .op__desc code, .event__desc code, .notice code, .ref-intro code, .ref-spec__desc code { font-size: 0.88em; padding: 1px 5px; border-radius: 5px; background: var(--surface); overflow-wrap: anywhere; }
.band--light .muted code, .band--light .event__desc code { background: var(--bg); }
.crumbs a { text-decoration: none; }
.chip[aria-current="page"] { background: var(--ink); color: #fff; }
.chip__count { margin-left: 8px; font-size: 12px; color: var(--muted); }
.notice { max-width: 760px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 4px 0 0 var(--gold); font-size: 15px; color: var(--muted); }
.notice strong { color: var(--ink); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 10px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; }

/* code block: dark card, tabs, copy button */
.code { min-width: 0; border-radius: var(--radius); background: var(--code-bg); color: var(--code-ink); overflow: hidden; }
.code + .code { margin-top: 16px; }
.code__bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid #2a2d36; }
.code__tabs { display: flex; gap: 2px; margin-left: -8px; overflow-x: auto; }
.code__tabs button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--code-muted); font: 700 13px var(--font); cursor: pointer; white-space: nowrap; }
.code__tabs button:hover { color: #fff; }
.code__tabs button[aria-selected="true"] { background: #2a2d36; color: #fff; }
.code__title { font-size: 13px; font-weight: 700; color: var(--code-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code__copy { margin-left: auto; min-height: 32px; padding: 0 12px; border: 1px solid #3a3e4a; border-radius: 8px; background: transparent; color: var(--code-ink); font: 600 13px var(--font); cursor: pointer; flex-shrink: 0; }
.code__copy:hover { border-color: var(--code-ink); }
.code:not(.is-ready) .code__tabs, .code:not(.is-ready) .code__copy { display: none; }
.code.is-ready .code__label { display: none; }
.code__label { margin: 12px 16px 0; font-size: 12px; font-weight: 700; color: var(--code-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.code pre { margin: 0; padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; tab-size: 2; }
.code pre code { font-size: inherit; padding: 0; background: none; color: inherit; }
.tok-key { color: var(--code-key); }
.tok-str { color: var(--code-str); }
.tok-num, .tok-lit { color: var(--code-num); }
.tok-kw { color: var(--code-key); font-weight: 600; }
.tok-com { color: var(--code-muted); font-style: italic; }
.prose .code { margin: 0 0 20px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-top: 1px solid var(--line); }
.prose th { font-size: 13px; color: var(--muted); font-weight: 600; }
.prose td:first-child { white-space: nowrap; }
.prose--dev { max-width: 760px; min-width: 0; }
.prose--dev h2 { scroll-margin-top: 24px; }
.prose--dev h3 { scroll-margin-top: 24px; }

/* overview: prose with an "on this page" rail */
.dev-overview { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px; align-items: start; }
.dev-overview .prose { grid-column: 1; grid-row: 1; }
.dev-aside { grid-column: 2; grid-row: 1; position: sticky; top: 24px; }
.dev-aside__inner { display: flex; flex-direction: column; gap: 12px; padding: 22px; background: var(--surface); border-radius: var(--radius); }
.dev-aside__title { font-size: 13px; font-weight: 700; color: var(--muted); }
.dev-aside ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.dev-aside a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 600; }
.dev-aside a:not(.btn):hover { color: var(--cobalt); }

/* the reference: sticky contents + operations */
.ref { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.ref__nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.ref-nav { background: var(--surface); border-radius: var(--radius); padding: 18px 16px; }
.ref-nav summary { font-weight: 800; cursor: pointer; }
.ref-nav nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; }
.ref-nav__group { margin: 14px 0 2px; font-size: 13px; font-weight: 700; }
.ref-nav__group a { color: var(--muted); text-decoration: none; }
.ref-nav__tag { margin-top: 6px; font-weight: 800; color: var(--ink); text-decoration: none; }
.ref-nav ul { list-style: none; margin: 0; padding: 0 0 0 2px; display: flex; flex-direction: column; }
.ref-nav li a { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; color: var(--ink); text-decoration: none; }
.ref-nav li a:hover span:last-child { color: var(--cobalt); text-decoration: underline; }
.ref-nav .method { width: 44px; justify-content: center; flex-shrink: 0; font-size: 10px; padding: 1px 0; }
.ref__main { display: flex; flex-direction: column; gap: 56px; min-width: 0; }
.ref-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ref-intro__item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 22px; background: var(--surface); border-radius: var(--radius); font-size: 15px; }
.ref-intro__item h2 { font-size: 13px; font-weight: 700; color: var(--muted); }
.ref-intro__item p { color: var(--muted); font-size: 14px; }
.ref-intro__item code { font-size: 14px; overflow-wrap: anywhere; background: var(--bg-2); }
.ref-spec { display: flex; flex-direction: column; gap: 48px; }
.ref-spec__head { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; border-top: 3px solid var(--ink); }
.ref-spec__head .setup__kicker { margin-top: 20px; }
.ref-spec__desc { color: var(--muted); max-width: 680px; }
.ref-spec__desc p + p { margin-top: 10px; }
.ref-tag { display: flex; flex-direction: column; gap: 20px; scroll-margin-top: 16px; }
.ref-tag__title { font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; }
.ref-tag > .muted { max-width: 680px; margin-top: -8px; }

.op { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 28px; background: var(--surface); border-radius: var(--radius-lg); scroll-margin-top: 16px; }
.op:target { box-shadow: inset 0 0 0 2px var(--cobalt); }
.op__doc { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.op__code { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.op__code .code + .code { margin-top: 0; }
.op__line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.op__path { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.op__param { color: var(--cobalt); }
.op__title { font-size: 22px; line-height: 1.15; font-weight: 800; }
.op__title a { color: var(--ink); text-decoration: none; }
.op__title a:hover { color: var(--cobalt); }
.op__desc { color: var(--muted); font-size: 15px; }
.op__desc p + p { margin-top: 8px; }
.op__facts { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.op__facts > div { display: flex; align-items: center; gap: 8px; }
.op__facts dt { font-weight: 700; }
.op__facts dd { margin: 0; color: var(--muted); }
.scope { padding: 3px 9px; border-radius: 8px; background: var(--cobalt-tint); color: var(--cobalt-dark); font-size: 13px; font-weight: 600; }
.op__sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 15px; font-weight: 800; }
.op__type { font: 600 13px var(--mono); color: var(--muted); }
.op__type a { color: var(--cobalt); }
.op__returns { color: var(--muted); font-size: 15px; margin-top: -6px; }
.op__empty { color: var(--muted); font-size: 14px; }
.op__error summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); padding: 4px 0 10px; }
.method { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font: 800 12px var(--mono); letter-spacing: 0.02em; background: var(--cobalt-tint); color: var(--cobalt-dark); }
.method--post { background: var(--cobalt); color: #fff; }
.method--patch, .method--put { background: var(--gold); color: var(--ink); }
.method--delete { background: var(--ink); color: #fff; }
.status { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 1px 7px; border-radius: 6px; background: var(--bg); font: 700 12px var(--mono); color: var(--ink); }
.status--ok { background: var(--cobalt-tint); color: var(--cobalt-dark); }
.errors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.errors li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.errors code { font-size: 13px; color: var(--ink); }

.fields { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.field__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.field__name { font-size: 14px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.field__type { font: 500 13px var(--mono); color: var(--muted); }
.field__type a { color: var(--cobalt); }
.field__null { margin-left: 4px; }
.field__in { font-size: 12px; color: var(--muted); }
.field__req { font-size: 12px; font-weight: 700; color: var(--gold-dark); }
.field__desc { font-size: 14px; color: var(--muted); }
.field__enum, .field__eg { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.field__enum code, .field__eg code { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--bg-2); color: var(--ink); overflow-wrap: anywhere; }

.schemas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.schema { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px; background: var(--surface); border-radius: var(--radius); scroll-margin-top: 16px; }
.schema:target { box-shadow: inset 0 0 0 2px var(--cobalt); }
.schema__name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 18px; font-weight: 800; }
.schema__name a { color: var(--ink); text-decoration: none; }
.schema .muted { font-size: 14px; }

/* notifications */
.dev-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 12px; }
.dev-split__code { min-width: 0; position: sticky; top: 16px; }
.events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.event { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 22px; background: var(--surface); border-radius: var(--radius); scroll-margin-top: 16px; }
.band:not(.band--light) .event { background: var(--bg-2); }
.event:target { box-shadow: inset 0 0 0 2px var(--cobalt); }
.event__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.event__type { font: 700 16px var(--mono); overflow-wrap: anywhere; }
.event__type a { color: var(--ink); text-decoration: none; }
.event__type a:hover { color: var(--cobalt); }
.event__desc { color: var(--muted); font-size: 15px; flex: 1; }

/* ---------- contact form ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.contact__main { padding: 32px; background: var(--surface); border-radius: var(--radius-lg); scroll-margin-top: 16px; }
.contact__aside { padding-top: 8px; }
.contact__aside h2 { font-size: 20px; margin: 32px 0 10px; }
.contact__aside ol { margin: 0 0 16px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.contact__done { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; outline: none; }
.contact__done-icon { width: 48px; height: 48px; padding: 10px; border-radius: 50%; background: var(--cobalt); fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.form { display: flex; flex-direction: column; gap: 22px; }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.form__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.form__required, .form__fineprint { font-size: 14px; color: var(--muted); }
.form__about { align-self: flex-start; padding: 6px 14px; border-radius: 16px; background: var(--cobalt-tint); color: var(--cobalt-dark); font-size: 14px; }
.form__errors { padding: 18px 20px; border-radius: var(--radius); background: var(--error-tint); box-shadow: inset 4px 0 0 var(--error); outline: none; }
.form__errors h2 { font-size: 17px; font-weight: 800; margin-bottom: 8px; color: var(--error); }
.form__errors ul { margin: 0; padding-left: 20px; }
.form__errors a { color: var(--error); font-weight: 600; }
.form .btn { align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 700; font-size: 15px; }
.field__req { color: var(--cobalt); }
.field__opt { font-weight: 500; color: var(--muted); }
.field__hint { font-size: 14px; color: var(--muted); }
.field__error { font-size: 14px; font-weight: 600; color: var(--error); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 400 16px/1.4 var(--font);
}
.field select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2314161c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 18px no-repeat;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b8b8b1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-tint); }
.field [aria-invalid="true"] { border-color: var(--error); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.check input { flex-shrink: 0; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--cobalt); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--cobalt); color: #fff; padding: 48px 0; --logo-thing: #fff; --logo-sim: #fff; }
.site-footer__cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid #5566e6; }
.site-footer__cta p { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; max-width: 720px; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(5, minmax(0, 1fr)); gap: 40px; }
.site-footer__grid > div { display: flex; flex-direction: column; gap: 12px; }
.site-footer h2 { font-size: 15px; font-weight: 700; }
.site-footer a { color: var(--cobalt-tint); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer__about p { color: var(--cobalt-tint); font-size: 14px; max-width: 300px; }
.site-footer .btn--inverse { color: var(--cobalt); font-size: 15px; text-decoration: none; }
.site-footer .btn--inverse:hover { color: var(--cobalt-dark); }
.site-footer__about .logo { width: auto; align-self: flex-start; }
.site-footer__legal { margin-top: 36px; font-size: 13px; color: var(--cobalt-tint); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --gutter: 40px; }
  .display { font-size: 52px; }
  .display--page { font-size: 46px; }
  .h2 { font-size: 34px; }
  .cards--4, .plans__grid, .sizes__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal, .sizes, .extra, .sector-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .extra .diagram, .extra__big { max-width: 640px; }
  .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer__about { grid-column: 1 / -1; }
  .op { grid-template-columns: minmax(0, 1fr); }
  .ref { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
  .ref-intro { grid-template-columns: minmax(0, 1fr); }
  .site-header__inner { gap: 28px; }
  .site-nav { gap: 22px; }
}

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 12px 0; }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line); color: var(--cobalt); }
  .site-nav__end { margin: 16px 0 0; flex-direction: column; align-items: stretch; gap: 12px; }
  .site-nav__end .btn { width: 100%; }
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .hero__card { margin: 8px 0 0; max-width: 560px; transform: rotate(-4deg); }
  .cards--3, .cards--2, .setup, .glance__tables, .contact { grid-template-columns: minmax(0, 1fr); }
  .contact { gap: 32px; }
  .form__grid--3 { grid-template-columns: minmax(0, 1fr); }
  .glance__list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .glance__list dd { margin-bottom: 10px; }
  .setup { padding: 36px 32px; }
  .card-back { padding: 36px 32px; }
  .ref, .dev-overview, .dev-split, .schemas, .events { grid-template-columns: minmax(0, 1fr); }
  .ref__nav, .dev-aside, .dev-split__code { position: static; max-height: none; }
  .dev-overview .prose, .dev-aside { grid-column: auto; grid-row: auto; }
  .ref-nav nav { max-height: 60vh; overflow-y: auto; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .display, .display--page { font-size: 38px; }
  .h2 { font-size: 28px; }
  .h3 { font-size: 21px; }
  .lede { font-size: 17px; }
  .band { padding: 52px 0; }
  .band--tight { padding: 0 0 52px; }
  .page-head { padding: 32px 0 48px; }
  .cards--4, .plans__grid { grid-template-columns: minmax(0, 1fr); }
  .portal__points, .portal__pair { grid-template-columns: minmax(0, 1fr); }
  .sizes__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 0 6px; font-size: 13px; }
  .plans__switches { width: 100%; }
  .tag { padding: 56px 22px 22px; }
  .site-footer__cta p { font-size: 24px; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .extra__big { font-size: 48px; min-height: 140px; }
  .related img { width: 88px; height: 64px; }
  .setup { padding: 28px 20px; }
  .setup__line { flex-direction: column; gap: 2px; }
  .card-back { padding: 28px 20px; }
  .op { padding: 20px 16px; border-radius: var(--radius); }
  .ref-tag__title { font-size: 24px; }
  .op__title { font-size: 20px; }
  .code pre { font-size: 12px; padding: 14px; }
}

@media (min-width: 961px) {
  .ref-nav summary { display: none; }
  .ref-nav nav { margin-top: 0; }
  .ref-nav__group:first-child { margin-top: 0; }

  .contact__main { padding: 24px 18px; border-radius: 20px; }
  .form__grid { grid-template-columns: minmax(0, 1fr); }
  .form .btn { align-self: stretch; }
}
