/* ==========================================================================
   CometX — site stylesheet
   Palette derives from cometary emission spectra: five bands, one per practice.
   ========================================================================== */

:root {
  --ink:        #0C1A2E;
  --ink-soft:   #17293F;
  --slate:      #4E6480;
  --slate-2:    #6E819A;
  --line:       #D8E0EB;
  --frost:      #EDF1F7;
  --paper:      #FBFCFE;
  --white:      #FFFFFF;

  /* spectral bands */
  --b-cyan:     #1594AC;
  --b-violet:   #5B4BD6;
  --b-lime:     #6F8F1E;
  --b-amber:    #C87F1B;
  --b-magenta:  #B23F80;

  --accent:     var(--b-violet);

  --maxw: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --sect-y: clamp(3.5rem, 7vw, 6.5rem);

  --shadow-sm: 0 1px 2px rgba(12,26,46,.06), 0 6px 18px rgba(12,26,46,.05);
  --shadow-md: 0 2px 6px rgba(12,26,46,.07), 0 18px 40px rgba(12,26,46,.09);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--b-violet); outline-offset: 3px; border-radius: 2px; }

/* ---------- type ---------- */
h1, h2, h3, h4, .display {
  font-family: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 .6em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.8vw, 1.45rem); letter-spacing: -.012em; }
h4 { font-size: 1.05rem; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.35rem); line-height: 1.55; color: var(--ink-soft); }
.muted { color: var(--slate); }
.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--slate); margin: 0 0 1rem; display: block;
}
.eyebrow-mark::before {
  content: ""; display: inline-block; width: 22px; height: 2px; vertical-align: .28em;
  margin-right: .6rem; background: var(--band, var(--accent));
}

/* ---------- layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding-block: var(--sect-y); }
.section--frost { background: var(--frost); }
.section--white { background: var(--white); }
.section--ink { background: var(--ink); color: #E6ECF5; }
.section--ink h2, .section--ink h3 { color: var(--white); }
.section--ink .eyebrow { color: #93A7C1; }
.section--ink p { color: #C6D2E2; }

.rail { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
@media (min-width: 900px) {
  .rail { grid-template-columns: 220px minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); }
  .rail > .rail-head { position: sticky; top: 6.5rem; align-self: start; }
}
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); }
.stack > * + * { margin-top: 1.5rem; }
.measure { max-width: 62ch; }

/* ---------- spectral strip (signature) ---------- */
.spectrum { display: flex; height: 4px; width: 100%; }
.spectrum i { flex: 1; display: block; }
.spectrum i:nth-child(1) { background: var(--b-cyan); }
.spectrum i:nth-child(2) { background: var(--b-violet); }
.spectrum i:nth-child(3) { background: var(--b-lime); }
.spectrum i:nth-child(4) { background: var(--b-amber); }
.spectrum i:nth-child(5) { background: var(--b-magenta); }
.spectrum--tall { height: 8px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251,252,254,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .85rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-text { display: block; }
.brand b { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; }
.brand-text span { display: block; font-family: "IBM Plex Mono", monospace; font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); margin-top: -.15rem; }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a {
  font-family: "Bricolage Grotesque", sans-serif; font-size: .95rem; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; padding-block: .35rem; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav-toggle { display: none; }
@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem; background: var(--white); border: 1px solid var(--line);
    border-radius: 999px; padding: .5rem .95rem; font-family: "IBM Plex Mono", monospace; font-size: .75rem;
    letter-spacing: .1em; text-transform: uppercase; cursor: pointer; color: var(--ink);
  }
  .nav {
    position: absolute; inset: 100% 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1.25rem; display: none;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--line); }
}

/* ---------- buttons ---------- */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; gap: .55rem; font-family: "Bricolage Grotesque", sans-serif;
  font-size: .98rem; font-weight: 600; letter-spacing: -.01em; text-decoration: none; cursor: pointer;
  padding: .8rem 1.35rem; border-radius: 999px; border: 1.5px solid transparent; transition: transform .18s ease, background .18s ease, color .18s ease;
}
.btn { background: var(--ink); color: var(--white); }
.btn:hover { background: var(--accent); color: var(--white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.section--ink .btn { background: var(--white); color: var(--ink); }
.section--ink .btn:hover { background: var(--b-cyan); color: var(--ink); }
.section--ink .btn-ghost { color: var(--white); border-color: rgba(255,255,255,.35); }
.section--ink .btn-ghost:hover { border-color: var(--white); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ---------- hero (home) ---------- */
.hero { position: relative; background: var(--ink); color: #E6ECF5; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 70% at 78% 18%, rgba(91,75,214,.38), transparent 65%),
              radial-gradient(45% 55% at 12% 88%, rgba(21,148,172,.28), transparent 70%);
}
.hero-inner { position: relative; z-index: 2; padding-block: clamp(4rem, 10vw, 7.5rem); }
.hero h1 { color: var(--white); max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--b-cyan); }
.hero .lede { color: #C6D2E2; max-width: 54ch; }
.hero .eyebrow { color: #93A7C1; }
.hero-arc { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }
.hero-arc path { fill: none; }
.comet { offset-path: path("M -60 460 C 240 300, 520 120, 1000 60"); offset-rotate: 0deg; animation: comet-run 11s cubic-bezier(.4,0,.35,1) infinite; }
@keyframes comet-run {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .comet { animation: none; offset-distance: 72%; opacity: 1; } }
.hero-figures { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.16); }
.hero-figures div { max-width: 15rem; }
.hero-figures dt { font-family: "IBM Plex Mono", monospace; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #93A7C1; }
.hero-figures dd { margin: .35rem 0 0; font-family: "Bricolage Grotesque", sans-serif; font-size: 1.05rem; font-weight: 500; color: var(--white); line-height: 1.35; }

/* ---------- page hero (interior) ---------- */
.page-hero { background: var(--white); border-bottom: 1px solid var(--line); padding-block: clamp(2.75rem, 6vw, 4.75rem); }
.page-hero h1 { max-width: 20ch; }
.page-hero .lede { max-width: 60ch; }
.page-hero .eyebrow::before { background: var(--band, var(--accent)); }

/* ---------- cards ---------- */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 1.6rem 1.5rem 1.7rem;
  position: relative; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease;
}
.card::before { content: ""; position: absolute; top: -1px; left: -1px; right: -1px; height: 3px; background: var(--band, var(--accent)); border-radius: 4px 4px 0 0; }
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: .5rem; }
.card p { font-size: .98rem; color: var(--slate); margin-bottom: 0; }
.card .card-more { display: inline-block; margin-top: 1rem; font-family: "Bricolage Grotesque", sans-serif; font-weight: 600; font-size: .9rem; color: var(--band, var(--accent)); }
.card-index { font-family: "IBM Plex Mono", monospace; font-size: .7rem; letter-spacing: .14em; color: var(--slate-2); display: block; margin-bottom: .75rem; }

/* ---------- lists ---------- */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 1.75rem; margin-bottom: .75rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .58em; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--band, var(--accent));
}
.divided { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.divided > li { border-bottom: 1px solid var(--line); padding: 1.35rem 0; display: grid; gap: .35rem 1.75rem; }
@media (min-width: 760px) { .divided > li { grid-template-columns: 13rem minmax(0,1fr); } }
.divided .k { font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .13em; text-transform: uppercase; color: var(--slate); padding-top: .3rem; }
.divided .v h3 { margin-bottom: .3rem; }
.divided .v p:last-child { margin-bottom: 0; }

/* purposes (charter clauses — numbering is from the constating document) */
.clauses { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.clauses li { background: var(--white); padding: 1.5rem; display: grid; gap: .2rem .5rem; }
.clauses .n { font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .14em; color: var(--band, var(--accent)); }
.clauses p { margin: 0; font-size: 1rem; }
@media (min-width: 720px) { .clauses { grid-template-columns: 1fr 1fr; } .clauses li:last-child { grid-column: 1 / -1; } }

/* ---------- figures ---------- */
.figure { margin: 0; }
.figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; background: linear-gradient(135deg, var(--frost), #DDE5F0); aspect-ratio: 4 / 3; }
.figure figcaption { font-family: "IBM Plex Mono", monospace; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--slate-2); margin-top: .7rem; }
.figure--wide img { aspect-ratio: 16 / 7; }
.split { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 880px) { .split { grid-template-columns: 1fr 1fr; } .split--narrow { grid-template-columns: 1.15fr .85fr; } }

/* ---------- quote ---------- */
.pull { border-left: 3px solid var(--band, var(--accent)); padding: .35rem 0 .35rem 1.5rem; margin: 0; }
.pull p { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.4; font-family: "Bricolage Grotesque", sans-serif; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.pull footer { font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }

/* ---------- callout ---------- */
.callout { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--band, var(--accent)); padding: 1.35rem 1.5rem; border-radius: 3px; }
.callout p:last-child { margin-bottom: 0; }
.callout h3 { font-size: 1.05rem; }

/* ---------- details ---------- */
details { border-bottom: 1px solid var(--line); padding: 1.1rem 0; }
details summary { cursor: pointer; font-family: "Bricolage Grotesque", sans-serif; font-weight: 600; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-family: "IBM Plex Mono", monospace; color: var(--accent); }
details[open] summary::after { content: "–"; }
details p { margin: .9rem 0 0; color: var(--slate); }

/* ---------- form ---------- */
.form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .4rem; }
.field label { font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--slate); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 3px; padding: .75rem .85rem; width: 100%;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(91,75,214,.16); }
.field-hint { font-size: .85rem; color: var(--slate); }
@media (min-width: 700px) { .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; } }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #C6D2E2; padding-block: clamp(2.75rem, 6vw, 4rem) 2rem; }
.site-footer a { color: #DCE5F1; text-decoration: none; }
.site-footer a:hover { color: var(--b-cyan); text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.footer-grid h4 { font-family: "IBM Plex Mono", monospace; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #93A7C1; font-weight: 500; margin-bottom: .9rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .55rem; font-size: .95rem; }
.footer-brand b { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.3rem; color: var(--white); letter-spacing: -.03em; }
.footer-brand p { font-size: .95rem; margin-top: .6rem; max-width: 30ch; }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.14); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .06em; color: #8FA3BE; }

/* ---------- utilities ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .75rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.tag {
  display: inline-block; font-family: "IBM Plex Mono", monospace; font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--band, var(--accent)); border: 1px solid currentColor; border-radius: 999px;
  padding: .25rem .6rem; margin: 0 .4rem .4rem 0;
}
