/* KamaraTech theme styles.
   Colour and type tokens come from tokens.css, which build_theme.py generates from OIL/BRAND/oil_brand_tokens.css.
   Components follow OIL/BRAND/OIL_BRAND_BOOK.md section 5, so kamara.tech and /oil/ read as one site.
   Motion runs only under html.kt-motion (set in the head unless the visitor asks for reduced motion);
   every element is complete at rest without it. */

:root {
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  --step-hero: clamp(2.25rem, 1.7rem + 4.2vw, 4.75rem);
  --measure: 66ch;
  --wide: 1120px;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-move: cubic-bezier(0.65, 0, 0.25, 1);
  /* The olive band is dark in both themes, so the colours on it are fixed. */
  --on-dark: #E7EBE2;
  --on-dark-strong: #F2F5EE;
  --on-dark-muted: #B9C0AE;
  --on-dark-rule: #3B3F2F;
  --on-dark-accent: #3CC7B3;
  --on-dark-field: #23251A;
  --on-dark-faint: #9DA492;
  /* The KamaraTech icon always sits on a light tile (brand book, section 2). */
  --tile: #FBFCFA;
  --tile-rule: #D0D7CE;
  --shadow-sheet: 0 1px 2px rgba(20, 22, 12, 0.08), 0 8px 24px -12px rgba(20, 22, 12, 0.18);
  --shadow-lift: 0 2px 4px rgba(20, 22, 12, 0.1), 0 18px 40px -18px rgba(20, 22, 12, 0.35);
}

/* The editor palette names map onto the live tokens, so text coloured in the editor follows dark mode. */
:root body {
  --wp--preset--color--ink: var(--ink);
  --wp--preset--color--muted: var(--muted);
  --wp--preset--color--teal: var(--teal);
  --wp--preset--color--teal-soft: var(--teal-soft);
  --wp--preset--color--paper: var(--paper);
  --wp--preset--color--sheet: var(--sheet);
  --wp--preset--color--olive: var(--olive);
}
:root .has-teal-color { color: var(--teal) !important; }
:root .has-muted-color { color: var(--muted) !important; }
:root .has-ink-color { color: var(--ink) !important; }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Short pages (404, a short post): the footer sits at the bottom of the window, not mid-screen. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }
main { flex: 1 0 auto; }
/* Paints the band behind a phone's status bar in the page colour. */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--paper); z-index: 40; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
/* The skip link's target is focused by script only; it needs no ring around the whole page. */
main[tabindex="-1"]:focus,
main[tabindex="-1"]:focus-visible { outline: 0; }
a:focus-visible { border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--teal-soft); color: var(--ink); }

.kt-wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.kt-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.kt-skip { position: absolute; left: 16px; top: -4rem; z-index: 60; background: var(--sheet); color: var(--ink); padding: 0.5rem 0.75rem; border: 1px solid var(--teal); border-radius: var(--radius); }
.kt-skip:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }
/* Anchors and keyboard focus land clear of the sticky header. */
html { scroll-padding-top: 6rem; }

/* Header */
/* Short windows (landscape phones, high zoom): the header scrolls away so it does not take half the screen. */
@media (max-height: 520px) { .kt-top { position: static !important; } html { scroll-padding-top: 0.5rem; } }
.kt-top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.kt-top.is-stuck { border-bottom-color: var(--rule); box-shadow: 0 6px 20px -18px rgba(20, 22, 12, 0.5); }
.admin-bar .kt-top { top: calc(32px + env(safe-area-inset-top, 0px)); }
@media (max-width: 782px) { .admin-bar .kt-top { top: calc(46px + env(safe-area-inset-top, 0px)); } }
@media (max-width: 600px) { .admin-bar .kt-top { top: env(safe-area-inset-top, 0px); } }
.kt-top .kt-wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 0.75rem; }

.kt-brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.kt-brand:hover { text-decoration: none; }
.kt-brand-tile { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: var(--tile); border: 1px solid var(--tile-rule); border-radius: var(--radius); }
.kt-brand-tile img { width: 28px; height: 28px; display: block; }
.kt-brand-text { display: grid; line-height: 1.15; }
.kt-brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.08rem; letter-spacing: 0.005em; }
.kt-brand-sub { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.kt-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.4rem; }
.kt-nav .kt-menu a { position: relative; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.94rem; padding-block: 0.35rem; }
.kt-nav .kt-menu a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform 240ms var(--ease-out); }
.kt-nav .kt-menu a:hover { color: var(--teal); }
.kt-nav .kt-menu a:hover::after,
.kt-nav .current-menu-item > a::after { transform: scaleX(1); }
.kt-nav .current-menu-item > a { color: var(--teal); }

@media (max-width: 760px) {
  .kt-top .kt-wrap { flex-wrap: wrap; padding-block: 0.6rem 0.4rem; }
  .kt-nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
  /* The fade at the right edge only when the menu is wider than the screen (kt.js sets is-scrolling). */
  .kt-nav.is-scrolling { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
  .kt-nav .kt-menu a:focus-visible { outline-offset: -2px; }
  .kt-nav::-webkit-scrollbar { display: none; }
  .kt-nav .kt-menu { flex-wrap: nowrap; gap: 1.15rem; padding-right: 1.5rem; }
  .kt-nav .kt-menu a { white-space: nowrap; font-size: 0.9rem; }
}

/* Landing pages: full-width bands built from blocks */
.kt-landing > * { margin-block: 0; }
.kt-landing .wp-block-group { margin-block: 0; }
.kt-band { padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem); border-top: 1px solid var(--rule); }
.kt-band:first-child { border-top: 0; }
.kt-band > .kt-wrap { display: grid; gap: clamp(1.75rem, 1rem + 2vw, 2.75rem); }
.kt-head { display: grid; gap: 0.85rem; max-width: 760px; }
.kt-head h2 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
.kt-head p:not(.kt-label) { color: var(--muted); font-size: var(--step-1); max-width: var(--measure); }

/* Buttons. Primary is teal; the "Outline" style (kt-ghost) is a rule border. WordPress's own outline style, hidden in
   the editor by kt-editor.js, is drawn the same way in case old content uses it. The arrows have empty alternative text,
   so screen readers read the label only. */
.kt-landing .wp-block-buttons,
.kt-ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
.kt-landing .wp-block-button { margin: 0; }
.wp-block-button .wp-block-button__link,
.kt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--teal);
  color: var(--sheet);
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 180ms var(--ease-out), filter 180ms ease, border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}
.wp-block-button .wp-block-button__link::after,
.kt-btn::after { content: "\2192"; content: "\2192" / ""; display: inline-block; transition: transform 220ms var(--ease-out); }
.wp-block-button .wp-block-button__link:hover,
.kt-btn:hover { filter: brightness(1.08); text-decoration: none; }
.wp-block-button .wp-block-button__link:hover::after,
.kt-btn:hover::after { transform: translateX(3px); }
.wp-block-button .wp-block-button__link:active,
.kt-btn:active { transform: translateY(1px); }
.wp-block-button.is-style-kt-ghost .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link,
.kt-btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.wp-block-button.is-style-kt-ghost .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.kt-btn-ghost:hover { filter: none; color: var(--teal); border-color: var(--teal); }

/* Hero */
.kt-hero { padding-block: clamp(1.5rem, 1rem + 3vw, 4rem) clamp(3rem, 2rem + 4vw, 5.5rem); position: relative; overflow: clip; }
.kt-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }
@media (max-width: 920px) { .kt-hero-grid { grid-template-columns: minmax(0, 1fr); } }
.kt-hero-copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.35rem; justify-items: start; min-width: 0; }
.kt-hero h1 { font-size: var(--step-hero); font-weight: 800; letter-spacing: -0.04em; line-height: 0.96; margin-top: 0.15rem; }
/* The marked word is its own block, so the underline can sit under it with clear space above the next line. */
.kt-hero h1 mark { position: relative; display: inline-block; margin-bottom: 0.1em; background: none !important; color: var(--teal); white-space: nowrap; }
.kt-hero h1 mark::after { content: ""; position: absolute; left: 0.02em; right: 0.12em; bottom: -0.04em; height: 0.075em; border-radius: 0.04em; background: currentColor; transform-origin: left center; }
.kt-lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 62ch; }
.kt-lede + .kt-lede { margin-top: -0.6rem; color: var(--ink); }
/* Laptop-height windows: the two buttons stay on the first screen. */
@media (min-width: 921px) and (max-height: 820px) { .kt-lede { font-size: 1.08rem; } .kt-hero-copy { gap: 1.1rem; } }
.kt-lede strong { color: var(--ink); font-weight: 600; }
.kt-sig { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.03em; color: var(--muted); width: 100%; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.kt-hero .wp-block-buttons { margin-top: 0.35rem; }

/* Figure: hand over, check, keep */
.kt-sort {
  container-type: inline-size;
  position: relative;
  margin: 0;
  min-width: 0;
  padding: clamp(1rem, 0.7rem + 1vw, 1.5rem);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-sheet);
}
.kt-sort-cap { display: grid; gap: 0.2rem; padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.kt-sort-cap .kt-label { font-size: 0.72rem; }
.kt-sort-who { font-weight: 600; font-size: 0.98rem; }
.kt-sort-cols { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.kt-col { display: grid; align-content: start; gap: 0.6rem; min-width: 0; }
.kt-col-title { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; padding-top: 0.55rem; border-top: 3px solid var(--rule); }
.kt-col-check .kt-col-title { border-top-color: var(--teal); color: var(--teal); }
.kt-col-keep .kt-col-title { border-top-color: var(--ink); }
.kt-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.kt-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.2;
  will-change: transform;
  transition: background-color 280ms ease, color 280ms ease, border-color 280ms ease, box-shadow 280ms ease;
}
.kt-chip-hand { border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); color: var(--muted); background: var(--sheet); }
.kt-chip-check { background: var(--teal-soft); color: var(--ink); border: 1px solid transparent; }
.kt-chip-keep { background: var(--ink); color: var(--sheet); border: 1px solid var(--ink); font-weight: 600; }
.kt-sort .kt-chip.is-raw { background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); font-weight: 500; box-shadow: 0 1px 2px rgba(20, 22, 12, 0.08), 0 8px 16px -10px rgba(20, 22, 12, 0.35); }
.kt-tick { width: 1rem; height: 1rem; flex: none; }
.kt-tick path { fill: none; stroke: var(--teal); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 0; }
.kt-col-note { font-family: var(--font-doc); font-style: italic; font-size: 0.9rem; color: var(--muted); }
.kt-sort-pile { position: absolute; left: 0; right: 0; margin: 0; text-align: center; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity 240ms ease; }
.kt-sort.is-piled .kt-sort-pile { opacity: 1; }
.kt-replay { position: absolute; right: clamp(1rem, 0.7rem + 1vw, 1.5rem); top: calc(clamp(1rem, 0.7rem + 1vw, 1.5rem) - 0.25rem); display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.55rem; font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; transition: color 180ms ease, border-color 180ms ease, opacity 300ms ease; }
.kt-replay svg { width: 0.85rem; height: 0.85rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.kt-replay:hover { color: var(--teal); border-color: var(--teal); }
/* While the items are being dealt, the replay button stays in place but is dimmed and inactive. */
.kt-replay[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.kt-replay[aria-disabled="true"]:hover { color: var(--muted); border-color: var(--rule); }

@media (max-width: 560px) {
  .kt-sort-cols { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .kt-chips { display: flex; flex-wrap: wrap; }
  .kt-chip { min-height: 0; }
  .kt-sort-cap { padding-right: 6.5rem; padding-bottom: 0.25rem; border-bottom: 0; }
}
/* Large text, or a narrow phone: one column, and "Sort again" moves under the items so it never covers the caption.
   In rem, so it follows the visitor's text size (20rem is 320 px at default size). */
@container (max-width: 20rem) {
  .kt-sort-cols { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .kt-chips { display: flex; flex-wrap: wrap; }
  .kt-chip { min-height: 0; }
  .kt-sort-cap { padding-right: 0; padding-bottom: 0.25rem; border-bottom: 0; }
  .kt-sort:has(.kt-replay:not([hidden])) .kt-sort-cols { margin-bottom: 2.75rem; }
  .kt-replay { top: auto; bottom: clamp(1rem, 0.7rem + 1vw, 1.5rem); }
}

/* Cards: four ways to work together */
.kt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .kt-cards { grid-template-columns: minmax(0, 1fr); } }
.kt-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
  padding: clamp(1.35rem, 1rem + 1vw, 2rem);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 2px);
  transition: border-color 200ms ease, transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.kt-card:hover { border-color: color-mix(in srgb, var(--teal) 55%, var(--rule)); transform: translateY(-2px); box-shadow: var(--shadow-sheet); }
.kt-card :is(h2, h3) { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); font-weight: 800; letter-spacing: -0.015em; }
.kt-card p:not(.kt-label) { color: var(--ink); max-width: 60ch; }
.kt-card .kt-label { color: var(--teal); }
.kt-card-key { background: var(--teal-soft); border-color: transparent; }
.kt-card-key:hover { border-color: var(--teal); }
.kt-more { font-weight: 600; margin-top: 0.25rem; }
.kt-more a { text-decoration: none; }
.kt-more a::after { content: "\00A0\2192"; content: "\00A0\2192" / ""; display: inline-block; transition: transform 220ms var(--ease-out); }
.kt-more a:hover::after { transform: translateX(3px); }
.kt-more a:hover { text-decoration: underline; }

/* Olive bands: worked example and closing */
.kt-dark { background: var(--olive); color: var(--on-dark); border-top: 1px solid var(--rule); }
.kt-dark h2 { color: var(--on-dark-strong); }
.kt-dark .kt-head p:not(.kt-label) { color: var(--on-dark-muted); }
.kt-dark .kt-label { color: var(--on-dark-accent); }
.kt-dark a:not(.wp-block-button__link) { color: var(--on-dark); }
.kt-dark .wp-block-button .wp-block-button__link { background: var(--on-dark-accent); color: #0F100A; }
.kt-dark .wp-block-button.is-style-kt-ghost .wp-block-button__link,
.kt-dark .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--on-dark); border-color: var(--on-dark-rule); }
.kt-dark .wp-block-button.is-style-kt-ghost .wp-block-button__link:hover,
.kt-dark .wp-block-button.is-style-outline .wp-block-button__link:hover { color: var(--on-dark-accent); border-color: var(--on-dark-accent); }
.kt-dark :focus-visible { outline-color: var(--on-dark-accent); }
.kt-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }
@media (max-width: 860px) { .kt-split { grid-template-columns: minmax(0, 1fr); } }
.kt-split .kt-head { gap: 1rem; }
.kt-split .wp-block-buttons { margin-top: 0.5rem; }
.kt-dark + .kt-dark { padding-top: 0; }
.kt-dark + .kt-dark > .kt-wrap { border-top: 1px solid var(--on-dark-rule); padding-top: clamp(3.5rem, 2rem + 5vw, 6.5rem); }

/* Figure: the case file, papers fanned on a desk */
.kt-casefile {
  container-type: inline-size;
  --step: max(10.5cqw, 2.9rem);
  display: grid;
  width: 100%;
  max-width: 480px;
  justify-self: center;
  padding: 1.5rem 0.5rem 0.5rem;
}
.kt-sheet {
  grid-area: 1 / 1;
  align-self: start;
  justify-self: center;
  position: relative;
  width: 86%;
  aspect-ratio: 16 / 11;
  margin-top: calc(var(--n) * var(--step));
  padding: 0.8rem 1rem 1rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.35rem;
  background: var(--sheet);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 14px 32px -14px rgba(0, 0, 0, 0.55);
  transform: translateX(var(--x, 0)) rotate(var(--r, 0deg));
  transition: transform 700ms var(--ease-move);
  transition-delay: calc(var(--n) * 80ms);
}
.kt-sheet:nth-child(1) { --x: -5%; --r: -4deg; }
.kt-sheet:nth-child(2) { --x: 3%; --r: 2.5deg; }
.kt-sheet:nth-child(3) { --x: -2%; --r: -1.5deg; }
.kt-sheet:nth-child(4) { --x: 1%; --r: 1deg; }
.kt-sheet-head { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.kt-sheet-week { flex: none; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; color: var(--teal); }
.kt-sheet-title { min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(0.84rem, 0.75rem + 0.5cqw, 0.98rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-sheet-meta { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-bottom: 0.45rem; border-bottom: 1px solid var(--rule); }
.kt-sheet-lines {
  display: block;
  margin-top: 0.35rem;
  background:
    linear-gradient(to right, var(--teal-soft) 0 34%, transparent 34%) 0 0 / 100% 0.5rem no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 0.95rem, color-mix(in srgb, var(--rule) 85%, transparent) 0.95rem calc(0.95rem + 1px));
  background-position: 0 0.15rem, 0 0.6rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.kt-stamp {
  position: absolute;
  right: 1rem;
  bottom: 1.1rem;
  padding: 0.35rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stamp);
  border: 1.5px solid var(--stamp);
  border-radius: 3px;
  background: color-mix(in srgb, var(--sheet) 85%, transparent);
  transform: rotate(-7deg);
}
/* Narrow phones or large text: wider sheets, and titles wrap onto two lines instead of being cut off. In rem, so it also
   applies when the visitor enlarges text (21.25rem is 340 px at default size). */
@container (max-width: 21.25rem) {
  .kt-sheet { --step: 3.6rem; width: 94%; padding-inline: 0.8rem; }
  .kt-sheet-title { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 0.82rem; line-height: 1.2; }
}
@media (hover: hover) {
  .kt-split:hover .kt-sheet,
  .kt-casefile:hover .kt-sheet { transform: translateX(calc(var(--x, 0) * 1.8)) translateY(calc((var(--n) - 3) * 0.22 * var(--step))) rotate(calc(var(--r, 0deg) * 1.7)); transition-delay: calc(var(--n) * 40ms); }
}

/* About */
.kt-about { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: start; }
@media (max-width: 820px) { .kt-about { grid-template-columns: minmax(0, 1fr); } }
.kt-portrait { margin: 0; position: relative; aspect-ratio: 4 / 5; max-width: 420px; width: 100%; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; border-radius: calc(var(--radius) + 4px); background: radial-gradient(120% 80% at 50% 100%, color-mix(in srgb, var(--teal) 22%, var(--teal-soft)) 0%, var(--teal-soft) 60%); }
.kt-portrait img { display: block; width: 94%; height: auto; object-fit: contain; }
@media (max-width: 820px) { .kt-portrait { max-width: 300px; } }
.kt-about-copy { display: grid; gap: 1.1rem; min-width: 0; }
.kt-about-copy h2 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; }
.kt-creds { list-style: none; margin: 0; padding: 0; display: grid; font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--muted); border-top: 1px solid var(--rule); }
.kt-creds li { padding-block: 0.55rem; border-bottom: 1px solid var(--rule); }
.kt-bio { font-family: var(--font-doc); font-size: 1.125rem; line-height: 1.62; max-width: 62ch; color: var(--ink); }
.kt-about-copy .wp-block-buttons { margin-top: 0.35rem; }

/* Contact page */
.kt-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 760px) { .kt-contact-grid { grid-template-columns: minmax(0, 1fr); } }
.kt-contact-grid .kt-card .wp-block-buttons { margin-top: 0.5rem; }
.kt-contact-note { color: var(--muted); }
.kt-page-hero h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.035em; line-height: 1; }

/* Standard pages and posts: set for reading */
.kt-page-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); border-bottom: 1px solid var(--rule); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.kt-page-head .kt-wrap { display: grid; gap: 0.75rem; }
.kt-page-title { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; max-width: 22ch; }
.kt-page { padding-bottom: clamp(3rem, 2rem + 4vw, 5.5rem); }
.kt-prose, .kt-page-title, .kt-card, .kt-postlink-title, .kt-head { overflow-wrap: anywhere; }
.kt-prose { max-width: 70ch; font-family: var(--font-doc); font-size: 1.125rem; line-height: 1.65; }
.kt-prose > * + * { margin-top: 1.1em; }
.kt-prose h2 { font-size: 1.6rem; font-weight: 800; color: var(--teal); margin-top: 2em; }
.kt-prose h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.6em; }
.kt-prose h2 + *, .kt-prose h3 + * { margin-top: 0.6em; }
.kt-prose ul, .kt-prose ol { padding-left: 1.3em; }
.kt-prose li + li { margin-top: 0.35em; }
/* A table sits in a box that scrolls sideways on phones, which a keyboard can reach (kt_scrollable_tables in functions.php). */
.kt-table-scroll { overflow-x: auto; }
.kt-prose table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: 0.92rem; }
.kt-prose th, .kt-prose td { border: 1px solid var(--rule); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; overflow-wrap: normal; word-break: normal; hyphens: none; min-width: 7.5rem; }
/* The box fades at the right edge while more is hidden (kt.js sets is-scrolling). */
.kt-table-scroll.is-scrolling { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); }
/* A mask also cuts off the focus ring, so it comes off while the box has keyboard focus. */
.kt-table-scroll.is-scrolling:focus-visible { -webkit-mask-image: none; mask-image: none; }
.kt-prose th { background: color-mix(in srgb, var(--teal-soft) 55%, var(--sheet)); font-weight: 600; }
.kt-prose blockquote { margin-inline: 0; padding: 1rem 1.25rem; background: var(--teal-soft); border-radius: var(--radius); }
.kt-prose code { font-family: var(--font-mono); font-size: 0.88em; }
.kt-prose img { border-radius: var(--radius); }
.kt-postlist { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); max-width: 760px; }
.kt-postlink { display: grid; gap: 0.3rem; padding-block: 1.25rem; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.kt-postlink:hover .kt-postlink-title { color: var(--teal); }
.kt-postlink-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; transition: color 160ms ease; }
.kt-postlink-text { color: var(--muted); }
.kt-pager { margin-top: 2rem; }
.kt-pager .nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kt-pager .page-numbers { padding: 0.4rem 0.7rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.kt-pager .page-numbers.current { background: var(--teal); border-color: var(--teal); color: var(--sheet); }
.kt-empty { color: var(--muted); }
.kt-404-links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* Footer, on the olive band */
.kt-foot { background: var(--olive); color: var(--on-dark); padding-block: 2.5rem calc(2rem + env(safe-area-inset-bottom, 0px)); }
.kt-landing:has(> .kt-dark:last-child) + .kt-foot { padding-top: 0; }
.kt-landing:has(> .kt-dark:last-child) + .kt-foot .kt-foot-grid { border-top: 1px solid var(--on-dark-rule); padding-top: 2rem; }
.kt-foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.kt-brand-on-dark { color: var(--on-dark-strong); }
.kt-brand-on-dark .kt-brand-sub { color: var(--on-dark-muted); }
.kt-foot-nav .kt-menu a { color: var(--on-dark); text-decoration: none; font-weight: 500; font-size: 0.94rem; }
.kt-foot-nav .kt-menu a:hover { color: var(--on-dark-accent); }
.kt-foot-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--on-dark-rule); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.03em; color: var(--on-dark-faint); }
.kt-foot-note { margin-top: 1.5rem; max-width: 70ch; font-size: 0.82rem; color: var(--on-dark-faint); }
.kt-foot-base a { color: inherit; }
/* Comfortable tap targets for the text links. */
.kt-foot-nav .kt-menu a, .kt-foot-base a, .kt-more a { display: inline-block; padding-block: 0.35rem; }
.kt-foot-base a:hover { color: var(--on-dark-accent); }
.kt-foot :focus-visible { outline-color: var(--on-dark-accent); }

/* ---------- Motion ---------- */

@keyframes kt-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes kt-fade { from { opacity: 0; } to { opacity: 1; } }

/* Hero: the copy rises line by line, then "Check." is underlined once the sort lands. */
.kt-motion .kt-hero-copy > * { animation: kt-rise 760ms var(--ease-out) both; }
.kt-motion .kt-hero-copy > :nth-child(2) { animation-delay: 90ms; }
.kt-motion .kt-hero-copy > :nth-child(3) { animation-delay: 180ms; }
.kt-motion .kt-hero-copy > :nth-child(4) { animation-delay: 260ms; }
.kt-motion .kt-hero-copy > :nth-child(5) { animation-delay: 340ms; }
.kt-motion .kt-hero-copy > :nth-child(n+6) { animation-delay: 420ms; }
.kt-motion .kt-hero .kt-sort { animation: kt-rise 900ms 200ms var(--ease-out) both; }
.kt-motion .kt-hero h1 mark::after { transform: scaleX(0); transition: transform 900ms var(--ease-move); }
.kt-motion.kt-sorted .kt-hero h1 mark::after,
.kt-motion.kt-ready .kt-hero h1 mark::after { transform: scaleX(1); }

/* Sort figure: chips wait for the script, which deals them from a pile into their columns. */
.kt-motion:not(.kt-ready) .kt-sort:not(.is-go) .kt-chip,
.kt-motion .kt-sort.is-wait .kt-chip { opacity: 0; }
.kt-motion .kt-sort.is-go:not(.is-sorted) .kt-tick path { stroke-dashoffset: 16; }
.kt-motion .kt-sort .kt-tick path { transition: stroke-dashoffset 420ms var(--ease-out); }
.kt-motion .kt-sort .kt-chip-check:nth-child(2) .kt-tick path { transition-delay: 160ms; }
.kt-motion .kt-sort.is-go:not(.is-sorted) .kt-col-note { opacity: 0; transform: translateY(4px); }
.kt-motion .kt-sort .kt-col-note { transition: opacity 400ms 260ms ease, transform 400ms 260ms var(--ease-out); }

/* Below the fold: blocks rise into place as they scroll into view. kt.js adds kt-pending only to blocks not yet seen. */
.kt-motion .kt-pending { opacity: 0; transform: translateY(22px); }
.kt-motion .kt-pending.is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }

/* Case file: the papers start squared in a pile and fan out when the band comes into view. */
.kt-motion .kt-casefile.kt-pending { opacity: 1; transform: none; }
.kt-motion .kt-casefile.kt-pending .kt-sheet { transform: translateY(calc((3 - var(--n)) * var(--step))) rotate(0deg); }
.kt-motion .kt-casefile.kt-pending.is-in .kt-sheet { transform: translateX(var(--x, 0)) rotate(var(--r, 0deg)); }

/* Print and save-as-PDF: show everything at rest, whatever the motion state. */
@media print {
  .kt-motion .kt-pending,
  .kt-motion .kt-hero-copy > *,
  .kt-motion .kt-hero .kt-sort,
  .kt-motion .kt-sort .kt-chip,
  .kt-motion .kt-sort .kt-col-note { opacity: 1 !important; transform: none !important; animation: none !important; }
  .kt-motion .kt-sort .kt-tick path { stroke-dashoffset: 0 !important; }
  .kt-motion .kt-hero h1 mark::after { transform: none !important; }
  .kt-motion .kt-casefile .kt-sheet { transform: translateX(var(--x, 0)) rotate(var(--r, 0deg)) !important; }
  body { display: block; min-height: 0; }
  .kt-top { position: static; }
  .kt-replay, .kt-skip, .kt-sort-pile { display: none !important; }
  .kt-table-scroll { overflow: visible; -webkit-mask-image: none !important; mask-image: none !important; }
  body::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-delay: 0ms !important; transition-delay: 0ms !important; }
  .kt-card:hover { transform: none; }
}
