/* The suite's one theme: Precision (id poppy), in light and dark (Popi Kit, #488, 2026-11-15). Creek and Ginkgo are
   retired; Ginkgo's editorial type lives on as the prose voice, [data-kc-voice="prose"], below. */
@font-face {font-family: Newsreader; src: url(/fonts/newsreader.woff2) format("woff2"); font-weight:400 700; font-display:swap;}
@font-face {font-family: Newsreader; src: url(/fonts/newsreader-italic.woff2) format("woff2"); font-weight:400 700; font-style:italic; font-display:swap;}
/* The 2026-11 brand book: self-hosted Latin variable fonts, SIL OFL. */
@font-face {font-family: Fraunces; src: url(/fonts/fraunces.woff2) format("woff2"); font-weight:400 700; font-display:swap;}
@font-face {font-family: Fraunces; src: url(/fonts/fraunces-italic.woff2) format("woff2"); font-weight:400 700; font-style:italic; font-display:swap;}
@font-face {font-family: 'Plus Jakarta Sans'; src: url(/fonts/plus-jakarta-sans.woff2) format("woff2"); font-weight:400 700; font-display:swap;}
/* ---------- The parts every theme shares ---------- */
:root {
  /* The root is 16px everywhere: no app scales it. Larger text comes from this one multiplier on the
     content roles below (set on <html>: data-kc-size="large" below, or an app's own preference), never
     on the header, which keeps the display and title roles. */
  --kc-text-scale: 1;
  --kc-reader-size-s: calc(1.0625rem * var(--kc-text-scale));
  --kc-reader-size-m: calc(1.25rem * var(--kc-text-scale));
  --kc-reader-size-l: calc(1.4375rem * var(--kc-text-scale));
  --kc-reader-size-xl: calc(1.625rem * var(--kc-text-scale));
  --kc-measure: 38rem;
  --kc-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* For a reader's own typeface choice (Reading's Aa) when it isn't the theme's. */


  --kc-target: 44px;      /* smallest tap target */
  --kc-space-1: 4px; --kc-space-2: 8px; --kc-space-3: 12px; --kc-space-4: 16px;
  --kc-space-5: 24px; --kc-space-6: 32px; --kc-space-7: 48px;
  /* The page frame and its rhythm: gutters, widths, and the gaps between the parts of a page. */
  --kc-gutter: clamp(16px, 4vw, 40px);
  /* The two page frames, by name. A page picks one with data-kc-width on .kc-page (never by
     overriding a token): narrow = rows, reading, writing; wide (the default) = cards, tables, maps;
     --kc-page-max is the frame in force. */
  --kc-page-narrow: 42rem;       /* reading, writing, one column */
  --kc-page-wide: 72rem;         /* lists, grids, dashboards */
  --kc-page-max: var(--kc-page-wide);
  --kc-gap-section: 3rem;        /* between sections */
  --kc-gap-block: 1.5rem;        /* between blocks: header, tabs, toolbar, list */
  --kc-gap-item: .75rem;         /* between cards, rows' contents */
  --kc-gap-tight: .5rem;         /* a label and the title it introduces */
  --kc-gap-inline: 8px;          /* between chips and buttons in a row */
  --kc-pad-card: 1rem;
  /* The display size steps with the screen, so its line height stays on the grid. */
  --kc-display-size: 2.5rem;
  --kc-display-leading: 2.75rem;
  --kc-ease: cubic-bezier(.2, .7, .2, 1);
  --kc-dur: .18s;
  --kc-focus: 3px solid var(--kc-accent);
  --kc-focus-offset: 2px;
  /* For the shared components (/kc-ui.css): the radius of a theme's sheets. Themes override. */
  --kc-sheet-radius: var(--kc-radius-l);
}
@media (min-width: 40rem) {
  :root { --kc-display-size: 3rem; --kc-display-leading: 3.25rem; --kc-gap-section: 4rem; --kc-gap-block: 2rem; --kc-pad-card: 1.5rem; }
}
@media (min-width: 64rem) {
  :root { --kc-display-size: 3.5rem; --kc-display-leading: 3.75rem; --kc-gap-section: 4.5rem; }
}

@font-face { font-family: Inter; src: url('/fonts/inter.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }

:root, [data-kc-theme="poppy"] {
  --kc-brand: #f25c24;
  /* The Popi mark (a California poppy) in every theme and scheme: 3:1 or more on every page
     background. Point it at var(--kc-accent-fill) to have the mark follow each theme instead. */
  --kc-brand-mark: #f25c24;
  /* Orange is agency: the one action to take (.kc-btn.pri, the capture +) and the agent at work (✦ Ask, the
     working dot). Never a score, count, amount or selected state: those use --kc-accent or the ink fill. */
  --kc-accent-fill: var(--kc-brand);
  --kc-on-accent: #14202e;
  --kc-font-ui: 'Plus Jakarta Sans', Inter, sans-serif;
  /* Poppy Editorial: prose has a voice; controls and task rows keep the UI face. */
  --kc-font-text: Fraunces, Newsreader, Georgia, serif;
  --kc-font-display: var(--kc-font-ui);
  --kc-font-editorial: Fraunces, Newsreader, Georgia, serif;
  --kc-strong-weight: 600;
  --kc-type-display: 400 var(--kc-display-size)/var(--kc-display-leading) var(--kc-font-display);
  --kc-type-editorial: 400 clamp(1.75rem, 4vw, 2.25rem)/2.5rem var(--kc-font-editorial);
  --kc-type-title: 400 1.5rem/1.75rem var(--kc-font-display);
  /* The app bar's title on a phone: 30px, one role in every app (below 40rem; kc-ui.css). */
  --kc-type-title-l: 400 1.875rem/2.25rem var(--kc-font-display);
  --kc-type-heading: 500 calc(1.1875rem * var(--kc-text-scale))/calc(1.5rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-type-body: 400 calc(1.0625rem * var(--kc-text-scale))/calc(1.5rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-type-reading: 400 calc(1.25rem * var(--kc-text-scale))/calc(2rem * var(--kc-text-scale)) var(--kc-font-text);
  --kc-type-meta: 400 calc(.875rem * var(--kc-text-scale))/calc(1.25rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-type-ui: 500 calc(.9375rem * var(--kc-text-scale))/calc(1.25rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-type-field: 400 calc(1rem * var(--kc-text-scale))/calc(1.5rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-type-label: 500 calc(.75rem * var(--kc-text-scale))/calc(1rem * var(--kc-text-scale)) var(--kc-font-ui);
  --kc-track-display: -.035em;
  --kc-track-editorial: -.02em;
  --kc-track-title: -.025em;
  --kc-track-heading: -.015em;
  --kc-track-label: .075em;
  --kc-label-case: uppercase;
  --kc-label-caps: normal;
  --kc-label-tracking: .04em;
  --kc-numerals: lining-nums tabular-nums;

  --kc-head-rule: 1px solid var(--kc-line);
  --kc-glass: none;
  --kc-mark-radius: 0;
  --kc-shadow: none;
  --kc-shadow-soft: 0 2px 10px rgb(0 0 0 / .05);
  --kc-shadow-float: 0 12px 36px rgb(0 0 0 / .14);

  --kc-sheet-radius: var(--kc-radius-l);
  --kc-dur: .16s;
  --kc-ease: cubic-bezier(.2, .7, .2, 1);
  --kc-quiet-bg: transparent;
  --kc-quiet-border: 1px solid var(--kc-line-strong);
  --kc-field-bg: var(--kc-surface);
  --kc-field-border: 1px solid var(--kc-line-strong);
  --kc-card-border: 1px solid var(--kc-line);
  --kc-surface-bar: var(--kc-bg);
  --kc-accent-soft: var(--kc-surface-2);
  --kc-selected-bg: var(--kc-ink);
  --kc-selected-ink: var(--kc-bg);
  /* Behind a modal sheet or task overlay. */
  --kc-scrim: rgb(0 0 0 / .4);
  /* Over a photo, in every theme and scheme (Media, #491): ink and its shade for counts and captions, and the
     soft button that floats on a photo. */
  --kc-on-media: #fff; --kc-media-shade: rgb(0 0 0 / .72);
  --kc-media-btn: color-mix(in srgb, var(--kc-bg) 92%, transparent);
  /* The highlighter: Reading's marks and Journal's highlight card. One yellow in every theme, because it means
     "highlighted" (mark: behind text; highlight: rules; strong: the favourite star). */
  --kc-highlight: #e8c13a; --kc-highlight-mark: color-mix(in srgb, #ffd84d 55%, transparent);
  --kc-ok: #205d39;
  --kc-warn: #754900;
  --kc-bad: #a02828; --kc-bad-soft: #fcebea;
  --kc-focus: 3px solid var(--kc-accent);
  /* Round in every theme: pills, segments, progress bars and toggles. Each theme's own radius is
     for boxes (chips excepted); the pill is the one shape that is the same everywhere. */
  --kc-radius-pill: 999px;
  color-scheme: light;
}
:root, [data-kc-theme="poppy"] {
  --kc-bg: #faf7f2; --kc-surface: #fffdfa; --kc-surface-2: #eeeae2;
  --kc-ink: #1c282e; --kc-ink-2: #3e4e53; --kc-muted: #566568;
  --kc-accent: #244c91; --kc-line: #ddd9d0; --kc-line-strong: #7b8583;
  --kc-radius-s: 2px; --kc-radius: 2px; --kc-radius-l: 2px;
}
[data-kc-theme="poppy"][data-kc-scheme="dark"] {
  --kc-highlight-mark: color-mix(in srgb, #ffd84d 28%, transparent);
  --kc-ok: #9dd9af;
  --kc-warn: #f1cf91;
  --kc-bad: #ffb1aa; --kc-bad-soft: #402323;
  --kc-shadow-soft: 0 2px 12px rgb(0 0 0 / .28);
  --kc-shadow-float: 0 12px 36px rgb(0 0 0 / .4);
  color-scheme: dark;
  --kc-bg: #1c282e; --kc-surface: #243238; --kc-surface-2: #304147;
  --kc-ink: #faf7f2; --kc-ink-2: #dee4e1; --kc-muted: #b5c4c1;
  --kc-accent: #acc8ff; --kc-line: #33445d; --kc-line-strong: #7f91ac;
}
/* Digital Organic Sanctuary: decorative color never carries status or selection. */
:root, [data-kc-theme="poppy"] {
  --kc-peach: #f9b895;
  --kc-mint: #bce3d1;
  --kc-glass-surface: color-mix(in srgb, var(--kc-surface) 88%, transparent);
  --kc-ambient-peach: color-mix(in srgb, var(--kc-peach) 34%, transparent);
  --kc-ambient-mint: color-mix(in srgb, var(--kc-mint) 38%, transparent);
  --kc-sanctuary-image: radial-gradient(ellipse at 92% 8%, var(--kc-ambient-mint), transparent 48%), radial-gradient(ellipse at 8% 75%, var(--kc-ambient-peach), transparent 48%);


}
[data-kc-theme="poppy"][data-kc-scheme="dark"] {
  --kc-ambient-peach: color-mix(in srgb, var(--kc-peach) 8%, transparent);
  --kc-ambient-mint: color-mix(in srgb, var(--kc-mint) 10%, transparent);
}
/* The prose voice (was the Ginkgo theme): a reading or writing surface (the Reader's article, a Journal entry) sets
   data-kc-voice="prose" on its own container, never on <html>, so the header keeps the UI face. Titles and headings
   inside take the editorial face; reading text already does in every page. The type roles are restated here because a
   role computed on :root would not see a font changed further down. */
[data-kc-voice="prose"] {
  --kc-font-display: var(--kc-font-editorial);
  --kc-track-display: -.02em; --kc-track-title: -.01em; --kc-track-heading: 0;
  --kc-type-display: 400 var(--kc-display-size)/var(--kc-display-leading) var(--kc-font-editorial);
  --kc-type-title: 400 1.5rem/1.75rem var(--kc-font-editorial);
  --kc-type-heading: 500 calc(1.1875rem * var(--kc-text-scale))/calc(1.5rem * var(--kc-text-scale)) var(--kc-font-editorial);
}
/* Only the baseline shared recipes apply. Appearance never moves a destination. */
:focus-visible { outline: var(--kc-focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

html[data-kc-theme] {background:var(--kc-bg);color:var(--kc-ink)}
/* The body reads in the theme's body role even outside .kc-page (a sheet, a fixed run-through, an error page). */
html[data-kc-theme] body {font:var(--kc-type-body);background:transparent}
/* The ambient canvas belongs to the viewport, outside every app's content frame and
   size container. It never intercepts input or changes scrolling or content layout. */
html[data-kc-theme]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--kc-sanctuary-image, none);
  background-repeat: no-repeat;
  background-size: 112% 116%, 116% 112%;
  background-position: 0% 0%, 100% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html[data-kc-theme]::before {
    animation: kc-ambient-ripple 32s ease-in-out infinite alternate,
      kc-ambient-breathe 14s ease-in-out infinite;
  }
  @keyframes kc-ambient-ripple {
    50% { background-position: 70% 35%, 30% 65%; }
    to { background-position: 100% 100%, 0% 0%; }
  }
  @keyframes kc-ambient-breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: .82; }
  }
}
/* ---------- The theme picker (mounted by /kc-theme.js at the end of the site bar) ---------- */
.kc-theme { position: relative; margin-left: auto; font: 400 14px/1.4 var(--kc-font-ui); }
.kc-theme-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--kc-target); padding: 0 2px;
  font: inherit; color: var(--kc-muted); background: none; border: 0; cursor: pointer;
}
.kc-theme-btn:hover, .kc-theme-btn[aria-expanded="true"] { color: var(--kc-ink); }
.kc-theme-btn:focus-visible, .kc-theme-mode button:focus-visible {
  outline: var(--kc-focus); outline-offset: var(--kc-focus-offset);
}
.kc-theme-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--kc-line-strong);
  background: linear-gradient(90deg, var(--kc-ink) 50%, var(--kc-bg) 50%); flex: none; }
.kc-theme-panel {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 1000; width: min(19rem, calc(100vw - 32px));
  padding: 12px; display: grid; gap: 8px; max-height: calc(100dvh - 72px); overflow-y: auto;
  background: var(--kc-bg); color: var(--kc-ink); border: 1px solid var(--kc-line);
  border-radius: var(--kc-radius-l); box-shadow: var(--kc-shadow-float);
}
.kc-theme-panel[hidden] { display: none; }
.kc-theme-mode { display: flex; gap: 4px; margin-top: 4px; padding: 3px; background: var(--kc-surface-2); border-radius: var(--kc-radius); }
.kc-theme-mode button {
  flex: 1; min-height: 38px; font: inherit; font-size: 13px; color: var(--kc-ink-2); background: none;
  border: 0; border-radius: calc(var(--kc-radius) - 2px); cursor: pointer;
}
.kc-theme-mode button[aria-checked="true"] { background: var(--kc-selected-bg); color: var(--kc-selected-ink); }
@media (prefers-reduced-motion: no-preference) {
  .kc-theme-panel:not([hidden]) { animation: kc-pop var(--kc-dur) var(--kc-ease); }
  @keyframes kc-pop { from { opacity: 0; transform: translateY(-4px); } }
}

/* Sparse, static identity marks accompany completed-action feedback. */
[data-kc-theme="poppy"]{--kc-signature:url(/theme-marks/poppy-bloom.svg)}
.kc-toast-text::before{content:"";display:inline-block;width:18px;height:18px;background:var(--kc-signature) center/contain no-repeat;margin-right:8px;vertical-align:middle}
