/*
 * Site polish (design pass, Dec 3, 2026): one spacing scale, one section
 * rhythm, and a few light lab-notebook details. Loaded after m3.css, so it
 * only overrides values; no words, no scripts, no web fonts.
 *
 * Scale: Material 3's 4/8dp grid. Section padding is one token per
 * breakpoint (--sec-y, --sec-y-tight, --sec-y-stack, --hero-top).
 */
:root {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --sec-y: var(--sp-9);          /* section: 96 desktop */
  --sec-y-tight: var(--sp-7);    /* short intro and link sections: 48 */
  --hero-top: var(--sp-8);       /* below the app bar: 64 */
  /* Material 3 shape and elevation (m3.material.io/styles/shape, /styles/elevation) */
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-elevation-level1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent), 0 1px 3px 1px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
  --md-sys-elevation-level2: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent), 0 2px 6px 2px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
  --photo-r: var(--md-sys-shape-corner-extra-large);
  --note-ink: color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent);
  --note-grid: color-mix(in srgb, var(--md-sys-color-primary) 6%, transparent);
  --note-margin: color-mix(in srgb, var(--md-sys-color-tertiary-container) 55%, transparent);
}
@media (max-width: 720px) {
  :root { --sec-y: var(--sp-8); --sec-y-tight: var(--sp-6); --hero-top: var(--sp-6); --photo-r: var(--md-sys-shape-corner-large); }
}

/* ---- Section rhythm ---- */
.hero { padding: var(--hero-top) 0 var(--sec-y); }
section.tight { padding: var(--sec-y-tight) 0; }
/* The hero already ends with a full section gap; an intro block right after
   it starts flush, so the gap is 96 (64 on phones), not 136. */
.hero:not([style]) + section.tight { padding-top: 0; }
/* Two sections on the same surface used to stack 96 + 96 = 192 of air.
   The second one now starts flush, and the gap is one section step with a
   survey tally mark and a hairline centred in it. */
section.band + section.band,
section:not(.band):not(.hero):not(.tight):not(.fda-data) + section:not(.band):not(.hero):not(.tight):not(.fda-data) {
  position: relative; padding-top: 0;
}
section.band + section.band::before,
section.band + section.band::after {
  content: ""; position: absolute; pointer-events: none;
  top: calc(var(--sec-y) / -2 - 8px); height: 16px;
  left: max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter)));
}
section.band + section.band::before {
  width: 56px; background: var(--note-ink);
  -webkit-mask: var(--tally) left center / 56px 16px no-repeat; mask: var(--tally) left center / 56px 16px no-repeat;
  --tally: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M6 2v12M16 2v12M26 2v12M36 2v12M2 12L40 4'/%3E%3C/svg%3E");
}
section.band + section.band::after {
  left: calc(max(var(--gutter), calc((100% - var(--page-max)) / 2 + var(--gutter))) + 72px);
  width: calc(min(100% - 2 * var(--gutter), var(--page-max) - 2 * var(--gutter)) - 72px);
  height: 1px; top: calc(var(--sec-y) / -2);
  background: color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent);
}

/* ---- Heading and block rhythm ---- */
.sec-head h2 { margin-bottom: var(--sp-3); }          /* was 8; every h2 now has 12 below */
.hero .lede { margin-bottom: var(--sp-5); }           /* was 28 */
.cards + h2, .cards ~ h2 { margin-top: var(--sp-7); } /* how it works: Common questions sat 24 under the cards */
.chat + .chat { margin-top: var(--sp-3); }            /* stacked example questions touched */
@media (max-width: 720px) {
  .cards, .cards.two { gap: var(--sp-4); }            /* was 12 */
  .cards.compact > .card { gap: 0 var(--sp-3); padding: var(--sp-4); }  /* was 14 / 14 16 */
}

/* ---- Lab-notebook details (decoration only, nothing moves) ---- */
/* 1. Graph paper behind the hero, with a notebook margin rule. */
.hero { position: relative; isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero::before {
  inset: 0;
  background-image: linear-gradient(to right, var(--note-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--note-grid) 1px, transparent 1px);
  background-size: var(--sp-5) var(--sp-5);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 90%); mask-image: linear-gradient(to bottom, #000 0, transparent 90%);
}
.hero::after {
  top: 0; bottom: 0; width: 1px;
  left: max(var(--sp-2), calc((100% - var(--page-max)) / 2 + var(--gutter) - var(--sp-4)));
  background: linear-gradient(to bottom, var(--note-margin), transparent 85%);
}
/* 2. Specimen tags: a punched hole before the small caps labels. */
.inshort .lab::before, .related .lab::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: var(--sp-2);
  border: 1px solid currentColor; border-radius: 50%; vertical-align: 1px;
}
/* 3. Bird-band rings round the step numbers. */
.step-num { box-shadow: 0 0 0 3px var(--md-sys-color-surface-container-lowest), 0 0 0 4px var(--note-ink); }

/* ---- People photos (Material 3: extra-large corners, elevated level 1, 16:9 on desktop and 3:2 on phones) ---- */
/* The frame: corner brackets 8px outside the photo that follow its corner radius, and a survey scale bar under it. */
.photo { position: relative; margin: 0 0 var(--sp-7); }
p + .photo { margin-top: var(--sp-6); }
.photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 30%;
  border-radius: var(--photo-r); box-shadow: var(--md-sys-elevation-level1); background: var(--md-sys-color-surface-container-low);
}
.photo::before, .photo::after { content: ""; position: absolute; pointer-events: none; }
.photo::before {
  inset: calc(var(--sp-2) * -1); border: 1px solid var(--note-ink); border-radius: calc(var(--photo-r) + var(--sp-2));
  --c: linear-gradient(#000 0 0);
  -webkit-mask: var(--c) 0 0 / 48px 48px no-repeat, var(--c) 100% 0 / 48px 48px no-repeat, var(--c) 0 100% / 48px 48px no-repeat, var(--c) 100% 100% / 48px 48px no-repeat;
  mask: var(--c) 0 0 / 48px 48px no-repeat, var(--c) 100% 0 / 48px 48px no-repeat, var(--c) 0 100% / 48px 48px no-repeat, var(--c) 100% 100% / 48px 48px no-repeat;
}
.photo::after {
  left: var(--sp-2); bottom: calc(var(--sp-3) * -2); width: 120px; height: 8px;
  background:
    repeating-linear-gradient(90deg, var(--note-ink) 0 1px, transparent 1px 8px) 0 0 / 100% 4px no-repeat,
    linear-gradient(var(--note-ink), var(--note-ink)) 0 0 / 1px 8px no-repeat,
    linear-gradient(var(--note-ink), var(--note-ink)) 100% 0 / 1px 8px no-repeat,
    linear-gradient(var(--note-ink), var(--note-ink)) 0 4px / 100% 1px no-repeat;
}
@media (max-width: 720px) {
  .photo { margin-bottom: var(--sp-6); }
  .photo img { aspect-ratio: 3 / 2; }
}
section > .wrap + .wrap { margin-top: var(--sp-8); }
.photo img[src*="handshake"] { object-position: 50% 30%; }
.photo img[src*="trade-show"] { object-position: 50% 20%; }
.photo img[src*="factory-floor"] { object-position: 50% 40%; }
.photo img[src*="lab-visit"] { object-position: 50% 15%; }
/* A real ChatGPT answer in a plain window frame: a bar with the word ChatGPT in system text, no logo, no caption. */
.shot { margin: 0; max-width: 720px; overflow: hidden; border-radius: var(--photo-r); box-shadow: var(--md-sys-elevation-level2); background: var(--md-sys-color-surface-container-lowest); }
.shot-split { align-items: center; }
.shot-split > .shot { width: 100%; justify-self: end; }
.shot-split .cards { grid-template-columns: 1fr; }
.shot img { display: block; width: 100%; height: auto; }
.shot-bar { position: relative; display: flex; align-items: center; justify-content: center; height: var(--sp-7); background: var(--md-sys-color-surface-container); border-bottom: 1px solid var(--md-sys-color-outline-variant); font: 500 0.875rem/1 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--md-sys-color-on-surface-variant); }
.shot-bar::before { content: ""; position: absolute; left: var(--sp-4); width: 10px; height: 10px; border-radius: 50%; background: var(--md-sys-color-outline-variant); box-shadow: 16px 0 0 var(--md-sys-color-outline-variant), 32px 0 0 var(--md-sys-color-outline-variant); }
@media (max-width: 900px) { .shot-split > .shot { justify-self: stretch; } }
/* Phones: the tight crop (792px wide) fills the frame width with no panning; nothing is clipped. */
