/*
 * ELLIO client fingerprint page - one stylesheet, no external requests.
 *
 * Dark only, on purpose. The product forces dark, and the field hues below
 * were measured against a dark card; a light variant would be a second set of
 * numbers nobody validated, free to drift away from the product.
 */

/* ------------------------------------------------------------- fonts ---- */

/* Montserrat, subset to the Latin characters this page uses and served from
 * our own origin. The tech('variations') hint first, the legacy
 * 'woff2-variations' string second, which is what older Safari understands. */
@font-face {
  font-family: 'Montserrat';
  src: url('assets/montserrat-latin-var.woff2') format('woff2') tech('variations'),
       url('assets/montserrat-latin-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jetbrains-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------ tokens ---- */

:root {
  color-scheme: dark;

  /* Surfaces and type, from the product's .dark block. */
  --background: hsl(213 57% 5%);
  --foreground: hsl(213 14% 97.5%);
  --muted-foreground: hsl(214 14% 68%);
  --border: hsl(216 24% 19%);
  --border-strong: hsl(216 24% 26%);
  --primary: hsl(200.5 100% 50%);
  --ring: hsl(200.5 100% 50%);

  /* The exact surface the field hues were measured against: the page under a
   * 2% white card. Written as a literal so the contrast arithmetic in the
   * product's palette notes still holds here - 5.60:1 to 10.70:1 for the five
   * hues, well clear of the 4.5:1 that body-weight text needs. */
  --card: #090f16;
  --card-raised: #0d141d;
  --card-sunken: #070d14;

  /*
   * One hue per field POSITION inside a fingerprint token, in wire order.
   * Taken verbatim from the product's palette.
   *
   * They wrap past the fifth, which is what JA4's eight fields need: blue,
   * green, amber, pink, purple, blue, green, amber. No two adjacent runs ever
   * share a hue under that order, and a repeat only ever pairs a short code
   * with a twelve-character hash, so run length and fixed position tell them
   * apart. Colour is never the key on its own: every run is restated in a
   * table row under a header naming the field.
   *
   * These belong on mono glyphs inside a token and on the breakdown rows that
   * token feeds. Never on a word, a badge, a pill or an icon - the moment one
   * of them lands on a label, a reader is entitled to read it as a verdict.
   */
  --hue-0: #6ab1ff;
  --hue-1: #2cd590;
  --hue-2: #f4b73b;
  --hue-3: #ef546e;
  --hue-4: #a86df0;

  /* The same five at 15% alpha, for the run highlight. */
  --hue-0-bg: rgba(106, 177, 255, 0.15);
  --hue-1-bg: rgba(44, 213, 144, 0.15);
  --hue-2-bg: rgba(244, 183, 59, 0.15);
  --hue-3-bg: rgba(239, 84, 110, 0.15);
  --hue-4-bg: rgba(168, 109, 240, 0.15);

  /* Separators, characters no field claims, and any value that did not parse.
   * Structure rather than data, so it recedes. */
  --hue-none: rgba(255, 255, 255, 0.4);

  --font-sans: 'Montserrat', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono',
    Menlo, Consolas, 'Liberation Mono', 'DejaVu Sans Mono', monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --wrap: 74rem;

  /* Height of the one sticky top bar - mark, layer links, platform link.
   * Every fragment target below sets scroll-margin-top from it, so following a
   * link never parks a heading underneath the bar. Measured at 47px for the one
   * row it occupies down to 24rem, and at 74px for the two rows it takes below
   * that, where this value is raised to 5rem to match. Kept a little generous:
   * too much is a gap, too little is a covered heading. */
  --nav-h: 3rem;
}

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

/* Several blocks on this page are revealed by taking the hidden attribute off,
 * and a class that sets display would otherwise outrank the user agent's
 * [hidden] rule and leave them visible. This settles it once, for every toggle
 * here and every later one. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  /* A long token wraps rather than widening the page; nothing here may push
   * the document sideways. */
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

/* -------------------------------------------------------------- a11y ---- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--card-raised);
  color: var(--foreground);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 120ms ease-out;
}

.skip-link:focus {
  top: 1rem;
}

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

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
}

a:hover {
  color: color-mix(in srgb, var(--primary) 78%, white);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  a:hover {
    color: #66c9ff;
  }
}

/* ------------------------------------------------------------ top bar ---- */

/*
 * One bar, and the only sticky element on the page: the mark, the three layer
 * anchors, the platform link. Nothing wraps - below each breakpoint a piece of
 * text steps aside instead, so the bar's height is the same at every width and
 * --nav-h stays true.
 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--card-sunken);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.6rem;
  min-width: 0;
}

.brand {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--foreground);
  text-decoration: none;
}

/* The mark inherits currentColor for its letterform, so the wordmark's E sits
 * at page-foreground brightness while the three bars keep ELLIO blue. */
.brand-logo {
  /* The wordmark is ~4.87:1, so height drives it and width follows. It
     carries its own fills - bars in ELLIO blue, letters in white - so it
     does not inherit currentColor and does not need to. */
  height: 1.35rem;
  width: auto;
  display: block;
  flex: 0 0 auto;
}


.platform-link {
  flex: none;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.platform-link:hover,
.platform-link:focus-visible {
  text-decoration: underline;
}

/* The short label is the one that appears below 44rem; until then it is out of
 * the layout entirely, and it is aria-hidden either way, so the link's
 * accessible name is the long label at every width. */
.platform-link-short {
  display: none;
}

/* --------------------------------------------------------------- hero --- */

.intro {
  padding-block: clamp(2.25rem, 6vw, 4rem) clamp(1.5rem, 4vw, 2.25rem);
}

h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.9rem, 5.2vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 20ch;
}

.lede {
  margin: 0 0 1.5rem;
  max-width: 62ch;
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--muted-foreground);
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.status {
  margin: 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: 0.875rem;
  color: var(--muted-foreground);
  max-width: 70ch;
}

.status code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--foreground);
}

.status--live {
  border-left-color: var(--primary);
}

/* ------------------------------------------------------------ failure --- */

/*
 * A read that failed. The panel is in the markup and starts hidden; app.js only
 * takes the hidden attribute off, so it survives a failure of the code that
 * would have drawn values.
 *
 * The state attribute takes down everything that could be mistaken for a
 * measurement: the connection facts, whose empty cells otherwise print a dash,
 * and every token and raw-string slot. The explanations stay, because they are
 * static and true whether or not the API answered - and with scripting off the
 * attribute is never set at all, so a crawler still meets the described page.
 */
.failure {
  max-width: 70ch;
  margin: 0;
  padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--hue-2);
  border-radius: var(--radius);
}

.failure-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--foreground);
}

.failure p {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.failure-lede {
  color: var(--foreground);
}

.failure code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--foreground);
}

/* The server's own words, the one line here that cannot be static markup. */
.failure-reason {
  padding-left: 0.8rem;
  border-left: 2px solid var(--border-strong);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

/*
 * A failed load must not leave a placeholder that reads as a measurement.
 * The empty-cell rules below render "not sent" for a field with no characters
 * and "-" for one with no reading; both are true statements ABOUT A CLIENT when
 * a response was parsed, and false when there was no response at all. Under
 * data-load='failed' the tables are empty because nothing was read, so the
 * placeholders are suppressed and the cells stay blank.
 */
[data-load='failed'] .f-chars [data-slot]:empty::after,
[data-load='failed'] .f-read:empty::after {
  content: none;
}

[data-load='failed'] #status,
[data-load='failed'] .connection,
[data-load='failed'] .token-block,
[data-load='failed'] .raws {
  display: none;
}

/*
 * The same rule, for everything else that can only be said about a document
 * that was read. An empty state says what the sensor did not see; a layer note
 * and a card warning say what the transport was; the spans inside the transport
 * note say which way this page arrived. A failed refresh must not leave any of
 * them standing from the read before it, so they go down together and the
 * static explanations around them stay.
 */
[data-load='failed'] .card-empty,
[data-load='failed'] .card-warning,
[data-load='failed'] .layer-note,
[data-load='failed'] .transport-note span {
  display: none;
}

/* --------------------------------------------------- connection facts --- */

.connection {
  margin: 0 0 0.9rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.connection h2 {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.9rem 1.75rem;
  margin: 0;
}

.meta > div {
  min-width: 0;
}

.meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.meta dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.meta dd:empty::after {
  content: '-';
  color: var(--hue-none);
}

/*
 * Which transport carried this page, and where the other one is.
 *
 * A sibling of the connection card rather than a child of it, and deliberately:
 * a failed read takes .connection down, because every cell in it is a
 * measurement, and the standing sentences here are neither measured nor
 * conditional. The spans app.js reveals inside are conditional, and they stay
 * hidden unless a document has actually been read.
 */
.transport-note {
  margin: 0 0 clamp(2rem, 5vw, 3rem);
  max-width: 78ch;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------- layer nav --- */

/*
 * Three anchors to the three section ids, in the middle of the bar. They
 * resolve with scripting off; app.js only adds the in-view mark on top.
 */
.layer-nav {
  flex: 0 0 auto;
  min-width: 0;
}

.layer-nav-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  min-width: 0;
  list-style: none;
}

.layer-nav-link {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
  text-decoration: none;
  white-space: nowrap;
}

.layer-nav-link:hover,
.layer-nav-link:focus-visible {
  color: var(--foreground);
  border-color: var(--border-strong);
}

/*
 * The section in view. app.js sets aria-current, and this rule follows it, so
 * the visible mark and the announced one cannot disagree. It is carried by the
 * border, the raised fill and the brighter text together - never by hue alone,
 * and never with one of the field hues, which mean something else on this page.
 */
.layer-nav-link[aria-current] {
  color: var(--foreground);
  background: var(--card-raised);
  border-color: var(--primary);
}

/*
 * What gives way, and in what order. The three layer links never do: they are
 * the only navigation on the page, and they stay reachable at every width.
 *
 *   under 44rem  the platform link drops to its short label
 *   under 34rem  the bar's gaps and the layer links' padding tighten
 *   under 24rem  the wordmark takes a row of its own and the bar becomes two
 *
 * The first two steps are set where the bar starts to read as one crowded run
 * rather than three groups. The third is arithmetic rather than taste, and the
 * arithmetic was redone when the fourth link came out rather than assumed to
 * still hold. Measured on the built page: a 105px wordmark, the three links at
 * 144px and the short platform link at 64px, with two 8px gaps, want 329px on
 * one row. A viewport of w px below 25rem has w - 32px of content box to give
 * them, so the row stops fitting below 361px - it was 460px with four links,
 * which is why this breakpoint moves rather than disappears. It is set at 24rem
 * (384px), the next step up with slack in it, because a bar that wraps a little
 * early is a tidy two rows and a bar that wraps a little late is the wordmark
 * keeping its width, overflowing the box flex had shrunk around it, and sitting
 * on top of the first link - which is exactly what happened here before there
 * was a rule for it. Everything above scales with the root font size, and so
 * does a rem breakpoint, so the two stay in step.
 *
 * The order in the markup is the order on the screen at every width, so the tab
 * order is still the reading order: logo, TCP, TLS, HTTP, platform.
 *
 * The brand link keeps its full accessible name throughout, and so does the
 * platform link, whose long label is only ever hidden from sight.
 */
@media (max-width: 44rem) {
  .platform-link-long {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .platform-link-short {
    display: inline;
  }
}

@media (max-width: 34rem) {

  .topbar-inner {
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
  }

  .layer-nav-link {
    padding-inline: 0.45rem;
  }

  .layer-nav-list {
    gap: 0.15rem;
  }
}

/* Two rows: the wordmark on the first, the links and the platform link on the
 * second. The brand takes the full row rather than the nav taking it, because
 * flex wraps in source order - handing the row to the nav instead would leave
 * the platform link stranded on a third one, and reaching for `order` to avoid
 * that would separate the tab order from what is on the screen. */
@media (max-width: 24rem) {
  :root {
    --nav-h: 5rem;
  }

  .brand {
    flex: 1 0 100%;
  }

  .platform-link {
    margin-left: auto;
  }
}

/* ------------------------------------------------------------- layers --- */

.layers {
  display: grid;
  gap: clamp(2.5rem, 7vw, 4rem);
  padding-block: clamp(1.5rem, 4vw, 2.5rem) 0;
  /* The skip link lands here, and the bar is sticky above it. */
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.layer {
  min-width: 0;
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.layer-head {
  margin-bottom: clamp(1rem, 2.5vw, 1.4rem);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.layer h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.layer-desc {
  margin: 0.55rem 0 0;
  max-width: 78ch;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/*
 * What this layer means for THIS connection, when it is not what the
 * description above assumes. It carries a rule the way the empty states do, so
 * a reader can see at a glance that it is a condition rather than more of the
 * standing explanation - and it is stated in the layer head, where the reason a
 * layer is empty belongs, rather than left for the card to imply.
 */
.layer-note {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.9rem;
  max-width: 78ch;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-sunken);
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------- cards --- */

.cards {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.1rem, 3.2vw, 1.9rem);
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.card-head {
  margin-bottom: 1.4rem;
}

.card h3 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.card-desc {
  margin: 0.7rem 0 0;
  max-width: 78ch;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

.card h4 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.card-empty {
  margin: 0;
  padding: 0.9rem 1.1rem;
  max-width: 78ch;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-sunken);
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/*
 * The server's own words about this fingerprint, quoted rather than paraphrased
 * - the one line in a card that is not static markup, and given the treatment
 * the failure panel gives the server's other words: a rule down the side, the
 * mono face, and a label saying whose sentence it is. It sits above whatever it
 * qualifies, whether that is a value or the absence of one.
 */
.card-warning {
  margin: 0.9rem 0 0;
  padding-left: 0.8rem;
  max-width: 78ch;
  border-left: 2px solid var(--border-strong);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.card-warning-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.note {
  margin: 0.9rem 0 0;
  max-width: 78ch;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* -------------------------------------------------------------- token --- */

.token-block {
  padding: clamp(0.85rem, 2.5vw, 1.15rem);
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.token-label {
  margin: 0 0 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/*
 * The value itself. Wraps rather than scrolling, so a 300 character raw string
 * cannot push the page sideways; wrapping inserts no characters, so a copied
 * value is still the value.
 */
.token {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.6vw, 1.35rem);
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: var(--hue-none);
}

.token:empty::after {
  content: 'waiting for the API';
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

/* One run of characters, in its field's hue. */
.tk {
  color: var(--tk-hue, var(--hue-none));
  border-radius: 3px;
  padding-block: 0.05em;
}

.tk-sep {
  color: var(--hue-none);
}

/*
 * JA3 publishes an MD5, and an MD5 has no fields. Colouring it would claim a
 * layout the string does not have, so it stays at foreground brightness and
 * the hues go on the pre-hash string instead.
 */
.token--plain {
  color: var(--foreground);
}

.token-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--card-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--primary);
}

.btn[data-copied='true'] {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--link {
  color: var(--primary);
}

.btn--primary {
  color: var(--foreground);
  border-color: var(--border-strong);
  background: var(--card-raised);
}

/* --------------------------------------------------------- breakdown --- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  margin: 1.6rem 0 0.7rem;
}

.section-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* The table gets its own scroll container so a narrow screen scrolls the
 * table rather than the document. It is focusable because a region that
 * scrolls has to be reachable from the keyboard. */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-raised);
}

.table-scroll:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

table.fields {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

table.fields thead th {
  padding: 0.6rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.fields tbody tr + tr > * {
  border-top: 1px solid var(--border);
}

table.fields th,
table.fields td {
  padding: 0.75rem 0.9rem;
  vertical-align: top;
}

/* The row header carries the field's hue as a rule down its left edge, and the
 * characters cell carries it as the colour of the glyphs. The hue never lands
 * on the field's name: the name is the header that says which field this is,
 * and it stays at foreground brightness so nothing about it reads as a
 * verdict. */
table.fields tbody th[scope='row'] {
  width: 30%;
  min-width: 14rem;
  border-left: 3px solid var(--tk-hue, var(--border-strong));
  font-weight: 400;
}

.f-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--foreground);
}

.f-help {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.f-chars {
  width: 22%;
  min-width: 8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--tk-hue, var(--hue-none));
  overflow-wrap: anywhere;
}

.f-chars [data-slot]:empty::after {
  content: 'not sent';
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted-foreground);
}

.f-read {
  width: 48%;
  min-width: 16rem;
  color: var(--foreground);
}

.f-read:empty::after {
  content: '-';
  color: var(--hue-none);
}

.f-derived {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* The run highlight: the same hue at 15% alpha, on the token run and on the
 * table row it feeds, so the correspondence is visible from either end. */
.card[data-hot] .tk[data-hot='true'] {
  background: var(--tk-hue-bg);
}

.card[data-hot] tr[data-hot='true'] > * {
  background: var(--tk-hue-bg);
}

/* --------------------------------------------------- TCP option kinds --- */

.opt-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.opt-list li {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.15rem 0.6rem;
  align-items: baseline;
}

.opt-kind {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-foreground);
  text-align: right;
}

.opt-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.opt-desc {
  grid-column: 2;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.opt-unusual {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}

.opt-unusual code {
  font-family: var(--font-mono);
  color: var(--foreground);
}

/* ------------------------------------------------------- raw and copy --- */

.raws {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.raw-row {
  min-width: 0;
  padding: 0.75rem 0.9rem;
  background: var(--card-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.raw-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.4rem;
}

.raw-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--foreground);
  margin-right: auto;
}

.raw-note {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.raw {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}

.raw--hued {
  color: var(--hue-none);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------- disclosure -- */

details.panel {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-raised);
}

details.panel > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

details.panel > summary::marker {
  color: var(--muted-foreground);
}

details.panel > summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

details.panel[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

details.panel > summary h4 {
  display: inline;
  font-size: 0.78rem;
  color: var(--foreground);
}

.panel-count {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.panel-body {
  padding: 0.9rem;
}

.panel-body > p {
  margin: 0 0 0.8rem;
  max-width: 78ch;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ------------------------------------------------------------ interop --- */

.interop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.interop-item {
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
}

/*
 * A reading that lands on the conformant value for this ClientHello is still
 * listed - dropping it would assert it does not exist - but quietened, because
 * it distinguishes nothing here. It also says so in words, so the difference is
 * never carried by the dashed border alone.
 */
.interop-item--same {
  border-style: dashed;
  border-color: var(--border);
}

.interop-item > details > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.7rem;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.interop-item > details > summary:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
}

.interop-item > details[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.interop-value {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.interop-item--same .interop-value {
  color: var(--muted-foreground);
}

.interop-title {
  min-width: 0;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.interop-flag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  white-space: nowrap;
}

/* minmax(0, 1fr) rather than the implicit auto track: the readings quote whole
 * JA4 values, and an auto track is floored at the widest unbreakable one, which
 * pushed the panel past the viewport at the narrowest widths. */
.interop-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.8rem;
}

.interop-how {
  margin: 0;
  max-width: 78ch;
  font-size: 0.875rem;
  color: var(--foreground);
}

.interop-rule {
  margin: 0;
  max-width: 78ch;
  padding-left: 0.8rem;
  border-left: 2px solid var(--border-strong);
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.interop-rule-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ------------------------------------------------------ talk and blog --- */

.talk {
  margin-block: clamp(2.5rem, 7vw, 4rem);
  padding-top: clamp(1.5rem, 4vw, 2.25rem);
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 0.75rem);
}

.talk h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3.4vw, 1.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.talk-lede {
  margin: 0.5rem 0 0;
  max-width: 70ch;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/*
 * The talk and the blog post as a matched pair: same frame, same 16:9 visual,
 * same body. Side by side while there is room for two, stacked below 52rem.
 * They are the same card in every respect but one - the talk's visual is a
 * button that loads the video, the blog post's is a picture behind a link.
 */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2rem);
  margin-top: clamp(1.25rem, 3vw, 1.75rem);
}

.media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/*
 * A fixed 16:9 box in both cards. The image, the play control and the iframe
 * that replaces them occupy exactly the same space, so nothing on the page
 * moves when an image decodes or when the embed takes over.
 */
.media-figure,
.talk-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-sunken);
  border-bottom: 1px solid var(--border);
}

.media-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.talk-media > iframe,
.talk-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.talk-play {
  display: block;
  margin: 0;
  padding: 0;
  font: inherit;
  color: var(--foreground);
  background: none;
  cursor: pointer;
}

.talk-play:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -3px;
  border-radius: 0;
}

/* The play indicator. Decoration: the button's own accessible name says what
 * pressing it does, so nothing here is load-bearing. */
.talk-play-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(4, 10, 17, 0.72);
}

.talk-play-mark svg {
  width: 1.8rem;
  height: 1.8rem;
  margin-left: 0.15rem;
}

.talk-play:hover .talk-play-mark,
.talk-play:focus-visible .talk-play-mark {
  border-color: var(--primary);
  background: rgba(4, 10, 17, 0.9);
}

.media-body {
  display: grid;
  align-content: start;
  gap: 0.65rem;
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.35rem);
}

.media-kind {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.media-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  color: var(--foreground);
}

.media-meta,
.media-desc,
.talk-privacy,
.talk-noscript {
  margin: 0;
  max-width: 62ch;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.media-meta {
  color: var(--foreground);
  font-weight: 500;
}

.talk-privacy {
  padding-left: 0.8rem;
  border-left: 2px solid var(--border-strong);
}

/*
 * The blog card's link covers the whole card, so the card is the target while
 * the accessible name stays the title alone. It is the only interactive thing
 * inside that card, so nothing is covered up by it. The focus ring is drawn on
 * the card rather than on the run of text, which is what was clicked.
 */
.media-link {
  color: inherit;
  text-decoration: none;
}

.media-link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.media-card--link:hover {
  border-color: var(--border-strong);
}

.media-card--link:hover .media-link {
  color: var(--primary);
  text-decoration: underline;
}

.media-card--link:focus-within {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.media-link:focus-visible {
  outline: none;
}

@media (max-width: 52rem) {
  .media-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------- footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card-sunken);
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.75rem 2.25rem;
}

.site-footer p {
  margin: 0;
  max-width: 70ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-weight: 500;
}

/* --------------------------------------------------------- responsive --- */

@media (max-width: 46rem) {
  .meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.7rem;
  }
}

/* Once the table is wider than its container, a soft edge says there is more
 * of it to the right. Decoration only: the columns are labelled, the region is
 * focusable, and nothing is carried by the shading alone. */
@media (max-width: 52rem) {
  .table-scroll {
    box-shadow: inset -14px 0 14px -14px rgba(255, 255, 255, 0.35);
  }
}

/* Smooth scrolling is opt-in against the preference rather than opt-out of it,
 * so a reader who has asked for less motion never gets any. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .btn,
  .skip-link,
  .topbar,
  .talk-media,
  .media-figure {
    display: none;
  }

  details.panel,
  .interop-item > details {
    display: block;
  }
}
