/* ============================================================================
 * RBC Quest — styles
 * Professional, blue-forward, education-first. Light theme with dark support.
 * ==========================================================================*/

:root {
  /* RBC brand (sampled from assets/rbc-logo.png) */
  --rbc-blue: #0054b4;
  --rbc-blue-deep: #00397e;
  --rbc-blue-bright: #1f74d0;
  --rbc-gold: #fce400;

  /* Questor Labs brand (sampled from assets/questor-labs-logo.png) */
  --questor-green: #30a848;
  --questor-green-dark: #0c6048;

  /* chrome aliases — RBC-blue-forward */
  --navy: var(--rbc-blue-deep);
  --navy-2: var(--rbc-blue);
  --blue: var(--rbc-blue);
  --blue-bright: var(--rbc-blue-bright);

  --bg: #eef2f9;
  --bg-2: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;

  --text: #0f172a;
  --text-muted: #52607a;
  --text-onDark: #eaf1ff;

  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 30px -12px rgba(15, 23, 42, .18);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .08), 0 24px 48px -18px rgba(29, 78, 216, .35);

  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
          "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1220;
    --bg-2: #0d1626;
    --surface: #121c2e;
    --surface-2: #17233a;
    --border: #223148;

    --text: #eaf1ff;
    --text-muted: #9db0cd;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 32px -14px rgba(0, 0, 0, .6);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .45), 0 26px 52px -20px rgba(59, 130, 246, .45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.15; margin: 0; }
p { margin: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------------ banner */
.mobile-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1rem;
  background: linear-gradient(90deg, #fde68a, #fcd34d);
  color: #4a2e05;
  font-size: .92rem;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35);
}
.mobile-banner[hidden] { display: none; }
.mobile-banner__icon { font-size: 1.25rem; line-height: 1; }
.mobile-banner p { flex: 1; }
.mobile-banner strong { font-weight: 700; }
.mobile-banner__close {
  border: 0;
  background: rgba(74, 46, 5, .12);
  color: inherit;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}
.mobile-banner__close:hover { background: rgba(74, 46, 5, .22); }

/* -------------------------------------------------------------------- hero */
.hero {
  position: relative;
  color: var(--text-onDark);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(31, 116, 208, .55), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(0, 84, 180, .45), transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--rbc-blue-bright) 130%);
  padding: clamp(2.6rem, 6vw, 4.6rem) 1.25rem clamp(2.4rem, 5vw, 3.8rem);
  text-align: center;
  overflow: hidden;
}
.hero::after {
  /* subtle top-light sheen */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 50% 0%, rgba(255, 255, 255, .10), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
/* white logo chip, shared by the hero crest and the footer Questor mark */
.brandchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, .5);
}
.hero__crest {
  margin: 0 auto 1.15rem;
  padding: 12px 16px;
}
.hero__crest img {
  height: 76px;
  width: auto;
  display: block;
}
.hero__title {
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero__tagline {
  margin-top: .5rem;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 600;
  color: #bcd3ff;
}
.hero__sub {
  margin: 1rem auto 0;
  max-width: 46ch;
  color: #cddcf7;
  font-size: 1rem;
}
.hero__present {
  margin-top: 1.2rem;
  font-size: .9rem;
  color: #bcd3ff;
}
.hero__present a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--rbc-gold);
  padding-bottom: 1px;
}
.hero__present a:hover { color: var(--rbc-gold); }

/* ------------------------------------------------------------------ layout */
main { flex: 1; }

.catalog {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.2rem) 1.25rem 3rem;
}
.catalog__head { text-align: center; margin-bottom: clamp(1.4rem, 3vw, 2.2rem); }
.catalog__heading { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 750; }
.catalog__hint { color: var(--text-muted); margin-top: .4rem; font-size: .96rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: stretch;
}

/* full-width labelled section dividers inside the grid */
.grid__section {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
}
.grid__section:not(:first-child) { margin-top: 1.4rem; }
.grid__section-title {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.grid__section-title::before {
  content: "";
  width: 10px;
  height: 22px;
  border-radius: 3px;
  background: var(--rbc-blue);
}
.grid__section--math .grid__section-title::before { background: var(--questor-green); }
.grid__section-blurb { color: var(--text-muted); font-size: .92rem; }

/* -------------------------------------------------------------------- card */
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card__banner {
  position: relative;
  height: 156px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
}
.card__banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 50% -10%, rgba(255, 255, 255, .28), transparent 60%);
}
.card__emoji {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .25));
}
.card__logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 14px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45));
}
.card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(6, 12, 24, .62);
  color: #fff;
  font-size: .72rem;
  font-weight: 650;
  padding: .28rem .55rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .18);
}

.card__body {
  padding: 1.05rem 1.15rem 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
}
.card__titlerow { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.card__title { font-size: 1.22rem; font-weight: 750; }
.card__age {
  font-size: .74rem;
  font-weight: 650;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .2rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.card__blurb { color: var(--text-muted); font-size: .95rem; }

.card__skills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .1rem; }
.chip {
  font-size: .74rem;
  font-weight: 600;
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  padding: .22rem .55rem;
  border-radius: 999px;
}
@media (prefers-color-scheme: dark) {
  .chip { color: #9fc0ff; }
}

.card__foot {
  margin-top: auto;
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

/* ------------------------------------------------------------------ button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  padding: .72rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .98rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .15s ease, background .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn--play {
  color: #fff;
  background: linear-gradient(180deg, var(--rbc-blue-bright), var(--rbc-blue));
  box-shadow: 0 8px 18px -10px rgba(0, 84, 180, .85);
}
.btn--play:hover { filter: brightness(1.06); }
.btn--play:focus-visible { outline: 3px solid #7db4ec; outline-offset: 2px; }
.btn--disabled {
  color: var(--text-muted);
  background: var(--surface-2);
  border-color: var(--border);
  cursor: not-allowed;
  font-weight: 650;
}
.btn__arrow { font-size: 1.05em; }

/* --------------------------------------------------- footer (Questor Labs) */
.site-footer {
  border-top: 3px solid var(--questor-green);
  background: var(--bg-2);
  padding: 1.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  color: var(--text-muted);
  font-size: .88rem;
}
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.qbrand__chip { padding: 10px 14px; flex: none; }
.qbrand__chip img { height: 40px; width: auto; display: block; }
.qbrand__tagline {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -.01em;
  color: var(--questor-green-dark);
}
.qbrand__note { margin-top: .15rem; }
.qbrand__note a { color: var(--questor-green); font-weight: 700; text-decoration: none; }
.qbrand__note a:hover { text-decoration: underline; }

.site-footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  text-align: right;
}
.site-footer__mark { font-weight: 800; color: var(--rbc-blue); font-size: 1rem; }

@media (prefers-color-scheme: dark) {
  .qbrand__tagline { color: #4cd07a; }
  .qbrand__note a { color: #4cd07a; }
  .site-footer__mark { color: #7db4ec; }
}

/* ------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover, .card:focus-within { transform: none; }
}
