/* Vitalis Foundation — site styles */
/* Self-hosted fonts (SIL Open Font License) */
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata.woff2") format("woff2-variations"), url("/assets/fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("/assets/fonts/public-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --slate: #24404b;
  --slate-2: #2f505c;
  --ink: #1c2e35;
  --ink-soft: #4a5d63;
  --clay: #e39b5e;        /* buttons, accents on dark */
  --clay-deep: #a65e28;   /* accent text on light */
  --cream: #f6eedb;
  --sage: #98a092;
  --rule: #dfe3df;
  --paper: #ffffff;
  --wash: #f4f6f4;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --wrap: 1140px;
  --gutter: clamp(20px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--paper); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }

/* Type scale */
.display { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 6vw, 72px); line-height: 1.04; letter-spacing: -0.02em; }
.h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -0.01em; }
.h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.25; }
.kicker { font-family: var(--sans); font-weight: 600; font-size: 15px; color: var(--clay-deep); margin-bottom: 14px; }
.on-dark .kicker { color: var(--clay); }
.lede { font-size: 19px; line-height: 1.7; }
.measure { max-width: 66ch; }
.muted { color: var(--ink-soft); }

/* Buttons */
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 16px;
  padding: 13px 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--clay); color: var(--ink); text-decoration: none;
}
.btn:hover { background: #eaa96f; }
.btn-dark { background: var(--slate); color: #fff; }
.btn-dark:hover { background: var(--slate-2); }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--slate); }
.brand img { width: 52px; height: 52px; }
.nav { display: flex; gap: 30px; list-style: none; padding: 0; }
.nav a { text-decoration: none; font-weight: 500; font-size: 16px; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--clay); }
.menu { display: none; }

@media (max-width: 760px) {
  .nav-desktop { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; font-weight: 600; padding: 10px 16px; border: 1px solid var(--rule); border-radius: 999px; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu .nav { position: absolute; right: 0; top: 52px; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 20px; min-width: 210px; box-shadow: 0 12px 30px rgba(28,46,53,.12); }
  .brand span { display: none; }
}

/* Hero */
.hero { background: var(--slate); color: #fff; overflow: hidden; position: relative; }
.hero .wrap { position: relative; padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }
.hero-copy { position: relative; z-index: 2; max-width: 640px; }
.hero .display { margin-bottom: 30px; }
.hero p { color: #dfe7e8; font-size: 18px; max-width: 62ch; }
.hero p + p { margin-top: 16px; }
.hero-art { position: absolute; z-index: 1; right: -120px; top: 50%; transform: translateY(-50%); width: min(540px, 46vw); color: var(--cream); opacity: .9; pointer-events: none; }
.hero-art path, .hero-art circle { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .leaf-mid { stroke: var(--clay); }
.hero-art .ring { opacity: .25; }
.hero-art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.6,.05,.3,1) forwards; }
.hero-art .d2 { animation-delay: .35s; } .hero-art .d3 { animation-delay: .7s; } .hero-art .d4 { animation-delay: 1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-art .draw { animation: none; stroke-dashoffset: 0; } }
@media (max-width: 1100px) { .hero-art { opacity: .35; } }
@media (max-width: 900px) { .hero-art { opacity: .12; right: -160px; width: 520px; } }

/* Sections */
.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-wash { background: var(--wash); }
.section-dark { background: var(--slate); color: #fff; }
.section-cream { background: var(--cream); }
.section-head { margin-bottom: 48px; }

/* What we do */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.pillar { border-top: 2px solid var(--ink); padding-top: 24px; }
.pillar .icon { width: 40px; height: 40px; color: var(--clay-deep); margin-bottom: 18px; }
.pillar .h3 { margin-bottom: 12px; }
.pillar p { color: var(--ink-soft); }
.icon path, .icon circle, .icon rect { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Why it matters */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.split .h2 { margin-bottom: 24px; }
.prose p + p { margin-top: 18px; }
.points { list-style: none; padding: 0; }
.points li { padding: 26px 0; border-top: 1px solid var(--sage); }
.points li:last-child { border-bottom: 1px solid var(--sage); }
.points .h3 { margin-bottom: 8px; }
.points p { color: var(--ink-soft); }
.after-points { margin-top: 32px; }

/* Motto */
.motto { font-family: var(--serif); font-weight: 600; font-size: clamp(44px, 6.4vw, 84px); line-height: 1; letter-spacing: -0.025em; color: var(--slate); margin-bottom: 28px; }
.motto-copy p { font-size: 19px; line-height: 1.7; }
.start { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 28px; }
.start .h3 { font-size: 26px; }
.stack > * + * { margin-top: 18px; }
.stack .h2 { font-size: clamp(26px, 2.6vw, 32px); }
.stack h3.h3 { margin-top: 36px; }

/* People teaser */
.person { display: grid; grid-template-columns: 180px 1fr; gap: 40px; align-items: center; }
.person img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; }
.person .h3 { font-size: 28px; margin-bottom: 4px; }
.person .cred { font-weight: 600; color: var(--clay-deep); margin-bottom: 12px; }
.person p.muted { margin-bottom: 20px; }

/* How you can help */
.helps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.help .icon { width: 40px; height: 40px; color: var(--clay); margin-bottom: 18px; }
.help .h3 { margin-bottom: 12px; }
.help p { color: #d5dfe1; }
.section-dark .h2 { color: #fff; }

/* Newsletter + forms */
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); align-items: start; }
.newsletter .h2 { margin-bottom: 20px; }
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .req { color: var(--clay-deep); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 12px 14px; background: #fff; border: 1px solid #b9c1bd; border-radius: 8px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--clay); outline-offset: 1px; border-color: var(--slate); }
.form-note { font-size: 14px; color: var(--ink-soft); }
.form-status { font-weight: 600; min-height: 1.6em; }
.form-status.ok { color: #2f6b45; }
.form-status.err { color: #a2372b; }
.hp { position: absolute; left: -9999px; }

/* Footer */
.site-footer { background: var(--ink); color: #c9d3d5; padding: 48px 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.site-footer .brand { color: #fff; }
.site-footer .nav a { color: #e6ecec; font-size: 15px; }
.site-footer small { font-size: 15px; }

/* Page title band (inner pages) */
.page-band { background: var(--slate); color: #fff; padding: clamp(56px, 7vw, 88px) 0; }
.page-band .display { font-size: clamp(38px, 5vw, 60px); }

/* Profile page */
.profile-hero .wrap { display: grid; grid-template-columns: 240px 1fr; gap: 48px; align-items: center; }
.profile-photo { width: 240px; height: 240px; border-radius: 50%; object-fit: cover; border: 5px solid var(--clay); }
.profile-hero .cred { font-size: 20px; font-weight: 600; color: var(--clay); margin-top: 14px; }
.profile-hero .role { color: #dfe7e8; margin-top: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; list-style: none; padding: 0; }
.tags li { font-size: 14px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.1); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.stat { padding: 26px 24px 26px 0; border-bottom: 1px solid var(--rule); }
.stat-num { font-family: var(--serif); font-weight: 600; font-size: 46px; line-height: 1; color: var(--slate); margin-bottom: 8px; }
.stat-label { color: var(--ink-soft); font-size: 15px; line-height: 1.45; max-width: 24ch; }
.fine { font-size: 14px; color: var(--ink-soft); margin-top: 18px; }

.timeline { list-style: none; padding: 0; }
.timeline li { padding: 20px 0; border-top: 1px solid var(--sage); }
.timeline li:last-child { border-bottom: 1px solid var(--sage); }
.timeline strong { display: block; font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.timeline span { color: var(--ink-soft); font-size: 16px; }

.contribs { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 56px; }
.contrib .when { font-weight: 600; color: var(--clay-deep); font-size: 15px; margin-bottom: 6px; }
.contrib .h3 { margin-bottom: 10px; }
.contrib p { color: var(--ink-soft); }
.contrib strong { color: var(--ink); }

.honours { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.honour { padding: 22px 26px; background: #fff; border-left: 4px solid var(--clay); }
.honour b { display: block; font-family: var(--serif); font-size: 19px; }
.honour span { color: var(--ink-soft); }

.pubs { list-style: none; padding: 0; }
.pubs li { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; padding: 18px 0; border-top: 1px solid var(--rule); }
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pub-title { font-weight: 600; }
.pub-meta { display: block; color: var(--ink-soft); font-size: 15px; margin-top: 2px; }
.pub-cites { font-weight: 600; color: var(--slate); white-space: nowrap; font-size: 15px; }
.links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* Responsive */
@media (max-width: 900px) {
  .pillars, .helps { grid-template-columns: 1fr; gap: 40px; }
  .split, .newsletter, .contribs { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .profile-hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .profile-photo { width: 170px; height: 170px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .form .row, .honours { grid-template-columns: 1fr; }
  .person { grid-template-columns: 1fr; gap: 24px; }
  .person img { width: 140px; height: 140px; }
  .stats { grid-template-columns: 1fr; }
  .pubs li { grid-template-columns: 1fr; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
