/*
 * THE DRAWING SHEET — see DESIGN.md.
 *
 * The page is an engineering drawing sheet, because a drawing is literally
 * what this team produces (documents/mecha-forge/ ships real CAD files).
 * Structure comes from ruled lines and registration marks, never from soft
 * cards or shadows. Nothing here is round, floating or drifting: three
 * attempts at organic decoration were rejected by the owner, and this world
 * is the deliberate opposite.
 *
 * Loaded last, so it governs where it disagrees with the older stylesheets.
 */


/* ------------------------------------------------------------------
   1. THE SUBSTRATE
   A real ruled grid, not a decorative dot field. Minor divisions at the
   module, major every eighth. Low enough contrast to sit under text,
   present enough that the page reads as measured rather than empty.
   ------------------------------------------------------------------ */
.sheet-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-linear-gradient(to right,  var(--rule-major) 0 var(--hair), transparent var(--hair) var(--mod-major)),
    repeating-linear-gradient(to bottom, var(--rule-major) 0 var(--hair), transparent var(--hair) var(--mod-major)),
    repeating-linear-gradient(to right,  var(--rule-minor) 0 var(--hair), transparent var(--hair) var(--mod)),
    repeating-linear-gradient(to bottom, var(--rule-minor) 0 var(--hair), transparent var(--hair) var(--mod));
  /* Fade vertically into the next section; keep line contrast quiet. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}
.section, .hero, .cta-band, .page-hero { position: relative; }
.section > .container,
.hero > .container,
.cta-band > .container,
.page-hero > .container { position: relative; z-index: 1; }

/* ------------------------------------------------------------------
   2. PANEL — replaces the card
   A hairline boundary with L-shaped registration ticks at the corners,
   the way a drawing frames a detail view. Never nested, never rounded.
   ------------------------------------------------------------------ */
.panel {
  position: relative;
  border: var(--hair) solid var(--color-border);
  border-radius: 0;
  background: var(--color-bg);
  padding: calc(var(--mod) * 3);
}
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: var(--tick);
  height: var(--tick);
  border: var(--hair) solid var(--rule-ink);
  opacity: 0.55;
  pointer-events: none;
}
/* Top-left and bottom-right arms; two pseudo-elements give the diagonal
   pair, which is how a drawing marks a frame without boxing it in. */
.panel::before { top: -1px;    left: -1px;   border-width: var(--hair) 0 0 var(--hair); }
.panel::after  { bottom: -1px; right: -1px;  border-width: 0 var(--hair) var(--hair) 0; }

/* ------------------------------------------------------------------
   3. TITLE BLOCK
   A drawing identifies itself in a ruled label/value table. This is where
   small uppercase labels legitimately live — as field names in a table,
   never as a kicker floating above a heading.
   ------------------------------------------------------------------ */
.title-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  border: var(--hair) solid var(--rule-ink);
  border-right: 0;
  border-bottom: 0;
  font-variant-numeric: tabular-nums;
  background: var(--color-bg);
}
.title-block > div {
  border-right: var(--hair) solid var(--rule-ink);
  border-bottom: var(--hair) solid var(--rule-ink);
  padding: calc(var(--mod) * 1.25) calc(var(--mod) * 1.5);
  min-width: 0;
}
.title-block dt,
.tb-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-body);
  margin: 0 0 calc(var(--mod) * 0.5);
}
.title-block dd,
.tb-value {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-heading);
}
/* The period a figure belongs to, so no number is ever stated bare. */
.tb-note {
  display: block;
  margin-top: calc(var(--mod) * 0.5);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-body);
}

/* ------------------------------------------------------------------
   4. DIMENSION CALLOUT
   A measured line with arrow terminators and extension lines. Used to
   annotate real quantities, which is the drawing's way of stating a
   figure — the alternative to a stat tile.
   ------------------------------------------------------------------ */
.dim {
  position: relative;
  display: block;
  color: var(--color-primary);
}
.dim svg { display: block; width: 100%; height: auto; overflow: visible; }
.dim line,
.dim path { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.dim .dim-ext { stroke: var(--color-border); }
.dim-value {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  fill: var(--color-heading);
  font-variant-numeric: tabular-nums;
}

/* The one authored moment: on load the hero's callouts draw themselves from
   origin to terminator, once, left to right. Nothing else on the page
   animates continuously. */
.dim--draw .dim-line {
  stroke-dasharray: var(--dim-len, 240);
  stroke-dashoffset: var(--dim-len, 240);
  animation: dim-draw 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--dim-delay, 700ms);
}
.dim--draw .dim-cap,
.dim--draw .dim-value {
  opacity: 0;
  animation: dim-cap 260ms steps(2, end) forwards;
  animation-delay: calc(var(--dim-delay, 700ms) + 780ms);
}
@keyframes dim-draw { to { stroke-dashoffset: 0; } }
@keyframes dim-cap  { to { opacity: 1; } }

/* ------------------------------------------------------------------
   5. LEDGER — ruled rows for history and resources
   ------------------------------------------------------------------ */
.ledger { border-top: var(--hair) solid var(--rule-ink); }
.ledger-row {
  display: grid;
  grid-template-columns: minmax(84px, 9ch) 1fr;
  gap: calc(var(--mod) * 3);
  align-items: baseline;
  padding: calc(var(--mod) * 2.5) 0;
  border-bottom: var(--hair) solid var(--color-border);
}
.ledger-key {
  font-family: var(--font-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--color-heading);
}

/* ------------------------------------------------------------------
   6. MECHANISM-DRIVEN MOTION
   Things move because something indexes them. Stepped, not eased into a
   drift. This is the direct answer to the rejected floating decoration.
   ------------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translate3d(0, calc(var(--mod) * 2), 0);
  transition:
    opacity 380ms steps(4, end),
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Without JS nothing may stay hidden. */
html:not(.js) .reveal { opacity: 1; transform: none; }

/* ------------------------------------------------------------------
   7. BROWSER SURFACES
   The parts not drawn by hand still carry the design.
   ------------------------------------------------------------------ */
::selection { background: var(--color-selection); color: var(--color-heading); }
:root {
  accent-color: var(--color-primary);
  caret-color: var(--color-primary);
  scrollbar-color: var(--color-border) transparent;
  scrollbar-width: thin;
}
a { text-underline-offset: 0.18em; text-decoration-thickness: from-font; }
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 0;
}
/* Measurements align. Every figure on the sheet is tabular. */
.title-block, .ledger-key, .dim-value, .fact dd, .goal-number,
.event-count, .journey-year, .hero-proof strong { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------
   8. CORRECTIONS TO THE OLD WORLD
   ------------------------------------------------------------------ */
/* Gradient-filled text is banned; emphasis comes from size and weight. */
.goal-number {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: var(--color-heading);
}
/* Ghost-outlined years belonged to the discarded look; on a sheet a year is
   a ledger key, set solid and aligned. */
.journey-year {
  -webkit-text-stroke: 0;
  color: var(--color-heading);
  opacity: 1;
}

@media (max-width: 900px) {
  .ledger-row { grid-template-columns: 1fr; gap: calc(var(--mod)); }
}

@media (prefers-reduced-motion: reduce) {
  /* Every line already drawn, every value already present. */
  .dim--draw .dim-line { animation: none; stroke-dashoffset: 0; }
  .dim--draw .dim-cap,
  .dim--draw .dim-value { animation: none; opacity: 1; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------
   9. HERO AS SHEET
   ------------------------------------------------------------------ */
.hero-title-block { margin-top: calc(var(--mod) * 4); max-width: 46rem; }
.hero-title-block dd { font-size: 1.375rem; }

/* The photo panels are detail views on the sheet: square corners, hairline
   frame, registration ticks. No rounding, no drop shadow doing the work. */
.hero-photo--main,
.hero-photo--inset,
.story-photo,
.journey-photo,
.collage figure {
  border-radius: 0;
  box-shadow: none;
  border: var(--hair) solid var(--color-border);
}
.hero-photo--inset { border-width: var(--hair); }

.dim--hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--mod) * -3.5);
  z-index: 3;
}

/* Section headings carry their own weight now that the kicker labels are
   gone, so they get the space the label used to occupy. */
.section-head { margin-bottom: calc(var(--mod) * 6); }
.section-title { letter-spacing: -0.035em; }

/* ------------------------------------------------------------------
   10. PANELS REPLACE CARDS
   ------------------------------------------------------------------ */
.bento-card,
.resource-item,
.fact,
.chip-list li,
.sponsor-tile {
  border-radius: 0;
}
.bento-card {
  border: var(--hair) solid var(--color-border);
  box-shadow: none;
}
.bento-card:hover,
.bento-card:focus-visible {
  box-shadow: none;
  border-color: var(--color-primary);
  transform: none;
}
/* Movement on a drawing is indexed, not floated: the card's own rule slides
   to meet the pointer instead of the whole card lifting. */
.bento-card::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent, var(--color-primary));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.bento-card:hover::after,
.bento-card:focus-visible::after { transform: scaleX(1); }

.journey-item { position: relative; }

@media (prefers-reduced-motion: reduce) {
  .bento-card::after { transition: none; }
}

/* ------------------------------------------------------------------
   11. NARROW-VIEWPORT CORRECTIONS
   ------------------------------------------------------------------ */
/* A grid item's default min-width:auto lets a wide child set the track's
   floor. The title block's six 96px columns were doing exactly that —
   forcing a 577px track inside a 335px grid and pushing the headline and
   body copy out past the clip edge. Both halves of the fix are needed:
   the track must be allowed to shrink, and the columns must be able to
   drop below their preferred width. */
.hero-grid > *,
.story-grid > *,
.journey-grid > *,
.outreach-grid > * { min-width: 0; }

.title-block {
  grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr));
}

@media (max-width: 640px) {
  /* "ROBOTICS" is a single unbreakable word, so the display size has to be
     derived from the viewport rather than inherited from the desktop ramp;
     at the inherited size it ran off the sheet. */
  .hero-heading { font-size: clamp(2.25rem, 12.5vw, 4rem); }
  .hero-mark { font-size: clamp(4rem, 22vw, 8rem); }
  .hero-title-block { margin-top: calc(var(--mod) * 3); }
  .title-block dd { font-size: 1rem; }
}

/* Polished sheet: a shared frame, stable facts grid and consistent details. */
.site-header { padding-inline: 0; }
.nav-shell {
  width: min(1200px, 100% - var(--space-xl));
  background: var(--color-bg);
  backdrop-filter: none;
  border-radius: 0;
  box-shadow: none;
}
.nav-dropdown, .nav-toggle, .nav-lang a, .nav-dropdown a,
.nav-sub-toggle, .btn { border-radius: 0; }
.btn { min-height: 44px; justify-content: center; box-shadow: none; }
.btn:hover, .btn:focus-visible { transform: none; box-shadow: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { border-radius: 0; }

.hero { padding-block: var(--space-2xl); }
.hero-grid { row-gap: var(--space-xl); }
.hero-heading { font-size: var(--text-sheet-hero); line-height: 1; }
.hero-desc { max-width: 52ch; }
.hero-visual { align-self: center; margin-bottom: var(--space-xl); }
.hero-title-block {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr) minmax(0, 1.2fr);
  max-width: none;
  width: 100%;
  margin: 0;
  border-color: var(--color-border);
}
.hero-title-block > div {
  border-color: var(--color-border);
  padding: var(--space-md) var(--space-lg);
}
.hero-title-block dd { font-size: var(--text-xl); line-height: var(--leading-snug); }
.hero-title-block dt { font-size: var(--text-sheet-label); letter-spacing: 0.06em; }
.hero-title-block .tb-note { font-size: var(--text-sheet-label); }

.section-head { max-width: 52rem; }
.section-head > p { max-width: 60ch; }
.section-title, .page-title, .cta-copy h2 { text-wrap: balance; }
.section-title { font-size: var(--text-sheet-section); }
.section-title--sm { font-size: var(--text-2xl); }
.section-title--display { font-size: var(--text-sheet-display); }
.page-hero { border-bottom: var(--hair) solid var(--color-border); }
.page-hero-media::before { content: none; }
.page-hero-media img, .gallery figure, .events-photos figure, .project-media {
  border-radius: 0;
  box-shadow: none;
  border: var(--hair) solid var(--color-border);
}
.values-grid li, .team-grid li, .why-grid li, .note-card,
.goal-band, .related-list a, .related-logo, .issue-grid a,
.file-links a, .resource-badge, .cta-contact { border-radius: 0; }
.related-list a:hover, .related-list a:focus-visible { box-shadow: none; border-color: var(--color-primary); }
.cta-band { background: var(--color-primary); }
.cta-band::before { content: none; }
.cta-contact { background: transparent; }

/* Retain the rule/arrow interaction without moving the panel's grid edge. */
.js .bento-card.reveal.is-visible:hover,
.js .bento-card.reveal.is-visible:focus-visible,
.resource-item:hover, .resource-item:focus-within,
.js .resource-item.reveal.is-visible:hover,
.js .resource-item.reveal.is-visible:focus-within {
  transform: none;
  box-shadow: none;
  border-color: var(--color-primary);
}
.bento-tile .bento-body { flex: 1; }
.resource-list { gap: 0; border-top: var(--hair) solid var(--color-border); }
.resource-item { border: 0; border-bottom: var(--hair) solid var(--color-border); }
.resource-item > div { min-width: 0; }

@media (max-width: 1100px) and (min-width: 861px) {
  .nav-shell, .nav-links { gap: var(--space-sm); }
  .nav-shell { padding-inline: var(--space-md); }
  .nav-cta { padding-inline: var(--space-md); }
}
@media (max-width: 900px) {
  .hero { padding-top: var(--space-xl); }
  .hero-heading { font-size: var(--text-sheet-hero-tablet); }
  .hero-title-block { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-title-block > div { padding: var(--space-md); }
  .hero-title-block dd { font-size: var(--text-lg); }
  .hero-visual { margin-top: 0; }
}
@media (max-width: 860px) {
  .nav-links { border-radius: 0; box-shadow: none; max-height: calc(100dvh - 160px); overflow-y: auto; }
}
@media (max-width: 640px) {
  .hero-heading { font-size: var(--text-sheet-hero-mobile); }
  .hero-title-block > div { padding: var(--space-sm); }
  .hero-title-block dd { font-size: var(--text-base); }
  .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
  .hero-actions .btn { padding-inline: var(--space-sm); text-align: center; }
  .bento-body { padding: var(--space-lg); }
  .section-head { margin-bottom: var(--space-xl); }
  .resource-item { padding: var(--space-lg) 0; }
}
