/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; }
.hero-stage {
  position: relative;
  display: flex; flex-direction: column;
  /* at least the screen's height (within limits); taller if a panel's copy needs it, so the copy
     never runs into the tab rail */
  min-height: clamp(540px, calc(100svh - var(--head-h) - 8px), 1000px);
}
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  touch-action: pan-y;
  transition: opacity .6s;
}
.hero-canvas.is-loading { opacity: 0; }
/* At a close-up the scene fills the frame, so on wide screens the canvas fades out behind
   the copy column (whose right edge app.js keeps in --copy-edge). The overview needs no fade:
   the whole desk sits to the right of the copy. hero.js sets --hero-k on every frame of a
   camera flight (0 at the overview, 1 at a close-up), so the fade arrives early on the way
   in and leaves only once the camera has pulled back on the way out. The ramp eases in, so
   a half-faded object has no hard edge. */
@property --hero-fade { syntax: "<length>"; inherits: false; initial-value: 0px; }
@media (min-width: 861px) {
  .hero-canvas {
    --hero-fade: calc((var(--copy-edge, 42vw) + 110px) * var(--hero-k, 0));
    -webkit-mask-image: linear-gradient(90deg, transparent calc(var(--hero-fade) - 170px), rgba(0, 0, 0, .06) calc(var(--hero-fade) - 130px), rgba(0, 0, 0, .25) calc(var(--hero-fade) - 90px), rgba(0, 0, 0, .6) calc(var(--hero-fade) - 45px), #000 var(--hero-fade));
    mask-image: linear-gradient(90deg, transparent calc(var(--hero-fade) - 170px), rgba(0, 0, 0, .06) calc(var(--hero-fade) - 130px), rgba(0, 0, 0, .25) calc(var(--hero-fade) - 90px), rgba(0, 0, 0, .6) calc(var(--hero-fade) - 45px), #000 var(--hero-fade));
  }
}
.hero-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 60% at 68% 52%, color-mix(in srgb, var(--surface) 70%, transparent), transparent 70%),
    radial-gradient(40% 40% at 72% 70%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%);
}
.hero-inner { position: relative; z-index: 2; flex: 1 0 auto; display: flex; flex-direction: column; pointer-events: none; }
.hero-copy {
  pointer-events: auto;
  width: min(500px, 42%);
  flex: 1 0 auto; /* fills the column, so faded-out objects behind it can't be clicked */
  padding-top: clamp(28px, 7vh, 88px);
}
.hero-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 0 0 18px; }
.hero-clock { margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 359px) { .hero-clock { display: none; } } /* no room beside the role on the narrowest phones */
@media (max-width: 380px) { .hero-eyebrow { font-size: .6875rem; } } /* 11px keeps the role and the clock on one line */
.hero-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-mark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok-mark) 22%, transparent); }
.hero-name {
  font-size: clamp(3.25rem, 1.8rem + 5vw, 6.75rem);
  line-height: .9;
  font-variation-settings: "wdth" 122;
  letter-spacing: -.035em;
  margin: 0 0 26px;
}
.hero-name > span { display: block; }
.hero-name .accent { color: var(--accent); }
.hero-panels { display: grid; }
.hero-panel { grid-area: 1 / 1; visibility: hidden; }
.hero-panel.is-active { visibility: visible; }
.hero-panel > * { opacity: 0; transform: translateY(10px); transition: opacity .35s var(--ease-out), transform .45s var(--ease-out); }
/* The old panel clears first, then the new one arrives line by line while the camera is still
   travelling, so the headline lands with its subject. */
.hero-panel.is-active > * { opacity: 1; transform: none; transition-delay: .2s; }
.hero-panel.is-active > :nth-child(2) { transition-delay: .27s; }
.hero-panel.is-active > :nth-child(3) { transition-delay: .34s; }
.hero-panel.is-active > :nth-child(4) { transition-delay: .41s; }
.hero-panel.is-active > :nth-child(5) { transition-delay: .48s; }
.hero-panel.is-leaving > * { opacity: 0; transform: translateY(-8px); transition-duration: .2s; transition-delay: 0s; }
/* the old panel stays visible (not clickable) while its text fades out */
.hero-panel.is-leaving { visibility: visible; pointer-events: none; }
.hp-ref { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 10px; }
.hp-ref b { color: var(--accent-ink); font-weight: 600; }
.hp-title { font-family: var(--font-display); font-weight: 800; font-variation-settings: "wdth" 112; font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.25rem); letter-spacing: -.02em; line-height: 1.02; margin-bottom: 12px; }
.hp-text { font-size: 1.0625rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 18px; text-wrap: pretty; }
.hp-lead { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); color: var(--ink-2); max-width: 44ch; margin-bottom: 22px; text-wrap: pretty; }
.hp-live { min-height: 26px; margin: -6px 0 16px; }
.hp-live:empty { display: none; }
.hp-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hp-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }

.hero-rail {
  pointer-events: auto;
  margin-top: auto;
  display: flex; align-items: stretch; gap: 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.hero-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 176px; z-index: 1; pointer-events: none; background: linear-gradient(to top, var(--bg) 72px, color-mix(in srgb, var(--bg) 0%, transparent)); }
.hero-tabs { display: flex; flex: 1; min-width: 0; position: relative; }
.hero-tab {
  flex: 1 1 0; min-width: 0; cursor: pointer; text-align: left;
  background: none; border: 0; padding: 14px 10px 16px 0;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--muted);
  transition: color .2s;
}
.hero-tab .n { font-family: var(--font-mono); font-size: .6875rem; letter-spacing: .06em; }
.hero-tab .l { font-weight: 600; font-size: .9375rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.hero-tab:hover .l, .hero-tab[aria-selected="true"] .l { color: var(--ink); }
.hero-tab[aria-selected="true"] .n { color: var(--accent-ink); }
/* On the desktop rail the ring goes round the label, not the whole tab: a tab's box starts right at
   its label, so a ring outside the box would cut through the next tab's label. (Phone tabs are
   separate pills, so they keep the ring round the pill.) */
@media (min-width: 861px) {
  .hero-tab .l { align-self: flex-start; max-width: 100%; } /* as wide as its text, so the ring hugs it */
  .hero-tab:focus-visible { outline: none; }
  .hero-tab:focus-visible .l { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 4px; }
}
/* narrow laptops: a little less type and padding, so no tab label is cut short */
@media (min-width: 861px) and (max-width: 1000px) {
  .hero-tab { padding-right: 6px; }
  .hero-tab .l { font-size: .875rem; }
}
.hero-ink { position: absolute; top: -1px; left: 0; height: 2px; width: 40px; background: var(--accent); border-radius: 2px; transition: transform .45s var(--ease-out), width .45s var(--ease-out); }
.hero-ink .prog { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); opacity: .35; }
.tour-btn { flex: none; align-self: center; margin-left: 12px; gap: 8px; }
.tour-btn svg { width: 14px; height: 14px; }
.hero-hint { position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--btn-bg); color: var(--btn-ink); font-size: .8125rem; font-weight: 600; white-space: nowrap; transform: translate(14px, 14px); opacity: 0; transition: opacity .15s; }
.hero-hint.is-on { opacity: 1; }
.hero-hint span { font-family: var(--font-mono); font-size: .6875rem; opacity: .7; margin-left: 6px; text-transform: uppercase; letter-spacing: .06em; }
.hero .btn--ghost { background: var(--glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero .btn--ghost:not([disabled], [aria-disabled="true"]):hover { background: var(--surface); }
/* short laptop screens: a smaller name and less space above it keep the tabs in view */
@media (min-width: 861px) and (max-height: 800px) {
  .hero-name { font-size: min(clamp(3.25rem, 1.8rem + 5vw, 6.75rem), 12.5vh); margin-bottom: 20px; }
  .hero-copy { padding-top: 20px; }
}
@media (min-width: 861px) and (max-height: 680px) {
  .hero-name { font-size: min(clamp(3.25rem, 1.8rem + 5vw, 6.75rem), 11vh); margin-bottom: 16px; }
  .hero-eyebrow { margin-bottom: 12px; }
  .hp-live { margin: -10px 0 8px; } /* so a roll result never pushes the tabs down */
}
/* below 1100px the overview keeps two buttons on one line; Career is in the menu bar */
@media (min-width: 861px) and (max-width: 1099px) { #hp-overview .hp-actions a[href="#career"] { display: none; } }
/* phones: two buttons a row, so the third would sit alone; Career is one tap away in the menu */
@media (max-width: 560px) { #hp-overview .hp-actions a[href="#career"] { display: none; } }
@media (min-width: 861px) {
  .hero-copy { padding-bottom: 92px; }
  .hero-rail { position: absolute; left: var(--gutter-l); right: var(--gutter-r); bottom: 0; margin-top: 0; }
}
.hero-note { position: absolute; right: var(--gutter-r); top: 18px; z-index: 2; color: var(--muted); display: flex; gap: 8px; align-items: center; pointer-events: none; transition: opacity .3s; }
/* The hint helps on the overview; at a close-up it would sit on top of the scene. */
/* on the way back to the overview it waits until the camera has pulled back (--hero-k, from hero.js) */
.hero-note { opacity: calc(1 - 1.5 * var(--hero-k, 0)); }
.hero-stage:not([data-stop="overview"]) .hero-note { opacity: 0; }
.no-3d .hero-note { display: none; }

@media (max-width: 860px) {
  .hero-stage { min-height: 0; display: flex; flex-direction: column; }
  .hero-stage::after { display: none; }
  .hero-inner, .hero-copy { display: contents; }
  .hero-id { order: 1; padding: 18px var(--gutter-r) 0 var(--gutter-l); }
  /* the role and the clock share one line, down to a 360 px phone (see the 380 px rule below) */
  .hero-eyebrow { gap: 8px; letter-spacing: .04em; margin-bottom: 12px; }
  .hero-clock { margin-left: 2px; padding-left: 10px; white-space: nowrap; }
  .hero-name { margin-bottom: 10px; }
  /* The desk gets what the first screen has left after the name, the tabs, the intro and its
     buttons (about 530px), so all of them show before any scrolling. */
  .hero-canvas { order: 2; position: relative; inset: auto; height: clamp(180px, calc(100svh - 530px), 440px); width: 100%; }
  /* a close-up fills the frame, so its top and bottom edges fade into the page (none at the overview) */
  .hero-canvas {
    --hero-vf: calc(28px * var(--hero-k, 0));
    -webkit-mask-image: linear-gradient(transparent, #000 var(--hero-vf), #000 calc(100% - var(--hero-vf)), transparent);
    mask-image: linear-gradient(transparent, #000 var(--hero-vf), #000 calc(100% - var(--hero-vf)), transparent);
  }
  /* the tabs and the tour button share one row; the tabs run from the screen's left edge */
  .hero-rail { order: 3; margin-top: 0; border-top: 0; flex-direction: row; align-items: center; gap: 4px; padding: 0 var(--gutter-r) 0 0; }
  .hero-panels { order: 4; padding: 12px var(--gutter-r) 0 var(--gutter-l); }
  .hp-lead { margin-bottom: 16px; }
  .hero-tabs {
    overflow-x: auto; scrollbar-width: none; gap: 6px; margin: 2px 0 0; padding: 6px 12px 8px var(--gutter-l);
    scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter-l) 12px;
    /* app.js sets the fades: an edge fades while there are more tabs past it */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 32px)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 32px)), transparent);
  }
  .hero-tabs::-webkit-scrollbar { display: none; }
  .hero-tab { flex: none; flex-direction: row; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; scroll-snap-align: start; min-height: 40px; }
  .hero-tab[aria-selected="true"] { background: var(--btn-bg); border-color: var(--btn-bg); }
  .hero-tab[aria-selected="true"] .l, .hero-tab[aria-selected="true"] .n { color: var(--btn-ink); }
  .hero-ink { display: none; }
  /* a round play/pause button; its label stays for screen readers */
  .tour-btn { position: relative; align-self: center; margin-left: 0; width: 40px; min-height: 40px; padding: 0; border-radius: 50%; justify-content: center; }
  .tour-btn > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .hero-glow { display: none; }
  .hero-note { display: none; }
  .no-3d .hero-canvas { display: none; }
}
.no-3d .hero-canvas, .no-3d .hero-glow { display: none; }
@media (min-width: 861px) {
  .no-3d .hero-stage { height: auto; min-height: 0; }
  .no-3d .hero-copy { width: min(640px, 100%); padding-bottom: 112px; }
}

/* ---------- without JavaScript ----------
   Every page shows, one after another, as a long document, and the links still jump between them.
   What only works with a script is left out: the hero's 3D, tabs and tour, the 3D viewers, the
   "Try it" demos, replay buttons, and the theme and menu buttons. Phones get the links in the bar. */
.no-js .hero-canvas, .no-js .hero-glow, .no-js .hero-note, .no-js .hero-rail, .no-js .viewer, .no-js .demo,
.no-js [data-replay], .no-js [data-tour-next], .no-js .theme-toggle, .no-js .menu-btn { display: none; }
.no-js .with-3d { display: none; }
.no-js .without-3d { display: inline; }
@media (min-width: 861px) {
  .no-js .hero-stage { height: auto; min-height: 0; }
  .no-js .hero-copy { width: min(640px, 100%); padding-bottom: 56px; }
}
@media (max-width: 860px) {
  .no-js .masthead-inner { height: auto; min-height: var(--head-h); flex-wrap: wrap; row-gap: 0; padding-block: 12px 4px; }
  .no-js .nav { display: flex; order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; }
  .no-js .hero-panels { padding-bottom: 32px; }
}

