/* ------------------------------------------------------------------
   Lab note style, copied from the Advanced Metal Research site stylesheet
   (amr-website/styles.css): ice-blue ground, ink rules, ticket labels, dotted
   grids, brand red as the single accent, navy block. Consolidated to the
   tokens and components this page uses, plus tables and figure frames.
   ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  --ice: #d9e7eb;
  --ice-2: #c9dbe0;
  --paper: #eaf2f4;
  --ink: #1b2a30;
  --ink-2: #4e6068;
  --line: #9db3ba;
  --line-2: #b9cbd0;
  --red: #b8020d;
  --blue: #13294b;
  --blue-ink: #13294b;
  --on-blue: #eaf2f4;
  --block-sub: #b4c3d6;
  --btn-arrow: var(--red);
  --fig-bg: #fff;
  --tt-moon: block;
  --tt-sun: none;
  --sans: "Saira", "Titillium Web", "Segoe UI", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --measure: 38rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ice: #0f1c22; --ice-2: #15252c; --paper: #16262d;
  --ink: #e2edf0; --ink-2: #9bb0b7;
  --line: #3d565e; --line-2: #2b424a;
  --red: #e0343c;
  --blue: #1a355f; --blue-ink: #8fb0d9; --block-sub: #b9c8da;
  --btn-arrow: #e0343c; --on-blue: #fff;
  --fig-bg: #eaf2f4;
  --tt-moon: none; --tt-sun: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ice: #0f1c22; --ice-2: #15252c; --paper: #16262d;
    --ink: #e2edf0; --ink-2: #9bb0b7;
    --line: #3d565e; --line-2: #2b424a;
    --red: #e0343c;
    --blue: #1a355f; --blue-ink: #8fb0d9; --block-sub: #b9c8da;
    --btn-arrow: #e0343c; --on-blue: #fff;
    --fig-bg: #eaf2f4;
    --tt-moon: none; --tt-sun: block;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ice); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, dl, ul, ol, figure { margin: 0; }
:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; }
::selection { background: var(--red); color: #fff; }
.skip { position: absolute; left: var(--gutter); top: -3rem; background: #1b2a30; color: #eaf2f4; padding: .5rem .75rem; z-index: 100; }
.skip:focus { top: .5rem; }

/* the ticket's micro-labels */
.lbl {
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
}
.lbl b { color: var(--ink); }
.num { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

h1 { font-size: clamp(3rem, 7vw, 6.5rem); line-height: .92; font-weight: 600; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.04; font-weight: 600; letter-spacing: -.03em; text-wrap: balance; }
h3 { font-size: 1.15rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
p { max-width: var(--measure); }
p + p { margin-top: 1rem; }
strong, b { font-weight: 600; }
code { font: .88em ui-monospace, "SF Mono", Menlo, monospace; background: var(--paper); padding: .05em .3em; border-radius: 2px; }

/* buttons and links */
.btn {
  display: inline-flex; align-items: center; gap: .7rem;
  background: var(--ink); color: var(--paper); text-decoration: none;
  font-weight: 600; font-size: .95rem; padding: .85rem 1.2rem; border-radius: 3px;
}
.btn::after { content: ""; width: 8px; height: 8px; background: var(--btn-arrow); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.btn:hover { background: var(--blue); color: var(--on-blue); }
.btn-red { background: #b8020d; color: #fff; }
.btn-red::after { background: #fff; }
.btn-red:hover { background: #8e0209; color: #fff; }
.link { text-decoration: none; border-bottom: 2px solid var(--red); font-weight: 600; }
.link:hover { border-bottom-color: var(--ink); }
.prose a { text-decoration: none; border-bottom: 2px solid var(--red); font-weight: 600; }
.prose a:hover { border-bottom-color: var(--ink); }

/* top bar as a ticket header */
.top {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem;
  padding: .7rem var(--gutter); background: var(--ice); border-bottom: 2px solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; }
.brand-mark { width: 3rem; fill: var(--red); flex: none; }
.brand-name { line-height: 1; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-name small { display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-top: .25rem; }
.nav { display: flex; gap: 1.4rem; justify-content: center; }
.nav a { text-decoration: none; font-size: .9rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--red); padding-bottom: .1rem; }
.nav .nav-home { color: var(--ink); font-weight: 600; padding-right: 1.4rem; border-right: 1px solid var(--line); }
.nav .nav-home:hover { color: var(--red); }
.top-end { display: flex; align-items: center; gap: .6rem; }
.top .btn { white-space: nowrap; }
.theme-toggle {
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; margin: 0; padding: 0; cursor: pointer;
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 3px;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .tt-moon { display: var(--tt-moon); }
.theme-toggle .tt-sun { display: var(--tt-sun); }
@media (max-width: 1180px) { .nav { gap: .8rem; } .nav a { font-size: .8rem; } }
@media (max-width: 760px) { .top { grid-template-columns: 1fr auto; row-gap: .5rem; } .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; gap: 1.1rem; flex-wrap: wrap; } .nav a { font-size: .85rem; } }
@media (max-width: 560px) { .top .btn { display: none; } .brand-name small { display: none; } }

/* ticket blocks */
.ticket {
  position: relative; margin: 0 var(--gutter);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.ticket-head {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-bottom: .6rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--ink);
}
.ticket-head .dots { display: inline-flex; gap: 4px; align-items: center; }
.ticket-head .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); display: block; }
.ticket-head .dots i:nth-child(2) { background: var(--blue-ink); }
.ticket-head .dots i:nth-child(3) { background: var(--red); width: 6px; height: 6px; }
.dotgrid { background-image: radial-gradient(var(--line-2) 1px, transparent 1.2px); background-size: 16px 16px; }

/* hero */
.hero { border-bottom: 2px solid var(--ink); }
.hero .ticket { border-bottom: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.hero-copy { display: grid; gap: 1.5rem; align-content: start; }
.seat { display: grid; gap: .2rem; }
.seat .lbl { color: var(--ink); }
.seat h1 { margin-top: .2rem; }
.hero-sub {
  width: fit-content; margin-top: 1rem; padding-top: .8rem; border-top: 2px solid var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.8rem); line-height: 1.1; font-weight: 600; letter-spacing: -.02em; color: var(--ink-2);
}
.hero-lede { font-size: 1.1rem; color: var(--ink-2); max-width: 32rem; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.hero-figure { position: relative; margin: 0; }
.hero-figure img, .hero-figure video { width: 100%; border-radius: 3px; background: #dfe6ea; }
.hero-figure .lbl-stack { position: absolute; left: .9rem; top: .9rem; display: grid; gap: .3rem; background: var(--ice); padding: .5rem .65rem; border-radius: 2px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* info band: navy with the brand-red edge, barcode in the middle */
.band {
  --ink: #e2edf0; --ink-2: #b4c3d6;
  background: var(--blue); color: var(--ink);
  border-top: 4px solid var(--red);
  padding: 1.25rem var(--gutter);
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 2rem; align-items: center;
}
:root[data-theme="dark"] .band { --ink: #1b2a30; --ink-2: #4e6068; background: #c9dbe0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band { --ink: #1b2a30; --ink-2: #4e6068; background: #c9dbe0; } }
.band .lbl-stack { display: grid; gap: .25rem; }
.barcode {
  height: 54px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 10px,
    var(--ink) 10px 13px, transparent 13px 15px, var(--ink) 15px 16px, transparent 16px 20px,
    var(--ink) 20px 22px, transparent 22px 23px, var(--ink) 23px 26px, transparent 26px 30px);
}
@media (max-width: 860px) { .band { grid-template-columns: 1fr; gap: 1rem; } .barcode { height: 40px; } }

/* facts ticket: one row of numbers */
.facts { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); border-top: 2px solid var(--ink); margin: 0; }
.facts div { padding: 1rem 1.25rem 0 0; border-right: 1px solid var(--line); display: grid; gap: .35rem; align-content: start; min-width: 0; }
.facts div + div { padding-left: 1.25rem; }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.facts dd { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.facts dd.red { color: var(--red); }
.facts p { font-size: .85rem; color: var(--ink-2); }
@media (max-width: 900px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div, .facts div + div { padding: .9rem 0; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .facts div:nth-child(odd) { padding-right: 1rem; border-right: 1px solid var(--line-2); }
  .facts div:nth-child(even) { padding-left: 1rem; }
}

/* section intro: heading left, copy right */
.intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; margin-bottom: 2rem; }
.intro .sub { color: var(--ink-2); margin-top: 1.25rem; font-size: 1.05rem; }
/* copy outside an .intro lines up with the intro's right column (5fr / 7fr split, same gap) */
.body { --g: clamp(2rem, 5vw, 5rem); max-width: none; margin-left: calc((100% - var(--g)) * 5 / 12 + var(--g)); }
.body p, .body ul { color: var(--ink); }
.body p + p { margin-top: 1rem; }
@media (max-width: 900px) { .intro { grid-template-columns: 1fr; } .body { margin-left: 0; } }

/* cols: parallel items under a single top rule */
.cols { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 2rem clamp(1.5rem, 3vw, 2.5rem); margin: 2rem 0; }
.cols > div { border-top: 2px solid var(--ink); padding-top: 1rem; display: grid; gap: .5rem; align-content: start; }
.cols h3 { font-size: 1.5rem; letter-spacing: -.02em; }
.cols p { font-size: .93rem; color: var(--ink-2); }
.cols .eq { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* rows: label and description, hairline separated */
.rows { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 2px solid var(--ink); }
.rows > li { display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--line-2); font-size: .97rem; }
.rows strong { font-weight: 600; }
.rows span { color: var(--ink-2); max-width: 46rem; }
@media (max-width: 760px) { .rows > li { grid-template-columns: 1fr; gap: .3rem; } }

/* sequence: numbered steps */
.seq { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 2px solid var(--ink); counter-reset: s; }
.seq li { counter-increment: s; display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line-2); font-size: .97rem; color: var(--ink-2); }
.seq li::before { content: counter(s, decimal-leading-zero); font-size: 1.5rem; font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--blue-ink); }
.seq li strong { color: var(--ink); font-weight: 600; }

/* the principle quote */
.principle { border-left: 3px solid var(--red); padding-left: 1.25rem; display: grid; gap: .5rem; margin: 2.5rem 0; }
.principle p { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.25; font-weight: 600; letter-spacing: -.02em; max-width: 36rem; }
.note { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--paper); border-top: 2px solid var(--ink); font-size: .95rem; color: var(--ink-2); max-width: 46rem; }
.note strong { color: var(--ink); }

/* figures: drawings and plots sit on paper, films on black */
.fig { margin: 2rem 0; display: grid; gap: .6rem; }
.fig img, .fig video { width: 100%; border-radius: 3px; background: var(--fig-bg); border: 1px solid var(--line); }
.fig figcaption, .clip figcaption { font-size: .8rem; color: var(--ink-2); max-width: 52rem; }
.fig figcaption b, .clip figcaption b { color: var(--ink); }
.clip { display: grid; gap: .5rem; margin: 0; }
.clip video { width: 100%; border-radius: 3px; background: #000; }
.clips { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; margin: 2rem 0; }
.clips .clip:first-child { grid-column: 1 / -1; }
@media (max-width: 760px) { .clips { grid-template-columns: 1fr; } }

/* tables in the rows idiom */
.tbl-wrap { overflow-x: auto; margin: 1.5rem 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: .93rem; font-variant-numeric: tabular-nums; }
.tbl th { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); text-align: left; padding: .6rem 1rem .6rem 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.tbl td { padding: .75rem 1rem .75rem 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl td.n { font-weight: 600; white-space: nowrap; }
.tbl tr.best td { background: var(--paper); }
.tbl .red { color: var(--red); }
.chip { font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; padding: .25rem .45rem; border: 1px solid currentColor; border-radius: 2px; white-space: nowrap; }
.chip.same { color: var(--blue-ink); }
.chip.close { color: var(--ink-2); }
.chip.diff { color: var(--red); }

/* footer */
.foot { margin: 0 var(--gutter); padding: 1.25rem 0 2.5rem; border-top: 2px solid var(--ink); display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; font-size: .8rem; color: var(--ink-2); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot .refs { flex-basis: 100%; display: grid; gap: .3rem; }
.foot .refs a { border-bottom: 1px solid var(--line); }

/* theme cross-fade, only when motion is welcome */
@media (prefers-reduced-motion: no-preference) {
  html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease, fill .18s ease, stroke .18s ease !important;
  }
}
