/* Melos Foundation — shared styles
   Palette sampled from the logo: plum -> magenta gradient, gold accent, navy ink. */

:root {
  --plum: #3e1a6e;
  --berry: #8e1c7c;
  --magenta: #e3257b;
  --gold: #d6a03a;
  --gold-soft: #f6e7c8;
  --pink-soft: #fde8f1;
  --ink: #1f1847;
  --muted: #5f5779;
  --paper: #fffbf6;
  --white: #ffffff;
  --line: #eadff0;

  --grad: linear-gradient(100deg, var(--plum) 0%, var(--berry) 45%, var(--magenta) 100%);
  --grad-gold: linear-gradient(100deg, var(--magenta) 0%, var(--gold) 100%);

  --display: "Nunito", system-ui, sans-serif;
  --body: "Nunito Sans", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;

  --wrap: 1160px;
  --radius: 22px;
  --shadow: 0 18px 50px -24px rgba(62, 26, 110, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--berry); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4.1rem); font-weight: 900; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 900; }
h3 { font-size: 1.35rem; font-weight: 800; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.eyebrow {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: .9rem;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  padding: .85em 1.6em; border-radius: 999px;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 12px 30px -12px rgba(227, 37, 123, .6); }
.btn-ghost { border-color: var(--plum); color: var(--plum); background: transparent; }
.btn-ghost:hover { background: var(--plum); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 251, 246, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  color: #fff; font-family: var(--display); font-weight: 900; font-size: 1.2rem;
}
.brand-name { font-family: var(--display); font-weight: 900; font-size: 1.25rem; letter-spacing: .02em; }
.brand-name small { display: block; font-size: .62rem; letter-spacing: .32em; font-weight: 700; color: var(--muted); margin-top: -2px; }
.nav-links { display: none; list-style: none; margin: 0; padding: 0; gap: 4px; align-items: center; }
.nav-links a {
  font-family: var(--display); font-weight: 700; text-decoration: none; color: var(--ink);
  padding: .5em .9em; border-radius: 999px; font-size: .98rem;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--pink-soft); color: var(--berry); }
.nav-links .btn { padding: .6em 1.2em; color: #fff; }
.nav-links .btn:hover { background: var(--grad); color: #fff; }
.nav-toggle {
  background: none; border: 0; padding: 10px; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 26px; height: 26px; }
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}
.nav-links.open {
  display: flex; flex-direction: column; align-items: stretch;
  position: absolute; top: 72px; left: 0; right: 0;
  background: var(--paper); padding: 12px 16px 20px; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.nav-links.open a { padding: .8em 1em; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
@media (min-width: 900px) { section { padding: 104px 0; } }
.section-tint { background: var(--white); }
.section-dark { background: var(--plum); color: #fff; position: relative; overflow: hidden; }
.section-dark .lede { color: rgba(255, 255, 255, .8); }
.section-dark .eyebrow { color: var(--gold); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 72px; position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; } .hero { padding: 64px 0 104px; } }
.hero h1 { margin-bottom: .35em; }
.hero-logo {
  background: #fff; border-radius: 32px; box-shadow: var(--shadow);
  padding: 8px; position: relative;
}
.hero-logo img { border-radius: 26px; }
.hero-tag {
  font-family: var(--display); font-weight: 900; font-size: 1.1rem; margin: 1.4rem 0 1.8rem;
}
.hero-tag span:nth-child(1) { color: var(--magenta); }
.hero-tag span:nth-child(2) { color: var(--gold); }
.hero-tag span:nth-child(3) { color: var(--plum); }
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; z-index: -1; pointer-events: none;
}
.blob-a { width: 420px; height: 420px; background: var(--magenta); top: -120px; right: -140px; }
.blob-b { width: 360px; height: 360px; background: var(--gold); bottom: -160px; left: -140px; opacity: .25; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 64px 0 56px; background: var(--grad); color: #fff; position: relative; overflow: hidden; }
.page-hero .eyebrow { color: var(--gold-soft); }
.page-hero .lede { color: rgba(255, 255, 255, .85); }
.page-hero::after {
  content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  border: 40px solid rgba(214, 160, 58, .35); right: -120px; top: -140px;
}

/* ---------- Affirmation ---------- */
.affirm { text-align: center; }
.affirm-lines { font-family: var(--display); font-weight: 900; font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.3; margin: 1rem 0; }
.affirm-lines span { display: block; }
.affirm-lines .big { font-size: 1.6em; margin-top: .3em; }
.section-dark .affirm-lines .big { color: var(--gold); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: 0 2px 0 rgba(62, 26, 110, .03);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.pillar-num {
  font-family: var(--display); font-weight: 900; font-size: 2.6rem; line-height: 1;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .6rem;
}
.pillar-motto { font-family: var(--display); font-weight: 800; color: var(--magenta); margin-bottom: .6rem; }
.card-cta {
  background: var(--grad); color: #fff; border: 0; display: flex; flex-direction: column; justify-content: center;
}
.card-cta h3 { color: #fff; }
.card-cta a { color: var(--gold-soft); font-weight: 800; }

/* ---------- Split ---------- */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.quote {
  font-family: var(--display); font-weight: 900; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.25;
  border-left: 6px solid var(--gold); padding-left: 24px; color: var(--plum);
}
.stack-lines { font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.6; }
.stack-lines span { display: block; }

/* ---------- Campaign band ---------- */
.campaign-title { font-size: clamp(2.4rem, 7vw, 5rem); font-weight: 900; line-height: 1; margin: .2em 0 .4em; }
.campaign-title em { font-style: normal; color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0; }
.chip {
  font-family: var(--display); font-weight: 800; padding: .5em 1.1em; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); color: #fff;
}
.ring {
  position: absolute; border-radius: 50%; pointer-events: none;
  border: 50px solid rgba(227, 37, 123, .25);
}
.ring-1 { width: 520px; height: 520px; right: -200px; top: -180px; }
.ring-2 { width: 300px; height: 300px; left: -120px; bottom: -150px; border-color: rgba(214, 160, 58, .25); border-width: 36px; }

/* ---------- Involved ---------- */
.role-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.role-list li {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px;
  font-family: var(--display); font-weight: 700;
}
.role-list b { color: var(--magenta); }

.contact-box {
  background: var(--gold-soft); border-radius: var(--radius); padding: 32px;
}
.placeholder { background: #fff3c4; border: 1px dashed var(--gold); padding: 0 .35em; border-radius: 6px; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .78); padding: 56px 0 32px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; }
.site-footer a { color: rgba(255, 255, 255, .78); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-tag { font-family: var(--display); font-weight: 900; font-size: 1.3rem; color: #fff; }
.footer-tag span:nth-child(1) { color: var(--magenta); }
.footer-tag span:nth-child(2) { color: var(--gold); }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; font-size: .9rem; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Constitution
   ========================================================= */
.const-banner {
  background: #fff3c4; border-bottom: 1px solid var(--gold); color: #5a4300;
  font-size: .92rem; padding: 10px 0; text-align: center;
}
.const-layout { display: grid; gap: 32px; padding: 48px 0 96px; }
@media (min-width: 1000px) { .const-layout { grid-template-columns: 280px 1fr; gap: 56px; } }

.toc { font-family: var(--display); }
.toc details { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; }
.toc summary { font-weight: 800; cursor: pointer; }
.toc ol { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; font-size: .92rem; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.toc a:hover, .toc a.active { background: var(--pink-soft); color: var(--berry); }
.toc .part { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--magenta); font-weight: 800; margin: 12px 10px 4px; }
@media (min-width: 1000px) {
  .toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; }
}

.doc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 20px; font-family: var(--serif); font-size: 1.08rem; line-height: 1.75;
  min-width: 0;
}
@media (min-width: 720px) { .doc { padding: 56px 64px; } }
.doc-head { text-align: center; border-bottom: 2px solid var(--line); padding-bottom: 28px; margin-bottom: 36px; }
.doc-head h1 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.doc-head .sub { font-family: var(--display); font-weight: 800; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); font-size: .8rem; }
.doc h2 {
  font-family: var(--display); font-size: 1.05rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--magenta); margin: 56px 0 8px; font-weight: 900;
}
.doc h3 {
  font-family: var(--display); font-size: 1.3rem; color: var(--plum); margin: 36px 0 14px;
  scroll-margin-top: 96px;
}
.doc h3 .art { color: var(--gold); margin-right: .4em; }
.doc ol, .doc ul { padding-left: 1.4em; }
.doc li { margin-bottom: .45em; }
.doc ol.sub { list-style: lower-alpha; }
.doc .preamble { font-style: italic; color: #3a3160; }
.doc .preamble p:last-child { font-style: normal; font-weight: 600; }
.doc dl dt { font-weight: 700; color: var(--plum); }
.doc dl dd { margin: 0 0 .8em 0; }
.doc .ph { background: #fff3c4; border-bottom: 1px dashed var(--gold); padding: 0 .2em; font-family: var(--body); font-size: .92em; font-weight: 700; color: #6b4d00; }
.sign-grid { display: grid; gap: 28px; margin-top: 24px; }
@media (min-width: 700px) { .sign-grid { grid-template-columns: 1fr 1fr; } }
.sign-line { border-top: 1px solid var(--ink); padding-top: 6px; font-size: .9rem; margin-top: 48px; font-family: var(--body); }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

@media print {
  .site-header, .site-footer, .toc, .const-banner, .page-hero, .doc-actions { display: none !important; }
  body { background: #fff; }
  .const-layout { display: block; padding: 0; }
  .doc { border: 0; padding: 0; font-size: 11pt; }
  .doc h3 { break-after: avoid; }
  .doc .ph { background: none; border: 0; }
}
