:root {
  --bg: #000000;
  --bg-raised: #161616;
  --green: #67b858;
  --green-hover: #77d466;
  --text: #e2e2e2;
  --text-strong: #f7f7f7;
  --text-muted: #969696;
  --text-soft: #dbdbdb;
  --line: rgba(255, 255, 255, 0.7);
  --line-muted: rgb(119, 119, 119);
  --header-h: 64px;
  --sidebar-w: 220px;
  --max: 1080px;
  --font-body: "Lato", arial, sans-serif;
  --font-logo: "Cabin", arial, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

/* Sidebar */
.site-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 22px 32px;
  background: var(--bg-raised);
  gap: 40px;
}

.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.2;
}

.nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.nav-link {
  letter-spacing: 0.063em;
  color: var(--text);
  padding: 4px 0 4px 12px;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.is-active {
  border-left-color: var(--green);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 6px;
  color: var(--text-strong);
  cursor: pointer;
}

.menu-toggle svg {
  display: block;
}

.mobile-drawer {
  display: none;
}

.site-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Hero */
.hero {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 128px 0 120px;
  background: var(--bg);
}

.hero img {
  width: 70%;
  max-width: 1020px;
  height: auto;
  transform: translateX(-52px);
}

/* Affiliations */
.affiliations {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  background: var(--bg);
  padding: 28px 24px 56px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 720px) {
  .affiliations {
    grid-template-columns: 1fr 1fr;
    gap: 32px 48px;
    align-items: stretch;
  }
}

.affiliation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.affiliation h2 {
  margin: 0 0 20px;
  color: var(--green);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
  min-height: 1.25em;
}

.affiliation-mark {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 210px;
}

.affiliation-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.affiliation-link:hover .affiliation-logo {
  opacity: 0.88;
}

.affiliation-logo {
  width: 210px;
  height: 210px;
  margin: 0 auto;
  object-fit: contain;
}

.affiliation-logo--wide {
  width: auto;
  max-width: min(400px, 100%);
  height: 108px;
}

/* Contact */
.contact {
  flex: 1;
  background: var(--bg);
  padding: 48px 24px 80px;
}

.contact-wrap {
  max-width: 880px;
  margin: 0 auto;
}

.contact h1 {
  margin: 0 0 16px;
  color: var(--text-strong);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.contact h1::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 12px;
  background: var(--line-muted);
}

.contact-lede {
  margin: 0 0 28px;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.rainbow-page {
  flex: 1;
  background: var(--bg);
  padding: 36px 24px 72px;
  max-width: min(1800px, 100%);
  margin: 0 auto;
  width: 100%;
}

.rainbow-article h1 {
  margin: 0 0 0.5rem;
  color: var(--text-strong);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0.03em;
  line-height: 1.3;
  text-transform: none;
}

.rainbow-article h1::after {
  display: none;
}

.rainbow-article .lede {
  max-width: 46rem;
  margin: 0 0 0.7rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.5;
}

.rainbow-article .status {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: 1.02rem;
}

.rainbow-article .chart {
  width: 100%;
  margin: 0 0 1rem;
}

.rainbow-article .guide {
  max-width: 46rem;
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.rainbow-article .guide h2 {
  margin: 1.2rem 0 0.4rem;
  color: var(--text-strong);
  font-weight: 400;
  font-size: 1.15rem;
}

.rainbow-article .guide ul {
  margin: 0.25rem 0 0.6rem;
  padding-left: 1.2rem;
}

.rainbow-article .guide a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rainbow-article .guide a:hover {
  color: var(--green-hover);
}

.rainbow-article .note {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.rainbow-article .x {
  margin-top: 1.25rem;
}

.btn {
  appearance: none;
  display: inline-block;
  border: 0;
  cursor: pointer;
  background: var(--green);
  color: #000;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 12px 28px;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background: var(--green-hover);
  color: #000;
}

/* Footer */
.site-footer {
  background: var(--bg);
  padding: 32px 24px 40px;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Mobile: sidebar becomes a top bar; menu slides in from the left */
@media (max-width: 767px) {
  body {
    flex-direction: column;
  }

  .site-sidebar {
    position: sticky;
    flex: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: var(--header-h);
    height: var(--header-h);
    padding: 12px 18px;
    gap: 12px;
  }

  .nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .site-frame {
    min-height: 0;
  }

  .mobile-drawer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .drawer-backdrop {
    position: absolute;
    inset: 0;
  }

  .mobile-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(320px, 86vw);
    height: 100%;
    background: var(--bg-raised);
    padding: 16px 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .mobile-drawer.is-open .drawer-panel {
    transform: translateX(0);
  }

  .drawer-close {
    background: none;
    border: 0;
    color: #fff;
    padding: 4px;
    cursor: pointer;
    margin-left: auto;
    display: block;
  }

  .drawer-panel .logo {
    display: block;
    margin: 12px 0 8px;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
  }

  .drawer-nav a {
    font-size: 18px;
    letter-spacing: 0.04em;
  }
}
