/* HER Digital Incubator: base styles, type and layout. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--blush); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Headlines: Unbounded, wide and round like the wordmark. Sentence case. */
h1, h2, h3, h4, .display, .h1, .h2, .h3, .h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--head);
  letter-spacing: var(--track-head);
  line-height: var(--lh-head);
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.04em; }
h1, .h1 { font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.035em; }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); letter-spacing: -0.02em; line-height: 1.25; font-weight: 600; }
h4, .h4 { font-family: var(--font-body); font-size: var(--fs-h4); letter-spacing: 0; line-height: 1.35; font-weight: 700; color: var(--text); }

/* HER-red words: large type only (24 px and up) */
.red { color: var(--red); }
.teal { color: var(--teal); }

/* The marker highlighter: Blush behind a phrase, never as text colour */
.hl {
  background: var(--blush);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  padding: 0 0.12em;
  border-radius: 3px;
}

/* A word with a red marker stroke drawn under or around it (SVG injected by build.py) */
.marked { position: relative; display: inline-block; white-space: nowrap; }
.marked > svg {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}
.marked--under > svg { left: -4%; width: 108%; bottom: -0.2em; height: 0.32em; }
.marked--ring > svg { left: -12%; top: -18%; width: 124%; height: 136%; }

/* Marker note: three to five words, red, at an angle. Once per view. */
.note {
  display: inline-block;
  font-family: var(--font-hand);
  font-size: var(--fs-note);
  line-height: 1.15;
  color: var(--red);
  transform: rotate(-4deg);
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
.lead { font-size: var(--fs-lead); line-height: 1.5; max-width: 40rem; color: var(--text); }
.small { font-size: var(--fs-small); line-height: 1.55; }
.muted { color: var(--text-2); }
strong, b { font-weight: 700; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* Labels: small tracked caps with a teal pill, echoing the lanes */
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--deep);
  margin: 0 0 var(--s-5);
}
.label::before {
  content: "";
  width: 22px; height: 10px;
  border-radius: var(--pill);
  background: var(--teal);
  flex: none;
}
.label--plain::before { display: none; }

.meta {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

/* Status tag for unconfirmed content */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--fill);
  color: var(--deep);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}
.tag--sample::before, .tag--proposed::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red);
}

/* Layout */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }
.section--flush-top { padding-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: var(--s-7);
}
/* Spans use grid-column-end so .start-N can be combined without collapsing */
.span-2 { grid-column-end: span 2; } .span-3 { grid-column-end: span 3; } .span-4 { grid-column-end: span 4; }
.span-5 { grid-column-end: span 5; } .span-6 { grid-column-end: span 6; } .span-7 { grid-column-end: span 7; }
.span-8 { grid-column-end: span 8; } .span-9 { grid-column-end: span 9; } .span-10 { grid-column-end: span 10; }
.span-12 { grid-column: 1 / -1; }
.start-2 { grid-column-start: 2; } .start-3 { grid-column-start: 3; } .start-4 { grid-column-start: 4; }
.start-5 { grid-column-start: 5; } .start-6 { grid-column-start: 6; } .start-7 { grid-column-start: 7; }
.start-8 { grid-column-start: 8; } .start-9 { grid-column-start: 9; }

.stack > * + * { margin-top: var(--s-5); }
.stack-lg > * + * { margin-top: var(--s-7); }

/* Accessibility helpers */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 20px;
  background: var(--deep);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: var(--pill);
}
.skip-link:focus { top: 16px; }

/* Entrance reveals (only once JS has confirmed motion is welcome) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: 90ms; }
.js .reveal[data-delay="2"] { transition-delay: 180ms; }
.js .reveal[data-delay="3"] { transition-delay: 270ms; }

/* Marker strokes draw themselves in once, when seen */
.js .draw path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 900ms var(--ease) 250ms; }
.js .draw.is-in path { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .js .draw path { stroke-dashoffset: 0; }
}
