/* =========================================================================
   0-Pay TriceratOps — s4lieri.tech
   Built from "Design kit — s4lieri.tech (ultramarine)". Section numbers in
   comments refer to that document.

   The page is a receiver. Every ornament here is an artifact of transmission:
   the dot lattice, the cursor readhead, the chroma smear, the noise trace.
   Nothing else is allowed in.
   ========================================================================= */

/* 1. Tokens — kit 2 ------------------------------------------------------- */

:root,
[data-scheme="ultramarine"] {
  --ground:    #07070B;   /* near-neutral black, deliberately NOT blue-black */
  --panel:     #0D0D13;
  --line:      #1C1C26;
  --line-soft: #14141C;

  --ink:       #D2D4DD;
  --ink-hi:    #FFFFFF;
  --muted:     #8A8D9A;
  --faint:     #6B6E7B;

  --accent:    #5B7CFF;   /* the signal */
  --channel:   #00C8B4;   /* second smear channel ONLY — never a UI colour */
  --dot:       #AFB6D4;

  --code-number: #C9A0FF;

  --smear-blend: screen;
  --dot-opacity: 0.1;
  /* Solved, not picked: at full strength a lit dot drops body text to 2.4:1
     against its own background. 0.35 is the brightest value that still clears
     the kit's 7:1 invariant (7.11:1). Same calculation gives paper 0.26. */
  --halo-opacity: 0.35;
  --accent-ink:  #07070B; /* text on a solid accent fill */
}

/* The paper scheme, from the sibling .art kit: same hues, darkened for a
   light ground, and the blend direction flips. "screen" does nothing on
   paper — kit .art 3.1. */
[data-scheme="paper"] {
  --ground:    #EDEBE4;
  --panel:     #E3E0D7;
  --line:      #C6C2B6;
  --line-soft: #D8D4C9;

  --ink:       #1C1C16;
  --ink-hi:    #000000;
  --muted:     #5C584D;
  --faint:     #6E6A5E;

  --accent:    #2F46C9;
  --channel:   #0F7D70;
  --dot:       #3A382F;

  --code-number: #5B2BA8;

  --smear-blend: multiply;
  --dot-opacity: 0.16;
  --halo-opacity: 0.26;
  --accent-ink:  #EDEBE4;
}

:root {
  --content: 1180px;
  /* 72ch of 18px Space Grotesk, frozen into a root-relative unit.
     NOT `72ch`: ch resolves against each element's own font-size, so a 34px
     h2 would claim a 1470px measure, overflow the column and stop centring
     while the paragraphs around it stayed put. */
  --measure: 52rem;
  --lattice: 22px;        /* tied to the trace sample spacing — kit 5.2 */
  --gutter: clamp(20px, 5vw, 40px);

  --sans: "Space Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}


/* 2. Base ----------------------------------------------------------------- */

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

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

body {
  position: relative;              /* containing block for the overlays */
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.72;
  font-weight: 400;
  overflow-x: hidden;              /* the body never scrolls sideways */
  -webkit-font-smoothing: antialiased;
  padding:
    env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 40;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--mono); font-size: 13px;
  padding: 12px 18px; min-height: 44px;
}
.skip-link:focus { left: 0; }


/* 3. Overlays — kit 5.2, 5.3, 5.4 ---------------------------------------- */

/* The dot lattice. Spans the whole document, origin at its top-left, so the
   halo below lights these exact dots. */
body::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  background-image: radial-gradient(circle at center, var(--dot) 1px, transparent 1.7px);
  background-size: var(--lattice) var(--lattice);
  opacity: var(--dot-opacity);
}

/* A readhead sweeping a sensor array. Not a cursor-finding aid. */
.halo {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  background-image: radial-gradient(circle at center, var(--accent) 1.1px, transparent 1.8px);
  background-size: var(--lattice) var(--lattice);
  mix-blend-mode: var(--smear-blend);
  opacity: var(--halo-opacity);
  -webkit-mask-image: radial-gradient(circle 180px at var(--mx, -999px) var(--my, -999px),
              #000 0%, rgba(0,0,0,0.55) 45%, transparent 78%);
  mask-image: radial-gradient(circle 180px at var(--mx, -999px) var(--my, -999px),
              #000 0%, rgba(0,0,0,0.55) 45%, transparent 78%);
}

/* The trace closes every page. */
.trace {
  display: block;
  width: 100%;
  height: 96px;
  margin-top: 56px;
  overflow: visible;
}
.trace polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}


/* 4. Shell ---------------------------------------------------------------- */

.shell {
  position: relative; z-index: 2;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter) 0;
}

.main { display: block; }


/* 5. Masthead — kit 3 ----------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 68px;
}

.masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-hi);
  min-height: 44px;
}
.masthead__brand:hover { text-decoration: none; }

.mark {
  width: 30px; height: 30px;
  flex: none;
  color: var(--ink-hi);
}

/* Mixed case, normal tracking. Never letterspaced uppercase.
   Rendered as h1 on the index, span elsewhere — same type either way. */
.masthead__name {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
}

.masthead__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 0; padding: 0;
  list-style: none;
}
.masthead__nav a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: lowercase;
  color: var(--muted);
}
.masthead__nav a:hover { color: var(--ink-hi); text-decoration: none; }
.masthead__nav a[aria-current="page"] { color: var(--ink-hi); }


/* 6. Display type and the chroma smear — kit 3, 5.1 ---------------------- */

.display {
  /* Full content width, not a narrow measure. Line count varies with the
     title; the long/xlong classes in post.hbs cap the worst cases. */
  max-width: none;
  margin: 0;
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: var(--ink-hi);
  overflow-wrap: break-word;
}
.display--long  { font-size: clamp(34px, 4.2vw, 62px); line-height: 1.06; }
.display--xlong { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.12; letter-spacing: -0.02em; }

/* Colour runs horizontally; the luminance edge stays sharp. */
.smear { position: relative; isolation: isolate; }
.smear::before,
.smear::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  mix-blend-mode: var(--smear-blend);
  pointer-events: none;
}
.smear::before { transform: translateX(0.21em);  color: var(--accent);  filter: url(#smear-lg); }
.smear::after  { transform: translateX(-0.11em); color: var(--channel); filter: url(#smear-lg); }

/* Offsets are in em, so they track the heading they sit on — but the title's
   values are far too heavy below ~40px, where the blur swallows the glyphs
   instead of trailing them. Two lighter tiers: md for a body h1, sm for
   everything from h2 down. */
.smear--md::before { transform: translateX(0.13em);  filter: url(#smear-lg); }
.smear--md::after  { transform: translateX(-0.07em); filter: url(#smear-lg); }

.smear--sm::before { transform: translateX(0.08em);  filter: url(#smear-sm); }
.smear--sm::after  { transform: translateX(-0.04em); filter: url(#smear-sm); }

/* h4-h6 are 12px mono labels. A 3.5px blur is wider than the glyphs there —
   it reads as a focus problem rather than a smear — so they get their own
   narrow filter. */
.smear--xs::before { transform: translateX(0.09em);   filter: url(#smear-xs); }
.smear--xs::after  { transform: translateX(-0.045em); filter: url(#smear-xs); }


/* 7. Lede ----------------------------------------------------------------- */

.lede { padding-bottom: 72px; }

/* No display type above it — the index carries its name in the masthead. */
.lede--bare { padding-bottom: 56px; }
.lede--bare .lede__text { margin-top: 0; }

.lede__kicker {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede__text {
  max-width: var(--measure);
  margin: 28px auto 0;
  font-size: 21px;
  line-height: 1.6;
  color: var(--ink-hi);
}


/* 8. Feed and cards ------------------------------------------------------- */

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 64px 48px;
  padding-bottom: 88px;
}

.card { display: flex; flex-direction: column; gap: 20px; }

.card__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.card__image img { width: 100%; height: 100%; object-fit: cover; }

.card__body { display: flex; flex-direction: column; gap: 14px; }

.card__meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.card__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.card__title a { color: var(--ink-hi); }
.card__title a:hover { color: var(--accent); text-decoration: none; }

.card__excerpt {
  margin: 0;
  max-width: var(--measure);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}


/* 9. Tags — kit 6: bare hashtags, no pills ------------------------------- */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;                       /* the spec's 20px, measured between items */
}
.tag {
  display: inline-flex; align-items: center;
  min-height: 44px;                /* tap target with nothing drawn around it */
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  border: 0; background: none; padding: 0;
}
.tag:hover { color: var(--ink-hi); text-decoration: none; }


/* 10. Pagination — kit 6: centred, unboxed ------------------------------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px 0 40px;
  font-family: var(--mono);
  font-size: 13px;
}
.pager__step {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 4px;
  color: var(--muted);
  text-transform: lowercase;
}
.pager__step:hover { color: var(--ink-hi); text-decoration: none; }
.pager__step--off { color: var(--line); }

.pager__count { display: inline-flex; align-items: baseline; gap: 2px; }
.pager__now {
  color: var(--ink-hi);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
}
.pager__of { color: var(--faint); }


/* 11. Post --------------------------------------------------------------- */

.post { padding-bottom: 72px; }

.post__head { padding-bottom: 48px; }

.post__meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.post__hero { margin: 0 0 56px; }
.post__hero img { width: 100%; }
.post__hero figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 12px 0 0;
}

.post__foot { padding-top: 48px; border-top: 1px solid var(--line); }


/* 12. Content — {{content}} is not ours. Koenig classes, kit 8 ----------- */

.content { max-width: none; }

/* The measure is centred in the content width, not flush left. Everything
   below keeps `auto` on the horizontal margins — a `margin: x 0 y` shorthand
   anywhere in this section would quietly shove the column back to the edge. */
.content > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.content p,
.content ul,
.content ol,
.content dl { margin: 0 auto 1.5em; }

/* Justified body. Hyphenation is not optional here — at 72ch, Space Grotesk
   set flush on both edges opens rivers without it. The language comes from
   <html lang>, so the browser picks the right dictionary. Long tokens break
   rather than blow a line open. */
.content p,
.content li,
.content dd,
.content .kg-callout-text,
.lede__text {
  text-align: justify;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Display type and short fragments stay ragged: justifying 30px type opens
   word gaps you can drive through, and a two-word caption is not a column. */
.content figcaption,
.content blockquote.kg-blockquote-alt,
.content pre,
.content table { text-align: left; }

.content li { margin-bottom: 0.5em; }
.content li::marker { color: var(--accent); }

.content h1,
.content h2,
.content h3,
.content h4 { color: var(--ink-hi); }

/* An h1 inside the body sits between the post title and an h2. Ghost's
   toolbar only offers h2/h3, but markdown `# ` produces one. */
.content h1 {
  margin: 2.4em auto 0.8em;
  font-size: 42px; line-height: 1.1;
  letter-spacing: -0.025em; font-weight: 400;
}

.content h2 {
  margin: 2.2em auto 0.7em;
  font-size: 34px; line-height: 1.18;
  letter-spacing: -0.02em; font-weight: 400;
}
.content h3 {
  margin: 1.9em auto 0.6em;
  font-size: 24px; line-height: 1.25;
  letter-spacing: -0.01em; font-weight: 500;
}
.content h4,
.content h5,
.content h6 {
  margin: 1.9em auto 0.6em;
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.content > *:first-child { margin-top: 0; }

.content strong { color: var(--ink-hi); font-weight: 700; }
.content hr {
  max-width: none;
  margin: 3em auto;
  border: 0; border-top: 1px solid var(--line);
}

.content figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* Blockquote keeps a plain accent rule so it stays distinct from the note. */
.content blockquote {
  margin: 2em auto;
  padding-left: 24px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}
.content blockquote p:last-child { margin-bottom: 0; }

/* Pull quote: full measure, hairline rules above and below. */
.content blockquote.kg-blockquote-alt {
  border-left: 0;
  padding: 36px 0;
  margin: 2.6em auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 30px;
  line-height: 1.34;
  letter-spacing: -0.01em;
  color: var(--ink-hi);
}

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

.content :where(.kg-card) { margin: 2.4em auto; }

.kg-width-wide  { max-width: min(100%, calc(var(--measure) + 200px)); }
.kg-width-full  { max-width: none; }

.kg-image-card img,
.kg-embed-card iframe { width: 100%; }

/* Gallery. Ratios are set by theme.js from the img attributes — kit 8. */
.kg-gallery-container { display: flex; flex-direction: column; gap: 10px; }
.kg-gallery-row { display: flex; flex-direction: row; gap: 10px; }
.kg-gallery-image { flex: 1 1 0%; min-width: 0; }
.kg-gallery-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Note / callout: no label, no panel. An unlabelled rule built from the
   smear — white core, accent and channel blurred either side. kit 6. */
.kg-callout-card {
  position: relative;
  isolation: isolate;
  padding: 2px 0 2px 30px;
  background: none;
  border: 0;
  border-radius: 0;
}
.kg-callout-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ink-hi);
}
.kg-callout-card::after {
  content: "";
  position: absolute; left: -9px; top: 0; bottom: 0;
  width: 22px;
  pointer-events: none;
  mix-blend-mode: var(--smear-blend);
  filter: url(#smear-sm);
  background:
    linear-gradient(90deg, transparent 0%, var(--channel) 30%, transparent 48%),
    linear-gradient(90deg, transparent 52%, var(--accent) 70%, transparent 100%);
}
/* The card ships an emoji slot. Hide it. */
.kg-callout-emoji { display: none !important; }
.kg-callout-text { margin: 0; }

.kg-bookmark-card a.kg-bookmark-container {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}
.kg-bookmark-card a.kg-bookmark-container:hover { text-decoration: none; border-color: var(--accent); }
.kg-bookmark-content { padding: 22px 24px; }
.kg-bookmark-title { color: var(--ink-hi); font-weight: 500; }
.kg-bookmark-description {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}
.kg-bookmark-metadata {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.kg-bookmark-icon { width: 16px; height: 16px; }
.kg-bookmark-thumbnail img { width: 100%; object-fit: cover; }

/* One solid accent button per page, dark text on accent. kit 6. */
.kg-button-card { display: flex; }
.kg-button-card.kg-align-center { justify-content: center; }
.kg-btn, .btn {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
  border: 0; border-radius: 0;
}
.kg-btn:hover, .btn:hover { text-decoration: none; filter: brightness(1.12); }

.kg-signup-card,
.kg-product-card,
.kg-video-card,
.kg-file-card,
.kg-toggle-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 28px;
}
.kg-signup-card input[type="email"] {
  background: var(--ground);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 14px;
  min-height: 44px;
  border-radius: 0;
}
.kg-toggle-heading { color: var(--ink-hi); }


/* 13. Code — panel on a line border, three token colours, kit 6 ---------- */

.content :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 5px;
  color: var(--ink-hi);
}

.content pre {
  max-width: none;
  margin: 2.4em auto;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow-x: auto;              /* wide content scrolls inside its own box */
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
  tab-size: 2;
}
.content pre code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-shadow: none;
}

/* Prism, three colours. Not a rainbow scheme. */
.token { color: var(--ink); background: none !important; }
.token.keyword,
.token.tag,
.token.atrule,
.token.selector,
.token.rule,
.token.important,
.token.builtin { color: var(--accent); }
.token.string,
.token.char,
.token.attr-value,
.token.regex { color: var(--channel); }
.token.number,
.token.boolean { color: var(--code-number); }
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: var(--faint); font-style: normal; }
.token.operator,
.token.punctuation,
.token.function,
.token.property,
.token.attr-name,
.token.variable,
.token.constant,
.token.symbol,
.token.class-name,
.token.entity,
.token.url,
.token.inserted,
.token.deleted { color: var(--ink); }


/* 14. Tables ------------------------------------------------------------- */

.table-scroll {
  max-width: none;
  overflow-x: auto;
  margin: 2.4em auto;
  border: 1px solid var(--line);
}
.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.content th {
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 14px 18px;
  white-space: nowrap;
}
.content td {
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  vertical-align: top;
}


/* 15. Prev / next — two plain lines. No cards, no arrows. kit 6 ---------- */

.adjacent {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.adjacent__item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-hi);
}
.adjacent__item:hover { text-decoration: none; }
.adjacent__item:hover .adjacent__title { color: var(--accent); }
.adjacent__label {
  flex: none;
  width: 54px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}
.adjacent__title { font-size: 19px; line-height: 1.4; }


/* 16. Footer ------------------------------------------------------------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding: 72px 0 0;
}
.footer__sig {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.footer__nav ul {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin: 0; padding: 0; list-style: none;
}
.footer__nav a {
  display: inline-flex; align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: lowercase;
  color: var(--muted);
}
.footer__nav a:hover { color: var(--ink-hi); text-decoration: none; }


/* 16b. Ghost's own card surfaces --------------------------------------------
   config.card_assets hands Ghost the audio, video, file, product, toggle and
   before/after cards, because their controls need Ghost's JS to function at
   all. Its CSS is light-ground biased, so everything below is a re-skin into
   the palette: colours, square corners, mono meta. Layout stays Ghost's.
   Gallery and bookmark are excluded there and built by hand above. */

.kg-bookmark-metadata .kg-bookmark-author,
.kg-bookmark-metadata .kg-bookmark-publisher { color: var(--muted); }
.kg-bookmark-metadata .kg-bookmark-author::after { color: var(--line); }

/* The note has no panel and no colour variants — kit 6. Every Koenig colour
   collapses back to the single smeared rule. */
.kg-callout-card,
.kg-callout-card-grey,
.kg-callout-card-white,
.kg-callout-card-blue,
.kg-callout-card-green,
.kg-callout-card-yellow,
.kg-callout-card-red,
.kg-callout-card-pink,
.kg-callout-card-purple,
.kg-callout-card-accent {
  background: none;
  color: var(--ink);
}

/* One solid accent button per page, dark text on accent. */
.kg-btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0;
}
.kg-button-card.kg-align-left { justify-content: flex-start; }

/* Ghost toggles its player state with these. They are defined in Ghost's own
   card CSS, but the players are unusable if that ever fails to load — both
   icons of every pair show at once — so they are restated here. */
.kg-audio-hide,
.kg-video-hide { display: none; }
.kg-video-hide-animated { opacity: 0; visibility: hidden; }

/* --- Audio ---------------------------------------------------------------- */
.kg-audio-card {
  display: flex; align-items: center; gap: 20px;
  padding: 0;
  background: none;
  border: 0;
}
.kg-audio-thumbnail {
  width: 72px; height: 72px; flex: none;
  object-fit: cover;
}
/* An empty thumbnail slot is a placeholder for nothing. Kit 7. */
.kg-audio-thumbnail.placeholder { display: none; }
.kg-audio-player-container { flex: 1 1 auto; min-width: 0; padding: 0; }
.kg-audio-player { width: 100%; }
.kg-audio-title {
  color: var(--ink-hi);
  font-size: 17px; font-weight: 500;
  margin-bottom: 10px;
}
.kg-audio-play-icon,
.kg-audio-pause-icon,
.kg-audio-mute-icon,
.kg-audio-unmute-icon {
  color: var(--ink-hi);
  background: none; border: 0;
  min-width: 44px; min-height: 44px;
  cursor: pointer;
}
.kg-audio-play-icon:hover,
.kg-audio-pause-icon:hover,
.kg-audio-mute-icon:hover,
.kg-audio-unmute-icon:hover { color: var(--accent); }
.kg-audio-time,
.kg-audio-current-time,
.kg-audio-duration {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.kg-audio-current-time { color: var(--ink); }
.kg-audio-playback-rate {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
  background: none; border: 0;
  min-width: 44px; min-height: 44px;
  cursor: pointer;
}
.kg-audio-playback-rate:hover { color: var(--ink-hi); }
.kg-audio-seek-slider,
.kg-audio-volume-slider { accent-color: var(--accent); }

/* --- Video ---------------------------------------------------------------- */
.kg-video-card,
.kg-video-container {
  background: var(--panel);
  border: 1px solid var(--line);
}
.kg-video-player-container { background: var(--ground); }
.kg-video-player { width: 100%; }
.kg-video-overlay { background: rgba(7, 7, 11, 0.45); }
.kg-video-large-play-icon,
.kg-video-play-icon,
.kg-video-pause-icon,
.kg-video-mute-icon,
.kg-video-unmute-icon {
  color: var(--ink-hi);
  background: none; border: 0;
  min-width: 44px; min-height: 44px;
  cursor: pointer;
}
.kg-video-large-play-icon:hover,
.kg-video-play-icon:hover,
.kg-video-pause-icon:hover,
.kg-video-mute-icon:hover,
.kg-video-unmute-icon:hover { color: var(--accent); }
.kg-video-time,
.kg-video-current-time,
.kg-video-duration {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.kg-video-current-time { color: var(--ink); }
.kg-video-playback-rate {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted);
  background: none; border: 0;
  min-width: 44px; min-height: 44px;
  cursor: pointer;
}
.kg-video-seek-slider,
.kg-video-volume-slider { accent-color: var(--accent); }
.kg-video-hide { display: none; }

/* --- File ----------------------------------------------------------------- */
.kg-file-card-container {
  display: flex; align-items: center; gap: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 24px;
  color: var(--ink);
}
.kg-file-card-container:hover { border-color: var(--accent); text-decoration: none; }
.kg-file-card-contents { flex: 1 1 auto; min-width: 0; }
.kg-file-card-title { color: var(--ink-hi); font-weight: 500; }
.kg-file-card-caption { color: var(--muted); font-size: 15px; }
.kg-file-card-filename,
.kg-file-card-filesize {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.kg-file-card-medium .kg-file-card-title { font-size: 17px; }
.kg-file-card-small .kg-file-card-title { font-size: 15px; }

/* --- Product -------------------------------------------------------------- */
.kg-product-card-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 26px 28px;
}
.kg-product-card-image { border: 1px solid var(--line); border-radius: 0; }
.kg-product-card-title-container { margin-bottom: 10px; }
.kg-product-card-title { color: var(--ink-hi); font-weight: 500; }
.kg-product-card-description { color: var(--ink); }
.kg-product-card-rating { color: var(--line); }
.kg-product-card-rating-active,
.kg-product-card-rating-star { color: var(--muted); }
.kg-product-card-rating-active .kg-product-card-rating-star { color: var(--accent); }
.kg-product-card-button,
.kg-product-card-btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0; border-radius: 0;
  min-height: 44px;
  font-family: var(--mono); font-size: 13px;
}

/* --- NFT ------------------------------------------------------------------ */
.kg-nft-card,
.kg-nft-card-container {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}
.kg-nft-image { width: 100%; border-bottom: 1px solid var(--line); }
.kg-nft-header { padding: 20px 24px 0; }
.kg-nft-title { color: var(--ink-hi); font-weight: 500; }
.kg-nft-creator,
.kg-nft-metadata {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 0 24px;
}
.kg-nft-description { padding: 10px 24px 20px; }
.kg-nft-opensea-logo { opacity: 0.6; }

/* --- Toggle --------------------------------------------------------------- */
.kg-toggle-heading-text { color: var(--ink-hi); font-weight: 500; }
.kg-toggle-card-icon { color: var(--accent); }
.kg-toggle-content { color: var(--ink); }

/* --- Before / after ------------------------------------------------------- */
.kg-before-after-card {
  border: 1px solid var(--line);
  background: var(--panel);
}
.kg-before-after-card-image-before,
.kg-before-after-card-image-after { display: block; width: 100%; }


/* 17. Motion and narrow viewports — kit 9 ------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .halo { display: none; }
}

/* Touch devices get no halo, so the base lattice carries the page alone. */
@media (hover: none) {
  .halo { display: none; }
}

/* Justification needs characters to work with. Below this the column holds
   fewer than ~50 of them, hyphenation runs out of places to break, and flush
   edges turn into word-gaps you can drive a cart through. Back to ragged. */
@media (max-width: 700px) {
  .content p,
  .content li,
  .content dd,
  .content .kg-callout-text,
  .lede__text { text-align: left; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .masthead { padding: 24px 0 48px; flex-wrap: wrap; }
  .lede { padding-bottom: 48px; }
  .feed { grid-template-columns: 1fr; gap: 56px; }
  .content blockquote.kg-blockquote-alt { font-size: 24px; }
  .content h2 { font-size: 28px; }
  .trace { height: 72px; margin-top: 40px; }
  .adjacent__item { flex-direction: column; gap: 6px; }
  .adjacent__label { width: auto; }
}
