/* Bright CUPEC palette. Keep the shared layout and interaction system. */
:root {
  --rb-paper: #fdfcf8;
  --rb-ink: #373a35;
  --rb-muted: #64695f;
  --rb-line: #d6d9d0;
  --rb-soft: #f0f1eb;
  --soft: var(--rb-soft);
}
body.cupec-rebuild { background: var(--rb-paper); color: var(--rb-ink); }
body.cupec-rebuild > header.rb-header,
.cupec-rebuild .event-header,
.cupec-rebuild .event-header.navigation-shell,
.cupec-rebuild .challenge-sidebar,
.cupec-rebuild .challenge-sidebar.navigation-shell,
.cupec-rebuild .reader-bar {
  background: var(--rb-paper);
  color: var(--rb-ink);
  border-color: var(--rb-line);
}
.rb-brand img,
.cupec-rebuild .event-header img,
.cupec-rebuild .challenge-sidebar .club-brand img { filter: none; mix-blend-mode: multiply; }
.rb-header nav > a,
.rb-header nav > a:hover,
.rb-header nav > a[aria-current=page],
.cupec-rebuild .rb-header .join-link { color: var(--rb-ink); }
.cupec-rebuild .rb-header .join-link { border-color: #b4baac; }
.rb-header .join-link:hover { background: var(--rb-soft); }
.cupec-rebuild .rb-header .menu-toggle,
.cupec-rebuild .challenge-sidebar .menu-toggle,
.cupec-rebuild .event-header .menu-toggle { color: var(--rb-ink); }
.rb-home,
.rb-light { background: var(--rb-paper); color: var(--rb-ink); }
.rb-dark {
  background: var(--rb-soft);
  color: var(--rb-ink);
  --line: var(--rb-line);
  --muted: var(--rb-muted);
}
.rb-path p, .rb-index, .rb-feature-copy .rb-small,
.rb-join .rb-prose, .rb-join .rb-lead, .rb-join .rb-prose > p:not(.rb-lead) { color: var(--rb-muted); }
.rb-link-light { color: var(--rb-ink); border-color: #a3a99d; }
.cupec-rebuild .rb-button,
.cupec-rebuild .rb-button-light,
.cupec-rebuild .button,
.cupec-rebuild .entry-button,
.cupec-rebuild .passcode-card button,
.cupec-rebuild .event-header .entry-button,
.cupec-rebuild .join-heading .button {
  background: #e8ebe2;
  color: var(--rb-ink)!important;
  border-color: #b9c0b0;
}
.cupec-rebuild .rb-button:hover,
.cupec-rebuild .rb-button-light:hover,
.cupec-rebuild .button:hover,
.cupec-rebuild .entry-button:hover,
.cupec-rebuild .passcode-card button:hover { background: #dce1d5; color: var(--rb-ink)!important; }
.cupec-rebuild .button.light { background: transparent; }
/* Separate the opening words from the photograph so every face stays visible. */
.rb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 50px 6%;
  align-items: center;
  min-height: 0;
  padding: 85px var(--rb-gutter) 32px;
  color: var(--rb-ink);
  background: var(--rb-paper);
}
.rb-hero-content { grid-column: 1; grid-row: 1; padding: 0; }
.rb-hero-art {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  z-index: auto;
  overflow: visible;
  align-self: center;
}
.rb-hero-photo-window { overflow: hidden; aspect-ratio: 4 / 3; }
.rb-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  animation: rb-photo-breathe 35s ease-in-out infinite alternate;
  transform-origin: center;
}
.cupec-rebuild .rb-hero h1 {
  font-size: clamp(56px, 5.7vw, 90px);
  line-height: 1.03;
  margin-bottom: 34px;
}
.rb-hero h1 em { color: #6d7668; }
.rb-hero-bottom { display: block; border-color: var(--rb-line); padding-top: 25px; }
.rb-hero-bottom p { font-size: 16px; }
.rb-hero-bottom .rb-link { margin-top: 13px; }
.rb-hero-foot { grid-column: 1 / -1; margin-top: 10px; color: var(--rb-muted); }
.rb-hero-foot > span { color: var(--rb-muted); }
.rb-photo figcaption {
  position: static;
  margin-top: 13px;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: .035em;
  color: var(--rb-muted);
}
.rb-photo img { display: block; width: 100%; }
@keyframes rb-photo-breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
/* Light landscape interlude: copy stays on paper instead of a dark overlay. */
.rb-landscape { height: auto; min-height: 0; max-height: none; background: #f0f1eb; }
.rb-landscape::after { display: none; }
.rb-landscape-window { height: clamp(340px, 42vw, 650px); overflow: hidden; }
.rb-landscape-window img {
  display: block;
  width: 100%;
  height: 115%;
  object-fit: cover;
  transform: translateY(var(--drift, -4%));
  filter: none;
}
.rb-landscape-copy { position: static; padding: 50px var(--rb-gutter) 25px; }
.cupec-rebuild .rb-landscape h2 { color: var(--rb-ink); font-size: clamp(48px, 5.7vw, 86px); }
.rb-landscape .rb-eyebrow { color: var(--rb-muted); }
.rb-landscape figcaption { position: static; padding: 0 var(--rb-gutter) 35px; color: var(--rb-muted); }
.rb-feature-image img { filter: none; }
.rb-feature-image figcaption { color: #44483f; background: #fdfcf8ed; padding: 5px 10px; }
.rb-events .rb-split { grid-template-columns: 1fr 1.15fr; align-items: center; gap: 8%; }
.rb-event-intro .rb-lead { margin-top: 30px; }
.rb-audience-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.rb-group-photo { margin-top: 65px!important; }
.rb-group-photo img { aspect-ratio: 8 / 5; object-fit: cover; object-position: center bottom; }
.rb-join { padding-bottom: var(--rb-space); }
.rb-footer { background: #eeeFE9; color: var(--rb-ink); }
.rb-footer-top p, .rb-footer-bottom { color: var(--rb-muted); }
.rb-footer-links { border-color: #cbd0c2; }
/* Carry the bright palette into every existing route and dialog. */
.cupec-rebuild main > [data-page]:not(.rb-home) > .page-heading,
.cupec-rebuild main > [data-page]:not(.rb-home) > .info-hero,
.cupec-rebuild main > .info-page > .info-heading {
  background: var(--rb-soft);
  color: var(--rb-ink);
}
.cupec-rebuild .page-heading .lede,
.cupec-rebuild .page-heading .eyebrow,
.cupec-rebuild .page-heading > p:not(.eyebrow):not(.lede),
.cupec-rebuild .info-heading > p,
.cupec-rebuild .info-hero .eyebrow,
.cupec-rebuild .info-hero .lede { color: var(--rb-muted); }
.cupec-rebuild .challenge-sidebar small,
.cupec-rebuild .challenge-sidebar .sidebar-bottom p,
.cupec-rebuild .challenge-sidebar nav a span { color: var(--rb-muted); }
.cupec-rebuild .challenge-sidebar nav a { border-color: var(--rb-line); }
.cupec-rebuild .challenge-sidebar nav a[aria-current] { background: #e5e8df; color: var(--rb-ink); }
.cupec-rebuild .reader-bar select { background: #fff; color: var(--rb-ink); }
.cupec-rebuild dialog::backdrop { background: #8e968066; }
.cupec-rebuild .sim-dashboard { background: #e9ece3; color: var(--rb-ink); border: 1px solid var(--rb-line); }
.cupec-rebuild .sim-dashboard h2, .cupec-rebuild .sim-dashboard h3 { color: var(--rb-ink); }
.cupec-rebuild .sim-stat { background: #fdfdf9; border-color: #d4d9cc; }
.cupec-rebuild .sim-company.selected,
.cupec-rebuild .sim-company[aria-pressed=true] { background: #e3e8dc; border-color: #969f8b; color: var(--rb-ink); }
.cupec-rebuild .sim-company.selected p,
.cupec-rebuild .sim-company[aria-pressed=true] p { color: var(--rb-muted); }
.cupec-rebuild .sim-primary { background: #e4e8dc; color: var(--rb-ink); border-color: #aab39e; }
.cupec-rebuild .compare-picker input:checked + span { background: #e1e6d9; color: var(--rb-ink); border-color: #a4af97; }
@media (max-width: 1100px) {
  .rb-hero { gap: 40px 5%; padding-top: 65px; }
  .cupec-rebuild .rb-hero h1 { font-size: 62px; }
}
@media (max-width: 900px) {
  .rb-hero { grid-template-columns: minmax(0, 1fr); padding-top: 60px; gap: 35px; }
  .rb-hero-content { grid-column: 1; grid-row: 1; }
  .rb-hero-art { grid-column: 1; grid-row: 2; width: 100%; }
  .rb-hero-photo-window { aspect-ratio: 16 / 10; }
  .rb-hero-art img { object-position: center 56%; }
  .rb-hero-foot { grid-row: 3; margin: 0; }
  .cupec-rebuild .rb-hero h1 { font-size: clamp(60px, 9.2vw, 82px); }
  .rb-hero-bottom { display: flex; align-items: end; gap: 25px; }
  .rb-hero-bottom .rb-link { flex-shrink: 0; }
  .rb-events .rb-split { grid-template-columns: 1fr; gap: 35px; }
  .rb-event-intro .rb-lead { max-width: 580px; }
}
@media (max-width: 767px) {
  .cupec-rebuild .rb-header nav > a,
  .cupec-rebuild .rb-header nav > a:first-child,
  .cupec-rebuild .rb-header nav > a:nth-child(2),
  .cupec-rebuild .challenge-sidebar nav a,
  .cupec-rebuild .event-header nav a { color: var(--rb-ink)!important; border-color: var(--rb-line); }
}
@media (max-width: 620px) {
  .rb-hero { padding-top: 45px; gap: 30px; }
  .cupec-rebuild .rb-hero h1 { font-size: clamp(51px, 12.5vw, 68px); margin-bottom: 28px; }
  .rb-hero-bottom { display: block; }
  .rb-hero-bottom p { font-size: 15px; }
  .rb-hero .rb-eyebrow { max-width: 280px; }
  .rb-hero-photo-window { aspect-ratio: 4 / 3; }
  .rb-hero-art img { object-position: center; }
  .rb-photo figcaption { font-size: 9px; }
  .rb-landscape-window { height: 340px; }
  .rb-landscape-copy { padding-top: 35px; }
  .cupec-rebuild .rb-landscape h2 { font-size: 47px; }
  .rb-event-intro .rb-lead { margin-top: 22px; }
  .rb-group-photo { margin-top: 40px!important; }
  .rb-group-photo img { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) { .rb-hero-art img { animation: none; } }
.cupec-rebuild .deal-diagram button[aria-pressed=true],
.cupec-rebuild .game-tabs [aria-selected=true],
.cupec-rebuild .game-metrics {
  background: #e3e8dc;
  color: var(--rb-ink);
  border-color: #a8b19e;
}
.cupec-rebuild .deal-diagram button[aria-pressed=true] small,
.cupec-rebuild .game-tabs [aria-selected=true] span,
.cupec-rebuild .game-metrics small { color: var(--rb-muted); }
/* Override the HTML dimensions when photographs scale to a narrow column. */
.rb-photo > img { height: auto; }
/* Simplified public site and a single shared CUPEC wordmark. */
.rb-brand > span, .cupec-rebuild .rb-footer-brand {
  font-family: var(--rb-sans);
  font-weight: 550;
  letter-spacing: -.045em;
}
.rb-brand > span { font-size: 27px; }
.cupec-rebuild .rb-footer-brand { font-size: clamp(64px, 9vw, 125px); line-height: 1; }
.rb-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rb-globe-section { background: #f1f2ec; }
.rb-globe-layout { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 8%; }
.rb-globe-copy .rb-lead { max-width: 440px; margin-top: 30px; font-size: 18px; }
.rb-globe-legend { display: flex; align-items: center; gap: 10px; margin-top: 36px; font-size: 11px; color: var(--rb-muted); }
.rb-globe-legend > span { width: 7px; height: 7px; background: #c4ac62; border-radius: 50%; box-shadow: 0 0 15px 5px #dbc77b55; flex-shrink: 0; }
.rb-globe-visual { min-width: 0; }
.rb-globe-stage { position: relative; aspect-ratio: 1; }
#cupec-globe { display: block; width: 100%; height: 100%; position: relative; z-index: 1; opacity: 0; transition: opacity .4s; }
.rb-globe-stage.ready #cupec-globe { opacity: 1; }
.rb-globe-fallback { position: absolute; inset: 9%; border-radius: 50%; background: linear-gradient(110deg,#ffffff30,#303b4455),url('assets/earth-map.jpg') 78% center/200% 100%; filter: grayscale(.8); box-shadow: inset -18px -5px 35px #2c3b4855,0 0 24px #9aa38c22; }
.rb-globe-stage.ready .rb-globe-fallback { opacity: 0; }
.rb-globe-visual figcaption { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 8px; font-size: 10px; color: var(--rb-muted); }
@media(max-width:767px) {
  .rb-globe-layout { grid-template-columns: 1fr; gap: 22px; }
  .rb-globe-visual { max-width: 520px; width: 100%; margin: auto!important; }
  .rb-globe-copy .rb-lead { font-size: 16px; }
}
@media(max-width:620px) {
  .rb-two { grid-template-columns: 1fr; }
  .rb-globe-legend { font-size: 10px; margin-top: 22px; }
  .rb-globe-visual figcaption { font-size: 9px; }
}
/* The acquisition game lives below the media library, opened by the reader. */
.media-play { border-top: 1px solid var(--rb-line); padding-top: 65px; margin-top: 80px; }
.media-play-intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: 9%; align-items: end; margin-bottom: 35px; }
.media-play-intro > p { max-width: 470px; margin: 0; color: var(--rb-muted); font-size: 16px; line-height: 1.8; }
.media-game { padding: 0; border: 1px solid var(--rb-line); background: #f7f8f2; }
.media-game > summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 28px; font-size: 14px; list-style: none; cursor: pointer; }
.media-game > summary::-webkit-details-marker { display: none; }
.media-game > summary:hover { background: #edf0e6; }
.media-game-toggle { font-size: 25px; font-weight: 300; line-height: 1; transition: transform .2s; }
.media-game[open] > summary { border-bottom: 1px solid var(--rb-line); }
.media-game[open] .media-game-toggle { transform: rotate(45deg); }
.media-game-player { padding: 28px; }
.media-game > .fine { margin: 0; padding: 0 28px 28px; }
.media-game { scroll-margin-top: 24px; }
.cupec-rebuild #acquisition-simulator .sim-dashboard .sim-gain { color: #236d41; }
.cupec-rebuild #acquisition-simulator .sim-dashboard .sim-loss { color: #a12a32; }
.cupec-rebuild #acquisition-simulator .sim-change { background: #e8ebe2; color: #52584b; border-color: #bfc6b3; }
.cupec-rebuild #acquisition-simulator .sim-change.sim-gain { background: #e2efe5; color: #236d41; border-color: #a6c9af; }
.cupec-rebuild #acquisition-simulator .sim-change.sim-loss { background: #f9e6e6; color: #a12a32; border-color: #d8aaaa; }
.cupec-rebuild .sim-failure-impact strong { font-family: var(--rb-serif); }
/* Keep the event return control aligned with the page, with a compact hit area. */
.cupec-rebuild main > [data-page] > .event-backbar { width: 100%; max-width: none; margin: 0; padding: 24px var(--rb-gutter); }
.event-back { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 16px; border: 1px solid #bdc4b3; font-size: 12px; text-decoration: none; background: var(--rb-paper); }
.event-back:hover { background: #e9ede2; }
.event-back > span { font-size: 20px; line-height: 1; }
@media(max-width:700px) {
  .media-play { padding-top: 40px; margin-top: 55px; }
  .media-play-intro { grid-template-columns: 1fr; gap: 22px; }
  .media-game > summary { padding: 20px; }
  .media-game-player { padding: 20px; }
  .media-game > .fine { padding: 0 20px 20px; }
  .media-game .sim-companies { grid-template-columns: 1fr; }
  .cupec-rebuild main > [data-page] > .event-backbar { padding-block: 18px; }
}
/* Quiet navigation and open company rows instead of outlined tiles. */
.cupec-rebuild.challenge-site .challenge-sidebar nav { gap: 4px; }
.cupec-rebuild.challenge-site .challenge-sidebar nav a {
  position: relative;
  border: 0;
  padding: 15px 0 15px 12px;
  background: transparent;
  color: var(--rb-muted);
}
.cupec-rebuild.challenge-site .challenge-sidebar nav a:hover,
.cupec-rebuild.challenge-site .challenge-sidebar nav a[aria-current] {
  border: 0;
  background: transparent;
  color: var(--rb-ink);
}
.cupec-rebuild.challenge-site .challenge-sidebar nav a[aria-current] { font-weight: 600; }
.cupec-rebuild.challenge-site .challenge-sidebar nav a[aria-current]::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 18px;
  transform: translateY(-50%);
  background: #7d8b73;
}
.cupec-rebuild.challenge-site .company-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  column-gap: 48px;
  border-top: 1px solid var(--rb-line);
}
.cupec-rebuild.challenge-site .company,
.cupec-rebuild.challenge-site .company:nth-child(even) {
  padding: 32px 0;
  border: 0;
  border-bottom: 1px solid var(--rb-line);
  background: transparent;
}
.cupec-rebuild.challenge-site .company:hover { background: transparent; }
.cupec-rebuild.challenge-site .company .metrics { margin: 25px 0; gap: 35px; }
.cupec-rebuild.challenge-site .company .spark-row { border-color: #e1e4dc; padding-top: 20px; }
.cupec-rebuild.challenge-site .company-links { margin-top: 25px; gap: 24px; }
.cupec-rebuild.challenge-site .company-links button {
  border: 0;
  background: #e9ede3;
  color: var(--rb-ink);
  padding: 10px 17px;
  min-height: 42px;
}
.cupec-rebuild.challenge-site .company-links button:hover { background: #dfe5d7; }
.cupec-rebuild.challenge-site .toolbar input,
.cupec-rebuild.challenge-site .toolbar select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid #c7cdbf;
  padding: 12px 4px;
}
@media(max-width:767px) {
  .cupec-rebuild.challenge-site .challenge-sidebar nav a { padding-left: 14px; }
}
@media(max-width:620px) {
  .cupec-rebuild.challenge-site .company-grid { column-gap: 28px; }
  .cupec-rebuild.challenge-site .company .metrics { gap: 28px; }
  .cupec-rebuild.challenge-site .company-links { gap: 20px; }
}

/* Use the homepage brand lockup throughout the challenge journey. */
.cupec-rebuild .rb-brand,
.cupec-rebuild .event-header > .rb-brand:first-child {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  flex-shrink: 0;
}
.cupec-rebuild .rb-brand > img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: none;
  mix-blend-mode: multiply;
}
.cupec-rebuild .rb-brand > span {
  font: 550 27px/1 var(--rb-sans);
  letter-spacing: -.045em;
}
.cupec-rebuild .event-header {
  min-height: 100px;
  padding: 20px var(--rb-gutter);
}
@media(max-width:767px) {
  .cupec-rebuild .rb-brand > img { width: 45px; height: 45px; }
  .cupec-rebuild .event-header,
  .cupec-rebuild .challenge-sidebar.navigation-shell {
    min-height: 82px;
    padding: 13px var(--rb-gutter);
  }
}
