/* ==========================================================================
   Makerere Actuarial Society — Campus horizon
   Navy + maize gold on cool chalk. No build step.
   ========================================================================== */

:root {
  --ink: #0c2340;
  --ink-mid: #1a3a5c;
  --accent: #d4a84b;
  --accent-deep: #b8903a;
  --surface: #f2f4f7;
  --surface-deep: #e6eaef;
  --white: #ffffff;
  --soft: #5a6b7a;
  --rule: #c8d0da;
  --rule-strong: #0c2340;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --rail: 11rem;
  --header-h: 4.25rem;
  --shell: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.15rem, 4.2vw + 0.8rem, 3.6rem);
  font-weight: 450;
}

h2 {
  font-size: clamp(1.45rem, 1.8vw + 0.9rem, 2.1rem);
}

h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

a {
  color: var(--ink);
}

a:not(.btn):not(.brand):not(.skip-link) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:not(.btn):not(.brand):not(.skip-link):hover {
  color: var(--accent-deep);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 2px;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- layout ---------- */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(2.75rem, 5.5vw, 4.5rem) 0;
}

.section--tight {
  padding-top: clamp(1.75rem, 3vw, 2.5rem);
}

.section-head {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.section-head .row-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  padding-top: 0.45rem;
}

.reveal {
  animation: fade-up 0.7s var(--ease) both;
}

.reveal-delay-1 {
  animation-delay: 0.08s;
}

.reveal-delay-2 {
  animation-delay: 0.16s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(0.85rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .section-head {
    grid-template-columns: 1fr;
  }
}

/* ---------- header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}

.site-header.is-scrolled,
.site-header.is-nav-open {
  border-bottom-color: var(--rule);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
}

.brand-word {
  font-family: var(--display);
  font-weight: 550;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand-word small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.68rem;
  color: var(--soft);
  letter-spacing: 0.01em;
  margin-top: 0.1rem;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2vw, 1.6rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--soft);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: var(--white);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 0.4rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 760px) {
  .brand-word small {
    display: none;
  }

  .brand-word {
    font-size: 0.95rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: 0.75rem var(--gutter) 1.25rem;
    gap: 0.35rem;
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.55rem 0;
    border-bottom: none;
  }

  .nav-links a[aria-current="page"] {
    border-bottom: none;
    color: var(--accent-deep);
  }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  border-radius: 2px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
}

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

.btn-primary[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--accent-deep);
  color: var(--accent-deep);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.btn-accent:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--ink);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- home hero ---------- */

.hero-home {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    linear-gradient(165deg, #0a1c33 0%, #0c2340 42%, #143352 100%);
  color: var(--white);
}

.hero-home .shell {
  position: relative;
  z-index: 2;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.hero-brand {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw + 0.6rem, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 1.35rem;
  color: var(--accent);
  max-width: none;
}

.hero-brand span {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--white) 70%, transparent);
  margin-top: 0.45rem;
}

.hero-home h1 {
  color: var(--white);
  max-width: 14ch;
  margin-bottom: 0.75rem;
}

.hero-home .lede {
  font-size: clamp(1.05rem, 1vw + 0.85rem, 1.2rem);
  color: color-mix(in srgb, var(--white) 82%, transparent);
  max-width: 38ch;
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.hero-home .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.hero-home .btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
}

.hero-home .btn-secondary {
  border-color: color-mix(in srgb, var(--white) 55%, transparent);
  color: var(--white);
}

.hero-home .btn-secondary:hover {
  border-color: var(--white);
  color: var(--white);
  background: color-mix(in srgb, var(--white) 10%, transparent);
}

.hero-plane {
  position: absolute;
  inset: auto 0 0 0;
  height: min(48vh, 420px);
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-plane svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-plane .horizon-line {
  stroke: color-mix(in srgb, var(--white) 22%, transparent);
  stroke-width: 1;
}

.hero-plane .curve {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-curve 1.6s var(--ease) 0.25s forwards;
}

.hero-plane .curve-soft {
  fill: none;
  stroke: color-mix(in srgb, var(--white) 28%, transparent);
  stroke-width: 1.25;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw-curve 1.8s var(--ease) 0.15s forwards;
}

@keyframes draw-curve {
  to {
    stroke-dashoffset: 0;
  }
}

/* Phones (portrait) and short viewports (landscape): top-align, no empty navy band */
@media (max-width: 760px), (max-height: 520px) {
  .hero-home {
    min-height: auto;
    justify-content: flex-start;
  }

  .hero-home .shell {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .hero-brand {
    margin-bottom: 0.85rem;
  }

  .hero-home h1 {
    margin-bottom: 0.55rem;
  }

  .hero-actions {
    margin-top: 1.25rem;
  }

  .hero-plane {
    height: min(28vh, 180px);
  }
}

@media (max-height: 520px) {
  .hero-home .shell {
    padding-top: 1rem;
    padding-bottom: 1.25rem;
  }

  .hero-plane {
    height: min(22vh, 120px);
  }
}

@media (max-width: 380px) {
  .hero-home .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-home .hero-actions .btn {
    width: 100%;
  }
}

/* ---------- page intro (inner pages) ---------- */

.page-intro {
  padding: clamp(2.5rem, 6vw, 4.25rem) 0 clamp(1.5rem, 3vw, 2rem);
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 50%),
    var(--surface);
}

.page-intro .kicker {
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.85rem;
}

.page-intro h1 {
  max-width: 18ch;
}

.page-intro .lede {
  font-size: 1.08rem;
  color: var(--soft);
  margin-bottom: 0;
}

/* ---------- qualitative strip ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
}

.pillar {
  background: var(--white);
  padding: clamp(1.35rem, 2.5vw, 1.85rem) clamp(1rem, 2vw, 1.5rem);
}

.pillar .label {
  font-size: 0.75rem;
  font-weight: 550;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0 0 0.55rem;
}

.pillar h2 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
}

.pillar p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--soft);
  max-width: none;
}

@media (max-width: 900px) {
  .pillars {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .pillars {
    grid-template-columns: 1fr;
  }
}

/* ---------- row lists ---------- */

.rows {
  border-top: 1px solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 2.8vw, 2rem) 0;
  border-bottom: 1px solid var(--rule);
}

.row .row-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0;
  padding-top: 0.2rem;
}

.row h3 {
  margin-bottom: 0.35rem;
}

.row p:last-child {
  margin-bottom: 0;
  color: var(--soft);
}

@media (max-width: 760px) {
  .row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.prose-narrow {
  max-width: 58ch;
  color: var(--soft);
}

.prose-narrow a {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- empty states ---------- */

.empty-state {
  background: var(--white);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: clamp(1.5rem, 3vw, 2rem);
  max-width: 42rem;
}

.empty-state h3 {
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--soft);
  margin-bottom: 1rem;
}

.empty-state p:last-child {
  margin-bottom: 0;
}

.role-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.65rem 1.25rem;
}

.role-list li {
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

/* ---------- election panel ---------- */

.election-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.election-panel .kicker {
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin: 0;
}

.election-panel p {
  color: var(--soft);
}

.election-panel p:last-child {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .election-panel {
    grid-template-columns: 1fr;
  }
}

/* ---------- forms ---------- */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  max-width: 480px;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--soft);
}

.form-field input,
.form-field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--white);
  color: var(--ink);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--ink);
}

.form-status {
  max-width: 480px;
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  border-radius: 2px;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: color-mix(in srgb, #1b7a4a 12%, var(--white));
  color: #145c38;
  border: 1px solid color-mix(in srgb, #1b7a4a 35%, transparent);
}

.form-status.is-error {
  background: color-mix(in srgb, #8b2e2e 10%, var(--white));
  color: #6b2222;
  border: 1px solid color-mix(in srgb, #8b2e2e 30%, transparent);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0;
  margin-top: 1rem;
  background: var(--white);
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.88rem;
  color: var(--soft);
}

.site-footer a {
  color: var(--soft);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- 404 ---------- */

.error-page {
  min-height: calc(100svh - var(--header-h) - 8rem);
  display: flex;
  align-items: center;
  padding: 3rem 0;
}

.error-page .code {
  font-family: var(--display);
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  color: var(--accent);
  margin: 0 0 0.4rem;
  line-height: 1;
}
