@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/InstrumentSerif-Regular.ttf') format('truetype');
  font-display: swap;
  font-weight: 400;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('assets/fonts/InstrumentSerif-Italic.ttf') format('truetype');
  font-style: italic;
  font-display: swap;
  font-weight: 400;
}

:root {
  --world-serif: 'Instrument Serif', Georgia, serif;
  --world-hero-size: clamp(75px, 8.7vw, 140px);
  --world-top: clamp(138px, 23.5dvh, 260px);
}
.home-view > header::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 -48px;
  background: linear-gradient(#111912 0%, #111912c0 42%, transparent);
  opacity: max(var(--ascii-scrim, 0), var(--scene-scrim, 0));
  pointer-events: none;
}
.home-view > header[data-world-scene="2"]::before { --scene-scrim: .83; }
.home-view > header .header-world {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border: 0;
}
.header-world span { opacity: .68; }
.home-view > header .contact { gap: 16px; }
.home-view .stage :focus-visible, .home-view > header :focus-visible, .intro-skip:focus-visible {
  outline: 2px solid #edf6d6;
  outline-offset: 5px;
}
.home-view .stage :focus-visible { box-shadow: 0 0 0 4px #18231766; }

.world-page-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.home-view .world-journey.world-static { height: auto; }
.world-poster[hidden], .scene-loading[hidden], .world-static canvas[hidden] { display: none; }
.stage:not(.is-ready) .sequence-wrap canvas { visibility: hidden; }

.world-caption {
  position: absolute;
  z-index: 3;
  top: 27%;
  left: 7%;
  width: min(72%, 920px);
  color: #f4f4ea;
  pointer-events: none;
  --enter: 1;
  --exit: 0;
  --away-x: 0px;
  --away-y: 0px;
  --lean: 0deg;
}
.world-caption[hidden], .world-frames[hidden], .world-offscreen[hidden] { display: none; }
.world-caption[data-interactive="true"] a,
.world-caption[data-interactive="true"] button { pointer-events: auto; }
.world-caption[data-caption="0"] { top: var(--world-top); }
.world-caption[data-caption="4"] { width: min(55%, 810px); }
.world-caption[data-caption="6"] { top: 23%; }
.world-caption .eyebrow {
  color: #edf0dce8;
  font-size: 10px;
  letter-spacing: .16em;
  margin: 0 0 22px;
  text-shadow: 0 1px 10px #18211b83;
}
.world-title {
  font-family: World Display, Arial, sans-serif;
  margin: 0 0 23px;
  font-size: clamp(47px, 6.0vw, 98px);
  line-height: .99;
  letter-spacing: -.065em;
  font-weight: 400;
  text-wrap: wrap;
}
[data-caption="0"] .world-title {
  font-size: var(--world-hero-size);
  line-height: .96;
}
[data-caption="2"] .world-title, [data-caption="6"] .world-title { font-size: clamp(44px, 5vw, 84px); }
.world-title-line { display: block; overflow: clip; overflow-clip-margin: .14em; }
.world-word {
  display: inline-block;
  vertical-align: top;
  overflow: clip;
  padding: .10em .057em .12em;
  margin: -.10em -.057em -.12em;
}
.world-ink {
  display: inline-block;
  --rise: clamp(0, calc((var(--enter) - var(--word-step, 0)) * 1.28), 1);
  --depart: clamp(0, calc(var(--exit) * 1.21 - var(--word-step, 0)), 1);
  transform: translate(
      calc(var(--away-x) * var(--depart)),
      calc(115% * (1 - var(--rise)) + var(--away-y) * var(--depart))
    ) scale(calc(1 + .047 * var(--depart))) skewX(var(--lean));
  opacity: calc(1 - var(--depart));
  filter: blur(calc(2.4px * var(--depart)));
}
.world-title em {
  font-family: var(--world-serif);
  font-weight: 400;
  font-size: 1.12em;
  letter-spacing: -.027em;
  color: #edf0d7;
  line-height: 0;
}

.caption-description {
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 19px;
  max-width: 41ch;
  color: #f7f7eeeb;
  text-shadow: 0 1px 7px #192019aa;
}
[data-caption="0"] .caption-description { max-width: 35ch; }
.caption-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  width: fit-content;
}
.caption-detail {
  --detail-delay: .03;
  --detail-in: clamp(0, calc((var(--enter) - var(--detail-delay)) * 1.75), 1);
  opacity: calc(var(--detail-in) * (1 - var(--exit)));
  transform: translate(
    calc(var(--away-x) * var(--exit) * .65),
    calc((1 - var(--detail-in)) * 9px + var(--away-y) * var(--exit) * .65)
  );
}
.caption-description { --detail-delay: .27; }
.caption-actions, .scene-contact-details, .world-offscreen { --detail-delay: .38; }
.world-action, .world-primary {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  font-size: 13px;
  font-weight: 600;
  color: #f5f6e9;
}
.world-action:not(.world-primary) { border-bottom: 1px solid #eff2e06b; }
.world-action:not(.world-primary):hover { border-color: #f5f6e9; }
.world-primary {
  gap: 28px;
  border: 0;
  border-radius: 2px;
  background: #e7eddb;
  color: #20281d;
  padding: 0 16px;
}
.world-primary:hover { background: #f4f7e9; }
.world-primary span { font-size: 16px; }
[data-magnet] { transition: translate .32s var(--motion-ease), background-color .2s ease; }
.world-cursor-active [data-magnet]:hover { transition: translate .13s ease-out, background-color .2s ease; }

.world-controls {
  position: absolute;
  z-index: 5;
  inset: auto 7% max(21px, env(safe-area-inset-bottom)) 7%;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 20px;
  color: #f2f3e9;
}
.world-track {
  position: relative;
  height: 44px;
  --playhead: 0%;
}
.world-track::before {
  content: '';
  position: absolute;
  top: calc(50% - .5px);
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, #edf0d7b8 var(--playhead), #eff0e345 var(--playhead));
}
.world-playhead { position: absolute; inset: 0; pointer-events: none; }
.world-playhead::before {
  content: '';
  position: absolute;
  top: calc(50% - 3px);
  left: var(--playhead);
  width: 6px;
  height: 6px;
  translate: -50% 0;
  border-radius: 50%;
  background: #eef3da;
}
.world-active-name {
  position: absolute;
  top: -9px;
  left: clamp(37px, var(--playhead), calc(100% - 37px));
  translate: -50% -50%;
  white-space: nowrap;
  color: #f3f2e5;
  font: 400 19px/1 var(--world-serif);
  text-shadow: 0 1px 8px #182319;
}
.world-step, .world-tick { border: 0; background: none; color: inherit; padding: 0; height: 44px; }
.world-step { font-size: 16px; }
.world-step:disabled { opacity: .34; cursor: default; }
.world-tick {
  position: absolute;
  top: 0;
  left: var(--tick);
  width: 30px;
  translate: -50% 0;
}
.world-tick::before {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% - .5px);
  width: 1px;
  height: 10px;
  background: #f1f2e393;
}
.world-tick[aria-current="step"]::before, .world-tick:hover::before { background: #f4f6df; }

.world-frames { position: absolute; inset: 0; z-index: 2; overflow: clip; pointer-events: none; }
.world-frames .world-frame {
  position: absolute;
  left: var(--frame-x);
  top: var(--frame-y);
  width: var(--frame-width);
  height: var(--frame-height);
  clip-path: var(--frame-clip);
  pointer-events: auto;
}
.world-frames .world-frame span {
  position: absolute;
  top: 33%;
  left: 50%;
  translate: -50% -50%;
  background: #18221b;
  color: #fff;
  padding: 6px;
  font-size: 11px;
  opacity: 0;
}
.world-frames .world-frame:focus-visible { background: #e8f3ca55; }
.world-frames .world-frame:focus-visible span { opacity: 1; }
.world-offscreen { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; }
.world-offscreen:not([hidden]) {
  opacity: 1;
  transform: none;
}
.world-offscreen a { pointer-events: auto; padding-block: 8px; text-decoration: underline; text-underline-offset: .23em; }

.world-cursor { display: contents; }
.world-cursor[hidden] { display: none; }
.cursor-dot, .cursor-ring, .cursor-label {
  position: fixed;
  z-index: 25;
  pointer-events: none;
  top: 0;
  left: 0;
  will-change: transform;
}
.cursor-dot, .cursor-ring { mix-blend-mode: difference; border-radius: 50%; }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px; background: #fff; }
.cursor-ring {
  width: 35px;
  height: 35px;
  margin: -17.5px;
  border: 1px solid #fff;
  transition: width .21s ease, height .21s ease, margin .21s ease;
}
.world-cursor[data-mode="frame"] .cursor-ring { width: 49px; height: 49px; margin: -24.5px; }
.world-cursor[data-mode="action"] .cursor-ring { width: 43px; height: 43px; margin: -21.5px; }
.cursor-label {
  margin: -8px 0 0 27px;
  white-space: nowrap;
  color: #fff;
  font: 600 11px/16px World Sans, Arial, sans-serif;
  text-shadow: 0 0 3px #151b12, 0 1px 5px #151b12, 0 2px 10px #151b12;
}
[data-mode="frame"] .cursor-label { margin-left: 33px; }
[data-label-left="true"] .cursor-label { translate: -100% 0; margin-left: -28px; }
[data-mode="frame"][data-label-left="true"] .cursor-label { margin-left: -35px; }
@media (pointer: fine) and (hover: hover) and (prefers-reduced-motion: no-preference) {
  .world-cursor-active .stage, .world-cursor-active .stage a, .world-cursor-active .stage button,
  .world-cursor-active > header [data-magnet] { cursor: none; }
}

.gallery-transfer {
  position: fixed;
  display: block;
  z-index: 24;
  pointer-events: none;
  transform-origin: 0 0;
  object-fit: contain;
  background: #d3ba98;
}
html.gallery-transfer-active::view-transition-group(gallery-case) {
  animation-duration: .72s;
  animation-timing-function: cubic-bezier(.23,.68,.25,1);
}
html.gallery-transfer-active::view-transition-old(gallery-case),
html.gallery-transfer-active::view-transition-new(gallery-case) {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
html.gallery-transfer-active::view-transition-old(gallery-case) {
  object-fit: contain;
  background: #d3ba98;
  animation: gallery-print-out .72s cubic-bezier(.23,.68,.25,1) both;
}
html.gallery-transfer-active::view-transition-new(gallery-case) {
  animation: gallery-hero-in .72s ease-out both;
}
html.gallery-transfer-active::view-transition-old(root) { animation: gallery-world-out .36s ease-out both; }
html.gallery-transfer-active::view-transition-new(root) { animation: none; }
@keyframes gallery-print-out {
  0% { clip-path: var(--gallery-clip-from); opacity: 1; }
  36% { opacity: 1; }
  95%, 100% { opacity: 0; }
  100% { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
}
@keyframes gallery-hero-in { 0%, 28% { opacity: 0; } 100% { opacity: 1; } }
@keyframes gallery-world-out { to { opacity: 0; } }

@media (max-width: 800px) {
  :root {
    --world-hero-size: clamp(50px, 11.7vw, 90px);
    --world-top: max(122px, 17.5dvh);
  }
  .home-view > header {
    display: grid;
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px 13px;
    padding-block: max(12px, env(safe-area-inset-top)) 6px;
  }
  .home-view > header nav {
    grid-column: 1 / -1;
    order: 3;
    gap: 0;
    margin: 0;
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
  }
  .home-view > header .brand .signature-name { font-size: clamp(16px, 4.6vw, 20px); }
  .home-view > header .header-world { gap: 5px; font-size: 11px; }
  .home-view > header .contact { white-space: nowrap; gap: 5px; font-size: 11px; }
  .world-caption { top: max(133px, 27%); width: 86%; }
  .world-caption[data-caption="2"] { top: max(116px, 14.5%); }
  .world-caption[data-caption="2"] .caption-description { max-width: 26ch; }
  .world-caption[data-caption="3"] { top: max(126px, 19%); }
  .world-caption[data-caption="4"] { top: max(125px, 55%); width: 86%; }
  .world-caption[data-caption="6"] { top: max(126px, 18%); }
  .world-caption .eyebrow { margin-bottom: 15px; font-size: 9px; }
  .world-title { margin-bottom: 17px; font-size: clamp(36px, 11.3vw, 68px); text-shadow: 0 1px 10px #17231970; }
  [data-caption="2"] .world-title, [data-caption="6"] .world-title { font-size: clamp(32px, 10.6vw, 61px); }
  .caption-description { font-size: 13px; max-width: 39ch; margin-bottom: 11px; }
  [data-caption="0"] .caption-description { max-width: 29ch; }
  [data-caption="6"] .caption-description { max-width: 26ch; }
  .caption-actions { gap: 17px; }
  .scene-contact-details { margin-top: 13px; }
  .world-controls { gap: 12px; grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .world-active-name { font-size: 18px; top: -3px; }
  .world-offscreen { margin-top: 4px; }
}

@media (max-height: 650px) {
  :root { --world-top: max(118px, 20dvh); --world-hero-size: clamp(45px, 8vw, 86px); }
  .world-caption { top: max(115px, 21%); }
  .world-caption[data-caption="6"] { top: max(115px, 21%); }
  .world-caption .eyebrow { margin-bottom: 10px; }
  .world-title { font-size: clamp(33px, 5.7vw, 68px); margin-bottom: 12px; }
  [data-caption="2"] .world-title, [data-caption="6"] .world-title { font-size: clamp(31px, 5.2vw, 62px); }
  .caption-description { font-size: 12px; line-height: 1.5; margin-bottom: 8px; }
  .world-controls { bottom: max(9px, env(safe-area-inset-bottom)); }
}

@media (max-width: 800px) and (max-height: 650px) {
  .world-caption[data-caption="4"] { top: max(115px, 45%); }
}
@media (min-width: 570px) and (max-height: 470px) {
  :root { --world-top: 77px; --world-hero-size: clamp(41px, 6vw, 66px); }
  .home-view > header {
    display: flex;
    flex-wrap: nowrap;
    height: 62px;
    gap: clamp(10px, 2vw, 22px);
    padding-block: 0;
  }
  .home-view > header nav {
    order: 0;
    margin-left: auto;
    width: auto;
    gap: clamp(10px, 2vw, 22px);
  }
  .world-caption[data-caption] { top: var(--world-top); }
  .world-caption[data-caption] .caption-description { max-width: min(47ch, 57vw); }
}

@media (prefers-reduced-motion: reduce) {
  .world-cursor { display: none; }
  .world-ink, .caption-detail { transform: none; filter: none; opacity: 1; }
}
