/* ============================================================
   iMINDBench — homepage
   Palette, type and shared controls live in assets/theme.css.
   ============================================================ */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  color: var(--surface);
  background: var(--text);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  color: var(--surface);
  transform: translateY(0);
}

/* ============================================================
   MASTHEAD
   The activity canvas fills the whole band as texture, so the band owns
   its own ink-on-dark colors independently of the active theme.
   ============================================================ */

.site-header {
  position: relative;
  overflow: hidden;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  background: var(--masthead);
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 12rem, 1080px);
  margin: 0 auto;
  padding: 7.75rem 0 4.5rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.4rem;
  color: var(--masthead-text);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 0.95;
}

.site-subtitle {
  margin-bottom: 0;
  color: var(--masthead-muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.35rem;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--masthead-border);
  border-radius: var(--radius);
  color: var(--masthead-text);
  background: var(--masthead-scrim);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.resource-link svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.resource-link:hover {
  border-color: var(--masthead-text);
  color: var(--masthead-text);
  background: var(--masthead-hover);
}

/* The primary action is set apart by hue and weight rather than position, so
   adding another resource link cannot silently steal the emphasis. */
.resource-link--primary {
  margin-left: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-color: var(--masthead-text);
  color: var(--masthead);
  background: var(--masthead-text);
  font-weight: 600;
}

.resource-link--primary:hover {
  border-color: var(--masthead-text);
  color: var(--masthead);
  background: #ffffff;
}

.resource-link:focus-visible {
  outline-color: var(--masthead-text);
}

.hero-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Keeps the trace from competing with the wordmark: it stays legible along
   the outer band and fades out under the copy. */
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      82% 72% at 16% 66%,
      var(--masthead) 0%,
      var(--masthead-scrim) 30%,
      transparent 64%
    ),
    linear-gradient(
      180deg,
      var(--masthead) 0%,
      transparent 13%,
      transparent 86%,
      var(--masthead) 100%
    );
}

.hero-activity {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

/* ============================================================
   LAYOUT & SECTIONS
   ============================================================ */

main {
  width: min(100% - 12rem, 1080px);
  margin: 0 auto;
}

.content-section {
  padding: 4.75rem 0 0;
}

.intro-section {
  max-width: 760px;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.5rem, 3.6vw, 1.85rem);
  letter-spacing: -0.028em;
  line-height: 1.2;
}

.section-lead {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.6;
}

.section-lead strong {
  font-weight: 600;
}

.benchmark-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0;
  margin: 1.9rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.benchmark-facts span {
  display: inline-flex;
  align-items: baseline;
}

.benchmark-facts span:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 1.5em;
  margin: 0 1.5rem;
  background: var(--border);
  transform: translateY(0.3em);
}

.benchmark-facts strong {
  margin-right: 0.5rem;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.figure-section,
.citation-section {
  margin-top: 2.75rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 1.85rem;
}

.section-heading > p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* ============================================================
   FIGURES
   ============================================================ */

.figure-card {
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* The figure PNGs have white baked in, so they keep a light plate in both
   themes rather than sitting straight on the dark card. */
.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--plate);
}

.figure-card figcaption {
  max-width: 900px;
  margin: 1.1rem 0 0.5rem;
  padding: 0 0.55rem;
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.65;
}

.figure-card figcaption a {
  color: var(--accent);
  font-weight: 500;
}

.figure-card figcaption a:hover {
  color: var(--accent-dark);
}

/* ============================================================
   CITATION
   ============================================================ */

.citation-code {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.citation-code code {
  font: inherit;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .header-inner,
  main {
    width: min(100% - 6rem, 1080px);
  }
}

@media (max-width: 820px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: 4.25rem;
    padding-bottom: 2.75rem;
  }

  /* Too little room for an off-centre scrim, so hold the trace to the edges. */
  .hero-visual::after {
    background: linear-gradient(
      180deg,
      var(--masthead) 0%,
      var(--masthead-scrim) 20%,
      var(--masthead-scrim) 80%,
      var(--masthead) 100%
    );
  }

  .header-actions {
    justify-content: space-between;
    width: 100%;
  }

  .resource-links {
    justify-content: flex-start;
  }

}

@media (max-width: 560px) {
  .header-inner,
  main {
    width: min(100% - 2.5rem, 1080px);
  }

  .header-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .section-lead {
    font-size: 1.1rem;
  }

  .benchmark-facts {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }

  .benchmark-facts span:not(:last-child)::after {
    display: none;
  }

  .figure-card {
    padding: 0.35rem;
  }

}

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

  .resource-link {
    transition: none;
  }
}
