/* H Capital: site stylesheet. Palette and type follow the approved redesign; the layout is fluid
   (fixed 1440px design -> desktop, tablet and phone). Breakpoints: 1000px, 720px. */

:root {
  --bg: #101112;
  --text: #e9e8e4;
  --gold: #c3ad7c;
  --gold-hover: #e0cfa3;
  --border: #2a2b2e;
  --dash: #3a3b3f;
  --card: #16171a;
  --cover: #1c1d20;
  --muted: #b9b7b1;
  --muted-2: #a3a19b;
  --muted-3: #8f8d87;
  --list: #d4d2cc;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 6.7vw, 96px);
  --section: clamp(56px, 7.6vw, 110px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
::selection { background: #776541; color: #fff; }
button { font: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--gold); color: var(--bg); padding: 10px 16px; z-index: 10; }
.skip:focus { left: 8px; }

/* Layout: full-width bands (their borders span the screen) around a centred, padded column. */
.in { max-width: 1440px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.band { border-bottom: 1px solid var(--border); }
.band-top { border-top: 1px solid var(--border); }
.block { padding-top: var(--section); padding-bottom: var(--section); }
.gold { color: var(--gold); }

/* Header and footer */
.header { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; padding-top: 28px; padding-bottom: 28px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-name { font-family: var(--serif); font-size: 22px; letter-spacing: 6px; }
.brand-tag { font-size: 11px; letter-spacing: 3px; color: var(--muted-2); }
.nav { display: flex; gap: 40px; font-size: 15px; letter-spacing: 1px; flex-wrap: wrap; }
.nav a { color: var(--text); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px 32px; flex-wrap: wrap; padding-top: 40px; padding-bottom: 40px; font-size: 14px; color: var(--muted-3); }
.footer-brand { font-family: var(--serif); font-size: 18px; letter-spacing: 5px; color: var(--text); }
.footer-brand:hover { color: var(--text); }

/* Type */
.kicker { font-size: 13px; letter-spacing: 4px; color: var(--gold); }
.kicker-small { font-size: 13px; letter-spacing: 3px; color: var(--muted-2); }
h1 { font-family: var(--serif); font-weight: 400; line-height: 1.06; }
h2 { font-family: var(--serif); font-weight: 400; line-height: 1.15; font-size: clamp(30px, 3.4vw, 48px); }

/* Buttons and links */
.actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 30px; background: var(--gold); color: var(--bg); font-size: 16px; letter-spacing: 1px; border: 1px solid var(--gold); }
.btn:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--bg); }
.btn-outline { background: transparent; color: var(--gold); }
.btn-outline:hover { background: rgba(195, 173, 124, 0.12); color: var(--gold-hover); border-color: var(--gold-hover); }
.head-link { font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
.back { font-size: 15px; letter-spacing: 1px; }

/* Home: hero */
.hero { padding-top: clamp(72px, 10.4vw, 150px); padding-bottom: clamp(64px, 9vw, 130px); display: flex; flex-direction: column; gap: clamp(24px, 2.5vw, 36px); }
.hero h1 { font-size: clamp(38px, 5.8vw, 84px); max-width: 1080px; }
.hero-lede { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.6; color: var(--muted); max-width: 760px; }
.hero .actions { padding-top: 12px; }

/* Section heads */
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-bottom: clamp(32px, 3.4vw, 48px); }
.block-head > div { display: flex; flex-direction: column; gap: 14px; }

/* Cards */
.cards { display: grid; gap: 28px; }
.cards-tools { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.cards-lib { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.meta-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; letter-spacing: 2px; color: var(--muted-2); }
.tool-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); color: var(--text); }
.tool-card:hover { border-color: var(--gold); color: var(--text); }
.tool-card-body { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.tool-card-body .meta-row { font-size: 13px; }
.card-title { font-family: var(--serif); font-size: 26px; line-height: 1.25; }
.tool-card-body p, .lib-card p { font-size: 16px; line-height: 1.6; color: var(--muted); }
/* Tool covers: 16:9 images (width/height are set in the markup, so there is no layout shift). */
.cover { background: var(--bg); aspect-ratio: 16 / 9; overflow: hidden; } /* image covers have no border; the artwork sits on the page background */
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A tool with no image yet: a plain panel with its name. */
.cover-fallback { display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; background: var(--cover); border: 1px solid var(--border); }
.cover-fallback span { font-family: var(--serif); color: var(--gold); line-height: 1.2; }
.cover-card.cover-fallback span { font-size: 26px; }
.cover-large.cover-fallback span { font-size: clamp(26px, 2.4vw, 34px); }
.lib-card { display: flex; flex-direction: column; gap: 18px; padding: 32px; border: 1px solid var(--border); color: var(--text); min-height: 300px; }
a.lib-card:hover { border-color: var(--gold); color: var(--text); }
.serif-lg { font-size: 28px; }
.card-date { margin-top: auto; font-size: 13px; color: var(--muted-3); }

/* Home: why */
.why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6.7vw, 96px); }
.why-text { display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.why-text p { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.7; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.step { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--gold); }
.step-n { font-size: 13px; letter-spacing: 2px; color: var(--gold); }
.step-name { font-family: var(--serif); font-size: 24px; }
.step-text { font-size: 16px; line-height: 1.6; color: var(--muted); }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px 32px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(30px, 3vw, 44px); }

/* Page heroes (Tools, Library, 404) */
.page-hero { padding-top: clamp(64px, 8.3vw, 120px); padding-bottom: clamp(40px, 5vw, 72px); display: flex; flex-direction: column; gap: 28px; align-items: flex-start; }
.page-hero h1 { font-size: clamp(36px, 5vw, 72px); max-width: 980px; }
.page-lede { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; color: var(--muted); max-width: 780px; }
.pledges { display: flex; gap: 12px 48px; flex-wrap: wrap; padding-top: 20px; font-size: 14px; letter-spacing: 2px; color: var(--muted-2); }

/* Tools page */
.tools-list { display: flex; flex-direction: column; }
.tool { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); padding: clamp(40px, 5vw, 72px) 0; border-top: 1px solid var(--border); }
.tool:last-child { border-bottom: 1px solid var(--border); }
.tool-text { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.tool-text h2 { font-size: clamp(30px, 3vw, 44px); }
.tool-desc { font-size: clamp(16px, 1.25vw, 18px); line-height: 1.65; color: var(--muted); }
.tool-features { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.5; color: var(--list); }
.facts { align-self: stretch; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 14px; }
.facts > div { display: flex; flex-direction: column; gap: 6px; }
.facts dt { letter-spacing: 2px; color: var(--muted-3); }
.strip { display: flex; justify-content: space-between; align-items: center; gap: 24px 48px; flex-wrap: wrap; padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(48px, 6vw, 96px); }
.strip p { font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 760px; }

/* Library page */
.library-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px 32px; flex-wrap: wrap; padding-bottom: 32px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; }
.filters[hidden] { display: none; }
.filters button { min-height: 44px; padding: 0 20px; font-size: 15px; letter-spacing: 1px; cursor: pointer; background: transparent; color: var(--list); border: 1px solid var(--dash); }
.filters button:hover { border-color: var(--gold); }
.filters button[aria-pressed="true"] { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.filters .count { opacity: 0.7; }
.count-label { font-size: 14px; color: var(--muted-3); }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 48px; padding: 44px 0; border-bottom: 1px solid var(--border); color: var(--text); align-items: start; }
a.row:hover { color: var(--text); }
.row:last-child { border-bottom: 0; }
a.row:hover .row-title { color: var(--gold); }
.row[hidden] { display: none; }
.row-id { display: flex; flex-direction: column; gap: 10px; font-size: 13px; letter-spacing: 2px; }
.row-cat { color: var(--muted-2); }
.row-main { display: flex; flex-direction: column; gap: 14px; }
.row-title { font-family: var(--serif); font-size: clamp(24px, 2.2vw, 32px); line-height: 1.2; }
.row-summary { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 720px; }
.row-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; font-size: 13px; letter-spacing: 2px; color: var(--list); }
.row-date { color: var(--muted-3); letter-spacing: 0; }
.meanings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; align-content: start; }
.meaning { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 16px; line-height: 1.6; color: var(--muted); }
.meaning-name { font-size: 13px; letter-spacing: 2px; color: var(--list); }
.meaning-name.gold { color: var(--gold); }

/* Research detail pages */
.paper-head { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(40px, 5vw, 64px); display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.paper-head h1 { font-size: clamp(34px, 4.4vw, 62px); max-width: 980px; }
.paper-meta { display: flex; gap: 8px 24px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted-2); }
.status { font-size: 13px; letter-spacing: 2px; color: var(--list); }
.status.published { color: var(--gold); }
.previous { font-size: 14px; color: var(--muted-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dash); }
.previous:hover { color: var(--gold); text-decoration-color: var(--gold); }
.notice { border: 1px solid var(--dash); border-left: 3px solid var(--gold); padding: 16px 20px; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 780px; }
p.notice { margin-top: 40px; }
.paper-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding-top: clamp(40px, 5vw, 72px); padding-bottom: clamp(56px, 7vw, 110px); }
.paper-body aside { display: flex; flex-direction: column; gap: 12px; align-self: start; position: sticky; top: 24px; font-size: 15px; }
.paper-body aside .kicker { margin-bottom: 8px; }
.paper-body aside a { color: var(--muted); }
.paper-body aside a:hover { color: var(--gold); }
.paper-body article { display: flex; flex-direction: column; gap: 44px; align-items: flex-start; max-width: 760px; }
.paper-body article section { display: flex; flex-direction: column; gap: 14px; }
.paper-body article h2 { font-size: clamp(26px, 2.4vw, 32px); }
.paper-body article p { font-size: 17px; line-height: 1.75; color: var(--muted); }
.paper-body article p.notice { margin-top: 0; }

/* Tablet */
@media (max-width: 1000px) {
  .tool, .why { grid-template-columns: minmax(0, 1fr); }
  .why { gap: 56px; }
  .paper-body { grid-template-columns: minmax(0, 1fr); }
  .paper-body aside { position: static; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .paper-body aside .kicker { flex-basis: 100%; margin-bottom: 0; }
  .row { grid-template-columns: 160px minmax(0, 1fr); gap: 20px 32px; }
  .row-side { grid-column: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 20px; }
}

/* Phone */
@media (max-width: 720px) {
  .header { padding-top: 20px; padding-bottom: 20px; }
  .nav { gap: 8px 24px; font-size: 14px; }
  .brand-name { font-size: 20px; letter-spacing: 5px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .block-head { align-items: flex-start; }
  .steps, .meanings { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 32px 0; }
  .row-id { flex-direction: row; gap: 16px; flex-wrap: wrap; }
  .row-side { grid-column: auto; }
  .lib-card { padding: 24px; min-height: 0; }
  .tool-card-body { padding: 22px; }
  .btn { min-height: 48px; padding: 0 22px; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
  .cta { align-items: flex-start; }
}
