/*
 * kaitakeradiology.co.nz. Colour and type come from brand.css (a copy of
 * tokens/brand.css put here by tools/build-site.py); nothing in this file
 * restates a brand value. Fonts are self-hosted from ./fonts with their
 * licences beside them (STYLE-GUIDE §9); no request leaves the site.
 */
@font-face { font-family: 'Orbitron';    src: url('fonts/Orbitron-Variable.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Nebula Sans'; src: url('fonts/NebulaSans-Book.woff2') format('woff2');       font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Nebula Sans'; src: url('fonts/NebulaSans-BookItalic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Nebula Sans'; src: url('fonts/NebulaSans-Semibold.woff2') format('woff2');   font-weight: 600; font-style: normal; font-display: swap; }


:root { color-scheme: light dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--krs-page-from), var(--krs-page-to)) fixed;
  color: var(--krs-text);
  font-family: var(--krs-font-body);
  font-size: 18px;
  line-height: 1.6;
}
a { color: var(--krs-primary-deep); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible { outline: 2px solid var(--krs-primary-bright); outline-offset: 2px; border-radius: var(--krs-radius); }

/* The body is a column that fills the viewport, so the footer sits at the bottom. The
   header and footer bars run edge to edge; their contents and the text share one
   horizontal padding. */
body { display: flex; flex-direction: column; }
main { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.wrap { max-width: 84rem; margin: 0 auto; padding: 0 1.5rem; }
.page { width: 100%; max-width: 50rem; margin: 0 auto; padding: 0 1.5rem 2.5rem; }

/* Header: the lockup top left, the menu top right, and the page's one accent — the
   rule beneath them. */
.site-header { border-bottom: 2px solid var(--krs-primary-bright); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.1rem; }
.site-header .krs-lockup { width: clamp(200px, 34vw, 300px); max-width: none; margin: 0; }
.site-header a { display: block; }

/* The menu: a native <details> disclosure with a hamburger for a summary, so it needs no
   script and works by keyboard and touch. Add links to the list; nothing else changes. */
.site-menu { position: relative; }
.site-menu summary {
  list-style: none; cursor: pointer; user-select: none;
  width: 44px; height: 44px; margin-right: -11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--krs-text-muted); border-radius: var(--krs-radius);
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu summary:hover, .site-menu[open] summary { color: var(--krs-primary-deep); }
.site-menu summary:focus-visible { outline: 2px solid var(--krs-primary-bright); outline-offset: 2px; }
.site-menu .bars, .site-menu .bars::before, .site-menu .bars::after {
  display: block; width: 22px; height: 2px; border-radius: 1px; background: currentColor;
}
.site-menu .bars { position: relative; }
.site-menu .bars::before, .site-menu .bars::after { content: ""; position: absolute; left: 0; transition: transform 0.15s ease, top 0.15s ease; }
.site-menu .bars::before { top: -7px; }
.site-menu .bars::after { top: 7px; }
.site-menu[open] .bars { background: transparent; }
.site-menu[open] .bars::before { top: 0; transform: rotate(45deg); }
.site-menu[open] .bars::after { top: 0; transform: rotate(-45deg); }
.site-menu ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 10;
  min-width: 12rem; margin: 0; padding: 0.35rem 0; list-style: none;
  background: var(--krs-surface); border: 1px solid var(--krs-border); border-radius: var(--krs-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.site-menu li a { display: block; padding: 0.6rem 1.2rem; color: var(--krs-text); font-size: 0.95rem; }
.site-menu li a:hover, .site-menu li a:focus-visible { background: var(--krs-page-to); color: var(--krs-primary-deep); text-decoration: none; outline: none; }
.site-menu li a[rel~="external"]::after { content: "\2197"; margin-left: 0.4em; font-size: 0.85em; color: var(--krs-text-muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A breadcrumb above a secondary page's title. main is a flex column, so without
   align-self the link stretches to the full column and all of that width is clickable.
   The negative margin pulls the title block up over the link's lower half, so the link
   is raised above it to stay clickable over its whole height. */
.crumb { align-self: flex-start; position: relative; z-index: 1; font-size: 0.9rem; color: var(--krs-text-muted); margin: 1.75rem 0 -1rem; }
.crumb:hover, .crumb:focus-visible { color: var(--krs-primary-deep); text-decoration: none; }

/* Hero: the one Orbitron line on the page. */
.hero { padding: 2.5rem 0; }
.hero h1 {
  font-family: var(--krs-font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0 0 1rem;
}
.hero p { font-size: 1.1rem; margin: 0; max-width: 42em; color: var(--krs-text-muted); }

section { padding: 0 0 1.75rem; }
section h2 { font-size: 1.05rem; }
section h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; margin: 0 0 0.75rem; }
section p { margin: 0 0 0.9rem; max-width: 62ch; }
section p:last-child { margin-bottom: 0; }
section ul { margin: 0 0 0.9rem; padding-left: 1.2rem; max-width: 62ch; }
section li { margin: 0 0 0.4rem; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.5rem; margin: 0; max-width: 62ch; }
dl.facts dt { color: var(--krs-text-muted); font-weight: 400; }
dl.facts dd { margin: 0; }
@media (max-width: 480px) { dl.facts { grid-template-columns: 1fr; gap: 0.1rem 0; } dl.facts dd { margin-bottom: 0.6rem; } }

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--krs-border);
  font-size: 0.85rem;
  color: var(--krs-text-muted);
}
.site-footer .wrap { padding-top: 1.25rem; padding-bottom: 1.5rem; text-align: right; }
.site-footer p { margin: 0; }

/* ── Pages with pictures ─────────────────────────────────────────────────────────────
   Product and infrastructure pages run wider than the text pages, so a screenshot can
   sit beside its paragraph. Text still keeps its own measure. */
.page.wide { max-width: 80rem; }
main.top { justify-content: flex-start; }

/* The inline navigation: shown beside the lockup on a wide screen, where the hamburger
   is hidden. Both lists are stamped from one definition by tools/build-site.py. */
.site-nav { display: none; }
@media (min-width: 62rem) {
  .site-nav { display: flex; gap: 1.9rem; align-items: center; }
  .site-nav a { display: block; padding: 0.4rem 0; color: var(--krs-text); font-size: 0.95rem; border-bottom: 2px solid transparent; }
  .site-nav a:hover, .site-nav a:focus-visible { color: var(--krs-primary-deep); text-decoration: none; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--krs-primary-bright); }
  .site-nav a[rel~="external"]::after { content: "\2197"; margin-left: 0.35em; font-size: 0.85em; color: var(--krs-text-muted); }
  .site-menu { display: none; }
}

/* An eyebrow above a title: the lockup's subtitle voice — small, wide-set capitals. */
.eyebrow {
  font-family: var(--krs-font-display); font-weight: 500;
  font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--krs-primary-deep); margin: 0 0 0.85rem;
}
.hero .eyebrow { margin-bottom: 0.9rem; }
.hero.tight { padding-bottom: 1.75rem; }

/* A screenshot: a plain frame, the product on a white ground in either scheme. */
.shot { margin: 0; }
.shot img {
  display: block; width: 100%; height: auto;
  background: #fff; border: 1px solid var(--krs-border); border-radius: var(--krs-radius);
  box-shadow: 0 14px 36px rgba(22, 32, 43, 0.09);
}
.shot figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--krs-text-muted); }
.shot.lead { margin-bottom: 2.75rem; }

/* A feature: words on one side, the screen that shows it on the other, alternating.
   A flex row: the screen takes up to 60% of it and the words take the rest. A heading
   stays on one line, so the words are never narrower than their heading and the screen
   gives way when a long heading needs the room. */
.feature {
  display: flex; gap: 2.75rem; align-items: center;
  padding: 2.5rem 0; border-top: 1px solid var(--krs-border);
}
.feature > div { flex: 1 1 0; min-width: min-content; }
.feature > .shot, .feature > .shots { flex: 0 1 60%; min-width: 0; }
.feature.flip .shot { order: -1; }
.feature h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: 0.01em; margin: 0 0 0.7rem; text-wrap: nowrap; }
.feature p { margin: 0 0 0.9rem; }
.feature p:last-child, .feature ul:last-child { margin-bottom: 0; }
.feature ul { margin: 0 0 0.9rem; padding-left: 1.15rem; }
.feature li { margin: 0 0 0.4rem; }
.feature.solo { flex-direction: column; align-items: stretch; }
.feature.solo > div:not(.shots) { flex: none; max-width: 46rem; }
.feature.solo h2 { text-wrap: balance; }
.feature.solo > .shot, .feature.solo > .shots { flex: none; }
/* Below this the screen beside the words would be smaller than the words: stack them. */
@media (max-width: 70rem) {
  .feature { flex-direction: column; align-items: stretch; gap: 1.5rem; padding: 2rem 0; }
  .feature > div, .feature > .shot, .feature > .shots { flex: none; min-width: 0; }
  .feature > div:not(.shots) { max-width: 46rem; }
  .feature h2 { text-wrap: balance; }
  .feature.flip .shot, .feature.flip .shots { order: 0; }
}


/* Short points in a row, each under the accent rule. */
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 1.75rem 2rem; margin: 0; padding: 2.5rem 0; border-top: 1px solid var(--krs-border); list-style: none; }
.points li { margin: 0; padding-top: 0.9rem; border-top: 2px solid var(--krs-primary-bright); }
.points h3 { margin: 0 0 0.35rem; font-size: 1rem; font-weight: 600; }
.points p { margin: 0; font-size: 0.95rem; color: var(--krs-text-muted); }
.points a { font-size: 0.95rem; }

/* The closing line of a page. */
.closing { padding: 2rem 0 0.5rem; border-top: 1px solid var(--krs-border); }
.closing p { margin: 0; }
/* A one-paragraph closing line runs the width of the column, not the prose measure,
   and breaks into even lines when it has to wrap. */
.closing > p:only-child { max-width: none; text-wrap: balance; }

/* Home and the products index: each product is a card, and each card is one link. */
.home-products { padding-bottom: 0.5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.5rem; margin: 0 0 1.25rem; }
.card {
  display: flex; flex-direction: column;
  background: var(--krs-surface); border: 1px solid var(--krs-border); border-radius: var(--krs-radius);
  color: var(--krs-text); overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover, .card:focus-visible { text-decoration: none; border-color: var(--krs-primary-bright); box-shadow: 0 10px 28px rgba(22, 32, 43, 0.08); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; background: #fff; border-bottom: 1px solid var(--krs-border); }
.card .body { padding: 1.1rem 1.25rem 1.25rem; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; font-weight: 600; color: var(--krs-primary-deep); }
.card p { margin: 0; font-size: 0.95rem; color: var(--krs-text-muted); }
.card .go { margin-top: 0.7rem; color: var(--krs-primary-deep); }
.nowrap { white-space: nowrap; }
.closing h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; margin: 0 0 0.6rem; }
.closing h2.gap { margin-top: 1.75rem; }
dl.facts.wide { max-width: 46rem; }

/* Infrastructure: the path a request takes, drawn in boxes. A row on a wide screen, a
   column on a narrow one; the arrows turn with it. */
.diagram { display: flex; align-items: stretch; gap: 0; margin: 0 0 2.75rem; font-size: 0.9rem; }
.diagram .node {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0.2rem;
  padding: 0.85rem 1rem; background: var(--krs-surface);
  border: 1px solid var(--krs-border); border-radius: var(--krs-radius);
}
.diagram .node strong { font-weight: 600; }
.diagram .node span { color: var(--krs-text-muted); font-size: 0.85rem; line-height: 1.4; }
.diagram .node.out { flex: 0 0 11rem; align-self: center; }
.diagram .link { flex: 0 0 5.5rem; align-self: center; text-align: center; color: var(--krs-primary-deep); font-size: 0.8rem; letter-spacing: 0.04em; }
.diagram .link span { display: block; padding-bottom: 0.3rem; margin: 0 0.5rem; border-bottom: 2px solid var(--krs-primary-bright); position: relative; }
.diagram .link span::after { content: ""; position: absolute; right: -1px; bottom: -6px; border: 5px solid transparent; border-left-color: var(--krs-primary-bright); border-right-width: 0; }
.diagram .zone { flex: 1 1 auto; min-width: 0; padding: 0.9rem 1rem 1rem; border: 1px solid var(--krs-primary-bright); border-radius: var(--krs-radius); }
.diagram .zone-label { margin: 0 0 0.75rem; font-family: var(--krs-font-display); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--krs-primary-deep); }
.diagram .row { display: flex; gap: 0.75rem; }
.diagram .mgmt { margin: 0.75rem 0 0; padding: 0.55rem 1rem; border: 1px dashed var(--krs-border); border-radius: var(--krs-radius); color: var(--krs-text-muted); font-size: 0.85rem; }
@media (max-width: 62rem) {
  .diagram { flex-direction: column; }
  .diagram .node.out { flex: 0 0 auto; align-self: stretch; }
  .diagram .link { flex: 0 0 auto; padding: 0.6rem 0; }
  .diagram .link span { display: inline-block; margin: 0; padding: 0 0 0 0.9rem; border-bottom: 0; border-left: 2px solid var(--krs-primary-bright); line-height: 2; }
  .diagram .link span::after { right: auto; left: -6px; bottom: -6px; border: 5px solid transparent; border-top-color: var(--krs-primary-bright); border-bottom-width: 0; }
}
@media (max-width: 40rem) { .diagram .row { flex-direction: column; } }
/* .stack: the diagram runs top to bottom at every width, for a flow with more than one zone. */
.diagram.stack { flex-direction: column; }
.diagram.stack .row > .node { flex: 1 1 0; }
.diagram.stack .node.out { flex: 0 0 auto; align-self: stretch; }
.diagram.stack .link { flex: 0 0 auto; padding: 0.6rem 0; }
.diagram.stack .link span { display: inline-block; margin: 0; padding: 0 0 0 0.9rem; border-bottom: 0; border-left: 2px solid var(--krs-primary-bright); line-height: 2; }
.diagram.stack .link span::after { right: auto; left: -6px; bottom: -6px; border: 5px solid transparent; border-top-color: var(--krs-primary-bright); border-bottom-width: 0; }
.hero.home { padding-top: 4rem; padding-bottom: 3rem; }
.points li > a { display: inline-block; margin-top: 0.5rem; }
/* A heading over a row of points. */
h2.band { margin: 0; padding: 2rem 0 1.1rem; border-top: 1px solid var(--krs-border); font-family: var(--krs-font-display); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--krs-primary-deep); }
h2.band + .points { border-top: 0; padding-top: 0; padding-bottom: 2.25rem; }
/* Two screens for one feature, stacked. */
.shots { display: grid; gap: 1.25rem; min-width: 0; }
.feature.flip .shots { order: -1; }
