/* Plant Therapy theme: chalky pistachio ground, moss-black ink, one clay-rose accent.
   Loaded after the Tailwind CDN config on every page. Contrast pairs (WCAG):
   ink #14190F on ground #E4EAD3 = 14.5:1, secondary #3B4630 = 8.1:1, accent #9A4455 = 5.1:1.
   Dark: ground #10150D, text #E4EAD3 = 15:1, accent #E8A3AE = 9.1:1. */
:root {
  --ground: #e4ead3;
  --card: #f4f7ea;
  --ink: #14190f;
  --ink2: #3b4630;
  --rule: #a9b78c;
  --hover: #dce4c8;
  --accent: #9a4455;
  --on-accent: #f4f7ea;
}
.dark {
  --ground: #10150d;
  --card: #1a2214;
  --ink: #e4ead3;
  --ink2: #a9b596;
  --rule: #3b4630;
  --hover: #1a2214;
  --accent: #e8a3ae;
  --on-accent: #10150d;
}

html { scroll-padding-top: 5rem; }
body { background: var(--ground); color: var(--ink); font-family: 'Epilogue', system-ui, sans-serif; }
::selection { background: var(--accent); color: var(--on-accent); }

/* Visible focus on every interactive element */
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Square the soft SaaS shapes; avatars stay round */
.rounded-3xl, .rounded-2xl, .rounded-xl, .rounded-lg { border-radius: 2px !important; }
a.rounded-full, button.rounded-full, input.rounded-full, span.rounded-full, nav a.rounded-full {
  border-radius: 0 !important;
}
.card-lift:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(20, 25, 15, 0.45); }
.card-lift { border: 1px solid var(--rule); box-shadow: none !important; }

h1, h2, h3 { font-family: 'Epilogue', system-ui, sans-serif; letter-spacing: -0.025em; }
.prose h2, .prose h3 { letter-spacing: -0.02em; }

/* Section labels: mono caption with a rose rule, not a pill */
.mono-label,
.uppercase.tracking-widest.rounded-full {
  font-family: 'Fragment Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}
.uppercase.tracking-widest.rounded-full {
  background: transparent !important;
  padding: 0.5rem 0 0 !important;
  border-top: 3px solid var(--accent);
}

/* Hero */
.hero-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 7vw, 6.4rem);
  line-height: 0.93;
  letter-spacing: -0.045em;
  color: var(--ink);
  margin: 0;
}

.btn-solid, .btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.95rem 1.15rem; font-weight: 600; white-space: nowrap; transition: background 0.2s, color 0.2s, gap 0.2s;
  border: 2px solid var(--ink);
}
.btn-solid { background: var(--ink); color: var(--ground); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); gap: 0.8rem; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--ground); }

/* Signature object: article index with read-time bars */
.ledger { margin: 0; border-top: 3px solid var(--ink); }
.ledger-head { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--ink); }
.ledger-head .mono-label { color: var(--ink2); }
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-row {
  display: grid;
  grid-template-columns: 2rem 7.5rem minmax(0, 1fr) 8.5rem 10.5rem;
  gap: 0 1.25rem; align-items: center;
  padding: 0.8rem 0.5rem; border-bottom: 1px solid var(--rule);
  color: var(--ink); text-decoration: none; transition: background 0.2s;
}
.ledger-row:hover { background: var(--hover); }
.ledger-row:hover .ledger-title { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ledger-no, .ledger-type, .ledger-min {
  font-family: 'Fragment Mono', ui-monospace, monospace; font-size: 0.8125rem; color: var(--ink2);
}
.ledger-type { text-transform: uppercase; letter-spacing: 0.06em; }
.ledger-title { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.ledger-author { font-size: 0.875rem; color: var(--ink2); }
.ledger-time { display: grid; grid-template-columns: 1fr 3.6rem; align-items: center; gap: 0.6rem; }
.ledger-bar { display: block; height: 0.6rem; width: calc(var(--min) / 25 * 100%); background: var(--accent); min-width: 0.4rem; }
.ledger-min { text-align: right; }
.ledger-foot { margin: 0; padding: 0.9rem 0 0; font-size: 0.875rem; color: var(--ink2); }

@media (max-width: 1023px) {
  .ledger-row { grid-template-columns: 2rem minmax(0, 1fr) 7rem; grid-template-areas: "no type type" "title title title" "author author time"; gap: 0.2rem 0.75rem; padding: 0.9rem 0.25rem; }
  .ledger-no { grid-area: no; } .ledger-type { grid-area: type; }
  .ledger-title { grid-area: title; } .ledger-author { grid-area: author; } .ledger-time { grid-area: time; }
  .ledger-head-r { display: none; }
}

/* Research notes (was gradient stat cards) */
.notes .note { border-top: 3px solid var(--ink); padding: 1.5rem 1.5rem 2.25rem 0; }
.note-word { font-weight: 800; text-transform: uppercase; letter-spacing: -0.04em; line-height: 0.95; font-size: clamp(2.75rem, 5.4vw, 4.75rem); color: var(--ink); }
@media (min-width: 768px) { .notes .note + .note { border-left: 1px solid var(--rule); padding-left: 1.75rem; } }
.gradient-text { background: none; -webkit-text-fill-color: currentColor; color: var(--ink); }

/* Header */
.header-scrolled { background: var(--ground); box-shadow: 0 1px 0 var(--rule); }
.dark .header-scrolled { background: var(--ground); }

/* Article prose picks up the same ink */
.prose blockquote { border-left: 4px solid var(--accent) !important; border-radius: 0 !important; background: var(--card) !important; }
.prose blockquote::before { color: var(--accent) !important; opacity: 0.35; }
.prose a { text-decoration-color: var(--accent); }

::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 0; }

@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;
  }
  .animate-on-scroll, .animate-slide-up, .animate-fade-in { opacity: 1 !important; transform: none !important; }
}

/* Wordmark stays in the display face on every page */
header a > span, footer a > span { font-family: 'Epilogue', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.02em; }

.breadcrumb span, .dark .breadcrumb span { color: var(--ink2) !important; }
.breadcrumb span.text-primary { color: var(--ink) !important; }
.breadcrumb a, .dark .breadcrumb a { color: var(--ink2) !important; text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { color: var(--accent) !important; }
