:root {
  --bg: #fff;
  --tint: #f4f4f4;
  --ink: #010205;
  --muted: #6b6d70;
  --line: #e0e0e0;
  --accent: #d5001c;
  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wrap { width: min(1200px, calc(100% - clamp(40px, 8vw, 128px))); margin-inline: auto; }

/* type */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.08; }
h2 { font-size: clamp(2rem, 4.6vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 1rem; }
p { margin: 0 0 1rem; }
.label { margin: 0 0 1rem; font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* header */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 56px); height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.brand { text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.top nav { display: flex; gap: clamp(1rem, 3vw, 2.4rem); }
.top nav a { text-decoration: none; font-size: .9rem; color: var(--muted); transition: color .2s; }
.top nav a:hover { color: var(--ink); }

/* crossfade images */
.xf { position: relative; overflow: hidden; background: var(--tint); }
.xf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s var(--ease); }
.xf img.out { opacity: 0; }

/* controls */
.env { display: flex; flex-wrap: wrap; gap: 1.6rem; }
.seg { display: flex; gap: 1.2rem; }
.env[hidden], .thumbs[hidden], .arrow[hidden] { display: none; }
.seg button { padding: .3rem 0; border: 0; border-bottom: 1px solid transparent; background: none; font-size: .9rem; color: var(--muted); transition: color .2s, border-color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.dark .seg button { color: #9a9ca0; }
.dark .seg button:hover { color: #fff; }
.dark .seg button[aria-pressed="true"] { color: #fff; border-color: #fff; }

/* hero */
.hero { position: relative; padding-top: 64px; }
.hero-img { aspect-ratio: 16 / 8; min-height: 56vh; max-height: 78vh; width: 100%; }
.hero-text { width: min(1200px, calc(100% - clamp(40px, 8vw, 128px))); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) 0 1rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); font-weight: 600; letter-spacing: -.035em; max-width: 14ch; }
.lede { max-width: 40ch; margin: 1.6rem 0 2rem; font-size: 1.25rem; color: var(--muted); }
.link { display: inline-block; padding-bottom: .2rem; text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 1px solid var(--ink); transition: color .2s, border-color .2s; }
.link:hover { color: var(--accent); border-color: var(--accent); }
.hero .env { width: min(1200px, calc(100% - clamp(40px, 8vw, 128px))); margin: 2rem auto 0; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* sections */
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section.tint { background: var(--tint); }
.section.dark { background: #000; color: #fff; }
.dark .label { color: #9a9ca0; }
.section h2 { max-width: 18ch; }

/* steps */
.steps { list-style: none; margin: clamp(2.5rem, 6vw, 5rem) 0 0; padding: 0; }
.step { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); width: min(1400px, calc(100% - clamp(40px, 8vw, 128px))); margin: 0 auto clamp(3rem, 8vw, 7rem); }
.step:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.step:nth-child(even) figure { order: 2; }
.step figure { margin: 0; aspect-ratio: 16 / 10; }
.step-copy { max-width: 28rem; }
.num { margin: 0 0 1.4rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.step-copy p:last-child { margin: 0; color: var(--muted); }

/* gallery */
.viewer { position: relative; margin-top: clamp(2rem, 5vw, 3.5rem); aspect-ratio: 16 / 9; }
.viewer .xf { position: absolute; inset: 0; background: #111; }
.arrow { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; width: 52px; height: 52px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #000; font-size: 1.7rem; line-height: 1; transition: background .2s, transform .2s var(--ease); }
.arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.arrow.prev { left: 1.2rem; }
.arrow.next { right: 1.2rem; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 1.4rem; }
.viewer-bar p { margin: 0; font-size: 1.1rem; font-weight: 600; }
.thumbs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .5rem; margin-top: 1.4rem; }
.thumbs button { aspect-ratio: 16 / 10; padding: 0; border: 0; background: #111; opacity: .45; overflow: hidden; transition: opacity .25s; outline-offset: 2px; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button:hover { opacity: .8; }
.thumbs button[aria-pressed="true"] { opacity: 1; outline: 1px solid #fff; }
.dark :focus-visible { outline-color: #fff; }

/* chemistry */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 6rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.cols article { padding-top: 1.6rem; border-top: 1px solid var(--ink); }
.cols article > p:not(.label) { color: var(--muted); }
.note { margin-top: 1.4rem !important; padding-left: 1rem; border-left: 2px solid var(--accent); font-size: .95rem; color: var(--ink) !important; }

/* kit */
.kit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.6rem, 3vw, 3rem) clamp(1.6rem, 3vw, 3rem); margin-top: clamp(2.5rem, 5vw, 4rem); }
.kit article { padding-top: 1.4rem; border-top: 1px solid var(--ink); }
.kit h3 { font-size: 1.3rem; margin-bottom: .7rem; }
.kit p:last-child { margin: 0; color: var(--muted); font-size: .98rem; }

/* footer */
.footer { padding-block: 2rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.footer-in { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .top nav a:nth-child(n+3) { display: none; }
  .step, .step:nth-child(even) { grid-template-columns: 1fr; gap: 1.6rem; }
  .step:nth-child(even) figure { order: 0; }
  .cols, .kit { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero-img { aspect-ratio: 4 / 3; }
  .arrow { width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
