/* Entrance clips preserve the original text wrapping and inline links. */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: clip;
}
.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.motion-word {
  display: inline-block;
  overflow: clip;
  vertical-align: top;
}
.motion-glyph {
  display: inline-block;
  opacity: 0;
  transform: translateY(105%);
  transition:
    transform 1s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 1s cubic-bezier(0.23, 1, 0.32, 1);
  transition-delay: calc(var(--line, 0) * 0.1s);
}
.motion-entered .motion-glyph {
  opacity: 1;
  transform: translateY(0);
}
.motion-content {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1s cubic-bezier(0.23, 1, 0.32, 1),
    transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}
.motion-content.motion-entered {
  opacity: 1;
  transform: translateY(0);
}
/* Legacy markup fallback. New pages use data-animate and keep text readable by default. */
html:not([data-animation-markup]) [style='opacity:0.001'],
html:not([data-animation-markup]) [style*='opacity: 0.001'],
.motion-fallback .motion-glyph,
.motion-fallback .motion-content {
  opacity: 1 !important;
  transform: none !important;
}
#contact:not([data-footer-ready]) [data-minimap-presence='footer-copy'],
.motion-fallback #contact [data-minimap-presence='footer-copy'] {
  width: min(472px, 88vw);
  opacity: 1 !important;
  pointer-events: auto;
}
#contact:not([data-footer-ready]) figure,
.motion-fallback #contact figure {
  visibility: hidden;
}
.announcement-motion {
  overflow: hidden;
  white-space: nowrap;
}
.announcement-motion > span {
  display: flex;
  width: max-content;
  animation: announcement-motion var(--marquee-duration, 16s) linear infinite;
}
.announcement-motion > span > span {
  flex: none;
}
.announcement-motion:hover > span {
  animation-play-state: paused;
}
.pricing-motion-editions {
  position: relative;
  isolation: isolate;
}
.pricing-motion-highlight {
  position: absolute;
  top: 0;
  left: 0;
  background: #f1eee7;
  border-radius: 4px;
  z-index: -1;
  pointer-events: none;
  transition:
    transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes announcement-motion {
  to {
    transform: translateX(-50%);
  }
}
.nav-motion-links {
  position: relative;
  isolation: isolate;
}
.nav-motion-highlight {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  background: #ffffff14;
  border: 1px solid #ffffff20;
  border-radius: 4px;
  opacity: 0;
  transition:
    transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    width 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    height 0.4s,
    opacity 0.2s;
  pointer-events: none;
}
.nav-motion-link {
  animation: nav-motion-in 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
  animation-delay: var(--nav-delay);
}
.nav-current {
  color: #fff;
}
@keyframes nav-motion-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
html[data-chrome='hidden'] header:has(nav[aria-label='Primary']),
html[data-chrome='hidden'] .site-minimap {
  opacity: 0;
  pointer-events: none;
}
header:has(nav[aria-label='Primary']),
.site-minimap {
  transition: opacity 0.3s;
}
[data-ascii-curtain].page-motion-curtain {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 9000;
  visibility: hidden;
  pointer-events: none;
}
.article-reading-progress {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #ff9100;
  transform-origin: left;
  pointer-events: none;
}
/* DOM-derived page minimap. */
.site-minimap {
  position: fixed;
  z-index: 55;
  top: 16px;
  right: 16px;
  width: 96px;
  height: 54px;
  opacity: 0;
  background: #232323;
  border: 1px solid #777;
  transition:
    opacity 0.3s,
    border-color 0.2s;
}
.site-minimap.is-ready {
  opacity: 1;
}
.minimap-window {
  position: absolute;
  inset: 3px;
  overflow: hidden;
}
.minimap-paper {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.minimap-scan,
.minimap-scan-counter {
  position: absolute;
  inset: 0;
}
.minimap-scan {
  overflow: hidden;
  animation: minimap-scan 5s ease-in-out infinite alternate;
}
.minimap-scan-counter {
  animation: minimap-counter 5s ease-in-out infinite alternate;
}
.minimap-scan > i {
  position: absolute;
  top: 0;
  height: 1px;
  width: 100%;
  background: #ff9100;
}
@keyframes minimap-scan {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(100%);
  }
}
@keyframes minimap-counter {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100%);
  }
}
.site-minimap > button {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.site-minimap:hover,
.site-minimap.is-inspecting {
  border-color: #ff9100;
}
.minimap-tooltip {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  padding: 2px 4px;
  background: #ff9100;
  color: #111;
  font: 10px/1.2 var(--font-mono);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.site-minimap:hover .minimap-tooltip {
  opacity: 1;
}
html[data-minimap-measuring] [data-minimap-pin] {
  position: relative !important;
  top: auto !important;
  transform: none !important;
}
.studio-motion-outline {
  position: fixed;
  z-index: 80;
  border: 1px solid #ff9100;
  pointer-events: none;
}
.studio-motion-outline > span {
  position: absolute;
  top: 0;
  left: 0;
  padding: 3px 6px;
  background: #ff9100;
  color: #111;
  font: 11px var(--font-mono);
}
.studio-motion-status {
  position: fixed;
  z-index: 100;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 14px;
  color: #ff9100;
  background: #232323;
  border: 1px solid #ff9100;
  border-radius: 4px;
  font: 11px var(--font-mono);
}
.studio-motion-status button {
  cursor: pointer;
  color: #fff;
}
.studio-motion-status[hidden],
.studio-motion-outline[hidden] {
  display: none;
}
.studio-motion-detail {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 80px;
  width: min(400px, calc(100% - 32px));
  max-height: 50svh;
  overflow: auto;
  padding: 16px;
  color: #eee;
  background: #232323;
  border: 1px solid #ff9100;
  font: 12px var(--font-mono);
}
.studio-motion-detail > button {
  float: right;
  cursor: pointer;
}
.studio-motion-detail pre {
  margin-top: 16px;
  white-space: pre-wrap;
}
/* Editor uses the captured public preview, including search and resizing. */
.repo-tree-row {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 4px 10px;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  color: #bcbcbc;
  font: 12px/1.5 var(--font-mono);
  letter-spacing: 0;
  cursor: pointer;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.repo-tree-row:hover {
  color: #fff;
  background: #ffffff0d;
}
.repo-file-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.repo-sidebar nav ul {
  width: 100%;
  min-width: 0;
}
.repo-workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.repo-file-icon {
  display: inline-block;
  flex: none;
  width: 14px;
  margin-right: 4px;
  color: #888;
}
.repo-file-active {
  color: #fff;
  background: #ffffff14;
}
.repo-folder-children {
  animation: repo-folder-in 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes repo-folder-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.repo-edition-active {
  background: #fff;
  color: #232323 !important;
  border-radius: 4px;
}
.repo-file-tab {
  display: flex;
  flex: none;
  gap: 16px;
  padding: 8px 12px;
  background: #292929;
  border-right: 1px solid #ffffff14;
  font: 12px var(--font-mono);
}
.repo-file-tab[data-active='true'] {
  background: #353535;
  color: #fff;
}
.repo-file-tab button {
  cursor: pointer;
}
.repo-mini-line {
  height: 1px;
  display: flex;
}
.repo-mini-line i {
  display: block;
  height: 1px;
  background: #8a8a8a;
  opacity: 0.55;
}
.repo-mini-window {
  position: absolute;
  inset-inline: 0;
  background: #ffffff18;
  border: 1px solid #ffffff28;
  pointer-events: none;
}
.repo-terminal-line {
  padding: 2px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.repo-prompt {
  color: #888;
  margin-top: 8px;
}
.repo-success {
  color: #a8cf9a;
}
.repo-error {
  color: #e8a39b;
}
.repo-search-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18svh 16px 24px;
  background: #0009;
  animation: repo-folder-in 0.2s;
}
.repo-search-box {
  width: min(640px, 100%);
  max-height: 65svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #fff3;
  border-radius: 6px;
  color: #ddd;
  background: #232323;
  box-shadow: 0 24px 80px #0006;
  font: 12px/1.5 var(--font-mono);
}
.repo-search-box > div {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid #fff2;
}
.repo-search-box input {
  flex: 1;
  min-width: 0;
  outline: none;
  color: #fff;
  background: transparent;
  font: inherit;
}
.repo-search-box button {
  cursor: pointer;
}
.repo-search-box > ul {
  margin: 6px;
  overflow-y: auto;
}
.repo-search-box li button {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px;
  text-align: left;
  border-radius: 3px;
}
.repo-search-box strong {
  font-weight: 400;
  flex: none;
}
.repo-search-box li span {
  color: #888;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.repo-search-box [data-selected='true'] button {
  color: #fff;
  background: #fff2;
}
.repo-search-box footer {
  padding: 8px 14px;
  border-top: 1px solid #fff2;
  color: #888;
}
/* Fullscreen reel and README drawer. */
dialog.reel-motion-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  color: #fff;
  background: #000;
}
.reel-motion-dialog::backdrop,
.clone-story::backdrop {
  background: transparent;
}
.reel-motion-stage {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(0.98);
  transition:
    transform 0.4s,
    opacity 0.4s;
}
.reel-motion-stage.is-playing {
  opacity: 1;
  transform: scale(1);
}
.reel-motion-stage mux-player,
.reel-motion-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  --controls: none;
  --loading-indicator: none;
  --dialog: none;
  --media-object-fit: contain;
  --media-object-position: center;
}
.reel-motion-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  font: 12px var(--font-mono);
  pointer-events: none;
}
.reel-motion-loading[hidden] {
  display: none;
}
.reel-motion-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 3;
  color: #222;
  cursor: pointer;
  font: 12px/1.2 var(--font-mono);
}
.reel-motion-close span {
  background: #eee;
  padding: 4px;
  border-radius: 3px;
}
.reel-motion-close span:first-child {
  font-size: 30px;
  line-height: 1;
  padding: 4px 10px;
}
.reel-motion-close:hover {
  filter: brightness(0.8);
}
.reel-motion-preview {
  position: fixed;
  left: 0;
  top: 0;
  width: 160px;
  height: 90px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.reel-motion-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.9);
  transition: transform 0.25s;
}
.reel-motion-preview.is-visible {
  opacity: 1;
}
.reel-motion-preview.is-visible img {
  transform: scale(1);
}
dialog.clone-story {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
.clone-story-nav button {
  transition:
    color 0.2s,
    padding-left 0.2s;
}
.clone-story-nav button.is-current {
  color: #000;
  padding-left: 7px;
}
.clone-story-nav button:not(.is-current) {
  color: #777;
}
@media (min-width: 1024px) {
  #the-repo [data-minimap-pin] {
    will-change: transform;
  }
}
@media (max-width: 1023px) {
  .repo-files-open {
    visibility: visible !important;
    transform: translateX(0) !important;
  }
  .repo-files-backdrop {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}
@media (max-width: 767px) {
  .site-minimap {
    top: 8px;
    right: 8px;
    width: 78px;
    height: 44px;
  }
  .studio-motion-status {
    max-width: calc(100% - 16px);
    width: max-content;
    font-size: 9px;
    gap: 10px;
  }
  .reel-motion-close {
    top: 8px;
    right: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .motion-glyph,
  .motion-content {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .nav-motion-link,
  .minimap-scan,
  .minimap-scan-counter,
  .announcement-motion > span {
    animation: none;
  }
  .reel-motion-stage,
  .reel-motion-preview,
  .reel-motion-preview img {
    transition: none;
  }
}

/* Keep dynamic sticky measurements from moving the native scroll anchor. */
html {
  overflow-anchor: none;
}
.repo-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}
.repo-breadcrumb {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.repo-code-input,
.repo-code-highlight {
  tab-size: 2;
  font: 13px/1.65 var(--font-mono);
  letter-spacing: 0;
}
.repo-gutter,
.repo-gutter pre {
  font: 13px/1.65 var(--font-mono);
  letter-spacing: 0;
}
.repo-terminal-pane {
  font: 12px/1.6 var(--font-mono);
}
.repo-terminal-pane input {
  font: 13px/1.6 var(--font-mono);
}
@media (max-width: 1023px) {
  .repo-motion {
    --repo-distance: 24svh !important;
  }
  .repo-sidebar {
    position: absolute !important;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(300px, calc(100% - 40px)) !important;
    max-width: none;
    visibility: hidden;
    pointer-events: none;
  }
  .repo-sidebar.repo-files-open {
    visibility: visible;
    pointer-events: auto;
  }
  .repo-tree-row {
    min-height: 32px;
    font-size: 12px;
  }
  .repo-code-input,
  .repo-code-highlight {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    padding-left: 44px;
    padding-right: 12px;
    font-size: 13px;
    line-height: 1.65;
  }
  .repo-code-input {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }
  .repo-code-highlight > span::before {
    padding-right: 12px;
  }
  .repo-gutter {
    display: none;
  }
  .repo-motion [aria-label='Scroll via minimap'] {
    display: none;
  }
  .repo-motion [aria-label='Scroll via minimap']:only-child {
    display: none;
  }
  .repo-terminal-pane {
    max-height: 45%;
  }
  .repo-terminal-pane input {
    font-size: 16px;
  }
  .repo-files-open {
    translate: 0 0 !important;
  }
  .repo-file-tab {
    min-height: 44px;
    gap: 20px;
    padding: 8px 12px;
  }
  .repo-file-tab > button:last-child {
    min-width: 28px;
  }
  .repo-search-overlay {
    padding-top: max(12px, env(safe-area-inset-top));
    align-items: flex-start;
  }
  .repo-search-box {
    max-height: calc(100dvh - 24px);
  }
  .repo-search-box input {
    font-size: 16px;
  }
  .repo-search-box li button {
    min-height: 44px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .repo-search-box li span {
    flex-basis: 100%;
  }
  .repo-search-box footer {
    font-size: 10px;
  }
  .clone-story-panel {
    overscroll-behavior: contain;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .clone-story-nav button {
    min-height: 28px;
  }
  .reel-motion-preview,
  .showcase-credits {
    display: none;
  }
  .clone-menu a {
    min-height: 30px;
  }
  .clone-menu {
    transform-origin: top;
    animation: mobile-menu-in 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  }
  .site-minimap {
    display: none;
  }
}
@media (max-width: 480px) {
  .repo-motion [aria-label='Open the contracts workspace'],
  .repo-motion [aria-label='Open the applications workspace'] {
    padding-inline: 7px;
    font-size: 10px;
  }
  .clone-story-nav {
    display: flex;
    gap: 8px;
    padding: 8px;
  }
  .clone-story-nav button {
    flex: 1;
    font-size: 10px;
  }
  .clone-story-panel {
    top: max(60px, calc(env(safe-area-inset-top) + 52px));
  }
  .clone-story-head {
    min-height: 112px;
  }
  .clone-story-panel section {
    padding: 32px 0 40px;
  }
  .clone-story-panel section p {
    font-size: 15px;
    line-height: 1.5;
  }
  .reel-motion-close {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
  }
}
@keyframes mobile-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .clone-menu {
    animation: none;
  }
}

dialog.repo-search-overlay {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  color: inherit;
  overscroll-behavior: contain;
}
dialog.repo-search-overlay::backdrop {
  background: transparent;
}

@media (max-width: 1023px) {
  header nav .clone-menu-open {
    height: 312px;
  }
  header nav .clone-menu a {
    min-height: 40px;
    padding: 10px 8px;
  }
  .clone-menu a:active {
    color: #fff;
    background: #454545;
  }
}

/* A compact native-scrolling editor on phones leaves page space around it. */
@media (max-width: 1023px) {
  #the-repo {
    padding-block: 48px;
  }
  #the-repo > div {
    height: auto !important;
    padding-inline: 16px;
  }
  #the-repo [data-minimap-pin] {
    position: relative !important;
    top: auto !important;
    height: min(680px, 76svh) !important;
    margin-inline: 0 !important;
    transform: none !important;
  }
  .repo-code-input {
    overscroll-behavior-y: auto !important;
    touch-action: pan-y;
  }
  .repo-code-highlight > span::before {
    display: none !important;
  }
  .repo-code-input,
  .repo-code-highlight {
    padding-left: 16px;
  }
}

.repo-scrollable {
  overscroll-behavior: auto;
}
