/* Shared by all pages of the wicket-testkit site: color tokens (light and dark), base type, header, inline
   code, tables, code blocks, the viewfinder brackets and the footer. Page-specific styles live in each page. */
:root {
  --paper: #F4F5F1;
  --surface: #FFFFFF;
  --ink: #14181F;
  --ink-2: #485060;
  --ink-3: #6A7280;
  --rule: #D9DCD4;
  --hit: #0E9F6E;
  --hit-ink: #04261A;
  --hit-soft: #D7F3E6;
  --miss: #CF3A44;
  --miss-soft: #FBE2E3;
  --code-bg: #12161D;
  --code-fg: #DDE3EA;
  --code-dim: #7F8896;
  --code-key: #9CC4FF;
  --code-str: #B6E3C4;
  --code-ann: #F2C97D;
  --code-rule: #232A35;

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  --step-4: clamp(2.5rem, 1.5rem + 4.4vw, 4.6rem);

  --measure: 66ch;
  --wide: 76rem;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E1116;
    --surface: #151A22;
    --ink: #E8ECF1;
    --ink-2: #A5AEBB;
    --ink-3: #7F8896;
    --rule: #252C37;
    --hit: #3DDC97;
    --hit-ink: #04261A;
    --hit-soft: #123A2A;
    --miss: #FF6B72;
    --miss-soft: #3B1B1E;
    --code-bg: #0A0D12;
    --code-rule: #1E2530;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E1116;
  --surface: #151A22;
  --ink: #E8ECF1;
  --ink-2: #A5AEBB;
  --ink-3: #7F8896;
  --rule: #252C37;
  --hit: #3DDC97;
  --hit-ink: #04261A;
  --hit-soft: #123A2A;
  --miss: #FF6B72;
  --miss-soft: #3B1B1E;
  --code-bg: #0A0D12;
  --code-rule: #1E2530;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--hit); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--hit); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.08; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
.wrap { max-width: var(--wide); margin-inline: auto; }

/* ---------- the viewfinder: corner brackets around what a locator finds; the site's one device ---------- */
.target {
  --corner: 0.32em;
  --stroke: 0.09em;
  position: relative;
  padding: 0.02em 0.16em;
  margin-inline: 0.04em;
  background:
    linear-gradient(var(--hit), var(--hit)) top left / var(--corner) var(--stroke),
    linear-gradient(var(--hit), var(--hit)) top left / var(--stroke) var(--corner),
    linear-gradient(var(--hit), var(--hit)) top right / var(--corner) var(--stroke),
    linear-gradient(var(--hit), var(--hit)) top right / var(--stroke) var(--corner),
    linear-gradient(var(--hit), var(--hit)) bottom left / var(--corner) var(--stroke),
    linear-gradient(var(--hit), var(--hit)) bottom left / var(--stroke) var(--corner),
    linear-gradient(var(--hit), var(--hit)) bottom right / var(--corner) var(--stroke),
    linear-gradient(var(--hit), var(--hit)) bottom right / var(--stroke) var(--corner);
  background-repeat: no-repeat;
  white-space: nowrap;
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
.top .wrap { display: flex; align-items: center; gap: 1.5rem; padding-block: 0.8rem; }
.mark {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 110%;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.mark svg { width: 1.35rem; height: 1.35rem; flex: none; }
.mark .dim { color: var(--ink-3); font-weight: 600; }
.nav { display: flex; gap: 1.25rem; margin-left: auto; align-items: center; font-size: var(--step--1); }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav .gh { color: var(--ink); font-weight: 600; display: inline-flex; gap: 0.4rem; align-items: center; }
.nav .gh svg { width: 1.05rem; height: 1.05rem; }
.theme-btn {
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  border-radius: 999px;
  font: 500 0.75rem/1 var(--mono);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
}
.theme-btn:hover { color: var(--ink); border-color: var(--ink-3); }
@media (max-width: 760px) { .nav .sec { display: none; } }
@media (max-width: 480px) {
  .nav { gap: 0.9rem; }
  .theme-btn .lbl, .nav .gh .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.eyebrow {
  font: 600 0.78rem/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- inline code ---------- */
p code, li code, td code, dd code, h2 code, h3 code, figcaption code {
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}
h2 code, h3 code { font-size: 0.8em; border: 0; background: none; padding: 0; }
/* On phones, long inline code wraps instead of overflowing. */
@media (max-width: 600px) {
  p code, li code, td code, dd code {
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font: 600 0.74rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); background: var(--paper); }
td code { white-space: nowrap; }

/* ---------- code blocks ---------- */
.code {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  min-width: 0;
  overflow: hidden;
  margin-top: 1.25rem;
}
.code .bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem 0.5rem 1rem;
  border-bottom: 1px solid var(--code-rule);
  font: 500 0.75rem/1.2 var(--mono);
  color: var(--code-dim);
}
.code .bar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code .copy {
  margin-left: auto;
  background: none;
  border: 1px solid var(--code-rule);
  color: var(--code-dim);
  border-radius: 4px;
  font: inherit;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
}
.code .copy:hover { color: var(--code-fg); border-color: var(--code-dim); }
.code pre {
  margin: 0;
  padding: 1rem 1.1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  tab-size: 4;
}
.code pre code { font-size: inherit; }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .c { color: var(--code-dim); font-style: italic; }
.code .a { color: var(--code-ann); }
.code .bad { color: #FF8A8F; }
.code .good { color: #4FE0A5; }

/* A failure message, as a test runner prints it. */
.message {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  border-left: 4px solid var(--miss);
  overflow: hidden;
}
.message pre { margin: 0; padding: 1rem 1.1rem; font-size: 0.82rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message .em { color: #FFD08A; }
.message .ok { color: #7EE8B8; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-block: 2.5rem 3rem;
  color: var(--ink-3);
  font-size: var(--step--1);
}
footer .wrap { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
footer h2 { font: 600 0.75rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.6rem; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
footer p + p { margin-top: 0.5rem; }

/* Code inside a code block is never styled as inline code, wherever the block sits. */
pre code {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  color: inherit;
  white-space: inherit;
  overflow-wrap: normal;
}
