:root[data-direction="c"] {
  background: var(--bg);
  color: var(--ink);
}
[data-direction="c"] body {
  margin: 0;
  font: 400 var(--t-body)/var(--lh-body) var(--font-body);
}
[data-direction="c"] *, [data-direction="c"] *::before, [data-direction="c"] *::after {
  box-sizing: border-box;
}
[data-direction="c"] :focus-visible {
  outline: var(--focus) solid var(--accent);
  outline-offset: var(--focus);
}

.film-header {
  position: sticky;
  z-index: 5;
  inset-block-start: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  height: var(--header);
  margin-block-end: calc(-1 * var(--header));
  padding-inline: var(--edge);
  background: transparent;
}
.film-header[data-scrolled]::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 calc(-1 * var(--s-4));
  background: linear-gradient(to bottom, var(--bg) var(--header), transparent);
  pointer-events: none;
}
.film-header .wordmark {
  justify-self: start;
  font: italic 400 var(--t-brand)/var(--lh-meta) var(--font-display);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.film-header :is(nav, .home-menu) {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.film-header .home-menu { display: contents }
.film-header nav { justify-self: center; grid-column: 2 }
.film-header #language { grid-area: 1 / 3 }
.film-header #pause-home { grid-area: 1 / 4 }
.film-header :is(a, button), .copy a {
  display: inline-flex;
  align-items: center;
  min-width: var(--hit);
  min-height: var(--hit);
}
.film-header :is(nav a, button) {
  font: 500 var(--t-meta)/var(--lh-meta) var(--font-mono);
  color: var(--muted);
}
.film-header nav a { text-decoration: none }
.film-header button {
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.film-header :is(nav a, button):is(:hover, :focus-visible) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .25em;
}
.film-header .menu-toggle { display: none }

[data-direction="c"] main > .feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: end;
  gap: 0;
  min-height: var(--section-min);
  padding: var(--header) 0 var(--copy-bottom);
  scroll-margin-top: 0;
  background:
    linear-gradient(to bottom, var(--bg), transparent var(--s-7), transparent calc(100% - var(--s-7)), var(--bg)),
    var(--section-bg);
}
.section-anchor {
  position: absolute;
  inset-block-start: 0;
  scroll-margin-top: 0;
}
.feature > .scene {
  grid-area: auto;
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: clip;
}
.feature > .scene :is(.render-layer, .work-poster, .home-poster, .scene-fallback) {
  mask-image: none;
}
.feature .copy {
  position: relative;
  z-index: 3;
  margin-inline: var(--edge);
  max-width: var(--home-copy-measure);
}
.copy :is(h1, h2, p), .film-footer p, .page-title { margin: 0 }
.copy :is(h1, h2), .page-title {
  font: italic 400 var(--t-display)/var(--lh-display) var(--font-display);
  letter-spacing: var(--tr-display);
  text-wrap: balance;
}
:root:lang(zh) :is(.copy :is(h1, h2), .page-title) {
  font: 600 var(--t-display-zh)/var(--lh-display-zh) var(--font-display-zh);
}
:root:lang(zh) .contact-card h2 {
  font: italic 400 var(--t-display)/var(--lh-display) var(--font-display);
}
.copy .kicker, .contact-role {
  font: 500 var(--t-meta)/var(--lh-meta) var(--font-mono);
  letter-spacing: var(--tr-meta);
  text-transform: uppercase;
  color: var(--accent);
}
.copy .kicker { margin-block-end: var(--label-to-title) }
.copy .lead {
  max-width: var(--lead-measure);
  margin-block-start: var(--title-to-lead);
  color: var(--muted);
  font: 400 var(--t-lead)/var(--lh-lead) var(--font-body);
}
.copy .cta {
  width: fit-content;
  margin-block-start: var(--lead-to-link);
  gap: var(--s-2);
  color: var(--accent);
  font: 500 var(--t-link)/var(--lh-meta) var(--font-mono);
  text-decoration: none;
}
.cta > span:first-child, .contact-links a {
  text-decoration: underline;
  text-decoration-thickness: var(--line);
  text-underline-offset: .25em;
}
.copy .cta:has(+ .cta), .copy .cta + .cta { display: flex }
.copy .cta + .cta { margin-block-start: var(--s-2) }
.cta-arrow { transition: transform var(--ease) }
.cta:is(:hover, :focus-visible) .cta-arrow { transform: translateX(var(--arrow-shift)) }
.feature .numeral {
  position: absolute;
  inset-inline-end: var(--edge);
  inset-block-end: var(--s-7);
  color: var(--numeral);
  font: italic 400 var(--t-numeral)/var(--lh-display) var(--font-display);
  pointer-events: none;
}

@media (width > 1100px) and (aspect-ratio >= 3/2) {
  .feature .copy { width: fit-content }
  :root:lang(zh) #hero .copy { max-width: var(--home-narrow-copy-measure) }
  .feature > .scene {
    isolation: isolate;
    inset-block-start: var(--home-desktop-scene-top);
  }
  [data-direction="c"] main > .feature::before,
  [data-direction="c"] main > .feature::after {
    content: "";
    position: absolute;
    z-index: 1;
    pointer-events: none;
  }
  [data-direction="c"] main > .feature::before {
    /* Fade the front-left desk back into the section backdrop. */
    inset: auto auto 0 0;
    width: calc(100% * var(--reading-fade-width));
    height: calc(100% * var(--reading-fade-height));
    background: inherit;
    background-size: calc(100% / var(--reading-fade-width)) calc(100% / var(--reading-fade-height));
    background-position: left bottom;
    mask-image: var(--reading-fade);
    mask-composite: intersect;
  }
  [data-direction="c"] main > .feature::after {
    /* Let desk legs fade into the section background before the bottom edge. */
    inset: auto 0 0;
    height: calc(2 * var(--s-7));
    background: linear-gradient(to top, var(--bg) var(--header), transparent);
  }
  .feature .numeral { z-index: 2 }
}

.copy .contact-role { margin-block-start: var(--title-to-lead); color: var(--muted) }
.contact-card .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s-3);
  margin-block-start: var(--s-1);
  color: var(--muted);
  font: 400 var(--t-meta)/var(--lh-meta) var(--font-mono);
}
.contact-card .contact-email { color: var(--accent); font-size: var(--t-link) }
.film-footer {
  padding: var(--s-4) var(--edge);
  color: var(--faint);
  background: var(--bg-deep);
  font: 400 var(--t-meta)/var(--lh-meta) var(--font-body);
}

.content-header {
  position: relative;
  grid-template-columns: 1fr auto;
  margin: 0;
}
.content-header #language { grid-area: auto }
.about-content {
  max-width: var(--copy-measure);
  margin-inline: auto;
  padding: var(--s-6) var(--edge);
}
.experience-record { margin-block-start: var(--s-5) }
.experience-record :is(h2, p, ol) { margin: 0 }
.experience-record h2 { font-size: var(--t-lead) }
.experience-record ol {
  padding-inline-start: var(--s-4);
  margin-block: var(--s-3) var(--s-4);
}
.experience-record li + li, .experience-record p + p { margin-top: var(--s-2) }

.feature > .workflow {
  --work-height: var(--section-min);
  align-self: stretch;
  padding: 0;
}
.feature > .workflow .work-stage {
  position: absolute;
  height: 100%;
  margin: 0;
}
.feature .work-stage :is(.render-layer, .work-poster) {
  inset: 0;
  width: 100%;
  height: 100%;
}
.feature > .pebble-scene {
  display: grid;
  align-content: start;
  padding-block-start: var(--s-7);
}
.pebble-scene .render-layer { z-index: 1 }
.pebble-scene > .home-poster { inset: 0 }
.pebble-scene .edit {
  width: min(var(--copy-measure), calc(100% - 2 * var(--edge)));
  margin: 0 var(--edge) 0 auto;
}
.pebble-scene .subtitles .clip { min-width: 0; min-height: 0 }
[data-page="home"][data-paused] :is(.work-poster, .chip-poster, .desk-label, .work-screen, .home-surface) {
  animation-play-state: paused;
}

@media (max-width: 46.25em) {
  .film-header { grid-template-columns: 1fr auto auto }
  .film-header .menu-toggle { display: inline-flex }
  .film-header .home-menu {
    display: none;
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    padding: var(--s-2) var(--edge);
    background: var(--bg-deep);
  }
  .film-header .menu-toggle[aria-expanded="true"] + .home-menu {
    display: grid;
    justify-items: start;
    gap: 0;
  }
  .film-header .home-menu :is(nav, #pause-home) { grid-area: auto }
  .film-header nav { justify-self: start; flex-wrap: wrap }
  .film-header #pause-home { justify-content: start }
  .film-header.content-header { grid-template-columns: 1fr auto }
  [data-direction="c"] main > .feature, .section-anchor { scroll-margin-top: var(--header) }
  [data-direction="c"] #hero { scroll-margin-top: 0 }
}

/* Keep the stacked-scene query aligned with the poster tokens in tokens.css. */
@media (width <= 1100px), (aspect-ratio < 3/2) {
  [data-direction="c"] main > .feature {
    min-height: auto;
    padding-block-start: 0;
  }
  .feature > .scene {
    position: relative;
    height: var(--stacked-scene-height);
    mask-image:
      radial-gradient(ellipse at 62% 45%, var(--bg) 45%, transparent 100%),
      linear-gradient(to bottom, transparent, var(--bg) var(--header), var(--bg) 80%, transparent);
    mask-composite: intersect;
  }
  .feature .numeral { display: none }
  .feature > .workflow { --work-height: var(--stacked-scene-height) }
  .feature .work-stage { --art-height: var(--work-height) }
  .feature > .pebble-scene {
    align-content: center;
    padding-block-start: 0;
  }
}

@media (width > 740px) and ((width <= 1100px) or (aspect-ratio < 3/2)) {
  [data-direction="c"] main > .feature { padding-block-start: var(--header) }
  .feature > .scene {
    width: var(--tablet-scene-width);
    height: auto;
    aspect-ratio: var(--home-poster-aspect);
    justify-self: center;
    mask-image: var(--tablet-scene-fade);
  }
  .feature > .pebble-scene { container-type: inline-size }
  .pebble-scene .timeline { overflow: clip }
}

@media (prefers-reduced-motion: reduce) {
  .cta-arrow { transition: none }
}

/* Screen overlays and loading artwork for the existing scenes. */
[data-direction="c"] [hidden] { display: none !important }
[data-direction="c"] .debug { position: fixed; inset: auto var(--s-2) var(--s-2) auto }
[data-page="home"] {
  --home-rim: #a3caff;
  --surface-pad: 6%;
  --surface-radius: .25rem;
}
.home-scene {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin: 0;
  width: 100%;
  height: 100%;
  container-type: inline-size;
  touch-action: pan-y pinch-zoom;
}
.home-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--under-desk-shade);
}
[data-direction="c"] [data-page="home"] :is(.scene-fallback, .desk-still) { display: none }
[data-direction="c"] [data-page="home"] :is(.home-scene, .feature > .workflow, .pebble-scene):not([data-projected]) {
  visibility: hidden;
  opacity: 0;
}
.home-scene :is(.render-layer, .scene-fallback, .home-poster) { position: absolute; inset: 0; width: 100%; height: 100% }
.home-scene .render-layer { z-index: 1 }
.home-poster { z-index: 2 }
.home-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--home-poster-fit);
  object-position: var(--home-poster-position);
}
.home-scene[data-projected]:has(img[data-ready]) .home-poster { visibility: visible; opacity: 1 }
.home-scene[data-presented][data-instant-handoff] .home-poster:has(img[data-ready]) { animation: none; visibility: hidden }
.home-scene:is([data-render="webgl"], [data-projected]:has(img[data-ready])) .home-surface {
  top: 0;
  left: 0;
}
.home-scene:is([data-render="webgl"], [data-projected]:has(img[data-ready])):not([data-pose-ready]) .home-surface {
  transform: var(--poster-projection, var(--live-projection));
}
.home-scene[data-pose-ready] .home-surface { transform: var(--live-projection) }
.scene-fallback { pointer-events: none }
.scene-fallback::before {
  content: "";
  position: absolute;
  inset: 53% -20% 17%;
  transform: perspective(22rem) rotateX(53deg) rotate(5deg);
  border-radius: var(--radius);
  background: linear-gradient(150deg, #6d8098, #233651 52%, #14243a);
  box-shadow: 0 1rem 0 -.38rem #111d2c, 0 1.9rem 1.6rem #080d17a0;
}
.hero-art .scene-fallback i {
  position: absolute;
  inset: 40% 18% 23%;
  transform: perspective(23rem) rotateX(57deg) rotate(-5deg);
  border: .5rem solid #8293a8;
  border-radius: var(--radius);
  background: repeating-linear-gradient(90deg, #0f192a 0 6%, transparent 6% 8%), repeating-linear-gradient(#758aa152 0 11%, #19283a 11% 16%);
  box-shadow: 0 1.7rem 1.7rem #0b1828db;
}
.home-surface {
  position: absolute;
  z-index: 3;
  transform-origin: 0 0;
  color: #e8f1ff;
  pointer-events: none;
  overflow: hidden;
  /* stage 8: clip (not hidden) with a margin lets the A1 glow show outside the frame; screen content never
     overflows (measured 0px at 1440 and 390). Browsers without overflow-clip-margin keep the inner glow only. */
  overflow: clip;
  overflow-clip-margin: var(--home-device-glow-blur);
  line-height: 1.14;
  font-family: var(--body);
}
.hero-code {
  top: 15%;
  left: 15%;
  width: 62%;
  aspect-ratio: 2;
  display: grid;
  grid-template-columns: 53% 1fr;
  align-content: start;
  padding: 3%;
  border-radius: var(--radius);
  background: #0b1627;
  color: #c7d8ef;
  font: 500 3cqw/1.25 var(--mono);
  box-shadow: 0 0 0 2px #5c708b;
}
.home-scene:is([data-render="webgl"], [data-projected]:has(img[data-ready])) .hero-code { box-shadow: none }
.hero-code > strong { grid-column: 1/-1; margin-block-end: .55em }
.hero-code code { white-space: nowrap; font: inherit }
.hero-code code span { display: block }
.hero-code code [data-line] { padding-inline-start: 8% }
.editor-card {
  display: grid;
  justify-items: start;
  gap: .25em;
  padding: .4em;
  color: #e8f1ff;
  background: #192e48;
  border-radius: var(--surface-radius);
  font-family: var(--body);
}
.hero-art[data-selection="0"] [data-line="0"], .hero-art[data-selection="1"] [data-line="1"] {
  color: var(--home-rim);
  background: #294366;
}
.preview-plate {
  top: 25%;
  left: 51%;
  width: 27%;
  aspect-ratio: 1.53;
  display: grid;
  align-content: center;
  gap: 7%;
  padding: 3%;
  font-size: 2.4cqw;
  color: #e8f1ff;
  background: #142640;
  border: 1px solid #6795c9;
  border-radius: var(--surface-radius);
  box-shadow: 0 .4rem .9rem #0710218a;
}
.preview-front {
  top: 22%;
  left: 56%;
  background: linear-gradient(140deg, #29496e, #13233b 68%);
  border-color: var(--home-rim);
}
.preview-plate strong { font-weight: 600; color: #d7e5f7 }
.project-title { font-size: 1.14em; font-weight: 700 }
.project-action { justify-self: start; color: #c2ddff; border-block-end: 1px solid currentColor }
.hero-art[data-selection="0"] .project-title, .hero-art[data-selection="1"] .project-action { color: #a8d2ff }
.hero-art[data-selection="1"]:not([data-pose-ready]) .preview-front {
  translate: calc(var(--hero-lift, 0) * 8px) calc(var(--hero-lift, 0) * -12px);
}
.hero-art[data-selection="0"]:not([data-pose-ready]) .preview-back {
  translate: calc(var(--hero-lift, 0) * -9px) calc(var(--hero-lift, 0) * -8px);
}
.skill-face {
  top: 44%;
  width: 26%;
  aspect-ratio: 1.72;
  display: grid;
  align-content: center;
  gap: .25em;
  padding-inline: var(--surface-pad);
  font-size: 2.6cqw;
  background: linear-gradient(145deg, #253b59, #14263e);
  border: 2px solid #d4c6ac;
  border-radius: var(--surface-radius);
  box-shadow: .1rem .35rem .55rem #0811229e;
}
.skill-face strong { max-width: 78%; text-wrap: balance }
.skill-face [data-skill-example] { display: none; max-width: 78%; color: #d2e5ff; font-size: .78em }
.skill-face[data-selected] [data-skill-example] { display: block }
.skill-face[data-skill="0"] { left: 8%; top: 51% }
.skill-face[data-skill="1"] { left: 36%; top: 55% }
.skill-face[data-skill="2"] { left: 64%; top: 54% }
.about-art:is([data-render="webgl"], [data-projected]:has(img[data-ready])) .skill-face {
  padding-inline: 2%;
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}
.about-art .skill-face[data-highlight] strong { color: #a3caff }
.about-art:not([data-render="webgl"], [data-projected]:has(img[data-ready])) .skill-face {
  transform: translateY(calc(-1 * var(--skill-rise, 0px)));
}
.about-art:not([data-render="webgl"], [data-projected]:has(img[data-ready])) .skill-face[data-selected] { --skill-rise: 2.6cqw }
.about-art:not([data-render="webgl"], [data-projected]:has(img[data-ready])) .skill-face[data-hovered] { --skill-rise: 3.2cqw }
.experience-screen {
  left: 49%;
  top: 13%;
  width: 41%;
  aspect-ratio: 3.36 / 2.15;
  padding: 3%;
  color: #e0edff;
  background: #0b1627;
  border: 1px solid #6384ab;
  border-radius: var(--surface-radius);
  font-size: 3cqw;
}
.experience-screen > strong { display: block; margin-block-end: .43em }
.screen-tracks { display: grid; gap: .22em; font-size: .74em; }
.screen-tracks > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .45em;
  padding: .20em .36em;
  border-inline-start: .13em solid #7297bd;
  white-space: nowrap;
}
.screen-tracks [data-highlight] { background: #25446b; color: #eaf4ff }
.about-art .experience-screen { z-index: 3 }
.about-art .skill-face { z-index: 4 }
/* The desk and stands remain available while the scene asset loads or falls back. */
.about-art .scene-fallback i {
  position: absolute;
  inset: 70% 6% auto 8%;
  height: 12%;
  background:
    radial-gradient(ellipse at 15% 50%, #080f1ecc 1%, transparent 19%),
    radial-gradient(ellipse at 48% 50%, #080f1ecc 1%, transparent 19%),
    radial-gradient(ellipse at 82% 50%, #080f1ecc 1%, transparent 19%);
}

.case-display {
  display: grid;
  align-content: start;
  gap: .45em;
  padding: .66em;
  border: 1px solid #6384ab;
  border-radius: var(--surface-radius);
  background: var(--panel);
  color: var(--panel-text);
  font-size: var(--console-type);
  pointer-events: auto;
}
.case-art { --console-type: 1.71cqw }
.case-art:is([data-render="webgl"], [data-projected]:has(img[data-ready])) .case-display {
  border: 0;
  border-radius: 0;
  background: transparent;
}
.case-art .case-display p, .stock-quantities :is(dd, dt) { margin: 0 }
.gateway-main {
  top: 20%;
  left: 8%;
  width: 53%;
  aspect-ratio: 4.81 / 2.56;
  padding: .66em .72em;
  gap: .50em;
  --console-type: 2.12cqw;
}
.gateway-providers { flex-wrap: nowrap }
.console-line.gateway-providers > span { background: #152743; padding: .35em; border-radius: var(--surface-radius) }
.gateway-main .console-line.gateway-providers [data-highlight] { background: #284a70 }
.gateway-providers [data-attempt] { margin-top: .23em }
.gateway-main [data-gateway="outcome"] { color: var(--panel-text) }
.gateway-trace { top: 22%; left: 64%; width: 25%; aspect-ratio: 2.15 / 2.71; --console-type: 1.51cqw }
.gateway-route {
  top: 65%;
  left: 32%;
  width: 43%;
  aspect-ratio: 3.73 / .34;
  padding-block: .2em;
  align-content: center;
  grid-template-columns: 1fr auto;
}
.systems-crm { top: 14%; left: 10%; width: 39%; aspect-ratio: 3.23 / 2.48 }
.systems-inventory { top: 14%; left: 50%; width: 39%; aspect-ratio: 3.23 / 2.48 }
.systems-booking { top: 58%; left: 49%; width: 41%; aspect-ratio: 3 / .76 }
.console-line { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .35em }
.console-line > span:has([data-attempt]) { flex: 1; padding: .25em }
.console-line [data-attempt] { display: block; color: var(--panel-muted) }
.console-label { font-weight: 700 }
.console-rows { display: grid; gap: .2em; touch-action: pan-y pinch-zoom }
.console-rows > span, .match-screen-row {
  min-width: 0;
  border: 1px solid var(--panel-edge);
  border-radius: .23em;
  padding: .22em .38em;
  color: inherit;
  background: #152743;
  font: inherit;
  text-align: start;
}
.console-rows > span[data-highlight], .case-display [data-highlight],
.case-display[data-highlight] .console-row, .case-display[data-highlight] .stock-quantities {
  background: #284a70;
  color: var(--panel-text);
}
.case-display [data-highlight] [data-attempt] { color: inherit }
.console-total { color: #a3caff; font-size: .85em }
.trace-stops { grid-template-columns: repeat(3, 1fr) }
.trace-stops > span { font-size: .81em; padding-inline: .22em; white-space: nowrap }
.systems-crm, .systems-inventory {
  --console-type: 2.05cqw;
  gap: .30em;
  padding: .48em;
}
.systems-inventory { --console-type: 1.88cqw; gap: .22em }
.stock-record { font-size: .85em }
.console-row { padding: .25em .34em; background: #152743 }
.stock-quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35em;
  margin: 0;
}
.stock-quantities dd { font-weight: 700 }
.stock-hint { display: none; color: var(--panel-muted); font-size: .77em }
[data-stock-explained] .stock-hint { display: block }
.match-screen-row {
  justify-self: start;
  min-height: 1.65em;
  white-space: nowrap;
  font-size: .82em;
}
.systems-booking {
  --console-type: 1.46cqw;
  gap: .11em;
  padding: .28em .48em;
}
.calendar-days { display: grid; gap: .05em }
.calendar-days span { padding-inline: .35em; background: #152743 }
.loyalty-monitor {
  top: 22%;
  left: 11%;
  width: 48%;
  /* The projection maps this layout box to the physical display face. */
  aspect-ratio: 4.61 / 2.55;
}
.loyalty-phone {
  top: 19%;
  left: 69%;
  width: 18%;
  aspect-ratio: 1.65 / 3.13;
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: anywhere;
}
.loyalty-art :is(.member-card, .reward-tile, .candidate-card) {
  display: grid;
  gap: .25em;
}
.loyalty-art .member-progress { width: 100% }

@media (max-width: 46.25em) {
  .loyalty-art { --console-type: 2.3cqw }
}

.contact-art .scene-fallback i {
  position: absolute;
  inset: 51% 39% 32%;
  transform: skew(-8deg);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #adbdcf, #5f7590 72%, #b6c4d2);
  box-shadow: 0 .5em 1em #080e1ba8;
}
.contact-art .scene-fallback b {
  position: absolute;
  inset: 74% 14% auto 70%;
  height: 1.3%;
  transform: rotate(-26deg);
  border-radius: var(--surface-radius);
  background: linear-gradient(#9bacbf, #4f6076);
}
.contact-paper {
  top: 32%;
  left: 29%;
  width: 42%;
  aspect-ratio: 3.36 / 1.58;
  padding: 1.7%;
  gap: .22em;
  background: linear-gradient(132deg, #f4f0e5, #eeeade);
  color: #17273b;
  border: .22em solid #26374a;
  --console-type: 1.72cqw;
}
.contact-art:not([data-pose-ready]) .contact-paper {
  translate: 0 var(--card-float, 0px);
}
.paper-name { font: 600 2.38em/1.05 var(--title) }
.paper-index { display: grid; margin-block-start: .35em }
.paper-index [data-contact-index] { padding-block: .20em; border-block-start: 1px solid #53647574 }



.resume-index, ul.contact-links { list-style: none }
.resume-index { margin-block-end: 0 }
.resume-index li, ul.contact-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--gap-xs) var(--gap-s) }
.resume-index li > span:last-child { font-size: var(--type-meta); color: var(--muted) }
ul.contact-links { padding: 0; margin: var(--gap-l) 0 0; font-size: var(--type-ui) }
ul.contact-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-underline-offset: .23em; overflow-wrap: anywhere }


.resume-index.scene-actions {
  display: grid;
  gap: var(--gap-s);
  align-items: start;
  padding-inline: var(--gap-m);
  margin-block-start: var(--gap-s);
}
.home-portrait .resume-index.scene-actions {
  padding: var(--gap-s) var(--gap-m);
  background: var(--ground);
  border-radius: var(--radius);
}
.resume-index.scene-actions .icon-button { justify-self: start }
.resume-index.scene-actions :is(p, dl) { margin: 0; color: var(--muted) }

:root:not([data-direction="c"]) [data-page="home"] .site-bar { position: sticky; top: 0; background: var(--scene-ink) }
:root:not([data-direction="c"]) [data-page="home"] .wordmark { text-decoration: none }

/* The home stills and live frames share the same screen planes. */
.feature > .workflow .work-poster img { inset: 0 }
.feature > :is(.workflow, .pebble-scene)[data-projected] > .home-poster,
.feature > .workflow[data-projected] .home-poster {
  visibility: visible;
  opacity: 1;
}
.feature > .scene[data-presented][data-instant-handoff] :is(.home-poster, .chip-poster[data-ready]) {
  animation: none;
  visibility: hidden;
}

.feature > .workflow:is([data-projected], [data-live-framing]) .work-screen {
  position: absolute;
  inset: 0 auto auto 0;
  width: 42%;
  height: auto;
  aspect-ratio: 5.66 / 2.56;
  overflow: hidden;
  border: 0;
  background: transparent;
  transform-origin: 0 0;
  opacity: 1;
  animation: none;
}
.feature > .scene:is([data-projected], [data-live-framing]):not([data-pose-ready]) [data-surface] {
  transform: var(--poster-projection, var(--live-projection));
}
.feature > .scene[data-pose-ready] [data-surface] { transform: var(--live-projection) }
.feature > .workflow[data-live-framing] .desk-label { transform: translate(-50%, var(--s-1)) }

.feature > .pebble-scene:is([data-projected], [data-live-framing]) .edit { grid-area: auto }
.feature > .pebble-scene:is([data-projected], [data-live-framing]) :is(.edit, .edit-layout) {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.pebble-scene:is([data-projected], [data-live-framing]) :is(.monitor, .edit-demo-label) {
  display: none;
}
.pebble-scene:is([data-projected], [data-live-framing]) [data-surface] {
  position: absolute;
  inset: 0 auto auto 0;
  width: 45%;
  height: auto;
  min-width: 0;
  margin: 0;
  transform-origin: 0 0;
}
.pebble-scene:is([data-projected], [data-live-framing]) .work-view {
  aspect-ratio: 6.27 / 1.85;
}
.pebble-scene:is([data-projected], [data-live-framing]) .output-view {
  width: 12%;
  aspect-ratio: 9 / 16;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline {
  aspect-ratio: 6.27 / 1.76;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: var(--s-1);
  border: 0;
  background: transparent;
  font-size: var(--t-pebble-timeline);
  pointer-events: auto;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline .transport {
  padding: 0;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline :is(.track-grid, .transport-buttons > span, #timecode) {
  font-size: inherit;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline .transport-buttons > span {
  min-width: 2.2em;
  min-height: 1.35em;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline .track-grid {
  grid-template-rows: 1.4em repeat(6, minmax(0, 1fr));
  row-gap: var(--line);
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline :is(.ruler, .track-clips, .waveform) {
  min-height: 0;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline :is(.marks, .track-clips, .clip) {
  padding-block: 0;
}
.pebble-scene:is([data-projected], [data-live-framing]) .timeline .playhead { top: 1.4em }
.pebble-scene:is([data-projected], [data-live-framing]) :is(.work-view, .output-view) .view {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border: 0;
}
.pebble-scene:is([data-projected], [data-live-framing]) :is(.view-heading, .outliner) {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
}
.pebble-scene:is([data-projected], [data-live-framing]) .outliner {
  inset: auto 0 0;
}
.pebble-scene[data-render="webgl"][data-pose-ready] .edit[data-shot] .chip-poster[data-ready] { visibility: hidden }
.pebble-scene .timeline { cursor: ew-resize; touch-action: pan-y pinch-zoom; user-select: none }
.pebble-scene:not([data-pose-ready]) [data-shot="1"] .chip-poster { scale: 1.12 }
.pebble-scene:not([data-pose-ready]) [data-shot="2"] .chip-poster { scale: 1.035 }
.pebble-scene[data-projected] .chip-still { visibility: hidden }

@media (width > 1100px) {
  .pebble-scene:is([data-projected], [data-live-framing]) :is(.view-heading, .outliner, .timeline, .fps-label) {
    font-size: var(--t-body);
  }
  .pebble-scene:is([data-projected], [data-live-framing]) .timeline #timecode {
    font-size: var(--t-lead);
  }
}

@media (max-width: 46.25em) {
  .feature > .workflow:is([data-projected], [data-live-framing]) .work-screen { width: 84% }
}

@media (max-width: 1100px) {
  .pebble-scene:is([data-projected], [data-live-framing]) [data-surface] { width: 100% }
  .pebble-scene:is([data-projected], [data-live-framing]) .output-view { width: 30% }
}

/* ---- stage 6 · 01 page transitions (DESIGN.md “动效 · 阶段 6”); home.css is loaded by every page ---- */
@view-transition { navigation: auto; }
::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: var(--vt-ms); animation-timing-function: var(--motion-out); }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
/* stage 6 · 06 decode: hidden copy of the final text for screen readers (shared by every page) */
.decode-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- stage 6 · 07 home title rise + film grain ---- */
/* overflow-clip-margin widens the clip for italic overhangs and descenders without changing the title's height */
.rise-line { display: block; overflow: clip; overflow-clip-margin: var(--home-rise-pad-block); white-space: nowrap; }
.rise-line > span { display: block; }
@media screen { .rise-line > span { animation: home-rise var(--home-rise-ms) var(--motion-out) both; } }
@keyframes home-rise { from { transform: translateY(var(--home-rise-shift)); } }
/* the reading corner waits hidden (set before first paint by transitions.js), then plays kicker → title → lead → links */
@media screen {
  html[data-rise-ready] section.feature .copy:not([data-rise="play"], [data-rise="done"]) > * { opacity: 0; pointer-events: none; }
  section.feature .copy[data-rise="play"] > :not(h1, h2) { animation: home-fade-up var(--home-rise-ms) var(--motion-out) var(--rise-delay, 0ms) both; }
}
@keyframes home-fade-up { from { opacity: 0; transform: translateY(var(--home-fade-shift)); } }
.feature > .scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: var(--grain-size);
  /* fade the grain out before the Blender reading-corner safe zone (x 0–48 %, y 52–100 %) so no hard edge shows */
  mask-image: linear-gradient(to bottom, #000 var(--grain-fade-y0), transparent var(--grain-fade-y1)), linear-gradient(to right, transparent var(--grain-fade-x0), #000 var(--grain-fade-x1));
}
@media (max-width: 740px) {
  .feature > .scene::after { mask-image: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rise-line > span, section.feature .copy > * { animation: none; }
  html[data-rise-ready] section.feature .copy:not([data-rise="play"], [data-rise="done"]) > * { opacity: 1; }
}

/* ---- stage 7 · A1 linked highlighting: pointing at a case link outlines its device on the desk ---- */
.home-surface.case-display::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border: var(--line) solid var(--ink);
  border-radius: inherit;
  /* stage 8: glow rides on the same ::after, so it only fades in; inward too, for browsers that clip at the frame */
  box-shadow: 0 0 var(--home-device-glow-blur) var(--home-device-glow), inset 0 0 var(--home-device-glow-blur) var(--home-device-glow);
  opacity: 0;
  transition: opacity var(--home-device-hint-ms) var(--motion-out);
  pointer-events: none;
}
#loyalty:has(.cta[href="work/loyalty/"]:is(:hover, :focus-visible)) .loyalty-monitor::after,
#loyalty:has(.cta[href="work/flutter-hrm/"]:is(:hover, :focus-visible)) .loyalty-phone::after,
#loyalty[data-hint="loyalty"] .loyalty-monitor::after,
#loyalty[data-hint="hrm"] .loyalty-phone::after { opacity: 1; }

/* ---- stage 7 · A6 header quick jump: a disclosure next to Work lists the six case studies ---- */
.film-header .work-jump { position: relative; display: inline-flex; align-items: center; }
.film-header .work-jump > a { min-width: 0; }
.film-header .work-toggle { min-width: var(--hit-compact); }
.film-header .work-toggle span { display: inline-block; transition: transform var(--case-path-ease); }
.film-header .work-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.film-header .work-list {
  position: absolute;
  inset-block-start: calc(100% + var(--s-2));
  inset-inline-start: 0;
  min-width: max-content;
  margin: 0;
  padding: var(--s-2);
  list-style: none;
  border: var(--line) solid var(--rule);
  border-radius: var(--r-2);
  background: var(--bg-deep);
}
.film-header .work-list[hidden] { display: none; }
/* the open list never runs past the window: it scrolls inside itself on short, wide windows */
.film-header .work-list { max-height: calc(100svh - var(--header) - var(--s-2)); overflow-y: auto; }
.film-header .work-toggle:is(:hover, :focus-visible) { text-decoration: none; }
.film-header .work-list a { width: 100%; padding-inline: var(--s-3); }
.film-header .work-list a[aria-current="page"] { color: var(--ink); }
/* phones: the six cases are listed directly in the menu, on their own row; the toggle is not needed */
@media (max-width: 46.25em) {
  .film-header .work-jump { flex-wrap: wrap; flex-basis: 100%; }
  /* the longer menu scrolls inside itself on short screens (landscape phones, 400 % zoom) */
  .film-header .home-menu { max-height: calc(100svh - var(--header)); overflow-y: auto; }
  .film-header .work-toggle { display: none; }
  .film-header .work-list { display: block; position: static; flex-basis: 100%; padding: 0 0 0 var(--s-4); border: 0; background: none; }
}
@media (prefers-reduced-motion: reduce) {
  .home-surface.case-display::after, .film-header .work-toggle span { transition: none; }
}
body[data-paused] .home-surface.case-display::after, body[data-paused] .film-header .work-toggle span { transition: none; }
@media print {
  .film-header :is(.work-toggle, .work-list) { display: none !important; }
}

/* ---- stage 8 · print: the scenes are decoration, so paper gets the reading corners only (print test P3, P6) ---- */
@media print {
  [data-direction="c"] main > .feature { min-height: 0; padding: var(--s-6) 0; break-inside: avoid; }
  [data-direction="c"] main > .feature > .scene { display: none; }
  .film-header :is(#language, .menu-toggle, #pause-home, .home-menu, nav) { display: none !important; }
}
