/* Kitebird site. One stylesheet, no build step, no external requests. */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono";
  src: url("fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Tokens ----------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --bg: #fbfcfc;        /* paper */
  --surface: #f0f5f4;   /* sky tint */
  --token: #e1eeec;     /* label chip */
  --text: #18232b;      /* ink */
  --muted: #4a5863;
  --accent: #0a6b66;    /* spruce */
  --accent-ink: #ffffff;
  --accent-hover: #08524e;
  --remove: #a3362f;
  --line: #c9d5d5;

  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.9375rem;  /* 15px */
  --step-0: 1.0625rem;   /* 17px */
  --step-1: 1.3125rem;   /* 21px */
  --step-2: 1.6875rem;   /* 27px */
  --step-3: clamp(2.125rem, 1.55rem + 2.4vw, 3rem);
  --step-4: clamp(2.375rem, 1.6rem + 3.4vw, 3.625rem);

  --measure: 68ch;
  --wrap: 74rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f171d;
    --surface: #16222a;
    --token: #1c3236;
    --text: #e3ebec;
    --muted: #a2b0b7;
    --accent: #62c6be;
    --accent-ink: #0f171d;
    --accent-hover: #8ad8d1;
    --remove: #f09088;
    --line: #334652;
  }
}

/* Base ------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--step-0)/1.6 var(--font);
  font-kerning: normal;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
h1 { font-size: var(--step-3); letter-spacing: -0.012em; }
h2 { font-size: var(--step-2); letter-spacing: -0.006em; }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p, ul, ol, dl, table, figure { margin: 0 0 1rem; }
p { text-wrap: pretty; }
ul, ol { padding-left: 1.35rem; }
li + li { margin-top: 0.4rem; }
li > ul, li > ol { margin-top: 0.4rem; margin-bottom: 0; }
strong, b { font-weight: 700; }

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2px; }

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

code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code {
  background: var(--token);
  border-radius: 3px;
  padding: 0.08em 0.35em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  background: var(--bg);
  color: var(--accent);
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

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

/* Header ----------------------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg { width: 2rem; height: 2rem; color: var(--accent); flex: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li + li { margin-top: 0; }
.site-nav a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--text);
  text-decoration: none;
}
.site-nav a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.45em;
}

/* Sections --------------------------------------------------------------- */

.section { padding-block: clamp(2.5rem, 6vw, 4.25rem); }
.section + .section { border-top: 1px solid var(--line); }
.section > h2 { margin-bottom: 1.25rem; }
.section-intro { max-width: var(--measure); color: var(--muted); margin-bottom: 2rem; }

.lead {
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 58ch;
}

.muted { color: var(--muted); }

/* Home hero */
.hero { padding-block: clamp(3rem, 10vw, 6.5rem) clamp(1rem, 3vw, 2rem); }
.hero + .section { padding-top: clamp(1.5rem, 4vw, 2.75rem); }
.hero h1 {
  font-size: var(--step-4);
  line-height: 1.08;
  max-width: 17ch;
  margin-bottom: 1.25rem;
}

/* Buttons ---------------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0.75rem;
}
.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-quiet { background: transparent; color: var(--accent); }
.button-quiet:hover { background: var(--token); border-color: var(--accent); }

.note { color: var(--muted); font-size: var(--step--1); margin: 0; }

/* Label chips: used wherever a real Confluence label name appears ---------- */

.label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.875em;
  line-height: 1.45;
  background: var(--token);
  color: var(--text);
  border-radius: 3px;
  padding: 0.05em 0.45em;
  white-space: nowrap;
}
.label-target { background: var(--accent); color: var(--accent-ink); }

/* Home: app list --------------------------------------------------------- */

.app-list { list-style: none; padding: 0; margin: 0; }
.app {
  display: grid;
  gap: 1rem 3rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.app h3 { font-size: var(--step-2); margin-bottom: 0.5rem; }
.app h3 a { color: var(--text); text-decoration: none; }
.app h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.app p { max-width: 60ch; }
.app-status { color: var(--muted); font-size: var(--step--1); }
.app-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }
.app-merge {
  align-self: center;
  margin: 0;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 2.1;
}
@media (min-width: 52rem) {
  .app { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

/* Definition grids (facts, where to find it) ----------------------------- */

.facts {
  display: grid;
  gap: 1.75rem 3rem;
  margin: 0;
}
.facts dt { font-weight: 700; font-size: var(--step-1); line-height: 1.25; margin-bottom: 0.35rem; }
.facts dd { margin: 0; max-width: 52ch; }
.facts dd p:last-child { margin-bottom: 0; }
@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.contact-line { font-size: var(--step-1); margin-bottom: 0.5rem; }

/* Product hero and dry-run figure ---------------------------------------- */

.product-hero {
  display: grid;
  gap: 2.5rem 4rem;
  align-items: start;
  padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2.5rem, 6vw, 4.25rem);
}
.product-hero h1 { font-size: var(--step-4); line-height: 1.08; max-width: 14ch; margin-bottom: 1.25rem; }
@media (min-width: 62rem) {
  .product-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
  .product-hero .dryrun { margin-top: 0.5rem; }
}

.dryrun {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: var(--step--1);
  overflow: hidden;
}
.dryrun figcaption {
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.dryrun-body { padding: 1.25rem 1.25rem 1.1rem; border-left: 4px solid var(--accent); }
.dryrun-title { font-weight: 700; margin-bottom: 0.6rem; line-height: 2; }
.dryrun-title .label { font-weight: 400; }
.dryrun-scope { color: var(--muted); margin-bottom: 0.9rem; }
.dryrun-count { font-size: var(--step-1); line-height: 1.3; margin-bottom: 1rem; }
.dryrun table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.dryrun th {
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0 0.75rem 0.4rem 0;
}
.dryrun td {
  border-top: 1px solid var(--line);
  padding: 0.5rem 0.75rem 0.5rem 0;
  vertical-align: top;
}
.dryrun td:last-child, .dryrun th:last-child { padding-right: 0; }
.change { font-family: var(--mono); font-size: 0.8125rem; line-height: 1.6; }
.change span { white-space: nowrap; }
.add { color: var(--accent); }
.remove { color: var(--remove); }
.dryrun-foot { margin: 0; color: var(--muted); }

/* Product feature grid --------------------------------------------------- */

.features {
  display: grid;
  gap: 2.25rem 3.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li + li { margin-top: 0; }
.features h3 { margin-bottom: 0.4rem; }
.features p { margin: 0; max-width: 54ch; }
@media (min-width: 48rem) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.plain-list { max-width: var(--measure); }

/* Long-form pages (docs, policies) --------------------------------------- */

.page-head { padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.page-head h1 { max-width: 22ch; }
.page-head .lead { color: var(--text); }
.meta { color: var(--muted); font-size: var(--step--1); margin: 0; }

.prose { max-width: var(--measure); padding-bottom: 3rem; }
.prose h2 {
  margin-top: 3rem;
  padding-top: 0.25rem;
  scroll-margin-top: 1.25rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; scroll-margin-top: 1.25rem; }
.prose h4 { margin-top: 1.5rem; margin-bottom: 0.4rem; }
.prose dl dt { font-weight: 700; margin-top: 1rem; }
.prose dl dd { margin: 0.25rem 0 0; }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.menu-path { font-weight: 700; }

.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; }
.table-scroll:focus-visible { outline-offset: 1px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  margin: 0;
}
table.data caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.5rem;
}
table.data th, table.data td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 1rem 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data thead th { font-size: 0.875rem; color: var(--muted); border-bottom-width: 2px; }
table.data td:first-child code { white-space: nowrap; }

/* Docs: two columns with an in-page contents list -------------------------- */

.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 4rem; }
.toc {
  font-size: var(--step--1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  background: var(--surface);
}
.toc h2 { font-size: var(--step-0); margin: 0 0 0.5rem; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: 0.25rem; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }
@media (min-width: 40rem) and (max-width: 63.99rem) {
  .toc ul { columns: 2; column-gap: 2.5rem; }
  .toc li { break-inside: avoid; }
}
@media (min-width: 64rem) {
  .docs { grid-template-columns: 15rem minmax(0, 1fr); }
  .toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    border: 0;
    background: none;
    padding: 0.25rem 0 0;
  }
}

/* 404 */
.not-found { padding-block: clamp(3rem, 10vw, 7rem); }
.not-found h1 { font-size: var(--step-4); }

/* Footer ----------------------------------------------------------------- */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--step--1);
}
.footer-main {
  display: grid;
  gap: 2rem 4rem;
  padding-block: 2.5rem 1.5rem;
}
.footer-brand { font-weight: 700; font-size: var(--step-0); margin-bottom: 0.25rem; }
.footer-main p { margin-bottom: 0.4rem; }
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 0.35rem 2.5rem;
}
.footer-nav li + li { margin-top: 0; }
.footer-nav a { color: var(--text); }
.footer-fine {
  padding-block: 1.25rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-fine p { margin-bottom: 0.35rem; max-width: 80ch; }
@media (min-width: 48rem) {
  .footer-main { grid-template-columns: minmax(0, 1fr) auto; }
  .footer-nav ul { grid-template-columns: repeat(3, max-content); }
}

/* Print: keep policies readable on paper ---------------------------------- */

@media print {
  .site-header nav, .skip-link, .toc, .site-footer .footer-nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .prose { max-width: none; }
}

/* Security: scope list --------------------------------------------------- */

.scope-list { margin: 0 0 1.5rem; border-top: 1px solid var(--line); }
.scope-list > div { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.prose .scope-list dt { margin: 0 0 0.25rem; font-weight: 400; }
.prose .scope-list dd { margin: 0; }
@media (min-width: 40rem) {
  .scope-list > div { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 1.25rem; }
  .prose .scope-list dt { margin: 0; }
}
