/* Smit Arekar portfolio. Hand-written, no build step. */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter-latin-opsz.woff2") format("woff2-variations"),
       url("../assets/fonts/inter-latin-opsz.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #000;
  --bg-2: #0a0a0b;
  --surface: #161617;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --line: #2a2a2d;
  --rule: #424245;
  --link: #2997ff;
  --button: #0071e3;
  --button-hover: #0066cc;

  /* Role tints for die blocks */
  --t-compute: oklch(0.79 0.065 245);
  --t-accel: oklch(0.81 0.07 186);
  --t-memory: oklch(0.77 0.085 302);
  --t-interconnect: oklch(0.83 0.08 78);
  --t-analog: oklch(0.77 0.09 34);

  --font: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 5vw, 48px);
  --nav-h: 48px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

[data-group="compute"] { --tint: var(--t-compute); }
[data-group="accel"] { --tint: var(--t-accel); }
[data-group="memory"] { --tint: var(--t-memory); }
[data-group="interconnect"] { --tint: var(--t-interconnect); }
[data-group="analog"] { --tint: var(--t-analog); }

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  scrollbar-color: #3a3a3c var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.47;
  letter-spacing: -0.011em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html.sheet-open { overflow: hidden; }

::selection { background: rgb(41 151 255 / 0.42); color: #fff; }

a { color: var(--link); text-decoration: none; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }

img, svg { display: block; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  letter-spacing: 0;
  padding: 0.08em 0.36em;
  border-radius: 5px;
  background: rgb(255 255 255 / 0.08);
  color: var(--text);
}

h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1em; height: 1em; flex: none; }

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: top 0.2s var(--ease-out);
}
.skip:focus { top: 12px; }

.no-js .js-only { display: none !important; }

/* ---------------------------------------------------------------- Nav */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: rgb(22 22 23 / 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}
.nav.is-scrolled { box-shadow: 0 1px 0 rgb(255 255 255 / 0.08); }

.nav-inner {
  max-width: calc(1120px + 2 * var(--gutter));
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-name {
  margin-right: auto;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.nav-name:hover { text-decoration: none; color: #fff; }
/* The name shows once: the hero carries it, and the nav takes it over after the hero's headline scrolls away */
.js .nav-name { transition: opacity 0.3s ease, visibility 0s linear 0.3s; }
.js .nav:not(.is-past-hero) .nav-name { opacity: 0; visibility: hidden; }
.js .nav.is-past-hero .nav-name { transition: opacity 0.3s ease; }

.nav-links { display: flex; gap: 30px; margin: 0; padding: 0; list-style: none; font-size: 0.8125rem; }
.nav-links a {
  color: rgb(245 245 247 / 0.78);
  font-size: 0.8125rem;
  letter-spacing: -0.005em;
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="true"] { color: #fff; text-decoration: none; }

.nav-email { color: var(--link); font-size: 0.8125rem; letter-spacing: -0.005em; }

.nav-toggle { display: none; }

/* ---------------------------------------------------------------- Buttons and links */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 980px;
  background: var(--button);
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}
.pill:hover { background: var(--button-hover); text-decoration: none; }
.pill:active { transform: scale(0.97); transition-duration: 0.06s; }

.pill--ghost {
  min-height: 36px;
  padding: 0 18px;
  background: transparent;
  color: var(--link);
  font-size: 0.9375rem;
  box-shadow: inset 0 0 0 1px rgb(41 151 255 / 0.7);
}
.pill--ghost:hover { background: rgb(41 151 255 / 0.12); box-shadow: inset 0 0 0 1px var(--link); }

.link-chev, .link-out {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  color: var(--link);
}
.link-chev { font-size: 1.0625rem; }
.link-chev .i { width: 0.78em; height: 0.78em; transition: transform 0.24s var(--ease-out); }
.link-chev:hover .i { transform: translateX(2px); }
.link-out .i { width: 0.85em; height: 0.85em; transition: transform 0.24s var(--ease-out); }
.link-out:hover .i { transform: translate(1.5px, -1.5px); }

.repo { font-family: var(--mono); font-size: 0.88em; letter-spacing: 0; }

/* ---------------------------------------------------------------- Shared type */

.h-section {
  margin: 0;
  font-size: clamp(2.25rem, 1.35rem + 3.6vw, 4rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.028em;
}

.lead {
  text-wrap: balance;
  max-width: 46ch;
  margin: 1.1rem auto 0;
  color: var(--text-2);
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.5rem);
  line-height: 1.38;
  letter-spacing: -0.014em;
}

.section-head { max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); text-align: center; }

.h-small { margin: 0 0 0.85rem; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.016em; }

/* Spec list: Apple tech-specs rows */
.spec { margin: 1.6rem 0 0; }
.spec > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.72rem 0;
  border-top: 1px solid var(--line);
}
.spec > div:last-child { border-bottom: 1px solid var(--line); }
.spec dt { color: var(--text-3); font-size: 0.875rem; line-height: 1.5; padding-top: 0.1em; }
.spec dd { margin: 0; color: var(--text); font-size: 0.9375rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.when { display: block; margin-top: 0.15rem; color: var(--text-3); font-size: 0.875rem; }

/* ---------------------------------------------------------------- Hero: the real layout as a specimen */

.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(24px, 5vh, 64px)) var(--gutter) clamp(24px, 4vh, 48px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(40px, 5vw, 96px);
  width: min(1120px, 100%);
  margin: 0 auto;
}

/* Two-tone headline: the name in white, the one-liner in grey, one size and one weight */
.hero-title {
  margin: 0;
  color: var(--text-2);
  font-size: clamp(2.5rem, 1.1rem + 2.9vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero-name { display: block; color: var(--text); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 2rem;
}

/* The specimen: the UART's routed GDS, plotted straight from the file (tools/plot_gds.py) and set
   on the stage. The frame is the die plus 3 um of margin: 133.42 x 144.14 um. */
.specimen {
  container-type: inline-size;
  width: min(560px, 44vw, max(300px, calc((100svh - 330px) * 0.9254)));
  margin: 0;
}

.specimen-frame {
  position: relative;
  aspect-ratio: 1240 / 1340;
  cursor: crosshair;
}

.specimen-img {
  width: 100%;
  height: 100%;
  animation: expose 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s backwards;
}

/* Arrival: the layout is exposed top to bottom, once, behind a thin scan line */
.exposure {
  position: absolute;
  inset: 0;
  pointer-events: none;
  animation: beam 1.6s cubic-bezier(0.65, 0, 0.35, 1) 0.2s both;
}
.exposure::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  top: 0;
  height: 56px;
  transform: translateY(-100%);
  background: linear-gradient(to bottom, rgb(255 255 255 / 0), rgb(255 255 255 / 0.08));
  border-bottom: 1px solid rgb(255 255 255 / 0.7);
}
@keyframes expose {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes beam {
  from { transform: translateY(0); opacity: 1; }
  88% { opacity: 1; }
  to { transform: translateY(100%); opacity: 0; }
}

/* Loupe: 3x over a 3600 px plot, with a cursor readout in microns from the die origin */
.loupe {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  background-color: #000;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.4),
    0 22px 44px -14px rgb(0 0 0 / 0.9);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.loupe::before,
.loupe::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgb(255 255 255 / 0.8);
}
.loupe::before { width: 13px; height: 1px; transform: translate(-50%, -50%); }
.loupe::after { width: 1px; height: 13px; transform: translate(-50%, -50%); }

.probe {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 980px;
  background: rgb(0 0 0 / 0.78);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.specimen-cap {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 0.9rem;
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.45;
}
/* 10 um at the plot's own scale: 10 / 133.42 um of frame width */
.scalebar {
  display: inline-flex;
  flex-direction: column;
  flex: none;
  gap: 4px;
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0;
}
.scalebar i {
  display: block;
  width: 7.495cqw;
  height: 4px;
  border: 1px solid currentColor;
  border-top: 0;
}

/* Proof line: four readouts in one quiet line, each a link to its evidence */
.proof {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  width: min(1120px, 100%);
  margin: clamp(28px, 5vh, 56px) auto 0;
  padding: 0;
  list-style: none;
  color: var(--text-3);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.proof li { white-space: nowrap; }
.proof li + li::before { content: "\00b7"; margin: 0 0.75em; color: var(--text-3); }
.proof a { color: var(--text-2); text-decoration: none; text-underline-offset: 0.22em; }
.proof b { color: var(--text); font-weight: 600; }
.proof a:hover { color: var(--link); text-decoration: underline; }
.proof a:hover b { color: var(--link); }

/* ---------------------------------------------------------------- The die */

.die-frame { container-type: inline-size; width: 100%; }

.die {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: 0.42cqw;
  aspect-ratio: 1080 / 705;
  padding: 4.07cqw;
  border-radius: 0.7cqw;
  color: #8f9198;
  background:
    linear-gradient(118deg, rgb(255 255 255 / 0.06) 0%, rgb(255 255 255 / 0) 30%, rgb(255 255 255 / 0.02) 62%, rgb(255 255 255 / 0) 100%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.012) 0 1px, rgb(255 255 255 / 0) 1px 3px),
    radial-gradient(130% 100% at 28% 0%, #23252a 0%, #141518 52%, #0b0c0e 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.1),
    inset 0 0 0 1px rgb(255 255 255 / 0.05),
    0 24px 48px -24px rgb(0 0 0 / 0.9);
}

.die-ring { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }

.block {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  border-radius: 0.24cqw;
  color: var(--tint);
  background: color-mix(in oklch, var(--tint) 5%, #0b0c0f);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tint) 18%, transparent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out),
    opacity 0.45s var(--ease-out),
    transform 0.16s var(--ease-out);
}

.block-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.78; transition: opacity 0.6s var(--ease-out); }

/* Annotations the way a keynote die shot labels its blocks: centered type, no boxes */
.block-label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6cqw;
  font-size: clamp(9px, 1.34cqw, 15px);
  line-height: 1.15;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.6s var(--ease-out);
}
.block-name {
  color: #f5f5f7;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-shadow: 0 0 0.8cqw rgb(0 0 0 / 0.95), 0 1px 2px rgb(0 0 0 / 0.9);
}
/* ---------------------------------------------------------------- Work: the die tour */

.work { padding-top: clamp(40px, 7vh, 96px); }

.tour {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  max-width: 1320px;
  margin: clamp(40px, 7vh, 88px) auto 0;
  padding: 0 var(--gutter);
}

.tour-stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
}

.tour-viewport {
  position: relative;
  width: 100%;
  height: min(88%, 720px);
  display: grid;
  place-items: center;
  overflow: hidden;
  --fade: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
          linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-image: var(--fade);
  -webkit-mask-composite: source-in;
  mask-image: var(--fade);
  mask-composite: intersect;
}

.die-frame--tour { width: 92%; }
.die--tour { transform-origin: 0 0; }
.die--tour.is-moving { will-change: transform; }
.die--tour .block { cursor: pointer; }
.die--tour .block:hover { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tint) 60%, transparent); }
/* Names show on the whole floorplan and fade out once the camera picks a block */
.die--tour .block-label { opacity: 0; }
.die--tour:not(.has-focus) .block-label { opacity: 1; }
.die--tour.has-focus .block { opacity: 0.24; }
.die--tour.has-focus .block.is-active {
  opacity: 1;
  background: color-mix(in oklch, var(--tint) 14%, #0d0e11);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tint) 80%, transparent);
}

/* The first chapter waits half a screen, so the whole floorplan shows before the camera moves */
.tour-chapters { padding: 46vh 0 26vh; }

.chapter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 82svh;
  max-width: 34rem;
  padding: 7vh 0;
}

.chapter-title {
  margin: 0;
  font-size: clamp(1.625rem, 1.2rem + 1.35vw, 2.375rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.024em;
}

.swatch {
  display: inline-block;
  width: 0.46em;
  height: 0.46em;
  margin-right: 0.42em;
  border-radius: 0.1em;
  background: var(--tint);
  vertical-align: 0.13em;
}

.chapter-lede { margin: 1rem 0 0; color: var(--text-2); font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.014em; }

.chapter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 1.6rem; }

/* Deep content lives in the page for crawlers and no-script visitors,
   and moves into the sheet when script is running. */
.js .deep { display: none; }
.no-js .deep { margin-top: 2rem; }

.deep h4, .sheet-body h4 { margin: 2.2rem 0 0.55rem; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.016em; }
.deep p, .sheet-body p { max-width: 65ch; margin: 0 0 1rem; color: var(--text-2); }
.deep .spec, .sheet-body .spec { margin-top: 0.6rem; max-width: 65ch; }
.deep-links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; margin-top: 2rem !important; }

.figure { margin: 0 0 1.75rem; }
.figure img { width: 100%; height: auto; border-radius: 14px; }
.figure-link { display: block; border-radius: 14px; cursor: zoom-in; }
.figure--diagram img { filter: invert(0.94) hue-rotate(180deg) saturate(1.25); background: #fff; }
.figure--photo img { background: #000; }
.figure figcaption { margin-top: 0.65rem; color: var(--text-3); font-size: 0.8125rem; }

/* ---------------------------------------------------------------- Shipped: the instruments */

.shipped { padding: clamp(96px, 15vh, 176px) 0; background: var(--bg-2); }

.bench {
  display: grid;
  gap: clamp(88px, 13vh, 144px);
  max-width: calc(1120px + 2 * var(--gutter));
  margin: clamp(48px, 8vh, 96px) auto 0;
  padding: 0 var(--gutter);
}

.role { display: grid; gap: clamp(56px, 8vh, 88px); }

.role-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.role-head h3 { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.role-head p { margin: 0; color: var(--text-3); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.sep { margin: 0 0.3em; }

.inst { display: grid; align-content: start; gap: 1.1rem; min-width: 0; }
.inst-copy { min-width: 0; }
.inst-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1.25rem; }
.inst-name { margin: 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.016em; }
.inst-desc { max-width: 62ch; margin: 0; color: var(--text-2); font-size: 0.9375rem; line-height: 1.5; }

.inst--lead,
.inst--side {
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.inst--side { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.inst--side .inst-desc { margin-top: 1rem; }
.inst--lead .inst-name { font-size: clamp(1.625rem, 1.2rem + 1.35vw, 2.375rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.024em; }
.inst--lead .inst-desc { margin-top: 1.25rem; }

.inst-row { display: grid; gap: clamp(48px, 6vw, 88px); align-items: start; }
.inst-row--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.inst-row--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

.readout { display: flex; flex: none; flex-direction: column; align-items: flex-end; margin: 0; text-align: right; }
.readout-value {
  font-size: clamp(1.5rem, 1.25rem + 0.7vw, 1.875rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.readout-value small { margin-left: 0.12em; color: var(--text-2); font-size: max(0.8125rem, 0.5em); font-weight: 500; letter-spacing: 0; }
.readout-label { margin-top: 0.4rem; color: var(--text-3); font-size: 0.8125rem; white-space: nowrap; }
.readout--lead { align-items: flex-start; margin: 1.4rem 0 0; text-align: left; }
.readout--lead .readout-value { font-size: clamp(3rem, 2rem + 3vw, 4.75rem); letter-spacing: -0.035em; }
.readout--lead .readout-label { margin-top: 0.6rem; font-size: 0.9375rem; color: var(--text-2); }

/* Plots: charts drawn from small models (tools/build_lower.py), lines in the die's thin-line register.
   SVG stretches to the box; strokes stay 1px; every word is HTML placed in percent. */
.plot { position: relative; margin: 0; padding-bottom: 1.5rem; }
.plot-body { position: relative; margin-left: var(--gut, 0); aspect-ratio: var(--ar); }
.plot-grid, .plot-data { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot-body svg *, .stack-svg * { vector-effect: non-scaling-stroke; }

.g { fill: none; stroke: rgb(255 255 255 / 0.075); stroke-width: 1; }
.ax { fill: none; stroke: rgb(255 255 255 / 0.22); stroke-width: 1; }
.tr { fill: none; stroke: #f5f5f7; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tr--clk { stroke: rgb(245 245 247 / 0.55); stroke-width: 1; }
.tr-raw { fill: none; stroke: rgb(255 255 255 / 0.3); stroke-width: 1; stroke-linejoin: round; }
.tr-raw--in { stroke: rgb(255 255 255 / 0.4); }
.box--board { fill: none; stroke: rgb(255 255 255 / 0.42); stroke-dasharray: 3 3; }
.tr-set { fill: none; stroke: rgb(255 255 255 / 0.42); stroke-width: 1; stroke-dasharray: 4 4; }
.fill { fill: rgb(255 255 255 / 0.06); stroke: none; }
.band { fill: rgb(255 255 255 / 0.08); }
.band-edge { fill: none; stroke: rgb(255 255 255 / 0.4); stroke-dasharray: 3 3; }
.zoom-bg { fill: var(--bg-2); stroke: rgb(255 255 255 / 0.24); }
.zoom-src { fill: rgb(255 255 255 / 0.05); stroke: rgb(255 255 255 / 0.45); stroke-dasharray: 2 3; }
.zoom-lead { fill: none; stroke: rgb(255 255 255 / 0.2); }
.bar-before { fill: url(#hatch); stroke: rgb(255 255 255 / 0.42); }
.hatch { stroke: rgb(255 255 255 / 0.24); }
.bar-after { fill: #f5f5f7; }
.bus { fill: rgb(255 255 255 / 0.05); stroke: #f5f5f7; stroke-width: 1.25; stroke-linejoin: round; }
.bus-z { fill: none; stroke: rgb(255 255 255 / 0.34); stroke-dasharray: 1 4; }
.box { fill: rgb(255 255 255 / 0.04); stroke: #f5f5f7; stroke-width: 1.25; }
.bracket { fill: none; stroke: rgb(255 255 255 / 0.42); }

.plot-labels { position: absolute; inset: 0; pointer-events: none; }
.plot-labels > * { position: absolute; white-space: nowrap; transform: translate(-50%, -50%); }
.plot-labels > .at-r { transform: translate(-100%, -50%); }
.plot-labels > .at-l { transform: translate(0, -50%); }

.tk { color: var(--text-3); font-family: var(--mono); font-size: 0.6875rem; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.lb { color: var(--text-2); font-family: var(--mono); font-size: 0.6875rem; line-height: 1; letter-spacing: 0; }
.lb--sans { font-family: var(--font); font-size: 0.8125rem; letter-spacing: -0.005em; }
.an { color: var(--text-2); font-size: 0.75rem; line-height: 1.2; letter-spacing: -0.005em; }
.an--hi { color: var(--text); font-weight: 600; }
.an b { font-weight: 600; }
.an--two { color: var(--text-2); line-height: 1.3; }
.an--two b { color: var(--text); font-size: 0.9375rem; font-weight: 600; }
.an--ink { color: var(--text); font-weight: 600; text-shadow: 0 0 6px var(--bg-2), 0 0 3px var(--bg-2), 0 0 1px var(--bg-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #f5f5f7; box-shadow: 0 0 0 3px var(--bg-2); }

/* The plot says what it is, in its own corner */
.plot-mark {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.55rem;
  color: rgb(170 182 210 / 0.8);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.plot-cap {
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.45em;
  color: var(--text-3);
  font-size: 0.75rem;
  line-height: 1;
}
.key { display: inline-block; width: 14px; height: 0; border-top: 1.5px solid #f5f5f7; }
.key--raw { border-top: 1px solid rgb(255 255 255 / 0.4); }
.plot-cap .key:not(:first-child) { margin-left: 0.7em; }

/* Acquisition: each trace is swept in left to right once, behind a thin line, like a scope filling its screen */
.plot-data { transition: clip-path 1.5s var(--ease-in-out); }
.js .plot:not(.is-swept) .plot-data { clip-path: inset(0 100% 0 0); }
.plot-sweep { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.plot-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  border-right: 1px solid rgb(255 255 255 / 0.75);
  background: linear-gradient(to right, rgb(255 255 255 / 0) 82%, rgb(255 255 255 / 0.06));
  opacity: 0;
  transform: translateX(-100%);
}
.js .plot.is-swept .plot-sweep::after { animation: sweep 1.5s var(--ease-in-out) both; }
@keyframes sweep {
  0% { transform: translateX(-100%); opacity: 1; }
  86% { opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}

/* Scrub: a cursor over the scope with the hero's probe readout (fine pointers) */
.plot-body[data-scrub] { cursor: crosshair; }
.scrub { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: rgb(255 255 255 / 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.scrub-dot { position: absolute; left: 0; width: 9px; height: 9px; margin: -4.5px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--bg-2); }
.scrub-probe {
  position: absolute;
  top: -2.1rem;
  left: 0;
  padding: 3px 8px;
  border-radius: 980px;
  background: rgb(0 0 0 / 0.78);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
}
.plot-body.is-scrubbing .scrub { opacity: 1; }

/* ---------------------------------------------------------------- About */

.about { padding-top: clamp(96px, 15vh, 176px); }
.about > .section-head .lead { max-width: 52ch; }

/* The timeline, as a logic analyzer: a clk lane of years and two buses, high-Z between roles */
.timeline { max-width: calc(1120px + 2 * var(--gutter)); margin: clamp(56px, 9vh, 104px) auto 0; padding: 0 var(--gutter); }
.tl-scroll { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.tl-scroll::-webkit-scrollbar { display: none; }
.tl-frame { position: relative; container-type: inline-size; padding-top: 1.9rem; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tl-frame .plot-body { cursor: ew-resize; }
.tl-frame .plot-labels { z-index: 2; }
.tl-cursor { z-index: 1; }
.seg b, .seg span { text-shadow: 0 0 4px #000, 0 0 2px #000, 0 0 1px #000; }
.future { fill: var(--bg); fill-opacity: 0.55; }
.now-line { stroke: rgb(255 255 255 / 0.3); stroke-dasharray: 2 3; fill: none; }
.bus { transition: fill 0.3s ease; }
.bus.is-on { fill: rgb(255 255 255 / 0.13); }

.seg { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; width: var(--w); padding: 0 7px; line-height: 1.2; text-align: center; }
.seg b, .seg span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.seg b { white-space: normal; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.seg span { white-space: nowrap; }
.seg b { color: var(--text); font-size: 0.8125rem; font-weight: 600; line-height: 1.15; letter-spacing: -0.008em; }
.seg span { color: var(--text-3); font-size: 0.75rem; }
.seg .short { display: none; }
@container (max-width: 900px) {
  .seg .full { display: none; }
  .seg .short { display: block; }
  .seg--out .short { display: inline; }
}
@container (max-width: 600px) {
  .seg .ind, .yr-odd { display: none; }
}
.seg--out { flex-direction: row; gap: 0.3em; width: auto; padding: 0; white-space: nowrap; }
.seg--out b { display: inline; color: var(--text-2); font-size: 0.75rem; }

.tl-cursor { position: absolute; top: -1.9rem; bottom: 11%; left: 0; width: 1px; margin-left: -0.5px; outline: none; }
.tl-line { position: absolute; top: 1.3rem; bottom: 0; left: 0; width: 1px; background: rgb(255 255 255 / 0.85); }
.tl-date {
  position: absolute;
  top: 0;
  left: 0;
  padding: 3px 9px;
  border-radius: 980px;
  background: #f5f5f7;
  color: #000;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transform: translateX(-50%);
  cursor: grab;
}
.tl-cursor:focus-visible .tl-date { outline: 2px solid var(--link); outline-offset: 3px; }

.tl-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0;
  margin-top: 0.9rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.tl-readout b { margin-right: 0.75em; color: var(--text); font-weight: 600; }
.tl-readout span + span::before { content: "·"; margin: 0 0.75em; color: var(--text-3); }

/* The stack: eight layers from FinFET devices to boards, exploded, building up as the list scrolls */
.layers { margin-top: clamp(112px, 17vh, 200px); }

.stack-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px);
  max-width: calc(1120px + 2 * var(--gutter));
  margin: clamp(24px, 4vh, 48px) auto 0;
  padding: 0 var(--gutter);
}
.stack-stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
}
.stack-fig { position: relative; width: min(100%, 470px); margin: 0; }
.stack-mark {
  position: absolute;
  left: 50%;
  bottom: -0.5rem;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgb(170 182 210 / 0.8);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.stack-svg { width: 100%; height: auto; max-height: calc(100svh - var(--nav-h) - 64px); overflow: visible; }

.stack-svg { --gap: 40; }
.layer { transform: translateY(calc(var(--i) * var(--gap) * -1px)); }
.layer-lift { transition: transform 0.55s var(--ease-out), opacity 0.45s var(--ease-out); }
.face-t { fill: url(#slab); stroke: rgb(255 255 255 / 0.1); }
.face-l { fill: #0a0b0d; }
.face-r { fill: #101114; }
.edge { fill: none; stroke: rgb(255 255 255 / 0.22); }
.tex-s { fill: none; stroke: #8f9198; stroke-opacity: 0.55; transition: stroke 0.45s var(--ease-out), stroke-opacity 0.45s var(--ease-out); }
.tex-f { fill: #8f9198; fill-opacity: 0.3; transition: fill 0.45s var(--ease-out), fill-opacity 0.45s var(--ease-out); }
.tex-f--hard, .tex-f--hot { fill-opacity: 0.55; }
.tex-h { fill: #000; stroke: #8f9198; stroke-opacity: 0.6; }

.layer.is-active .layer-lift { transform: translateY(-18px); }
.layer.is-active .face-t { fill: url(#slab-hi); }
.layer.is-active .tex-s { stroke: #f5f5f7; stroke-opacity: 0.85; }
.layer.is-active .tex-f { fill: #f5f5f7; fill-opacity: 0.5; }
.layer.is-above .layer-lift { opacity: 0.2; }

.stack-list { margin: 0; padding: 22vh 0 26vh; list-style: none; }
.layer-item { padding: 1.7rem 0 1.9rem; border-top: 1px solid var(--line); transition: opacity 0.45s var(--ease-out); }
.layer-item:last-child { border-bottom: 1px solid var(--line); }
.stack-grid.is-live .layer-item:not(.is-active) { opacity: 0.4; }
.layer-name { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.layer-tools { margin: 0.45rem 0 0; color: var(--text-2); font-size: 1rem; line-height: 1.45; }
.layer-proof .swatch { background: #8f9198; }
.layer-proof { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0.85rem 0 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.layer-early { max-width: 56ch; margin: 0.85rem 0 0; color: var(--text-3); font-size: 0.875rem; line-height: 1.5; }
.layer-early b { color: var(--text-2); font-weight: 600; }

/* ---------------------------------------------------------------- The night: a long exposure, then contact */

.night { position: relative; }
.night-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(to bottom, #010102 0%, #020308 42%, #060912 70%, #0c111b 84%, #111724 92%);
}
.trails { position: absolute; inset: 0; width: 100%; height: 100%; }
.horizon { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: clamp(190px, 32svh, 340px); }
.ridge-far { fill: #07090e; }
.ridge-near { fill: #030406; }
.ground { fill: #000; }
.jt path { fill: none; stroke: #000; stroke-linecap: round; stroke-linejoin: round; }
.jt .spikes { stroke-width: 1.2; }
.jt ellipse { fill: #000; }
.jt--far path { stroke: #040508; }
.jt--far ellipse { fill: #040508; }
.rig path { fill: none; stroke: #000; stroke-width: 2.4; stroke-linecap: round; }
.rig rect { fill: #000; }

.night-mark {
  position: absolute;
  right: max(var(--gutter), calc((100% - 1120px) / 2));
  top: calc(var(--nav-h) + clamp(16px, 3vh, 32px));
  margin: 0;
  color: rgb(170 182 210 / 0.8);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.night-mark .sep { margin: 0 0.5em; }

.night-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 215svh;
  margin-top: -100svh;
  padding: 30svh var(--gutter) 0;
  text-shadow: 0 0 22px rgb(0 0 0 / 0.95), 0 1px 3px rgb(0 0 0 / 0.9);
}
.offclock { width: 100%; max-width: 1120px; margin: 0 auto; }
.offclock > * { max-width: 31rem; }
.h-sub { margin: 0; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.024em; }
.offclock p { margin: 0.65rem 0 0; color: #c7c7cc; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.45; }

.contact { margin: auto 0 0; padding-bottom: calc(clamp(190px, 32svh, 340px) + 6svh); text-align: center; scroll-margin-top: 22svh; }
.contact .lead { color: #c7c7cc; }
.contact-email {
  margin: 1.8rem 0 0;
  font-size: clamp(1.5rem, 0.8rem + 3.2vw, 3.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.026em;
  overflow-wrap: anywhere;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 30px;
  margin: 1.8rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1.0625rem;
}
.contact-place { color: var(--text-2); }

/* The footer stands on the ground */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  margin: -64px auto 0;
  padding: 0 0 28px;
  color: var(--text-3);
  font-size: 0.75rem;
}
.footer p { margin: 0; }

/* ---------------------------------------------------------------- Sheet */

.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: rgb(0 0 0 / 0);
  color: var(--text);
}
.sheet::backdrop { background: transparent; }

.sheet-panel {
  position: absolute;
  top: max(24px, 5vh);
  bottom: max(24px, 5vh);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(880px, calc(100% - 48px));
  margin: 0 auto;
  overflow: hidden;
  border-radius: 22px;
  background: rgb(29 29 31 / 0.84);
  -webkit-backdrop-filter: blur(40px) saturate(170%);
  backdrop-filter: blur(40px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.1),
    inset 0 0 0 1px rgb(255 255 255 / 0.06),
    0 40px 100px -20px rgb(0 0 0 / 0.8);
}

.sheet-grabber { display: none; }

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 28px 24px 14px 40px;
}
.sheet-title {
  margin: 0;
  padding-top: 4px;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.024em;
}
.sheet-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.1);
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.12s ease;
}
.sheet-close .i { width: 16px; height: 16px; }
.sheet-close:hover { background: rgb(255 255 255 / 0.17); }
.sheet-close:active { transform: scale(0.94); }

.sheet-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 40px 56px;
  scrollbar-width: thin;
  scrollbar-color: #48484a transparent;
}
.sheet-lede { margin: 0 0 1.75rem !important; color: var(--text) !important; font-size: 1.1875rem; line-height: 1.42; letter-spacing: -0.014em; }
.sheet-body .figure:first-child { margin-top: 0.25rem; }

/* ---------------------------------------------------------------- Responsive */

@media (max-width: 1023px) {
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 6vw, 48px); }
  .specimen { width: min(740px, 100%); }
}

@media (max-width: 959px) {
  .tour { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .tour-stage {
    z-index: 2;
    height: min(44svh, 64vw + 24px);
    background: var(--bg);
  }
  .tour-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 40px;
    background: linear-gradient(var(--bg), rgb(0 0 0 / 0));
    pointer-events: none;
  }
  .tour-viewport { height: 100%; -webkit-mask-image: none; mask-image: none; }
  .die-frame--tour { width: calc(100% - 2 * var(--gutter)); }
  .tour-chapters { padding-top: 6vh; }

  .tour-chapters { position: relative; z-index: 1; padding: 2vh var(--gutter) 22vh; }
  .chapter { justify-content: flex-start; min-height: 66svh; max-width: 40rem; margin: 0 auto; padding: 5vh 0; }

  .inst--lead, .inst--side { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .inst-row--7-5, .inst-row--5-7 { grid-template-columns: minmax(0, 1fr); }
  .inst--side .plot { order: 2; }

  .stack-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .stack-stage {
    z-index: 2;
    height: min(40svh, 96vw);
    padding: 10px var(--gutter) 0;
    background: var(--bg);
  }
  .stack-stage::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 40px;
    background: linear-gradient(var(--bg), rgb(0 0 0 / 0));
    pointer-events: none;
  }
  .stack-fig { display: flex; justify-content: center; width: 100%; height: 100%; }
  .stack-svg { width: auto; height: 100%; max-height: none; }
  .stack-list { position: relative; z-index: 1; width: min(40rem, 100%); margin: 0 auto; padding: 4vh var(--gutter) 34vh; }
}

@media (max-width: 734px) {
  .specimen-frame { cursor: default; }
  .proof { flex-direction: column; gap: 8px; }
  .proof li + li::before { content: none; }

  .nav-inner { gap: 16px; }
  .nav-email { margin-left: auto; }
  .nav-name { margin-right: 0; }
  .nav-toggle {
    display: grid;
    place-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    grid-area: 1 / 1;
    width: 17px;
    height: 1.5px;
    border-radius: 1px;
    background: currentColor;
    transition: transform 0.32s var(--ease-out);
  }
  .nav-toggle span:first-child { transform: translateY(-3.5px); }
  .nav-toggle span:last-child { transform: translateY(3.5px); }
  .nav.is-open .nav-toggle span:first-child { transform: rotate(45deg); }
  .nav.is-open .nav-toggle span:last-child { transform: rotate(-45deg); }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 28px;
    background: rgb(0 0 0 / 0.9);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.24s var(--ease-out), transform 0.32s var(--ease-out), visibility 0s linear 0.32s;
  }
  .nav.is-open .nav-links { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-links a { display: block; padding: 10px 0; color: var(--text); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }
  .no-js .nav-links { position: static; opacity: 1; visibility: visible; transform: none; flex-direction: row; padding: 0; background: none; }
  .no-js .nav-links a { font-size: 0.8125rem; font-weight: 400; }

  .spec > div { grid-template-columns: 5.75rem minmax(0, 1fr); gap: 0.75rem; }

  .plot-body { aspect-ratio: var(--ar-m, var(--ar)); }
  .tl-readout { flex-direction: column; gap: 0.2rem; }
  .tl-readout span + span::before { content: none; }
  .tl-readout b { margin: 0 0 0.15rem; }
  .inst-head { flex-direction: column; gap: 0.6rem; }
  .inst-head .readout { align-items: flex-start; text-align: left; }
  .night-copy { padding-top: 20svh; }
  .footer { flex-direction: column; margin-top: 0; padding-top: 22px; }
  .contact { padding-bottom: calc(clamp(190px, 32svh, 340px) + 4svh); }
  .stack-mark { bottom: 0.25rem; }

  .sheet-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: calc(100% - 40px);
    border-radius: 16px 16px 0 0;
  }
  .sheet-grabber {
    display: grid;
    place-items: center;
    flex: none;
    height: 22px;
    touch-action: none;
    cursor: grab;
  }
  .sheet-grabber span { width: 36px; height: 5px; border-radius: 3px; background: rgb(255 255 255 / 0.28); }
  .sheet-head { padding: 4px 16px 10px 22px; touch-action: none; }
  .sheet-body { padding: 4px 22px 48px; }
}

/* ---------------------------------------------------------------- Preferences */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .specimen-img { animation: none; }
  .exposure { display: none; }
  .block, .pill, .link-chev .i, .link-out .i, .nav-toggle span, .nav-links { transition-duration: 0.01s; }
  .plot-data { transition: none; }
  .js .plot:not(.is-swept) .plot-data { clip-path: none; }
  .plot-sweep { display: none; }
  .layer-lift, .face-t, .tex-s, .tex-f, .layer-item, .bus { transition-duration: 0.01s; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav { background: #161617; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav-links { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .sheet-panel { background: #1c1c1e; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --text-2: #d1d1d6; --text-3: #b4b4ba; --line: #5a5a5e; --rule: #7c7c80; }
  .block { box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tint) 70%, transparent); }
  .nav { background: #000; }
  .sheet-panel { background: #111; box-shadow: inset 0 0 0 1px #8e8e93; }
}

@media (forced-colors: active) {
  .block { border: 1px solid CanvasText; }
  .swatch { forced-color-adjust: none; }
}

@media print {
  :root { --bg: #fff; --bg-2: #fff; --text: #111; --text-2: #333; --text-3: #555; --line: #ccc; --rule: #999; --link: #0b57d0; }
  .nav, .loupe, .probe, .exposure, .tour-stage, .sheet, .skip, .night-stage, .tl-cursor, .plot-sweep, .stack-stage { display: none !important; }
  .js .plot .plot-data { clip-path: none !important; }
  .night-copy { margin-top: 0; min-height: 0; padding: 2rem 0; text-shadow: none; }
  .night { background: none; }
  .offclock p, .contact .lead, .contact-place { color: var(--text-2); }
  .plot-mark, .stack-mark { color: #555; }
  .tl-date { background: #111; color: #fff; }
  .contact { padding-bottom: 2rem; }
  .footer { margin-top: 0; }
  .js .deep { display: block; }
}
