/* MAT Robotics 6228 — main stylesheet. Tokens live in variables.css. */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-md);
  font-weight: 700;
}
p { margin: 0 0 var(--space-md); }
button { font: inherit; cursor: pointer; }

/* Visible keyboard focus everywhere — CLAUDE.md hard rule */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: min(1200px, 100% - 2.5rem);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus { top: var(--space-md); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-card);
}
.btn-primary:hover, .btn-primary:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  background: var(--color-primary-dark);
}
.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border-color: var(--color-border);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  transform: translateY(-2px);
  border-color: var(--color-primary);
}
/* Light button for use on the blue CTA band */
.btn-light {
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-card);
}
.btn-light:hover, .btn-light:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover, .btn-primary:focus-visible,
  .btn-secondary:hover, .btn-secondary:focus-visible,
  .btn-light:hover, .btn-light:focus-visible { transform: none; }
}

/* ---------- Floating nav ---------- */
.site-header {
  position: sticky;
  top: var(--space-md);
  z-index: 100;
  padding: 0 var(--space-md);
}
.nav-shell {
  width: min(1200px, 100% - 1rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-nav);
  padding: var(--space-sm) var(--space-lg);
}
.nav-logo img { height: 32px; width: auto; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.nav-links a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-heading);
  padding: var(--space-xs) 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-item-dropdown { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% + var(--space-md));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-nav);
  padding: var(--space-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard),
              visibility var(--duration-fast);
}
.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown,
.nav-item-dropdown.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav-dropdown a:hover, .nav-dropdown a:focus-visible {
  background: var(--color-bg-secondary);
}
.nav-dropdown a::after { display: none; }

.nav-lang { display: flex; gap: var(--space-2xs); font-size: var(--text-xs); font-weight: 700; }
.nav-lang a { padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-sm); color: var(--color-body); }
.nav-lang a[aria-current="true"] { color: var(--color-primary); background: var(--color-primary-light); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-heading);
}
/* Hamburger drawn with one bar + two pseudo-bars; becomes an X when open. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--duration-fast) var(--ease-standard),
              opacity var(--duration-fast) var(--ease-standard);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Chevron button beside dropdown parents: opens the submenu for keyboard,
   touch and screen readers (the parent link itself still navigates). */
.nav-sub-toggle {
  width: 28px;
  height: 28px;
  margin-left: calc(var(--space-xs) * -1);
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-heading);
  position: relative;
  vertical-align: middle;
}
.nav-sub-toggle::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -70%) rotate(45deg);
  transition: transform var(--duration-fast) var(--ease-standard);
}
.nav-sub-toggle[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(225deg); }
.nav-sub-toggle:hover { background: var(--color-bg-secondary); }
.nav-item-dropdown { display: flex; align-items: center; }

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    inset: 88px var(--space-md) auto var(--space-md);
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-nav);
    padding: var(--space-md);
    gap: 0;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: var(--space-sm); }
  .nav-links > li > a { flex: 1; }
  .nav-item-dropdown { flex-wrap: wrap; }
  .nav-sub-toggle { width: 44px; height: 44px; margin-left: 0; }
  .nav-item-dropdown .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    display: none;
    width: 100%;
    min-width: 0;
    padding: 0 0 var(--space-xs) var(--space-md);
  }
  .nav-item-dropdown:hover .nav-dropdown,
  .nav-item-dropdown:focus-within .nav-dropdown,
  .nav-item-dropdown.is-open .nav-dropdown { transform: none; }
  .nav-item-dropdown.is-open .nav-dropdown { display: block; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }

  /* Replaces .nav-cta, which hides at this width — the primary conversion
     action stays reachable without a scroll or a menu tap. */
  .mobile-cta-bar { display: flex; }
  body { padding-bottom: 84px; }
}

.mobile-cta-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  justify-content: center;
  padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 24px rgba(16, 42, 86, 0.1);
}
.mobile-cta-bar .btn {
  width: 100%;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: var(--space-3xl) 0 var(--space-2xl);
  /* Was `overflow: hidden`, which — on top of the page-level
     `body { overflow-x: hidden }` reset already above — was hard-clipping
     the sculptural form's intended bleed at the section's own edges.
     overflow-x keeps the horizontal safety net; overflow-y stays visible
     so the form can actually extend past the section per BRIEF.md. */
  overflow-x: clip;
}
.hero-headline-row {
  position: relative;
}
.hero-heading-wrap {
  /* Self-contained stacking context so .hero-mark's negative z-index
     stays local to this element instead of the whole page. */
  position: relative;
  z-index: 0;
}
.hero-mark {
  /* The team's own Business Plan cover uses this exact device: a giant
     outlined team number behind the title — reused here as the real
     brand motif it is, not decoration. */
  position: absolute;
  z-index: -1;
  top: -0.2em;
  left: -0.04em;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(8rem, 17vw, 16rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--color-border);
  text-stroke: 1.5px var(--color-border);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.hero-heading {
  font-size: var(--text-hero);
  letter-spacing: -0.03em;
}
.hero-heading-line { display: block; }
.hero-context {
  font-size: var(--text-sm);
  color: var(--color-body);
  max-width: 46ch;
  margin: var(--space-md) 0 0;
}
.hero-grid {
  display: grid;
  /* Asymmetric ~42:58 split (was a near-symmetric 1.1fr/1fr) so the copy
     and visual columns stop reading as one uniform two-up grid. */
  grid-template-columns: minmax(260px, 0.73fr) 1fr;
  column-gap: clamp(2.5rem, 7vw, 6rem);
  row-gap: var(--space-2xl);
  /* `start`, not `center` — the copy and visual no longer share one
     vertical centerline, which is what reads as "symmetric" regardless
     of the column widths. */
  align-items: start;
  margin-top: var(--space-2xl);
}
.hero-copy {
  align-self: start;
  padding-top: clamp(1rem, 4vw, 2.5rem);
}
.hero-slogan {
  font-size: var(--text-lg);
  color: var(--color-heading);
  font-weight: 600;
}
.hero-desc {
  max-width: 46ch;
  margin-top: var(--space-md);
  font-size: var(--text-base);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.hero-proof {
  /* Demoted from a fourth paragraph of equal rhythm to a light caption —
     the reassurance data stays, it just stops filling the column. */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: baseline;
  margin: var(--space-md) 0 0;
  font-size: var(--text-xs);
  color: var(--color-body);
  opacity: 0.75;
}
.hero-proof strong {
  font-family: var(--font-display);
  color: var(--color-heading);
}
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 0.92;
  align-self: start;
  /* Pulls the visual column above the copy column's top edge — breaks the
     shared vertical anchor of a plain two-column grid. */
  margin-top: clamp(-2rem, -4vw, -0.5rem);
}
.hero-blob {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}
/* Ambient bloom: the furthest-back, softest layer — a wide, heavily
   blurred tint rather than a defined shape, so the sculptural form feels
   like it's lighting the space around it instead of sitting flat on top
   of the page. */
.hero-blob-bloom {
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  filter: blur(60px);
  opacity: 0.45;
}
/* Sharp foreground layer: the primary sculptural form. Deliberately
   oversized and bled past the frame on two sides — BRIEF.md: "the form
   may extend beyond the image boundary while keeping text and controls
   unobstructed." */
.hero-blob-a {
  width: 132%;
  height: 132%;
  top: -18%;
  right: -24%;
  animation: hero-float 13s ease-in-out infinite;
}
/* Soft background layer: larger, blurred, offset opposite corner — gives
   the composition real depth instead of one flat shape. */
.hero-blob-b {
  width: 96%;
  height: 96%;
  bottom: -16%;
  left: -20%;
  opacity: 0.6;
  filter: blur(10px);
  animation: hero-float 17s ease-in-out infinite reverse;
}
/* Fold-shadow and rim-highlight paths inside .hero-blob-a's own SVG — the
   technique that makes a silhouette read as folded 3D instead of a flat
   gradient sticker: a darkened sliver (multiply) paired with a lightened
   sliver (screen) along the same edge. Every fill stays inside the
   existing blue/navy token family — value contrast, not new hues. */
.hero-blob-fold {
  mix-blend-mode: multiply;
  opacity: 0.45;
}
.hero-blob-fold--soft {
  opacity: 0.3;
  filter: blur(6px);
}
.hero-blob-rim {
  mix-blend-mode: screen;
  opacity: 0.8;
}
.hero-photo {
  position: absolute;
  z-index: 1;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg-secondary);
  box-shadow: var(--shadow-photo);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo--main {
  top: 0;
  right: 0;
  width: 92%;
  height: 80%;
  border-radius: var(--radius-xl);
}
/* Second, smaller photo layered over the corner of the first — depth from
   real images rather than decoration. */
.hero-photo--inset {
  left: 0;
  bottom: 0;
  z-index: 2;
  width: 44%;
  height: 40%;
  border: 6px solid var(--color-white);
  border-radius: var(--radius-lg);
}

@keyframes hero-float {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-18px) rotate(3deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-blob { animation: none; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  /* Copy first, photo second on mobile (BRIEF.md). */
  .hero-visual {
    margin-inline: auto;
    margin-top: 0; /* desktop-only anchor-break offset would overlap here */
  }
  .hero-copy { padding-top: 0; }
}

/* ---------- Scroll reveal ----------
   Only hidden when JS is running (the <html class="js"> flag is set in the
   head), so without JS every section is simply visible. main.js adds
   .is-visible once, when the element enters the viewport. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-reveal) var(--ease-standard),
              transform var(--duration-reveal) var(--ease-standard);
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Staggered entrance for direct children (used in hero) */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(16px);
  animation: stagger-in var(--duration-entrance) var(--ease-standard) forwards;
}
[data-stagger] > *:nth-child(1) { animation-delay: 0ms; }
[data-stagger] > *:nth-child(2) { animation-delay: 100ms; }
[data-stagger] > *:nth-child(3) { animation-delay: 200ms; }
[data-stagger] > *:nth-child(4) { animation-delay: 300ms; }
[data-stagger] > *:nth-child(5) { animation-delay: 400ms; }
@keyframes stagger-in {
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  [data-stagger] > * { opacity: 1; transform: none; animation: none; }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-3xl) 0; }
.section-alt { background: var(--color-bg-secondary); }
.section-head { max-width: 60ch; margin-bottom: var(--space-2xl); }
.section-proof {
  margin-top: var(--space-md);
  font-weight: 600;
  color: var(--color-primary);
}
.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}
.section-title { font-size: var(--text-3xl); }
.section-title--display {
  /* Scoped to Sponsors only — a numeral-led headline standing in for the
     eyebrow+heading pair it replaces, not a change to .section-title
     itself, so every other section's heading is untouched. */
  font-size: clamp(2.75rem, 5vw, 4.5rem);
  letter-spacing: -0.01em;
}
.section-title-number { color: var(--color-primary); }

/* Stat tiles */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}
.stat-tile {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  background: #fff;
}
.stat-number { font-family: var(--font-display); font-size: var(--text-2xl); color: var(--color-primary); }
.stat-label { font-size: var(--text-sm); color: var(--color-body); }

/* Timeline */
.timeline { border-left: 2px solid var(--color-border); margin-top: var(--space-xl); }
.timeline-item { position: relative; padding: 0 0 var(--space-xl) var(--space-xl); }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
}
.timeline-year { font-family: var(--font-display); font-weight: 700; color: var(--color-heading); font-size: var(--text-lg); }

/* Project cards (varied layout, not a uniform grid — alternating rows) */
.project-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: center;
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--color-border);
}
.project-row:last-child { border-bottom: none; }
.project-row:nth-child(even) .project-media { order: 2; }
.project-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: var(--color-bg-secondary);
  display: grid;
  place-items: center;
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
  transition: transform var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
}
.project-media img { max-height: 90px; width: auto; }
.project-row:hover .project-media,
.project-row:focus-within .project-media {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-md);
}
.project-link .arrow { transition: transform var(--duration-fast) var(--ease-standard); }
.project-row:hover .arrow, .project-link:focus-visible .arrow { transform: translateX(4px); }
@media (max-width: 760px) {
  .project-row { grid-template-columns: 1fr; }
  .project-row:nth-child(even) .project-media { order: 0; }
}

/* Resource list */
.resource-list { display: grid; gap: var(--space-md); margin-top: var(--space-xl); }
.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  transition: box-shadow var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.resource-item:hover, .resource-item:focus-within {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.resource-title { font-weight: 700; color: var(--color-heading); }
.resource-desc { font-size: var(--text-sm); color: var(--color-body); }

/* Footer */
.site-footer {
  background: var(--color-heading);
  color: #C7D3E8;
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--color-accent-matx); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: var(--space-xl);
}
.footer-social { display: flex; gap: var(--space-md); margin-top: var(--space-md); flex-wrap: wrap; }
.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Background decorative glow — used sparingly per BRIEF.md */
.bg-glow {
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.10), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
