/* ===========================================================================
 * Keep My Darlings — Design System v0.1
 *
 * Aesthetic: "Calm Concierge" — editorial, butler-of-an-estate feel.
 * Cream paper rather than sterile white; deep pond ink for text;
 * Alfred yellow used sparingly so it stays special.
 * Built on Bootstrap 5; everything below customises the underlying tokens
 * so the result reads as Keep My Darlings, not as Bootstrap.
 * =========================================================================== */


/* ----------  Tokens  ---------------------------------------------------- */

:root {
  /* Brand surfaces */
  --kd-cream:        #FDF6E3;   /* warmer than the spec — actual paper */
  --kd-cream-deep:   #F6ECCB;
  --kd-cloud:        #F4F7F8;
  --kd-mist:         #E6EAEE;
  --kd-soft-pond:    #DDF0F4;
  --kd-pond:         #2D8EA7;
  --kd-pond-ink:     #14596A;
  --kd-deep-pond:    #0E3D49;

  /* Alfred */
  --kd-alfred:       #F8C928;
  --kd-alfred-soft:  #FFE89A;
  --kd-beak:         #F28A1A;
  --kd-suit:         #14181D;
  --kd-shirt:        #FFFFFF;

  /* Text */
  --kd-ink:          #1F2328;
  --kd-slate:        #4F5963;
  --kd-muted:        #8A949E;

  /* States */
  --kd-sleep:        #8A949E;
  --kd-sleep-bg:     #ECEEF1;
  --kd-incubate:     #6F9F7B;
  --kd-incubate-bg:  #E8F1EA;
  --kd-active:       #D89324;
  --kd-active-bg:    #FBEFCE;
  --kd-crunch:       #6C4AB6;
  --kd-crunch-bg:    #ECE3FB;

  /* Geometry */
  --kd-radius-sm:    8px;
  --kd-radius:       14px;
  --kd-radius-lg:    22px;
  --kd-radius-pill:  999px;
  --kd-shadow-soft:  0 1px 2px rgba(20, 89, 106, 0.06),
                     0 8px 24px -12px rgba(20, 89, 106, 0.18);
  --kd-shadow-card:  0 1px 0 rgba(20, 89, 106, 0.04),
                     0 18px 40px -22px rgba(20, 89, 106, 0.22);
  --kd-shadow-lift:  0 8px 18px -8px rgba(20, 89, 106, 0.28),
                     0 30px 60px -30px rgba(20, 89, 106, 0.30);

  /* Typography — single restrained system, hierarchy via weight + size */
  --kd-font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --kd-font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* Bootstrap overrides */
  --bs-body-bg:      var(--kd-cream);
  --bs-body-color:   var(--kd-ink);
  --bs-body-font-family: var(--kd-font-body);
  --bs-body-font-size: 16px;
  --bs-body-line-height: 1.55;
  --bs-border-radius:    var(--kd-radius);
  --bs-border-radius-sm: var(--kd-radius-sm);
  --bs-border-radius-lg: var(--kd-radius-lg);
  --bs-border-color:     var(--kd-mist);
  --bs-link-color:       var(--kd-pond-ink);
  --bs-link-hover-color: var(--kd-deep-pond);
  --bs-primary:          var(--kd-pond);
  --bs-primary-rgb:      45, 142, 167;
}


/* ----------  Page atmosphere  ------------------------------------------ */

html, body { height: 100%; }

body {
  font-family: var(--kd-font-body);
  color: var(--kd-ink);
  background-color: var(--kd-cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sticky footer: body fills the viewport, main grows to push footer down. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main { flex: 1 0 auto; }
body > footer { flex-shrink: 0; }

::selection { background: var(--kd-alfred-soft); color: var(--kd-suit); }


/* ----------  Typography  ------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--kd-font-body);
  color: var(--kd-deep-pond);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
}
h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); line-height: 1.15; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.98rem; }

.eyebrow {
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--kd-muted);
}

.lede {
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--kd-slate);
}

.mono { font-family: var(--kd-font-mono); font-size: 0.92em; }


/* ----------  Top navigation  ------------------------------------------- */

.kd-nav {
  background: rgba(253, 246, 227, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(20, 24, 29, 0.22);
  box-shadow: 0 1px 0 rgba(20, 24, 29, 0.04);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.kd-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--kd-suit);
}
.kd-brand img {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--kd-cream-deep);
  border: 1px solid var(--kd-suit);
}
.kd-brand .kd-wordmark {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.012em;
  color: var(--kd-deep-pond);
}
.kd-brand .kd-wordmark em {
  font-style: normal;
  font-weight: 400;
  color: var(--kd-slate);
}

.kd-nav-links {
  display: flex; gap: 6px; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.kd-nav-links a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--kd-radius-pill);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--kd-slate);
  transition: background 160ms ease, color 160ms ease;
}
.kd-nav-links a:hover { background: rgba(45, 142, 167, 0.08); color: var(--kd-pond-ink); }
.kd-nav-links a.is-active {
  background: var(--kd-pond-ink);
  color: var(--kd-cream);
}

.kd-nav-utility {
  display: flex; gap: 14px; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.kd-nav-utility a {
  font-size: 0.84rem;
  color: var(--kd-slate);
  text-decoration: none;
  font-weight: 400;
}
.kd-nav-utility a:hover { color: var(--kd-pond-ink); }
.kd-nav-utility .kd-divider-v {
  width: 1px; height: 14px;
  background: rgba(20, 24, 29, 0.18);
}

/* Account dropdown — username summary opens a small panel with
   Settings / Change password / Admin (superusers) / Log out. Uses
   <details> so it works without JS; click outside doesn't auto-close
   (acceptable trade-off for a small persistent menu). */
.kd-nav-account { position: relative; }
.kd-nav-account__menu > summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--kd-pond-ink);
  padding: 4px 8px;
  border-radius: 6px;
}
.kd-nav-account__menu > summary::-webkit-details-marker { display: none; }
.kd-nav-account__menu > summary:hover { background: rgba(45, 142, 167, 0.08); }
.kd-nav-account__caret { font-size: 0.7rem; opacity: 0.6; }
.kd-nav-account__items {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--kd-cream, #fdf6e3);
  border: 1px solid var(--kd-mist, #e6eaee);
  border-radius: 10px;
  box-shadow: var(--kd-shadow-card, 0 18px 40px -22px rgba(20, 89, 106, 0.22));
  padding: 6px 0;
  margin: 0;
  list-style: none;
  z-index: 200;
}
.kd-nav-account__items li { margin: 0; padding: 0; }
.kd-nav-account__items a,
.kd-nav-account__logout button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.86rem;
  color: var(--kd-ink);
  text-decoration: none;
  cursor: pointer;
}
.kd-nav-account__items a:hover,
.kd-nav-account__logout button:hover {
  background: var(--kd-cream-deep, #f6eccb);
  color: var(--kd-pond-ink);
}
.kd-nav-account__sep {
  height: 1px;
  background: var(--kd-mist, #e6eaee);
  margin: 4px 0;
}
.kd-nav-account__logout { margin: 0; padding: 0; }


/* ----------  Buttons  --------------------------------------------------- */

.btn {
  font-weight: 500;
  border-radius: var(--kd-radius-pill);
  padding: 10px 20px;
  letter-spacing: -0.005em;
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary, .btn-pond {
  --bs-btn-bg:           var(--kd-pond-ink);
  --bs-btn-border-color: var(--kd-pond-ink);
  --bs-btn-hover-bg:     var(--kd-deep-pond);
  --bs-btn-hover-border-color: var(--kd-deep-pond);
  --bs-btn-active-bg:    var(--kd-deep-pond);
  --bs-btn-color:        var(--kd-cream);
  --bs-btn-hover-color:  var(--kd-cream);
  box-shadow: 0 6px 18px -10px rgba(20, 89, 106, 0.55);
}
.btn-primary:hover, .btn-pond:hover {
  box-shadow: 0 10px 28px -12px rgba(20, 89, 106, 0.60);
}

.btn-alfred {
  background: var(--kd-alfred);
  color: var(--kd-suit);
  border: 1px solid rgba(20, 24, 29, 0.06);
  box-shadow: 0 6px 16px -10px rgba(248, 201, 40, 0.85);
}
.btn-alfred:hover { background: #FFD440; color: var(--kd-suit); }

.btn-quiet {
  background: transparent;
  color: var(--kd-slate);
  border: 1px solid var(--kd-mist);
}
.btn-quiet:hover { background: var(--kd-cloud); color: var(--kd-pond-ink); border-color: var(--kd-soft-pond); }

.btn-ghost {
  background: transparent;
  color: var(--kd-pond-ink);
  border: 0;
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--kd-deep-pond); }


/* ----------  Cards & containers  --------------------------------------- */

.kd-card {
  background: var(--kd-shirt);
  border: 1px solid rgba(20, 89, 106, 0.06);
  border-radius: var(--kd-radius-lg);
  box-shadow: var(--kd-shadow-card);
  padding: 28px;
}

.kd-card--cream { background: var(--kd-cream-deep); }
.kd-card--pond  { background: var(--kd-soft-pond); border-color: rgba(45,142,167,0.18); }
.kd-card--ink   { background: var(--kd-deep-pond); color: var(--kd-cream); }
.kd-card--ink h1, .kd-card--ink h2, .kd-card--ink h3 { color: var(--kd-cream); }

.kd-panel {
  background: var(--kd-shirt);
  border-radius: var(--kd-radius);
  border: 1px solid rgba(20, 89, 106, 0.07);
  padding: 18px 20px;
}

/* No decorative ripple — kept as a no-op shim so existing markup is harmless */
.kd-ripple { position: relative; }

/* Reusable Alfred circle: keeps the suit-black border consistent everywhere */
.kd-alfred-circle {
  border-radius: 50%;
  background: var(--kd-cream-deep);
  border: 1.5px solid var(--kd-suit);
  display: inline-grid; place-items: center;
  overflow: hidden;
}
.kd-alfred-circle img { width: 86%; height: 86%; object-fit: contain; }


/* ----------  Alert (the one unified recommendation banner)  ------------
 * Used identically on every page for: strategy reminder, Alfred observations,
 * gentle nudges, suggested next actions. Same background, same spacing, same
 * type — so the eye sees "this is Alfred speaking" instantly without
 * different colors competing for attention.
 */

.kd-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 14px;
  background: var(--kd-shirt);
  border: 1px solid var(--kd-mist);
  border-left: 3px solid var(--kd-pond);
  border-radius: var(--kd-radius);
  margin: 0 0 24px 0;
  font-size: 0.94rem;
  color: var(--kd-slate);
}
.kd-alert__body { flex: 1; line-height: 1.45; }
.kd-alert__body strong { color: var(--kd-deep-pond); font-weight: 600; }
.kd-alert__label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kd-pond);
  margin-right: 6px;
}
.kd-alert__actions {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.kd-alert__actions a, .kd-alert__actions button {
  padding: 4px 10px;
  border-radius: var(--kd-radius-pill);
  border: 0; background: transparent;
  color: var(--kd-pond-ink);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}
.kd-alert__actions a:hover, .kd-alert__actions button:hover {
  background: var(--kd-soft-pond);
  color: var(--kd-deep-pond);
}
.kd-alert--quiet { border-left-color: var(--kd-mist); }


/* ----------  State pills  ----------------------------------------------- */

.kd-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  border-radius: var(--kd-radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--kd-sleep-bg);
  color: var(--kd-slate);
  white-space: nowrap;
}
.kd-state::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--kd-sleep);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.kd-state--sleeping   { background: var(--kd-sleep-bg);    color: var(--kd-slate); }
.kd-state--sleeping::before  { background: var(--kd-sleep); }
.kd-state--incubating { background: var(--kd-incubate-bg); color: #3F6748; }
.kd-state--incubating::before { background: var(--kd-incubate); }
.kd-state--active     { background: var(--kd-active-bg);   color: #6F4A0E; }
.kd-state--active::before     { background: var(--kd-active); box-shadow: 0 0 0 4px rgba(248,201,40,0.18); }
.kd-state--crunch     { background: var(--kd-crunch-bg);   color: #3D2773; }
.kd-state--crunch::before     { background: var(--kd-crunch); }


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

.kd-darling {
  background: var(--kd-shirt);
  border-radius: var(--kd-radius);
  padding: 18px 20px;
  border: 1px solid rgba(20, 89, 106, 0.06);
  box-shadow: var(--kd-shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  text-decoration: none;
  color: inherit;
}
.kd-darling:hover {
  transform: translateY(-2px);
  box-shadow: var(--kd-shadow-lift);
  border-color: rgba(45, 142, 167, 0.18);
  color: inherit;
}
.kd-darling__title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--kd-deep-pond);
  margin: 0;
  line-height: 1.25;
}
.kd-darling__meta {
  font-size: 0.84rem;
  color: var(--kd-slate);
}
.kd-darling__blurb {
  font-size: 0.94rem;
  color: var(--kd-slate);
  margin: 0;
}

/* Stale cards: subtle amber accent on the meta row, no panic colour. */
.kd-darling--stale .kd-darling__meta {
  color: var(--kd-active);
}
.kd-darling--stale .kd-darling__meta::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--kd-active);
  margin-right: 6px;
  vertical-align: middle;
}

/* Subtask cards: a thin left bar + small breadcrumb */
.kd-darling__breadcrumb {
  font-size: 0.74rem;
  color: var(--kd-muted);
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.kd-darling--subtask {
  border-left-style: dotted;
}
.kd-darling__actions {
  display: flex; gap: 6px; justify-content: flex-end;
  margin-top: 4px;
}
.kd-darling__actions .btn-sm {
  padding: 2px 10px;
  font-size: 0.78rem;
}

/* Sleeping variant — quieter */
.kd-darling--sleeping {
  background: transparent;
  border-style: dashed;
  border-color: var(--kd-mist);
  box-shadow: none;
}
.kd-darling--sleeping .kd-darling__title { color: var(--kd-slate); font-style: italic; }

/* Crunch variant — sharper accent */
.kd-darling--crunch {
  border: 1px solid rgba(108, 74, 182, 0.30);
  background: linear-gradient(180deg, var(--kd-shirt) 0%, #F8F2FF 100%);
}

/* Active focus ring */
.kd-darling--active {
  border-left: 3px solid var(--kd-active);
}


/* ----------  Chat (the home screen)  ----------------------------------- */

.kd-chat {
  max-width: 1100px;
  margin: 0 auto;
}

/* Two-column shell: chat on the left, context rail on the right. The rail
   reflects whatever Alfred declared as `referenced_projects` for the
   current turn, refreshed by the same HTMX swap as the chat itself.

   The chat column has min=0 (so it shrinks rather than overflowing on
   narrow desktops where Bootstrap's .container caps width at ~944px),
   max=720px (its natural reading width). The rail is fixed at 320px.
   Centering the grid keeps the layout balanced when the container is
   wider than the two columns combined. */
.kd-shell {
  display: grid;
  grid-template-columns: minmax(0, 720px) 320px;
  gap: 24px;
  /* No `align-items: start` — we want both grid items to stretch to the
     full row height so the rail aside is as tall as the chat column.
     position: sticky is then applied to an inner wrapper; that inner
     element has the entire chat-height row as its scroll runway, so it
     stays glued to top:115 throughout the whole chat scroll range. */
  justify-content: center;
}
.kd-shell__main { min-width: 0; }
@media (max-width: 880px) {
  .kd-shell { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

.kd-rail {
  font-size: 0.9rem;
}
.kd-rail__sticky {
  position: sticky;
  /* Match the rail's natural position at scroll=0:
     .kd-nav (sticky, ~67px) + main's py-md-5 padding-top (48px) = 115px.
     Sticky engages from scroll=0 onward, so there's no transition jump
     between stuck and natural state. */
  top: 115px;
  /* If many cards make the rail taller than the viewport, scroll inside
     the sticky pane instead of clipping at the viewport edge. */
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kd-rail__title {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--kd-suit, #8a8a8a);
  margin-bottom: 2px;
}
.kd-rail__empty .kd-rail__hint {
  color: var(--kd-suit, #8a8a8a);
  font-style: italic;
  margin: 0;
}
.kd-rail__card {
  border: 1px solid var(--kd-suit, #d8d4cc);
  border-radius: 10px;
  background: var(--kd-cream, #fbfaf6);
  padding: 12px 14px;
}
.kd-rail__card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.kd-rail__name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--kd-pond-ink, #1a2a36);
}
.kd-rail__state {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--kd-cream-deep, #efece1);
  color: var(--kd-pond-ink, #1a2a36);
}
.kd-rail__state--active   { background: #d6ead0; }
.kd-rail__state--crunch   { background: #f3d6c6; }
.kd-rail__state--incubating { background: #e2dcef; }
.kd-rail__state--sleeping { background: #e8e6df; color: var(--kd-suit, #8a8a8a); }
.kd-rail__field {
  margin-top: 8px;
}
.kd-rail__field p {
  margin: 2px 0 0 0;
  line-height: 1.4;
}
.kd-rail__constraint {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--kd-cream-deep, #efece1);
  border-left: 3px solid var(--kd-pond, #14596a);
  border-radius: 4px;
}
.kd-rail__constraint p {
  margin: 2px 0 0 0;
  line-height: 1.4;
  font-style: italic;
  color: var(--kd-pond-ink, #14596a);
}
.kd-rail__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kd-suit, #8a8a8a);
}

/* Consultation footer inside an Alfred bubble — shows which sub-agents
   he called this turn. Click expands to see the full Q&A. */
.kd-consults {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--kd-mist, #e3e0d6);
  font-size: 0.82rem;
  color: var(--kd-suit, #8a8a8a);
}
.kd-consults > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  user-select: none;
}
.kd-consults > summary::-webkit-details-marker { display: none; }
.kd-consults > summary::before {
  content: "▸";
  display: inline-block;
  font-size: 0.7rem;
  margin-right: 4px;
  transition: transform 0.12s;
}
.kd-consults[open] > summary::before { transform: rotate(90deg); }
.kd-consults__lead {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}
.kd-consults__role {
  color: var(--kd-pond-ink, #1a2a36);
  font-weight: 500;
}
.kd-consults__sep { opacity: 0.5; }
.kd-consults__item {
  margin-top: 10px;
  padding-left: 10px;
  border-left: 2px solid var(--kd-mist, #e3e0d6);
}
.kd-consults__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 4px;
}
.kd-consults__head strong {
  color: var(--kd-pond-ink, #1a2a36);
  font-weight: 600;
}
.kd-consults__q {
  font-style: italic;
  color: var(--kd-suit, #8a8a8a);
}
.kd-consults__a {
  color: var(--kd-pond-ink, #1a2a36);
  line-height: 1.45;
}
.kd-consults__a p { margin: 0 0 6px 0; }

/* "What Alfred knows about you" pane — sits below the project cards.
   Compact, read-only; the user corrects values in chat, not here. */
.kd-userbox {
  border: 1px solid var(--kd-suit, #d8d4cc);
  border-radius: 10px;
  background: var(--kd-cream, #fbfaf6);
  padding: 12px 14px;
  margin-top: 18px;
}
.kd-userbox .kd-rail__title { margin-bottom: 8px; }
.kd-userbox__list { margin: 0; padding: 0; }
.kd-userbox__row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dotted var(--kd-mist, #e8e6df);
}
.kd-userbox__row:last-child { border-bottom: 0; }
.kd-userbox__row dt {
  flex: 0 0 80px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kd-suit, #8a8a8a);
  margin: 0;
}
.kd-userbox__row dd { margin: 0; line-height: 1.4; flex: 1; }
.kd-userbox__row--block { flex-direction: column; gap: 2px; }
.kd-userbox__row--block dt { flex: 0 0 auto; }

.kd-userbox__skills { margin-top: 12px; }
.kd-userbox__sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kd-suit, #8a8a8a);
  margin-bottom: 6px;
}
.kd-userbox__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.kd-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--kd-cream-deep, #efece1);
  font-size: 0.82rem;
  line-height: 1.2;
  color: var(--kd-pond-ink, #14596a);
}
.kd-pill__name { font-weight: 500; }
/* "⋯" disclosure inside a skill pill — opens a tiny action menu.
   Today the only action is 'Consult <skill> expert'; we'll add more
   (Edit, Hide, Mark expert) when needed. */
.kd-pill__menu {
  position: relative;
  margin-left: 4px;
}
.kd-pill__menu > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  color: var(--kd-suit, #8a8a8a);
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}
.kd-pill__menu > summary::-webkit-details-marker { display: none; }
.kd-pill__menu > summary:hover {
  color: var(--kd-pond-ink, #14596a);
  background: rgba(45, 142, 167, 0.10);
}
.kd-pill__menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: var(--kd-cream, #fdf6e3);
  border: 1px solid var(--kd-mist, #e6eaee);
  border-radius: 10px;
  box-shadow: var(--kd-shadow-card, 0 18px 40px -22px rgba(20, 89, 106, 0.22));
  z-index: 50;
  font-size: 0.84rem;
}
.kd-pill__menu-items a {
  display: block;
  padding: 8px 14px;
  color: var(--kd-pond-ink, #14596a);
  text-decoration: none;
  font-weight: 500;
}
.kd-pill__menu-items a:hover {
  background: var(--kd-cream-deep, #f6eccb);
  color: var(--kd-deep-pond, #0e3d49);
}

/* Skill rows on the settings page: display + inline edit. */
.kd-skills { display: flex; flex-direction: column; gap: 8px; }
.kd-skill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px;
  border: 1px solid var(--kd-mist, #e6eaee);
  border-radius: 8px;
  background: var(--kd-cream, #fdf6e3);
}
.kd-skill-row__main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.kd-skill__name { font-weight: 500; color: var(--kd-pond-ink, #14596a); }
.kd-skill__notes { color: var(--kd-suit, #8a8a8a); font-size: 0.86rem; }
.kd-skill-row__actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.kd-skill-row--editing {
  flex-direction: column;
  align-items: stretch;
  background: var(--kd-cream-deep, #efece1);
}
.kd-skill-row__edit-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.kd-skill-row__notes { grid-column: 1 / -1; }
.form-label--sm {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kd-suit, #8a8a8a);
  margin-bottom: 2px;
}
@media (max-width: 640px) {
  .kd-skill-row__edit-grid { grid-template-columns: 1fr; }
}

/* AI usage meter on the settings page. */
.kd-usage-bar {
  width: 100%;
  height: 10px;
  background: var(--kd-cream-deep, #efece1);
  border-radius: 999px;
  overflow: hidden;
}
.kd-usage-bar__fill {
  height: 100%;
  background: var(--kd-pond, #14596a);
  border-radius: 999px;
  transition: width 200ms ease;
}
.kd-usage-bar__fill--warn { background: #b8a85b; }
.kd-usage-bar__fill--full { background: #a05050; }

.kd-prompt {
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--kd-deep-pond);
  margin: 0;
}
.kd-prompt em { font-style: normal; color: var(--kd-pond-ink); }

.kd-message {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 0 0 22px 0;
}
.kd-message__avatar {
  flex: 0 0 56px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--kd-cream-deep);
  border: 1px solid var(--kd-suit);
  overflow: hidden;
  display: grid; place-items: center;
}
.kd-message__avatar img { width: 100%; height: 100%; object-fit: cover; }
.kd-message__bubble { flex: 1; padding-top: 4px; }
.kd-message__from {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--kd-pond);
  margin-bottom: 6px;
}
.kd-message__body {
  margin: 0;
  line-height: 1.5;
  color: var(--kd-ink);
}
.kd-message__body p { margin: 0 0 0.6em 0; }
.kd-message__body p:last-child { margin-bottom: 0; }
.kd-message__body ul, .kd-message__body ol { margin: 0.4em 0 0.6em 1.5em; padding: 0; }
.kd-message__body li { margin: 0.15em 0; }
.kd-message__body h1, .kd-message__body h2, .kd-message__body h3,
.kd-message__body h4, .kd-message__body h5 {
  margin: 0.8em 0 0.3em; line-height: 1.25;
  color: var(--kd-deep-pond);
}
.kd-message__body h1 { font-size: 1.15rem; }
.kd-message__body h2 { font-size: 1.05rem; }
.kd-message__body h3, .kd-message__body h4, .kd-message__body h5 { font-size: 0.98rem; }
.kd-message__body code {
  background: rgba(20, 89, 106, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--kd-font-mono);
  font-size: 0.88em;
}
.kd-message__body pre {
  background: var(--kd-cream-deep);
  padding: 10px 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--kd-font-mono);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0.6em 0;
}
.kd-message__body pre code { background: transparent; padding: 0; }
.kd-message__body blockquote {
  border-left: 3px solid var(--kd-pond);
  padding: 0 12px;
  color: var(--kd-slate);
  margin: 0.6em 0;
}
.kd-message__body table {
  border-collapse: collapse;
  margin: 0.6em 0;
}
.kd-message__body th, .kd-message__body td {
  border: 1px solid var(--kd-mist);
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}
.kd-message__body th {
  background: var(--kd-cream-deep);
  font-weight: 600;
}
.kd-message__body strong { color: var(--kd-deep-pond); }
.kd-prompt p { margin: 0 0 0.6em 0; }
.kd-prompt p:last-child { margin-bottom: 0; }

/* All messages share the same calm transcript styling — left-aligned,
   56px avatar, ink-coloured prose. */
.kd-message--past .kd-message__bubble { padding-top: 4px; }
.kd-message--past .kd-message__body {
  font-size: 0.96rem;
  color: var(--kd-ink);
}

/* User messages — same left-aligned layout as Alfred's past turns, with
   a generic 32px avatar on the LEFT. Reads as a transcript, not a
   messenger app. */
.kd-message--user {
  margin-bottom: 14px;
}
.kd-message--user .kd-message__bubble {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0;
}
.kd-message--user .kd-message__body {
  font-size: 0.94rem;
  color: var(--kd-deep-pond);
}
.kd-message__avatar--user {
  flex: 0 0 56px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--kd-pond-ink);
  border: 1px solid var(--kd-suit);
  display: grid; place-items: center;
}
.kd-message__avatar--user svg {
  width: 38px; height: 38px;
  fill: var(--kd-cream);
}


.kd-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.kd-option {
  background: var(--kd-shirt);
  border: 1px solid var(--kd-mist);
  border-radius: var(--kd-radius);
  padding: 14px 16px;
  text-align: left;
  font-size: 0.97rem;
  color: var(--kd-ink);
  cursor: pointer;
  transition: all 160ms ease;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.kd-option:hover {
  border-color: var(--kd-pond);
  background: var(--kd-soft-pond);
  transform: translateY(-1px);
}
.kd-option .kd-option__hint { color: var(--kd-muted); font-size: 0.82rem; }

.kd-option--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 18px;
}
.kd-option--stacked .kd-option__hint { color: var(--kd-muted); font-size: 0.82rem; }

.kd-input-row {
  margin-top: 18px;
  display: flex; gap: 10px;
  background: var(--kd-shirt);
  border: 1px solid var(--kd-mist);
  border-radius: var(--kd-radius-pill);
  padding: 6px 6px 6px 18px;
  align-items: center;
  box-shadow: var(--kd-shadow-soft);
}
.kd-input-row input {
  border: 0; outline: 0; background: transparent;
  flex: 1; font-size: 0.98rem; color: var(--kd-ink); padding: 8px 0;
}
.kd-input-row input::placeholder { color: var(--kd-muted); }
.kd-input-row .btn { padding: 8px 16px; }

/* "Alfred is thinking" indicator — rendered as a regular Alfred message
   bubble with Bootstrap's spinner-border. Hidden by default; shown
   while an HTMX request to /chat/reply/ is in flight. */
.kd-chat__thinking { display: none !important; }
.htmx-request .kd-chat__thinking,
.htmx-request.kd-chat__thinking { display: flex !important; }
/* Async path: turn is in flight on the worker, so HTMX has no
   in-flight request driving .htmx-request. The view sets
   --active on the indicator to keep the bubble visible until
   polling brings in Alfred's reply. */
.kd-chat__thinking--active { display: flex !important; }
.kd-chat__thinking-timer {
  font-family: var(--kd-font-mono, ui-monospace, monospace);
  font-size: 0.82rem;
  color: var(--kd-suit, #8a8a8a);
  font-variant-numeric: tabular-nums;
}
.kd-chat__thinking-cancel {
  background: transparent;
  border: 0;
  color: var(--kd-suit, #8a8a8a);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0 4px;
}
.kd-chat__thinking-cancel:hover { color: var(--kd-pond-ink, #14596a); }

/* Specialist coaching surface — same chat shape as Alfred but with a
   monogram avatar instead of the Alfred portrait, plus a small header
   panel that names the specialist and the optional project scope. */
.kd-specialist-header {
  border-bottom: 1px solid var(--kd-mist, #e6eaee);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.kd-message__avatar--specialist {
  background: var(--kd-pond-ink, #14596a);
  color: var(--kd-cream, #fdf6e3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
}
.kd-specialist-monogram {
  text-transform: uppercase;
  letter-spacing: 0;
}

/* Experts directory page — grid of expert cards. Each card has a
   circular avatar (image with monogram fallback), name, role + brief,
   personality bio, and a "Talk to <name>" CTA. */
.kd-experts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.kd-expert-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px 18px;
  border: 1px solid var(--kd-mist, #e6eaee);
  border-radius: var(--kd-radius, 14px);
  background: var(--kd-cream, #fdf6e3);
  align-items: stretch;
  text-align: center;
}
.kd-expert-card__avatar {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--kd-pond-ink, #14596a);
  color: var(--kd-cream, #fdf6e3);
  overflow: hidden;
  position: relative;
}
.kd-expert-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.kd-expert-card__monogram {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 4.2rem;
  font-weight: 600;
  text-transform: uppercase;
}
.kd-expert-card__body { flex: 1 1 auto; min-width: 0; }
.kd-expert-card__name {
  margin: 0 0 2px 0;
  font-size: 1.1rem;
  color: var(--kd-pond-ink, #14596a);
}
.kd-expert-card__role {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--kd-suit, #8a8a8a);
}
.kd-expert-card__bio {
  margin: 8px 0 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--kd-ink, #1f2328);
}

/* Capture modal — fixed full-viewport overlay loaded into #modal-region
   by the nav 'Capture' link. Backdrop click + Cancel + Close all
   route through /capture/close/ which returns empty body to clear
   the region. */
.kd-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
}
.kd-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 29, 0.5);
  cursor: pointer;
}
.kd-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--kd-cream, #fdf6e3);
  border-radius: var(--kd-radius, 14px);
  padding: 24px 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--kd-shadow-lift, 0 20px 60px -20px rgba(20, 89, 106, 0.4));
}

.kd-specialist-wrapup {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--kd-cream-deep, #f6eccb);
  border-radius: 8px;
  font-size: 0.9rem;
}
.kd-specialist-wrapup > summary {
  cursor: pointer;
  color: var(--kd-pond-ink, #14596a);
  user-select: none;
  list-style: none;
}
.kd-specialist-wrapup > summary::-webkit-details-marker { display: none; }

/* Per-project "Get coaching" disclosure on rail cards. Compact list of
   the 10 specialists; clicking opens a coaching session scoped to
   that project. */
.kd-rail__coaches {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--kd-mist, #e6eaee);
  font-size: 0.84rem;
}
.kd-rail__coaches > summary {
  cursor: pointer;
  color: var(--kd-pond-ink, #14596a);
  user-select: none;
  list-style: none;
}
.kd-rail__coaches > summary::-webkit-details-marker { display: none; }
.kd-rail__coach-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kd-rail__coach-list li {
  line-height: 1.3;
}
.kd-rail__coach-list a {
  font-weight: 500;
  text-decoration: none;
}
.kd-rail__coach-list a:hover { text-decoration: underline; }
.kd-rail__coach-brief {
  color: var(--kd-suit, #8a8a8a);
  font-size: 0.78rem;
  display: block;
}

/* Disabled (mid-request) styling so the user doesn't keep clicking.
   No cursor:wait — the native wait cursor near the pointer competes
   with the inline "Thinking…" indicator. */
.kd-input-row--multi textarea:disabled,
.kd-input-row--multi .btn:disabled,
.kd-options:has(button:disabled) button { opacity: 0.5; }


/* Reset link beneath the chat input — visible but not loud. */
.kd-chat__footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.kd-chat__provider {
  font-size: 0.78rem;
  color: var(--kd-slate);
  font-family: var(--kd-font-mono);
}
.kd-chat__provider strong { color: var(--kd-pond-ink); font-weight: 500; }
.kd-chat__provider--fake strong { color: var(--kd-beak); }
.kd-chat__reset {
  background: transparent;
  border: 1px solid var(--kd-mist);
  color: var(--kd-slate);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--kd-radius-pill);
}
.kd-chat__reset:hover {
  color: var(--kd-pond-ink);
  border-color: var(--kd-pond);
  background: var(--kd-soft-pond);
}

/* LLM debug panel — collapsed by default. Only rendered when DEBUG=True. */
.kd-llm-debug {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--kd-cream-deep);
  border: 1px dashed rgba(20, 24, 29, 0.18);
  border-radius: var(--kd-radius);
  font-size: 0.82rem;
}
.kd-llm-debug[open] { background: #fef9e7; border-color: rgba(248, 201, 40, 0.45); }
.kd-llm-debug summary {
  cursor: pointer;
  color: var(--kd-deep-pond);
  font-weight: 600;
  padding: 4px 0;
}
.kd-llm-debug__hint {
  font-weight: 400;
  color: var(--kd-muted);
  font-size: 0.78rem;
  margin-left: 6px;
}
.kd-llm-debug h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kd-muted);
  margin: 12px 0 4px;
}
.kd-llm-debug pre {
  background: rgba(20, 89, 106, 0.04);
  padding: 8px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-family: var(--kd-font-mono);
  font-size: 0.78rem;
  color: var(--kd-deep-pond);
  max-height: 320px;
  overflow: auto;
}
.kd-llm-debug__calls {
  margin: 4px 0 0; padding-left: 18px;
  font-family: var(--kd-font-mono);
  font-size: 0.78rem;
}
.kd-llm-debug__turn {
  border-top: 1px dashed rgba(20, 24, 29, 0.10);
  padding-top: 8px;
  margin-top: 8px;
}


/* Multi-line variant: textarea on top, send button beneath it.
   Higher selector specificity so it wins against the base .kd-input-row. */
form.kd-input-row.kd-input-row--multi {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  align-items: stretch;
  border-radius: var(--kd-radius-lg);
  padding: 12px;
  gap: 10px;
}
.kd-input-row--multi textarea {
  order: 1;
  border: 0; outline: 0; background: transparent;
  width: 100%;
  resize: vertical;
  min-height: 96px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--kd-ink);
  font-family: inherit;
  padding: 4px 6px;
}
.kd-input-row--multi textarea::placeholder { color: var(--kd-muted); }
.kd-input-row--multi .btn {
  order: 2;
  justify-self: end;
  display: inline-flex; align-items: center; gap: 8px;
}
/* Subtle keyboard hint inside the send button: same background, just
   slightly faded text. No competing pill. */
.kd-input-row--multi .btn .kd-kbd {
  font-size: 0.78rem;
  background: transparent;
  border: 0;
  color: rgba(253, 246, 227, 0.7);
  padding: 0;
}


/* ----------  Boards layout  -------------------------------------------- */

.kd-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.kd-board__column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


/* ----------  Kanban (Darlings + Attention)  ---------------------------- */

.kd-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .kd-kanban { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .kd-kanban { grid-template-columns: 1fr; }
}

.kd-kanban-column {
  background: var(--kd-shirt);
  border: 1px solid var(--kd-mist);
  border-radius: var(--kd-radius);
  padding: 12px;
}
.kd-kanban-column__header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 2px 4px 10px;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--kd-deep-pond);
}
.kd-kanban-column__header .kd-count {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--kd-muted);
  letter-spacing: 0.02em;
  text-transform: none;
}
.kd-kanban-column__body {
  display: flex; flex-direction: column;
  gap: 8px;
  min-height: 60px;
  /* a bit of padding so the empty drop area is forgiving */
  padding: 4px;
  border-radius: var(--kd-radius-sm);
}
.kd-kanban-column__body.kd-dropzone-active {
  background: var(--kd-soft-pond);
  outline: 2px dashed rgba(45, 142, 167, 0.45);
  outline-offset: -4px;
}
.kd-kanban-column__empty {
  font-size: 0.82rem;
  color: var(--kd-muted);
  padding: 14px 6px;
  text-align: center;
  font-style: italic;
}

/* Collapsed Sleeping column: subdued, drop-target-only by default. */
.kd-kanban-column--collapsed {
  background: var(--kd-cream-deep);
  border-style: dashed;
}
.kd-kanban-column--collapsed .kd-kanban-column__header { color: var(--kd-muted); }

.kd-kanban-column__reveal {
  display: block;
  padding: 14px 8px;
  text-align: center;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--kd-pond-ink);
  text-decoration: none;
  border-radius: var(--kd-radius-sm);
}
.kd-kanban-column__reveal:hover {
  background: rgba(45, 142, 167, 0.08);
  color: var(--kd-deep-pond);
}

/* Per-state column accent — narrow color cue, not a wall of color. */
.kd-kanban-column[data-state="sleeping"]   .kd-kanban-column__header { color: var(--kd-slate); }
.kd-kanban-column[data-state="incubating"] .kd-kanban-column__header { color: #3F6748; }
.kd-kanban-column[data-state="active"]     .kd-kanban-column__header { color: #6F4A0E; }
.kd-kanban-column[data-state="crunch"]     .kd-kanban-column__header { color: #3D2773; }

/* Cards inside the kanban: tighter than the regular .kd-darling. */
.kd-kanban .kd-darling {
  padding: 12px 14px;
  cursor: grab;
}
.kd-kanban .kd-darling:active { cursor: grabbing; }

/* SortableJS classes — keep them subtle. */
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { box-shadow: var(--kd-shadow-lift); }
.sortable-drag   { opacity: 0.95; transform: rotate(0.5deg); }
.kd-section-title {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 10px 0;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--kd-deep-pond);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.kd-section-title .kd-count {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--kd-muted);
  letter-spacing: 0.02em;
  text-transform: none;
}


/* ----------  Page header (boards)  ------------------------------------- */

.kd-pageheader {
  margin: 28px 0 28px 0;
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px;
}
.kd-pageheader h1 { margin: 0; }
.kd-pageheader .lede { margin: 6px 0 0 0; max-width: 56ch; }

.kd-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px;
}


/* ----------  Money decision panel  ------------------------------------- */

.kd-money {
  background: var(--kd-deep-pond);
  color: var(--kd-cream);
  border-radius: var(--kd-radius-lg);
  padding: 36px;
}
.kd-money h1, .kd-money h2 { color: var(--kd-cream); }
.kd-money .kd-money__statement {
  font-size: 1rem;
  line-height: 1.5;
  border-left: 2px solid rgba(255,255,255,0.18);
  padding-left: 14px;
  margin: 0 0 24px 0;
  color: rgba(255,255,255,0.78);
}
.kd-money__field {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--kd-radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.kd-money__field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 6px;
}
.kd-money__field input,
.kd-money__field textarea {
  width: 100%;
  background: transparent;
  border: 0; outline: 0;
  color: var(--kd-cream);
  font-size: 1rem;
  resize: none;
}
.kd-money__field input::placeholder,
.kd-money__field textarea::placeholder { color: rgba(255,255,255,0.4); }


/* ----------  Celebration  ---------------------------------------------- */

.kd-celebrate {
  position: relative;
  text-align: center;
  padding: 56px 20px;
  background: var(--kd-shirt);
  border: 1px solid rgba(20, 89, 106, 0.06);
  border-radius: var(--kd-radius-lg);
  overflow: hidden;
}
.kd-celebrate__alfred {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--kd-cream-deep);
  border: 1.5px solid var(--kd-suit);
  display: inline-grid; place-items: center;
  margin-bottom: 18px;
  animation: alfred-nod 2200ms ease-in-out infinite;
}
.kd-celebrate__alfred img { width: 92%; height: 92%; object-fit: contain; }
.kd-celebrate h1 { font-size: clamp(2.2rem, 4vw, 3.2rem); }

@keyframes alfred-nod {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(3deg) translateY(-2px); }
}

/* Confetti — small, tasteful, slow drift */
.kd-confetti {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.kd-confetti span {
  position: absolute;
  top: -24px;
  width: 10px; height: 14px;
  border-radius: 2px;
  opacity: 0.85;
  animation: confetti-drift 6s linear infinite;
}
.kd-confetti span:nth-child(1)  { left: 12%; background: var(--kd-alfred);   animation-delay: 0s; }
.kd-confetti span:nth-child(2)  { left: 24%; background: var(--kd-pond);     animation-delay: 1.1s; }
.kd-confetti span:nth-child(3)  { left: 38%; background: var(--kd-alfred);   animation-delay: 1.8s; transform: rotate(40deg); }
.kd-confetti span:nth-child(4)  { left: 52%; background: var(--kd-pond);     animation-delay: 0.6s; }
.kd-confetti span:nth-child(5)  { left: 66%; background: var(--kd-alfred);   animation-delay: 2.2s; transform: rotate(-30deg); }
.kd-confetti span:nth-child(6)  { left: 80%; background: var(--kd-pond);     animation-delay: 0.3s; }

@keyframes confetti-drift {
  0%   { transform: translateY(0) rotate(0); opacity: 0; }
  10%  { opacity: 0.85; }
  100% { transform: translateY(120vh) rotate(540deg); opacity: 0; }
}


/* ----------  Empty / quiet states  ------------------------------------- */

.kd-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--kd-shirt);
  border-radius: var(--kd-radius-lg);
  border: 1px solid rgba(20, 89, 106, 0.08);
}
.kd-empty__alfred {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--kd-cream-deep);
  border: 1.5px solid var(--kd-suit);
  display: inline-grid; place-items: center;
  margin-bottom: 14px;
}
.kd-empty__alfred img { width: 86%; height: 86%; object-fit: contain; }


/* ----------  Footer  ---------------------------------------------------- */

.kd-footer {
  margin-top: 64px;
  padding: 28px 0;
  border-top: 1px solid rgba(20, 24, 29, 0.18);
  background: var(--kd-cream-deep);
  font-size: 0.92rem;
  color: var(--kd-slate);
}
.kd-footer .kd-footer__pond {
  color: var(--kd-pond-ink);
  font-weight: 500;
}
.kd-footer .kd-footer__phase {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--kd-shirt);
  color: var(--kd-pond-ink);
  border: 1px solid var(--kd-mist);
  padding: 2px 10px;
  border-radius: var(--kd-radius-pill);
}


/* ----------  Utilities  ------------------------------------------------- */

.kd-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(20,89,106,0.16), transparent);
  border: 0;
  margin: 24px 0;
}

.kd-quiet { color: var(--kd-slate); }
.kd-muted { color: var(--kd-muted); }
.kd-pond  { color: var(--kd-pond-ink); }

.kd-tag {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  padding: 2px 10px;
  border-radius: var(--kd-radius-pill);
  background: var(--kd-cloud);
  color: var(--kd-slate);
}

.kd-kbd {
  font-family: var(--kd-font-mono);
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--kd-cream-deep);
  color: var(--kd-slate);
  border: 1px solid rgba(20, 89, 106, 0.10);
}


/* ============================================================
   Landing page — editorial / concierge-desk treatment.
   Scoped under body.kd-landing so nothing leaks to the app.

   Voice: a quiet hotel directory printed on warm paper.
   - Display: Fraunces (variable serif, soft italics for the title hits)
   - Body:    Newsreader (literary serif for the lede + memo)
   - Labels:  IBM Plex Mono in caps with letter-spacing (kept from base)

   Colour comes from the existing tokens (--kd-cream, --kd-pond-ink, etc.).
   One bold accent: a stamp red for marks/seals, mixed locally below.
   ============================================================ */

body.kd-landing {
  --kd-stamp:        #B23A2B;     /* aged ink-stamp red — for marks only */
  --kd-paper-edge:   #E5D9B0;     /* old-paper border line */
  --kd-paper-shade:  rgba(20,89,106,0.06);

  background:
    radial-gradient(1200px 600px at 100% -10%,
                    var(--kd-soft-pond) 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%,
                    var(--kd-cream-deep) 0%, transparent 55%),
    var(--kd-cream);
}

/* Drop the default content container constraint — the landing is its
   own document layout. Other pages keep .container behaviour. */
body.kd-landing main.container {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* Optional paper grain overlay. Inline SVG noise filter, fixed-position
   so it doesn't scroll. Very subtle — 4% alpha. */
.kd-landing__paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0 0.04 0 0 0 0.85 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* Document wrapper — the long sheet of paper. */
.kd-landing__doc {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 28px 80px;
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  color: var(--kd-ink);
}

/* ---- Cover photograph (cinemascope band) ------------------------ */
/* Sits above the masthead, full-bleed. A soft cream vignette top + bottom
   makes the photo melt into the paper instead of stamping on it. */
.kd-landing__cover-band {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  padding: 0;
  width: 100%;
  overflow: hidden;
  background: var(--kd-cream);
}
.kd-landing__cover-band img {
  display: block;
  width: 100%;
  height: clamp(280px, 38vw, 540px);
  object-fit: cover;
  object-position: center center;
  /* Slow Ken Burns drift on load — a few percent of scale over a long
     duration so the page feels alive but never restless. */
  transform: scale(1.04);
  animation: kd-landing-drift 22s ease-out forwards;
}

.kd-landing__cover-caption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  max-width: 1180px;
  margin: 8px auto 0;
  padding: 0 28px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.88rem;
  color: var(--kd-slate);
}
.kd-landing__cover-caption span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--kd-stamp);
  align-self: center;
}
.kd-landing__cover-caption em { font-style: italic; }

@keyframes kd-landing-drift {
  from { transform: scale(1.06); }
  to   { transform: scale(1.0);  }
}
@media (prefers-reduced-motion: reduce) {
  .kd-landing__cover-band img { animation: none; transform: none; }
}

/* ---- Establishment plate ---------------------------------------- */

.kd-landing__plate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  margin: 0 0 38px;
  border-top: 1px solid var(--kd-paper-edge);
  border-bottom: 1px solid var(--kd-paper-edge);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--kd-slate);
}
.kd-landing__plate-mark {
  color: var(--kd-stamp);
  font-size: 1.05rem;
  line-height: 1;
}
.kd-landing__plate-rule {
  flex: 1 1 30px;
  height: 1px;
  background: var(--kd-paper-edge);
  min-width: 30px;
}

/* ---- Eyebrow + dot label ---------------------------------------- */

.kd-landing__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--kd-pond-ink);
}
.kd-landing__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--kd-stamp);
  display: inline-block;
}

/* ---- HERO -------------------------------------------------------- */

.kd-landing__hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 60px;
  align-items: center;
  padding: 28px 0 48px;
}
@media (max-width: 880px) {
  .kd-landing__hero { grid-template-columns: 1fr; gap: 36px; }
}

.kd-landing__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 360;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--kd-deep-pond);
  margin: 0 0 22px;
}
.kd-landing__title-line {
  display: block;
  opacity: 0;
  transform: translateY(14px);
  animation: kd-landing-rise 700ms cubic-bezier(.2,.7,.2,1) forwards;
}
.kd-landing__title-line:nth-child(1) { animation-delay: 60ms; }
.kd-landing__title-line:nth-child(2) { animation-delay: 220ms; }
.kd-landing__title-line:nth-child(3) { animation-delay: 380ms; }
.kd-landing__title-line--accent em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--kd-pond-ink);
  position: relative;
  padding: 0 0.06em;
}
.kd-landing__title-line--accent em::after {
  /* hand-drawn underline, sketched on after the title rises */
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0.04em;
  height: 0.18em;
  background: var(--kd-alfred);
  border-radius: 50%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: -1;
  animation: kd-landing-underline 700ms cubic-bezier(.7,.05,.3,1) 700ms forwards;
}
.kd-landing__title-rule {
  display: block;
  width: 84px;
  height: 1px;
  margin: 22px 0 18px;
  background: var(--kd-paper-edge);
  opacity: 0;
  animation: kd-landing-fade 600ms ease forwards 600ms;
}
.kd-landing__title-coda {
  display: block;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  color: var(--kd-slate);
  letter-spacing: 0;
  opacity: 0;
  animation: kd-landing-fade 600ms ease forwards 800ms;
}

.kd-landing__lede {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--kd-slate);
  max-width: 52ch;
  margin: 28px 0 30px;
  opacity: 0;
  animation: kd-landing-fade 600ms ease forwards 950ms;
}

.kd-landing__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 36px;
  opacity: 0;
  animation: kd-landing-fade 600ms ease forwards 1100ms;
}

/* ---- Buttons ----------------------------------------------------- */

.kd-landing__btn {
  --btn-pad-y: 14px;
  --btn-pad-x: 22px;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 480;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease,
              background 180ms ease, color 180ms ease;
  position: relative;
  isolation: isolate;
}
.kd-landing__btn--primary {
  background: var(--kd-deep-pond);
  color: var(--kd-cream);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.4) inset,
    0 8px 22px -10px rgba(20,89,106,0.65),
    0 1px 0 var(--kd-deep-pond);
}
.kd-landing__btn--primary:hover {
  transform: translateY(-1px);
  background: var(--kd-pond-ink);
  color: var(--kd-cream);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,0.45) inset,
    0 14px 28px -12px rgba(20,89,106,0.75),
    0 1px 0 var(--kd-pond-ink);
}
.kd-landing__btn--ghost {
  background: transparent;
  color: var(--kd-deep-pond);
  border: 1px solid var(--kd-paper-edge);
}
.kd-landing__btn--ghost:hover {
  background: var(--kd-cream-deep);
  border-color: var(--kd-pond-ink);
  color: var(--kd-pond-ink);
}
.kd-landing__btn--big {
  --btn-pad-y: 18px;
  --btn-pad-x: 30px;
  font-size: 1.12rem;
}
.kd-landing__btn-arrow {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 400;
  transition: transform 220ms cubic-bezier(.2,.7,.2,1);
}
.kd-landing__btn:hover .kd-landing__btn-arrow {
  transform: translateX(4px);
}

/* ---- Tiny seal beneath the CTAs --------------------------------- */

.kd-landing__seal {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 44ch;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--kd-slate);
  margin: 0;
  opacity: 0;
  animation: kd-landing-fade 600ms ease forwards 1250ms;
}
.kd-landing__seal-num {
  flex: 0 0 auto;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 3rem;
  line-height: 1;
  color: var(--kd-stamp);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  letter-spacing: -0.02em;
}

/* ---- Hero figure: Alfred concierge bell ------------------------- */

.kd-landing__hero-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.kd-landing__bell {
  position: relative;
  width: min(440px, 88vw);
  aspect-ratio: 1;
  margin: 0 auto;
  opacity: 0;
  transform: scale(0.96);
  animation: kd-landing-pop 900ms cubic-bezier(.2,.7,.2,1) forwards 200ms;
}
/* concentric ripple rings */
.kd-landing__bell-rings {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 41%, var(--kd-paper-edge) 41% 41.4%, transparent 41.4% 50%),
    radial-gradient(circle, transparent 0 47%, var(--kd-paper-edge) 47% 47.3%, transparent 47.3% 60%);
  opacity: 0.6;
}
.kd-landing__bell-pond {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #FFFFFF 0%, var(--kd-soft-pond) 55%, var(--kd-pond) 105%);
  box-shadow:
    inset 0 8px 24px rgba(255,255,255,0.55),
    inset 0 -10px 40px rgba(14,61,73,0.18),
    0 30px 60px -28px rgba(20,89,106,0.55),
    0 6px 14px -8px rgba(20,89,106,0.25);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.kd-landing__bell-pond img {
  width: 78%;
  height: auto;
  margin-bottom: -2%;
  filter: drop-shadow(0 14px 18px rgba(14,61,73,0.32));
  transition: transform 600ms cubic-bezier(.2,.7,.2,1);
}
.kd-landing__bell:hover .kd-landing__bell-pond img {
  transform: rotate(-2.4deg) translateY(-3%);
}
/* circular stamp text */
.kd-landing__bell-stamp {
  position: absolute;
  inset: -2%;
  pointer-events: none;
  animation: kd-landing-stamp-spin 80s linear infinite;
}
.kd-landing__bell-stamp-svg { width: 100%; height: 100%; overflow: visible; }
.kd-landing__bell-stamp-text {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9.4px;
  letter-spacing: 0.32em;
  fill: var(--kd-pond-ink);
  text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
  .kd-landing__bell-stamp { animation: none; }
}

.kd-landing__caption {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 0.86rem;
  color: var(--kd-muted);
  display: inline-flex;
  gap: 8px;
  margin: 8px 0 0;
}
.kd-landing__caption span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--kd-stamp);
  align-self: center;
}
.kd-landing__caption em { font-style: italic; }

/* ---- Ornament between sections ---------------------------------- */

.kd-landing__ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, 70%);
  margin: 56px auto;
  color: var(--kd-paper-edge);
}
.kd-landing__ornament span:first-child,
.kd-landing__ornament span:last-child {
  flex: 1;
  height: 1px;
  background: var(--kd-paper-edge);
  display: block;
}
.kd-landing__ornament-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--kd-stamp);
  flex: 0 0 auto;
  box-shadow: 0 0 0 5px rgba(178,58,43,0.06);
}

/* ---- Section headers -------------------------------------------- */

.kd-landing__section-head {
  margin: 0 0 36px;
}
.kd-landing__h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 380;
  font-variation-settings: "SOFT" 50, "opsz" 144;
  font-size: clamp(1.7rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  color: var(--kd-deep-pond);
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 24ch;
}

/* ---- Principles (i. ii. iii.) ----------------------------------- */

.kd-landing__principles {
  padding: 24px 0 36px;
}
.kd-landing__principles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 36px;
  counter-reset: principle;
}
@media (max-width: 760px) {
  .kd-landing__principles-list { grid-template-columns: 1fr; }
}
.kd-landing__principles-list li {
  border-top: 1px solid var(--kd-paper-edge);
  padding: 18px 0 0;
  position: relative;
}
.kd-landing__roman {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 1.6rem;
  color: var(--kd-stamp);
  display: block;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}
.kd-landing__principles-list h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 460;
  font-size: 1.32rem;
  line-height: 1.18;
  color: var(--kd-deep-pond);
  margin: 0 0 10px;
}
.kd-landing__principles-list p {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--kd-slate);
  margin: 0;
}

/* ---- Council ---------------------------------------------------- */

.kd-landing__council {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 60px;
  align-items: center;
  padding: 48px 0;
}
@media (max-width: 880px) {
  .kd-landing__council { grid-template-columns: 1fr; gap: 32px; }
}
.kd-landing__body {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--kd-slate);
  margin: 0 0 16px;
  max-width: 50ch;
}
.kd-landing__inline-link {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 460;
  color: var(--kd-pond-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--kd-paper-edge);
  padding-bottom: 2px;
  transition: border-color 200ms ease, color 200ms ease;
}
.kd-landing__inline-link:hover {
  color: var(--kd-deep-pond);
  border-color: var(--kd-pond-ink);
}
.kd-landing__inline-link span { display: inline-block; transition: transform 200ms; }
.kd-landing__inline-link:hover span { transform: translateX(4px); }

.kd-landing__council-row {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 14px;
}
@media (max-width: 560px) {
  .kd-landing__council-row { grid-template-columns: repeat(3, 1fr); }
}
.kd-landing__council-row li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.kd-landing__council-row img {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  background: var(--kd-cream-deep);
  box-shadow: 0 6px 14px -8px rgba(20,89,106,0.35);
  transition: transform 320ms cubic-bezier(.2,.7,.2,1),
              box-shadow 320ms;
}
.kd-landing__council-row li:hover img {
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 14px 26px -10px rgba(20,89,106,0.55);
}
.kd-landing__council-row span {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--kd-slate);
}

/* ---- Memo + Not-this two-up ------------------------------------- */

.kd-landing__memo-section {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 56px 0;
}
@media (max-width: 880px) {
  .kd-landing__memo-section { grid-template-columns: 1fr; gap: 40px; }
}

.kd-landing__memo {
  background: var(--kd-cream-deep);
  border: 1px solid var(--kd-paper-edge);
  padding: 26px 28px 22px;
  position: relative;
  font-family: 'Newsreader', Georgia, serif;
  color: var(--kd-ink);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 12px 24px -16px rgba(20,89,106,0.18);
  transform: rotate(-0.6deg);
}
.kd-landing__memo::before,
.kd-landing__memo::after {
  /* hairline corner notches like an old memo pad */
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--kd-paper-edge);
}
.kd-landing__memo::before { top: 6px;    left: 6px;    border-right: 0; border-bottom: 0; }
.kd-landing__memo::after  { bottom: 6px; right: 6px;   border-left: 0;  border-top: 0;    }
.kd-landing__memo-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px; margin: 0 0 18px;
  border-bottom: 1px dashed var(--kd-paper-edge);
  padding-bottom: 10px;
}
.kd-landing__memo-stamp {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--kd-stamp);
  border: 1px solid var(--kd-stamp);
  padding: 3px 7px;
  border-radius: 3px;
  transform: rotate(-3deg);
}
.kd-landing__memo-meta {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  color: var(--kd-slate);
  font-size: 0.92rem;
}
.kd-landing__memo p {
  font-size: 1.04rem;
  line-height: 1.6;
  margin: 0 0 12px;
}
.kd-landing__memo p em { font-style: italic; color: var(--kd-pond-ink); }
.kd-landing__memo-foot { text-align: right; margin-top: 8px; }
.kd-landing__memo-sig {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  color: var(--kd-deep-pond);
}

.kd-landing__not-this ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--kd-deep-pond);
}
.kd-landing__not-this li {
  position: relative;
  padding-left: 1.6em;
  font-style: italic;
  font-weight: 400;
}
.kd-landing__not-this li::before {
  content: "✕";
  position: absolute;
  left: 0; top: 0.04em;
  color: var(--kd-stamp);
  font-style: normal;
  font-size: 0.86em;
  letter-spacing: 0;
}

/* ---- Closing CTA ------------------------------------------------- */

.kd-landing__close {
  text-align: center;
  padding: 80px 0 60px;
  border-top: 1px solid var(--kd-paper-edge);
  margin-top: 36px;
}
.kd-landing__close-eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--kd-stamp);
  margin: 0 0 14px;
}
.kd-landing__close-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 360;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  color: var(--kd-deep-pond);
  letter-spacing: -0.02em;
  margin: 0 0 30px;
}
.kd-landing__close-title em {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  color: var(--kd-pond-ink);
}
.kd-landing__close-fine {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--kd-muted);
  margin: 22px 0 0;
}

/* ---- Animations -------------------------------------------------- */

@keyframes kd-landing-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes kd-landing-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes kd-landing-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes kd-landing-underline {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes kd-landing-stamp-spin {
  to { transform: rotate(360deg); }
}

/* Reduced motion: honour the global override; also kill the staggered
   reveals so content is visible immediately. */
@media (prefers-reduced-motion: reduce) {
  .kd-landing__title-line,
  .kd-landing__title-rule,
  .kd-landing__title-coda,
  .kd-landing__lede,
  .kd-landing__ctas,
  .kd-landing__seal,
  .kd-landing__bell {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}


/* ----------  Reduced motion  ------------------------------------------- */

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