/* CAABA — Central Asian American Bar Association
   Editorial institutional design system */

:root {
  --ink: #0B1B2B;          /* midnight navy */
  --ink-2: #132537;         /* slightly lifted navy */
  --ink-3: #1F2A36;         /* charcoal */
  --paper: #F5F1E8;         /* warm ivory */
  --paper-2: #EDE7D8;       /* deeper ivory */
  --paper-3: #FBF8F1;       /* near-white warm */
  --rule: #D9D0BB;          /* ivory rule */
  --rule-dark: #2A3B4D;     /* dark rule on navy */
  --gold: #C8A04A;          /* warm gold */
  --gold-2: #B08A35;        /* deeper gold */
  --gold-soft: #E4CB88;
  --teal: #2C4A47;
  --muted: #5B6875;
  --muted-light: #8A9099;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 17px;
  line-height: 1.6;
}

/* Typography */
.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
  font-feature-settings: "liga", "dlig";
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.eyebrow.light {
  color: var(--gold-soft);
}

.section-num {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Layout primitives */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.hr {
  border: 0;
  border-top: 1px solid var(--rule);
}

.hr.dark {
  border-top: 1px solid var(--rule-dark);
}

.hr.gold {
  border: 0;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: all .28s cubic-bezier(.2,.7,.2,1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-primary.on-dark {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.btn-primary.on-dark:hover {
  background: transparent;
  color: var(--paper);
  border-color: var(--paper);
}

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-ghost.on-dark {
  border-color: rgba(245,241,232,0.4);
  color: var(--paper);
}
.btn-ghost.on-dark:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.btn-link {
  padding: 4px 0;
  border-bottom: 1px solid var(--gold);
  letter-spacing: 0.16em;
  font-size: 11px;
  gap: 14px;
  color: var(--ink);
}
.btn-link.on-dark { color: var(--paper); }
.btn-link:hover { gap: 20px; }
.btn-link .arr { transition: transform .28s; }
.btn-link:hover .arr { transform: translateX(4px); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245,241,232,0.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: background .25s, border-color .25s;
}
.header.dark {
  background: rgba(11,27,43,0.9);
  border-bottom-color: var(--rule-dark);
  color: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-name {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.02em;
  font-weight: 500;
}
.brand-sub {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}
.header.dark .brand-sub { color: var(--gold-soft); }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav a {
  font-size: 14px;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-radius: 2px;
  position: relative;
  transition: color .2s;
  cursor: pointer;
  background: transparent;
  border: 0;
  font-family: var(--sans);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--gold-2); }
.header.dark .nav a.active { color: var(--gold-soft); }

.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sections */
section { padding: clamp(64px, 10vw, 128px) 0; }
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(24px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}
.section-head.on-dark { border-bottom-color: var(--rule-dark); }
.section-head-left { display: flex; flex-direction: column; gap: 8px; }
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  font-weight: 400;
  max-width: 20ch;
}
.section-head .lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 52ch;
}
.section-head.on-dark .lead { color: #A9B3BF; }

@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .header-cta .btn:not(.menu-btn) { display: none; }
  .nav { display: none; }
}

/* Logo mark SVG helper */
.logo-mark circle, .logo-mark path, .logo-mark line { fill: none; }

/* Page switching */
.page { animation: pageIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--paper-3);
  border: 1px solid var(--rule);
  padding: 32px;
  transition: all .3s;
}
.card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.card.on-dark {
  background: var(--ink-2);
  border-color: var(--rule-dark);
}
.card.on-dark:hover { border-color: var(--gold); }

/* Form */
input, textarea, select {
  font-family: var(--sans);
  font-size: 15px;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  width: 100%;
  min-width: 0;
  outline: none;
  transition: border-color .2s;
  text-overflow: ellipsis;
}
input::placeholder, textarea::placeholder { color: #6F7780; opacity: 1; }
input:focus, textarea:focus, select:focus { border-bottom-color: var(--gold); }
.on-dark input, .on-dark textarea, .on-dark select { border-bottom-color: var(--rule-dark); color: var(--paper); }
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  padding: 0;
  border: 0;
  accent-color: var(--gold-2);
}
label {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* Footer */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding: 88px 0 32px;
}
.footer a { color: #BAC4CE; text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--gold-soft); }

/* Utility */
.scroll-smooth { scroll-behavior: smooth; }
.serif-num {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
}

::selection { background: var(--gold); color: var(--ink); }

/* Tweak panel */
.tweaks-panel {
  position: fixed;
  right: 20px; bottom: 20px;
  background: var(--ink);
  color: var(--paper);
  padding: 20px 22px;
  border: 1px solid var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  z-index: 100;
  display: none;
  max-width: 280px;
}
.tweaks-panel.active { display: block; }
.tweaks-panel h4 {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--rule-dark);
  padding-bottom: 8px;
  text-transform: none;
}
.tweaks-panel .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.tweaks-panel select, .tweaks-panel input[type="color"] {
  background: var(--ink-2);
  border: 1px solid var(--rule-dark);
  color: var(--paper);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
}
.tweaks-panel input[type="color"] { padding: 0; height: 26px; width: 42px; border-radius: 0; cursor: pointer; }
