:root {
  color-scheme: dark;
  --black: #000;
  --ink: #070707;
  --cream: #f4ebd9;
  --amber: #f5a623;
  --orange: #f06423;
  --red: #e0322c;
  --magenta: #c42d7c;
  --violet: #7a3ff2;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --hard-ease: cubic-bezier(.76, 0, .24, 1);
  --edge: clamp(16px, 2.1vw, 34px);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #000;
}

* {
  box-sizing: border-box;
}

html {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  margin: 0;
  overflow: hidden;
  scrollbar-width: none;
  background: #000;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--cream);
  background: #000;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button {
  font: inherit;
}

.story {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pinch-zoom;
  background: #000;
}

.scene {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  clip-path: inset(100% 0 0 0);
  transform: translate3d(0, 3.5%, 0) scale(.995);
  transition:
    clip-path 780ms var(--hard-ease),
    opacity 300ms linear,
    transform 950ms var(--ease),
    visibility 0s linear 950ms;
}

.scene.is-before {
  clip-path: inset(0 0 100% 0);
  transform: translate3d(0, -3.5%, 0) scale(.995);
}

.scene.is-after {
  clip-path: inset(100% 0 0 0);
  transform: translate3d(0, 3.5%, 0) scale(.995);
}

body[data-direction="backward"] .scene.is-before {
  clip-path: inset(0 0 100% 0);
}

body[data-direction="backward"] .scene.is-after {
  clip-path: inset(100% 0 0 0);
}

.scene.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  clip-path: inset(0 0 0 0);
  transform: none;
  transition:
    clip-path 780ms var(--hard-ease),
    opacity 240ms linear,
    transform 1100ms var(--ease),
    visibility 0s linear;
}

.scene-sticky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.scene-surface {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
}

.scene-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 700ms ease, transform 1300ms var(--ease);
}

.scene.is-loaded .scene-frame {
  opacity: 1;
  transform: scale(1);
}

.scene[data-scene="live-chat"] .scene-frame {
  pointer-events: auto;
}

.scene[data-scene="built-for-intelligence"] .scene-edge,
.scene[data-scene="built-for-intelligence"] .scene-scan,
.scene[data-scene="live-chat"] .scene-edge,
.scene[data-scene="live-chat"] .scene-scan {
  display: none;
}

.scene-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 500ms ease 120ms;
}

.scene-loader::before {
  content: "";
  width: 26px;
  height: 26px;
  border: 1px solid rgba(244, 235, 217, .24);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.scene.is-loaded .scene-loader {
  opacity: 0;
  pointer-events: none;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

.scene-edge {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.22), transparent 8%, transparent 92%, rgba(0,0,0,.2)),
    linear-gradient(180deg, rgba(0,0,0,.16), transparent 10%, transparent 89%, rgba(0,0,0,.2));
  opacity: .22;
}

.scene-scan {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, transparent 0 48%, rgba(244,235,217,.09) 49.8%, transparent 51% 100%);
  transform: translateY(-60%);
}

.scene.is-active .scene-scan {
  animation: scan-pass 1100ms cubic-bezier(.25,.8,.25,1) 130ms both;
}

@keyframes scan-pass {
  0% { opacity: 0; transform: translateY(-55%); }
  18% { opacity: .48; }
  100% { opacity: 0; transform: translateY(58%); }
}

.grain {
  position: fixed;
  z-index: 70;
  inset: -20%;
  width: 140%;
  height: 140%;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.78' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: grain-shift .8s steps(2) infinite;
  mix-blend-mode: screen;
}

@keyframes grain-shift {
  0% { transform: translate3d(-2%, 1%, 0); }
  25% { transform: translate3d(3%, -2%, 0); }
  50% { transform: translate3d(-1%, 3%, 0); }
  75% { transform: translate3d(2%, -1%, 0); }
  100% { transform: translate3d(-3%, 2%, 0); }
}

.top-spectrum {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: rgba(255,255,255,.08);
}

.top-spectrum i {
  display: block;
  width: var(--story-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--orange), var(--red), var(--magenta), var(--violet));
  box-shadow: 0 0 16px rgba(196,45,124,.35);
  transition: width 80ms linear;
}

.site-chrome {
  position: fixed;
  z-index: 60;
  top: calc(var(--edge) + env(safe-area-inset-top, 0px));
  left: calc(var(--edge) + env(safe-area-inset-left, 0px));
  right: calc(var(--edge) + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.site-chrome button {
  pointer-events: auto;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  color: var(--cream);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

body.is-opening .brand-button {
  visibility: hidden;
  pointer-events: none;
}

body.is-chat .brand-button {
  visibility: hidden;
  pointer-events: none;
}

body.is-chat .deck-experience > .grain,
body.is-chat .portrait-note {
  display: none;
}

.brand-copy {
  display: grid;
  gap: 3px;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 220ms ease, transform 360ms var(--ease);
}

.brand-button:hover .brand-copy,
.brand-button:focus-visible .brand-copy {
  opacity: 1;
  transform: none;
}

.brand-copy b {
  font-size: 10px;
  line-height: 1;
  letter-spacing: .18em;
}

.brand-copy small {
  color: rgba(244,235,217,.42);
  font: 700 7px/1.1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.kora-mark {
  display: block;
  object-fit: contain;
  aspect-ratio: 268 / 228;
}

.mini-mark {
  width: 31px;
  height: auto;
  flex: 0 0 auto;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.text-button,
.icon-button,
.close-button {
  border: 1px solid rgba(244,235,217,.16);
  color: rgba(244,235,217,.76);
  background: rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 240ms var(--ease);
}

.text-button {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font: 800 8px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .18em;
}

.icon-button,
.close-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
}

.text-button:hover,
.icon-button:hover,
.close-button:hover,
.text-button:focus-visible,
.icon-button:focus-visible,
.close-button:focus-visible {
  outline: 0;
  color: #fff;
  border-color: rgba(244,235,217,.4);
  background: rgba(0,0,0,.62);
  transform: translateY(-1px);
}

body.is-chat .text-button,
body.is-chat .icon-button {
  color: rgba(10,10,10,.74);
  border-color: rgba(10,10,10,.2);
  background: rgba(244,235,217,.7);
}

body.is-chat .text-button:hover,
body.is-chat .icon-button:hover,
body.is-chat .text-button:focus-visible,
body.is-chat .icon-button:focus-visible {
  color: #0a0a0a;
  border-color: rgba(10,10,10,.42);
  background: rgba(244,235,217,.94);
}

.chapter-rail {
  position: fixed;
  z-index: 54;
  top: 50%;
  right: calc(var(--edge) + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: stretch;
  height: min(48vh, 390px);
  transform: translateY(-50%);
}

.rail-line {
  position: relative;
  width: 1px;
  height: 100%;
  margin-right: 11px;
  overflow: hidden;
  background: rgba(244,235,217,.14);
}

.rail-line i {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--rail-progress, 0%);
  background: linear-gradient(180deg, var(--amber), var(--red), var(--violet));
}

.chapter-rail ol {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-button {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.rail-button::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 5px;
  height: 1px;
  background: rgba(244,235,217,.32);
  transform: translateY(-50%);
  transition: width 220ms var(--ease), background 180ms ease;
}

.rail-button span {
  position: absolute;
  top: 50%;
  right: 18px;
  width: max-content;
  padding: 5px 8px;
  border: 1px solid rgba(244,235,217,.12);
  border-radius: 3px;
  color: rgba(244,235,217,.7);
  background: rgba(0,0,0,.68);
  font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .12em;
  opacity: 0;
  pointer-events: none;
  transform: translate(7px, -50%);
  transition: opacity 150ms ease, transform 240ms var(--ease);
}

.rail-button:hover::before,
.rail-button:focus-visible::before,
.rail-button[aria-current="true"]::before {
  width: 11px;
  background: var(--amber);
}

.rail-button:hover span,
.rail-button:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}

body.is-chat .rail-line {
  background: rgba(10,10,10,.16);
}

body.is-chat .rail-button::before {
  background: rgba(10,10,10,.34);
}

.rail-button:focus-visible {
  outline: 0;
}

.chapter-readout {
  position: fixed;
  z-index: 52;
  left: calc(var(--edge) + env(safe-area-inset-left, 0px));
  bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(244,235,217,.46);
  font: 750 8px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .15em;
  pointer-events: none;
}

.chapter-readout > span:first-child {
  color: var(--amber);
}

.chapter-readout i {
  width: 20px;
  height: 1px;
  background: rgba(244,235,217,.24);
}

body.is-chat .chapter-readout {
  color: rgba(10,10,10,.5);
}

body.is-chat .chapter-readout > span:first-child {
  color: var(--red);
}

body.is-chat .chapter-readout i {
  background: rgba(10,10,10,.26);
}

.state-readout {
  position: fixed;
  z-index: 52;
  right: calc(var(--edge) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--edge) + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(244,235,217,.36);
  font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .14em;
  pointer-events: none;
}

.state-readout b {
  color: var(--cream);
  font-size: 11px;
}

.state-readout i {
  font-style: normal;
  opacity: .5;
}

.scroll-cue {
  position: fixed;
  z-index: 51;
  left: 50%;
  bottom: calc(27px + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: center;
  gap: 9px;
  color: rgba(244,235,217,.44);
  font: 800 7px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .19em;
  transform: translateX(-50%);
  transition: opacity 400ms ease, transform 500ms var(--ease);
  pointer-events: none;
}

.scroll-cue i {
  position: relative;
  width: 1px;
  height: 24px;
  overflow: hidden;
  background: rgba(244,235,217,.18);
}

.scroll-cue b {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(180deg, var(--amber), var(--magenta));
  animation: cue 1500ms var(--ease) infinite;
}

@keyframes cue {
  0% { transform: translateY(-110%); }
  70%, 100% { transform: translateY(245%); }
}

.has-scrolled .scroll-cue {
  opacity: 0;
  transform: translate(-50%, 8px);
}

.legal-footer {
  position: fixed;
  z-index: 52;
  left: 50%;
  bottom: calc(9px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  overflow: hidden;
  color: rgba(244,235,217,.34);
  font-family: "Neue Frutiger", "NeueFrutiger", "Frutiger Neue", Frutiger, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(6px, .42vw, 8px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: .08em;
  text-align: center;
  text-overflow: clip;
  text-shadow: 0 1px 8px rgba(0,0,0,.82);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  transition: color 420ms ease, opacity 420ms ease;
}

.is-closing .legal-footer,
.is-final .legal-footer {
  color: rgba(244,235,217,.46);
  letter-spacing: .045em;
}

.is-chat .legal-footer,
.is-chat.is-final .legal-footer {
  color: rgba(10,10,10,.46);
  text-shadow: none;
}

.index-panel {
  position: fixed;
  z-index: 90;
  inset: 0;
}

.index-panel[hidden] {
  display: none;
}

.index-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fade-in 220ms ease both;
}

.index-card {
  position: absolute;
  top: 0;
  right: 0;
  width: min(620px, 100vw);
  height: 100%;
  padding: max(42px, env(safe-area-inset-top)) max(34px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) 38px;
  overflow: auto;
  border-left: 1px solid rgba(244,235,217,.14);
  background:
    radial-gradient(circle at 100% 0, rgba(122,63,242,.13), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.035), transparent 20%),
    #070707;
  animation: index-in 560ms var(--ease) both;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes index-in { from { opacity: 0; transform: translateX(38px); } }

.index-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(244,235,217,.14);
}

.index-header span {
  color: rgba(244,235,217,.4);
  font: 800 8px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .2em;
}

.index-header h1 {
  margin: 17px 0 0;
  font-size: clamp(28px, 5vw, 52px);
  line-height: .88;
  letter-spacing: -.055em;
}

.close-button {
  width: 34px;
  height: 34px;
  font-size: 25px;
}

#indexList {
  margin: 0;
  padding: 12px 0 20px;
  list-style: none;
  counter-reset: chapter -1;
}

#indexList li {
  counter-increment: chapter;
}

.index-link {
  display: grid;
  grid-template-columns: 43px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 4px 2px;
  border: 0;
  border-bottom: 1px solid rgba(244,235,217,.08);
  color: rgba(244,235,217,.58);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, padding 260ms var(--ease);
}

.index-link::before {
  content: counter(chapter, decimal-leading-zero);
  color: rgba(244,235,217,.25);
  font: 700 8px/1 "SFMono-Regular", Consolas, monospace;
}

.index-link::after {
  content: "↘";
  opacity: 0;
  transform: translate(-7px, -7px);
  transition: opacity 180ms ease, transform 260ms var(--ease);
}

.index-link:hover,
.index-link:focus-visible,
.index-link[aria-current="true"] {
  outline: 0;
  padding-left: 8px;
  color: var(--cream);
}

.index-link:hover::after,
.index-link:focus-visible::after,
.index-link[aria-current="true"]::after {
  opacity: 1;
  transform: none;
}

.index-link[aria-current="true"]::before {
  color: var(--amber);
}

.index-link span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.index-card footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(244,235,217,.26);
  font: 700 7px/1.4 "SFMono-Regular", Consolas, monospace;
  letter-spacing: .16em;
}

.portrait-note {
  display: none;
}

.noscript {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--cream);
  background: #000;
  font-size: 13px;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .brand-copy,
  .chapter-rail,
  .chapter-readout,
  .state-readout,
  .icon-button {
    display: none !important;
  }

  .mini-mark {
    width: 28px;
    height: auto;
  }

  .scene-surface {
    border-radius: 0;
    clip-path: none;
    filter: none;
  }

  .scene,
  .scene.is-before,
  .scene.is-after {
    transform: none;
    transition:
      clip-path 560ms var(--hard-ease),
      opacity 220ms linear,
      visibility 0s linear 580ms;
  }

  .scene.is-active {
    transform: none;
    transition:
      clip-path 560ms var(--hard-ease),
      opacity 200ms linear,
      visibility 0s linear;
  }

  .scene-frame,
  .scene.is-loaded .scene-frame {
    transform: none;
    transition: opacity 420ms ease;
  }

  .scene-scan,
  .deck-experience > .grain {
    display: none;
  }

  .top-spectrum i {
    box-shadow: none;
  }

  .text-button,
  .icon-button,
  .close-button,
  .index-scrim {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .text-button,
  .icon-button,
  .close-button {
    background: rgba(0,0,0,.72);
  }

  .index-card {
    padding-left: 24px;
  }

  .index-card footer {
    display: none;
  }

  .legal-footer {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    font-size: clamp(6px, 1.45vw, 7px);
  }
}

@media (max-width: 720px) and (orientation: portrait),
       (hover: none) and (pointer: coarse) and (orientation: portrait) {
  .portrait-note {
    position: fixed;
    z-index: 55;
    right: calc(15px + env(safe-area-inset-right, 0px));
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    display: block;
    color: rgba(244,235,217,.32);
    font: 700 7px/1 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .14em;
    pointer-events: none;
  }
}

@supports (-webkit-touch-callout: none) {
  @media (any-pointer: coarse) {
    .scene,
    .scene-surface,
    .scene-frame {
      will-change: auto;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .scene,
  .scene-surface,
  .scene-frame { transform: none !important; clip-path: none !important; filter: none !important; }
  .grain,
  .scene-scan { display: none !important; }
}
