/* Visit Kisoro — design system
   Motion follows the design-engineering rules: custom ease-out curves,
   nothing over 250ms, hover gated to fine pointers, reduced-motion honoured. */

:root {
  --paper: #faf8f3;
  --paper-2: #f2eee4;
  --ink: #17140f;
  --ink-2: #4a453b;
  --ink-3: #7d7668;
  --rule: #ddd6c7;
  --accent: #a2451c;
  --ledger: #1f4733;
  --ledger-bg: #eef2ec;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 1.5rem 0 0.75rem;
}

.masthead-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 6vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}

.logo span { color: var(--accent); }

.dateline {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

nav.sections {
  display: flex;
  gap: 1.5rem;
  padding: 0.9rem 0 0;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

nav.sections a {
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  nav.sections a:hover { color: var(--accent); border-bottom-color: var(--accent); }
}

nav.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; line-height: 1.12; }

h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 0 0 0.5rem; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin: 2.75rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1.15rem; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.standfirst {
  font-size: 1.32rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 1.5rem;
}

.byline {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-3);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin: 0 0 2rem;
}

/* ---------- Front page grid ---------- */

.lede { padding: 2.5rem 0 1rem; border-bottom: 1px solid var(--rule); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--rule);
}

.grid article {
  padding: 1.75rem var(--gutter) 1.75rem 0;
  border-right: 1px solid var(--rule);
}

.grid article:last-child { border-right: none; padding-right: 0; }

.grid h3 { margin-top: 0; font-size: 1.32rem; }
.grid h3 a { color: var(--ink); text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .grid h3 a:hover { color: var(--accent); }
}

.grid p { font-size: 0.98rem; color: var(--ink-2); margin-bottom: 0; }

@media (max-width: 720px) {
  .grid article { border-right: none; border-bottom: 1px solid var(--rule); padding-right: 0; }
  .grid article:last-child { border-bottom: none; }
}

/* ---------- The number strip ---------- */

.strip {
  background: var(--ledger-bg);
  border-left: 3px solid var(--ledger);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--sans);
}

.strip-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ledger);
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.strip dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.9rem; margin: 0; }
.strip dt { font-size: 0.74rem; color: var(--ink-3); margin-bottom: 0.15rem; }
.strip dd { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.strip .note { font-size: 0.78rem; color: var(--ink-3); margin: 0.85rem 0 0; line-height: 1.5; }

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-family: var(--sans); font-size: 0.92rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem 0.65rem 0; border-bottom: 1px solid var(--rule); }
th { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
td { font-variant-numeric: tabular-nums; }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: transform 130ms var(--ease-out), background-color 150ms var(--ease-out), opacity 150ms var(--ease-out);
}

.btn:active { transform: scale(0.975); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--accent); border-color: var(--accent); }
}

.btn-ghost { background: transparent; color: var(--ink); }

@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}

/* ---------- Estimator ---------- */

.estimator {
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  font-family: var(--sans);
}

.estimator h3 { font-family: var(--serif); margin-top: 0; }

.field { margin: 0 0 1.1rem; }
.field label { display: block; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem; font-weight: 600; }

.field select, .field input[type="number"] {
  width: 100%;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 150ms var(--ease-out);
}

.field select:focus, .field input:focus { outline: none; border-color: var(--ink); }

input[type="range"] { width: 100%; accent-color: var(--ledger); }

.readout {
  border-top: 1px solid var(--rule);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}

.readout-value {
  font-family: var(--serif);
  font-size: clamp(2rem, 7vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ledger);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  transition: color 150ms var(--ease-out);
}

.readout-sub { font-size: 0.85rem; color: var(--ink-3); margin-top: 0.3rem; }

/* ---------- The footer line that does the work ---------- */

.ownership {
  border-top: 2px solid var(--ink);
  margin: 3rem 0 0;
  padding: 1.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.6;
}

.ownership strong { color: var(--ink); }

/* ---------- Locked watchlist ---------- */

.locked { position: relative; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin: 2rem 0; }
.locked-inner { padding: 1.5rem; filter: blur(4px); opacity: 0.5; user-select: none; pointer-events: none; font-family: var(--sans); font-size: 0.95rem; }
.locked-veil { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1.5rem; background: rgba(250, 248, 243, 0.55); }
.locked-veil p { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-2); max-width: 34ch; margin: 0 auto 1rem; }

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

footer.site {
  border-top: 1px solid var(--ink);
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-3);
}

footer.site a { color: var(--ink-2); }
footer.site .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }

article.body { padding: 2.5rem 0 0; }

.verified { font-family: var(--sans); font-size: 0.78rem; color: var(--ink-3); font-style: normal; border-left: 2px solid var(--rule); padding-left: 0.85rem; margin: 2rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 60ms !important; animation: none !important; }
  .btn:active { transform: none; }
}
