/* XRShare — xrshare.ca
   An anatomy atlas that happens to be interactive: paper, ink, one arterial accent. */

@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/plex-mono-400.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/plex-mono-500.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }

:root {
  --paper: #e8e6e1;
  --paper-deep: #dedbd4;
  --ink: #141414;
  --ink-soft: #55514a;
  --ink-faint: #66615a;
  --rule: rgba(20, 20, 20, 0.14);
  --signal: #c8372a;       /* display italics and fills only */
  --signal-text: #a82b20;  /* anything smaller than 24px */
  --night: #0d0d0f;
  --night-2: #17171a;
  --night-ink: #ecebe6;
  --night-soft: #a3a19b;
  --night-rule: rgba(236, 235, 230, 0.14);
  --night-accent: #ff6a55;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--paper);
  /* paper grain, painted behind content */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--signal-text); }
:focus-visible { outline: 2px solid var(--signal-text); outline-offset: 3px; border-radius: 2px; }
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 200; }
.skip:focus { left: 8px; }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(44px, 5.8vw, 84px); line-height: 0.98; }
h1 em { font-style: italic; color: var(--signal); }
h2 { font-size: clamp(32px, 4.2vw, 56px); line-height: 1.04; }
h2 em { font-style: italic; color: inherit; }
h3 { font-size: 26px; line-height: 1.15; }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.lede { font-size: clamp(18px, 1.5vw, 20px); color: var(--ink-soft); max-width: 32em; margin: 0; }

/* ---------- header ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 22px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 0 0 1px var(--rule); }
.nav { display: flex; align-items: center; gap: clamp(4px, 1.6vw, 20px); font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.nav a { text-decoration: none; padding: 12px 6px; }
.nav a[aria-current="page"] { color: var(--signal-text); }
.nav .get {
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 9px 14px; margin-left: 6px;
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.nav .get:hover { color: var(--paper); background: #000; }
.site-head.scrolled .nav .get, .site-head.always .nav .get { opacity: 1; transform: none; pointer-events: auto; }
.nav .get { white-space: nowrap; }
@media (max-width: 640px) { .nav .wide { display: none; } }
@media (max-width: 420px) { .nav .get { display: none; } }

/* ---------- hero ---------- */

.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 7vw, 96px); }
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-areas: "head plate" "body plate";
  grid-template-rows: auto 1fr;
  column-gap: clamp(24px, 4vw, 64px);
}
.hero-head { grid-area: head; align-self: end; }
.hero-body { grid-area: body; }
.hero-plate { grid-area: plate; align-self: center; }
.hero-head .mono { margin: 0 0 22px; }
.hero-body { display: flex; flex-direction: column; gap: 26px; padding-top: 26px; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.badge { display: inline-block; }
.badge img { height: 52px; width: auto; }
.textlink { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid currentColor; padding: 10px 0 2px; }
.facts { margin: -8px 0 0; color: var(--ink-soft); font-size: 15px; }

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; grid-template-areas: "head" "plate" "body"; grid-template-rows: auto; }
  .hero-body { padding-top: 8px; }
  .hero-body .lede { order: 3; }
  .hero-body .cta { order: 1; }
  .hero-body .facts { order: 2; }
  .hero-head .mono .long { display: none; }
}

/* specimen plate */
.plate { position: relative; width: 100%; max-width: 620px; margin-left: auto; }
.plate-stage { position: relative; aspect-ratio: 1 / 1; container-type: inline-size; }
.rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rings circle, .rings path { fill: none; stroke: var(--ink); stroke-linecap: round; }

.plate model-viewer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-height: 0px;
}
.plate model-viewer::part(default-progress-bar) { display: none; }
.plate model-viewer::part(default-ar-button) { display: none; }

/* atlas labels (model-viewer hotspots) */
.tag {
  position: relative; width: 10px; height: 10px; padding: 0; border: 0; background: transparent; cursor: default;
  transition: opacity .3s;
}
.tag::before { content: ""; position: absolute; inset: 1px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.tag span {
  position: absolute; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.tag span::before { content: ""; width: calc(var(--k, 12) * 1cqi); height: 1px; background: var(--ink); flex: none; }
.tag span > i { font-style: normal; background: color-mix(in srgb, var(--paper) 88%, transparent); padding: 2px 6px; border-radius: 4px; }
.tag.left span { right: 5px; flex-direction: row-reverse; }
.tag.right span { left: 5px; }
.tag[data-visible="false"] { opacity: 0; }
.plate:not(.show-tags) .tag { opacity: 0; }
@media (max-width: 540px) { .tag span { font-size: 9.5px; letter-spacing: 0.04em; gap: 4px; } .tag span > i { padding: 1px 4px; } }

.plate-foot {
  display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; align-items: start;
  border-top: 1px solid var(--ink); padding-top: 14px; margin-top: 4px;
}
.fig { margin: 0; }
.fig .mono b { color: var(--signal-text); font-weight: 500; }
.fig p { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); max-width: 38ch; }
.plate-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.specimens { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.specimens button, .ar-btn {
  font: inherit; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
}
.specimens button { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.specimens button:hover { border-color: var(--ink); }
.specimens button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ar-btn { background: var(--signal); color: #fff; border: 0; }
.ar-btn[hidden] { display: none; }
.hint { font-size: 13px; color: var(--ink-faint); margin: 0; }
@media (max-width: 880px) { .plate { margin: 0 auto; max-width: 520px; } }
@media (max-width: 560px) {
  .plate-foot { grid-template-columns: 1fr; }
  .plate-controls { align-items: flex-start; }
  .specimens { justify-content: flex-start; }
}

/* entrance: transform only, so the headline is never invisible */
.rise { animation: rise 0.8s cubic-bezier(.2,.7,.2,1) both; }
.rise.r2 { animation-delay: .06s; } .rise.r3 { animation-delay: .12s; }
@keyframes rise { from { transform: translateY(12px); } to { transform: none; } }

/* ---------- proof: an atlas figure ---------- */

.proof { padding: 0 0 clamp(64px, 9vw, 128px); }
.pair { margin: 0; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.pair-art { position: relative; }
.pair-art img { width: 100%; filter: drop-shadow(0 28px 36px rgba(20,20,20,.28)); }
/* leader joining the neuron on each screen (soma at 25.5% and 81.5% across, 50.7% down) */
.pair-link {
  position: absolute; left: 25.5%; right: 18.5%; top: 50.7%; transform: translateY(-50%);
  display: flex; align-items: center; pointer-events: none;
}
.pair-link i { flex: 1; height: 1px; background: var(--ink); }
.pair-link::before, .pair-link::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); flex: none; }
.pair-link b {
  font-weight: 400; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  background: var(--paper); padding: 3px 8px; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule);
}
.pair figcaption .mono { margin: 0 0 16px; }
.pair figcaption h2 { font-size: clamp(30px, 3.6vw, 48px); margin-bottom: 18px; }
.pair figcaption p:not(.mono) { color: var(--ink-soft); margin: 0; max-width: 30em; }
@media (max-width: 760px) {
  .pair { grid-template-columns: 1fr; }
  .pair-art { max-width: 460px; }
  .pair-link b { font-size: 9.5px; padding: 2px 5px; }
}

/* ---------- how it works: steps beside a sticky phone ---------- */

.how { padding: clamp(64px, 9vw, 128px) 0; border-top: 1px solid var(--rule); }
.how h2 { max-width: 14em; margin-bottom: clamp(40px, 6vw, 80px); }
.walk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: clamp(32px, 6vw, 96px); }
.walk ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.walk li { counter-increment: step; padding: 28px 0 clamp(48px, 10vh, 120px); border-top: 1px solid var(--rule); transition: opacity .3s; }
.walk li:first-child { border-top-color: var(--ink); }
.walk li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 12px; color: var(--signal-text); margin-bottom: 14px; }
.walk h3 { margin-bottom: 10px; }
.walk p { margin: 0; color: var(--ink-soft); max-width: 30em; }
.walk li img { display: none; }
.walk.js li:not(.active) { opacity: .45; }

.phone { position: sticky; top: 88px; align-self: start; justify-self: end; width: min(100%, calc((100vh - 128px) * 600 / 1317)); }
.walk li:last-child { padding-bottom: max(120px, 36vh); }
.phone-screen { position: relative; aspect-ratio: 600 / 1317; }
.phone-screen img, .walk li img {
  border-radius: 36px;
  box-shadow: 0 30px 60px -30px rgba(20,20,20,.45), 0 0 0 1px rgba(20,20,20,.08);
  background: #111;
}
.phone-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s; }
.phone-screen img.on { opacity: 1; }

@media (max-width: 860px) {
  .walk { grid-template-columns: 1fr; }
  .phone { display: none; }
  .walk.js li:not(.active) { opacity: 1; }
  .walk li:last-child { padding-bottom: 40px; }
  .walk li { display: grid; grid-template-columns: minmax(0, 1fr) 132px; grid-template-rows: auto auto 1fr; align-content: start; gap: 4px 20px; padding-bottom: 40px; }
  .walk li::before { margin-bottom: 6px; }
  .walk li::before, .walk li h3, .walk li p { grid-column: 1; }
  .walk li img { display: block; grid-column: 2; grid-row: 1 / span 3; width: 132px; border-radius: 20px; }
}

/* ---------- Vision Pro (night) ---------- */

.night { background: var(--night); color: var(--night-ink); }
.night .mono { color: var(--night-soft); }
.vision { padding: clamp(48px, 6vw, 80px) 0 clamp(64px, 8vw, 112px); }
.vision-stage { margin: 0; }
.vision-stage img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; transition: opacity .35s; }
.vision-stage img.fading { opacity: 0; }
.vision-copy { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 12px clamp(24px, 4vw, 64px); align-items: end; margin-bottom: clamp(24px, 3vw, 40px); }
.vision-copy .mono { grid-column: 1 / -1; margin: 0; }
.vision-copy h2 { font-size: clamp(30px, 3.8vw, 52px); }
.vision-copy p:not(.mono) { color: var(--night-soft); margin: 0; }
.vision-tabs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.vision-tabs button {
  width: 100%; text-align: left; background: var(--night-2); color: var(--night-ink); border: 1px solid var(--night-rule);
  border-radius: 12px; padding: 8px; font: inherit; font-size: 14px; cursor: pointer; display: grid; gap: 8px; min-height: 44px;
}
.vision-tabs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 7px; }
.vision-tabs button[aria-pressed="true"] { border-color: var(--night-accent); }
.vision-tabs button:hover { border-color: rgba(236,235,230,.4); }
.vision .caption { margin: 14px 0 0; color: var(--night-soft); font-size: 15px; }
@media (max-width: 860px) {
  .vision-copy { grid-template-columns: 1fr; }
  .vision-stage img { border-radius: 14px; }
  .vision-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 150px; overflow-x: auto; padding-bottom: 6px; }
}

/* ---------- what you can do: ruled rows ---------- */

.can { padding: clamp(64px, 9vw, 128px) 0 clamp(48px, 6vw, 80px); }
.can h2 { margin-bottom: clamp(32px, 5vw, 56px); }
.rows { margin: 0; }
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) 120px; gap: 16px clamp(20px, 4vw, 56px); padding: 26px 0; border-top: 1px solid var(--ink); align-items: start; }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row dt { font-family: var(--serif); font-size: 26px; line-height: 1.15; }
.row dd { margin: 0; color: var(--ink-soft); }
.row .thumb { width: 120px; aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 0 0 1px var(--rule); }
.used { margin: clamp(28px, 4vw, 44px) 0 0; font-size: 18px; color: var(--ink-soft); max-width: 44em; }
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr) 84px; }
  .row dt { grid-column: 1; font-size: 23px; }
  .row dd { grid-column: 1; }
  .row .thumb { grid-column: 2; grid-row: 1 / span 2; width: 84px; }
}

/* ---------- privacy + support ---------- */

.trust { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 104px); }
.notices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.notice { background: var(--paper-deep); border-radius: 18px; padding: clamp(24px, 3vw, 36px); }
.notice h3 { margin: 10px 0 12px; }
.notice p { margin: 0 0 14px; color: var(--ink-soft); }
.notice ul { margin: 0 0 18px; padding-left: 18px; color: var(--ink-soft); }
.notice li { margin: 4px 0; }
.notice .email { font-family: var(--serif); font-size: 24px; text-decoration: none; }
@media (max-width: 820px) { .notices { grid-template-columns: 1fr; } }

/* ---------- closing ---------- */

.closing { text-align: center; padding: clamp(80px, 11vw, 148px) 0; }
.closing .mark { width: 76px; height: 76px; margin: 0 auto 28px; border-radius: 18px; }
.closing h2 { max-width: 12em; margin: 0 auto; }
.closing p { color: var(--night-soft); margin: 18px auto 0; }
.closing .cta { justify-content: center; margin-top: 34px; }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--ink); padding: 32px 0 44px; font-size: 14px; color: var(--ink-soft); }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-foot nav a { padding: 10px 0; }
.site-foot .tm { flex-basis: 100%; font-size: 12.5px; color: var(--ink-faint); margin: 0; }
.site-foot.night { border-top-color: var(--night-rule); color: var(--night-soft); }
.site-foot.night .tm { color: #8f8d87; }

/* ---------- document pages (privacy / support) ---------- */

.doc { padding: clamp(32px, 6vw, 80px) 0 clamp(64px, 8vw, 112px); }
.doc .wrap { display: grid; grid-template-columns: 220px minmax(0, 40em); gap: clamp(24px, 5vw, 72px); }
.doc aside { position: sticky; top: 88px; align-self: start; }
.toc summary { cursor: pointer; list-style: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-soft); min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; color: var(--signal-text); }
.toc[open] summary::after { content: "\2212"; }
.toc ol { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a { display: block; padding: 8px 0; text-decoration: none; }
.toc a[aria-current="true"] { color: var(--signal-text); }
.doc h1 { font-size: clamp(40px, 6vw, 68px); margin: 10px 0 20px; }
.doc h2 { font-size: clamp(26px, 3vw, 34px); margin: 56px 0 14px; scroll-margin-top: 84px; }
.doc h3 { font-size: 21px; margin: 28px 0 8px; }
.doc p, .doc li { color: #2b2925; }
.doc ul, .doc ol.steps { padding-left: 20px; }
.doc li { margin: 6px 0; }
.doc .summary { background: var(--paper-deep); border-left: 3px solid var(--signal); padding: 20px 24px; border-radius: 0 12px 12px 0; margin: 28px 0; }
.doc .summary p { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); }
.doc th { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.doc details.qa { border-bottom: 1px solid var(--rule); }
.doc details.qa summary { cursor: pointer; font-family: var(--serif); font-size: 21px; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; min-height: 44px; }
.doc details.qa summary::-webkit-details-marker { display: none; }
.doc details.qa summary::after { content: "+"; font-family: var(--mono); color: var(--signal-text); }
.doc details.qa[open] summary::after { content: "\2212"; }
.doc details.qa > :not(summary) { margin-top: 0; }
.doc details.qa > :last-child { margin-bottom: 18px; }
.contact-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--paper-deep); padding: 24px 28px; border-radius: 18px; margin: 28px 0; }
.contact-card a.email { font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); text-decoration: none; word-break: break-all; }
.contact-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.doc .aside-badge { margin-top: 28px; }
.doc .aside-badge img { height: 44px; width: auto; }
@media (max-width: 860px) {
  .doc .wrap { grid-template-columns: 1fr; gap: 8px; }
  .doc aside { position: static; border-bottom: 1px solid var(--rule); }
  .doc .aside-badge { display: none; }
}

/* ---------- 404 ---------- */

.lost { text-align: center; padding: clamp(80px, 14vw, 180px) 0; }
.lost h1 { font-size: clamp(40px, 6vw, 72px); margin: 16px 0 0; }
.lost p { color: var(--ink-soft); margin: 20px auto 0; max-width: 32em; }
.lost .cta { justify-content: center; margin-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .phone-screen img, .vision-stage img, .nav .get, .walk li { transition: none; }
}
