body:has(#stage-message:not([hidden])) {
  position: relative;
  isolation: isolate;
  min-block-size: 100svh;
  padding-block-end: clamp(2.5rem, 8svh, 5rem);
}

body:has(#stage-message:not([hidden]))::before {
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  block-size: clamp(8rem, 27svh, 16rem);
  background: url("/landing/hero-honey-oak.webp") center bottom / max(100%, 42rem) auto no-repeat;
  mask-image: linear-gradient(transparent, #000 72%);
  pointer-events: none;
  content: "";
}

.launch {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  background: radial-gradient(ellipse at 85% 0, #ffffff23, transparent 56%), var(--blue);
}

.launch-content { min-width: 0; }

.storage-note {
  max-inline-size: 54ch;
  color: #fff0c5;
  font-size: .875rem;
  line-height: 1.45;
}

.storage-note:not(:empty) {
  margin-block-start: 1rem;
  padding: .6rem .8rem;
  border-inline-start: 2px solid var(--gold);
  border-radius: .4rem;
  background: rgb(0 0 0 / .18);
}

.launch-stage {
  --startup-width: clamp(3.8rem, 20vw, 14.5rem);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--startup-width);
  gap: clamp(.6rem, 2.5vw, 2.1rem);
}

.launch-stage-copy { min-width: 0; }

#stage-message #status {
  max-width: 22ch;
  margin-block: 0 .42rem;
  font: 680 clamp(1.9rem, 4vw, 3.45rem)/1.02 var(--display);
  letter-spacing: -.05em;
}

#status-detail { min-height: 1.5em; max-width: 60ch; font-size: .94rem; }
.launch-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6rem;
  align-items: center;
  gap: .65rem;
  width: min(20rem, 100%);
  min-height: 1.75rem;
  margin-top: .65rem;
}
.launch-progress-track {
  position: relative;
  display: block;
  height: .48rem;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff36;
}
.launch-progress-track::before, .launch-progress-track::after {
  position: absolute;
  inset: 0;
  content: "";
}
.launch-progress-track::before {
  border-radius: inherit;
  background: var(--gold);
  transform: scaleX(var(--setup-fraction, 0));
  transform-origin: left;
}
.launch-progress progress[value] + .launch-progress-track::before {
  transition: transform .22s ease-out;
}
.launch-progress-track::after {
  background: linear-gradient(90deg, transparent 30%, #ffe5a7 50%, transparent 70%);
  will-change: transform;
  animation: waiting-track 1.4s linear infinite;
}
#progress-count {
  justify-self: start;
  padding: .29rem .55rem;
  border: 1px solid #ffffff40;
  border-radius: 999px;
  background: #14265e55;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.launch-actions:has(> :not([hidden])) { margin-top: .3rem; }
.launch[data-state="busy"] .launch-actions { margin-top: .75rem; }

.startup-scene {
  position: absolute;
  inset: 0 0 auto auto;
  display: grid;
  width: var(--startup-width);
  height: min(100%, 9rem);
  place-items: center;
  border: 1px solid #ffffff55;
  border-radius: .65rem;
  background: linear-gradient(145deg, #ffffff21, #ffffff06);
}

.loading-window {
  display: grid;
  grid-template-rows: 23% minmax(0, 1fr);
  width: min(77%, 16rem);
  aspect-ratio: 1.66;
  overflow: hidden;
  border: 1px solid var(--blue-edge);
  border-radius: .55rem;
  background: var(--card);
  box-shadow: .22rem .28rem 0 color-mix(in srgb, var(--blue) 55%, var(--deep));
  animation: loading-window-dock 420ms cubic-bezier(.2, .85, .3, 1) both;
}

.loading-window-toolbar {
  display: grid;
  align-items: center;
  padding-inline: 7%;
  background: var(--blue);
}

.loading-window-toolbar::before {
  width: clamp(.18rem, .4vw, .3rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: .44rem 0 0 var(--card), .88rem 0 0 var(--card);
  content: "";
}

.loading-window-body {
  background:
    linear-gradient(126deg, transparent 30%, #fffdf8c9 49%, transparent 70%) -95% center / 64% 100% no-repeat,
    linear-gradient(var(--light-blue), var(--light-blue)) 10% 33% / 38% 55% no-repeat,
    linear-gradient(var(--gold), var(--gold)) 83% 25% / 33% 8% no-repeat,
    repeating-linear-gradient(180deg, var(--blue-edge) 0 10%, transparent 10% 32%) 87% 66% / 43% 32% no-repeat,
    var(--card);
  animation: loading-window-paper 1.8s ease-in-out infinite;
}

.preview-surface { position: relative; isolation: isolate; }

.preview-loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(.9rem, 2vw, 1.35rem);
  overflow: hidden;
  padding: 1rem;
  background: radial-gradient(ellipse at 50% 38%, var(--card), transparent 75%), var(--light-blue);
  color: var(--ink);
  pointer-events: none;
  text-align: center;
}

.preview-loading .loading-window { width: min(13.5rem, 62vw); }
.preview-loading p { font: 660 clamp(1.25rem, 3.35vw, 1.7rem)/1.12 var(--display); }

@keyframes loading-window-dock {
  from { opacity: .72; transform: translateY(.55rem) rotate(-3deg) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes loading-window-paper {
  to { background-position: 195% center, 10% 33%, 83% 25%, 87% 66%; }
}

@keyframes waiting-track {
  from { transform: translate3d(-70%, 0, 0); }
  to { transform: translate3d(70%, 0, 0); }
}

.starter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.85rem, 2.1vw, 1.55rem);
  margin-top: clamp(1rem, 2.6vw, 1.7rem);
}

.starter-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: .92rem;
  background: var(--linen-pattern), var(--card);
  color: var(--ink);
  cursor: pointer;
  text-align: start;
  transition: transform 240ms cubic-bezier(.19, .85, .29, 1), border-color 180ms ease, box-shadow 180ms ease;
  animation: starter-card-in 620ms cubic-bezier(.2, .85, .26, 1) backwards;
}

.starter-card:disabled { opacity: 1; }
.starter-card:not(:disabled):is(:hover, :focus-visible) { border-color: var(--gold); transform: translateY(-3px); }
.starter-card:not(:disabled):active { transform: translateY(1px); }
.starter-scratch { animation-delay: 125ms; }

.starter-art {
  position: relative;
  isolation: isolate;
  display: grid;
  min-block-size: clamp(6.5rem, 10vw, 9.2rem);
  place-items: center;
  overflow: hidden;
}

.starter-bakery .starter-art { background: #9b684c; }

.starter-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  transition: transform 620ms cubic-bezier(.22, .78, .29, 1);
}

.starter-bakery:not(:disabled):is(:hover, :focus-visible) img { transform: scale(1.06); }

.starter-receipt {
  position: relative;
  width: clamp(4.15rem, 7vw, 6.25rem);
  aspect-ratio: 1.04;
  margin-inline-start: 51%;
  box-shadow: 0 .4rem 1.2rem #24160b6b;
  background: #fff3d7;
  transform: rotate(-11deg);
  animation: starter-receipt-in 800ms cubic-bezier(.19, .83, .25, 1) 115ms backwards;
}

.starter-receipt::before {
  position: absolute;
  inset: 12% 13% 16%;
  background:
    linear-gradient(#793835, #793835) top left / 56% 11% no-repeat,
    linear-gradient(#f5c375, #f5c375) center / 100% 27% no-repeat,
    repeating-linear-gradient(180deg, #956149 0 1px, transparent 1px 22%) left bottom / 100% 69% no-repeat;
  content: "";
}

.starter-scratch .starter-art {
  --notebook-rule: color-mix(in srgb, var(--blue) 8%, transparent);
  background:
    repeating-linear-gradient(90deg, var(--notebook-rule) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(0deg, var(--notebook-rule) 0 1px, transparent 1px 15px),
    var(--light-blue);
}

.starter-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(64%, 10.7rem);
  aspect-ratio: 1.61;
  gap: .16rem;
  border: .22rem solid var(--blue);
  border-radius: .24rem;
  background: var(--blue);
  box-shadow: 0 .35rem .8rem #25337245;
  transform: rotate(-8deg);
  animation: starter-book-in 860ms cubic-bezier(.18, .85, .28, 1) 195ms backwards;
  transition: transform 430ms cubic-bezier(.18, .85, .28, 1);
}

.starter-scratch:not(:disabled):is(:hover, :focus-visible) .starter-book { transform: rotate(-3deg) translateY(-3px); }

.starter-sheet {
  position: relative;
  border-radius: .23rem .1rem .1rem .23rem;
  background: #fff8e7;
  box-shadow: inset -.3rem 0 .35rem #6538151a;
}

.starter-sheet::after {
  position: absolute;
  inset: 20% 15%;
  background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--blue) 36%, transparent) 0 1px, transparent 1px 25%);
  content: "";
}

.starter-sheet:last-child { border-radius: .1rem .23rem .23rem .1rem; box-shadow: inset .3rem 0 .35rem #6538151a; }
.starter-sheet:last-child::after {
  background:
    linear-gradient(var(--blue), var(--blue)) center / 46% 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 2px 36% no-repeat;
  opacity: .65;
}

.starter-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  align-content: start;
  align-items: center;
  gap: .35rem .6rem;
  min-width: 0;
  padding: clamp(.8rem, 1.55vw, 1.25rem);
}

.starter-name { grid-area: 1 / 1; font: 680 clamp(1.4rem, 2.65vw, 2.25rem)/1.07 var(--display); letter-spacing: -.045em; }

.starter-description {
  grid-area: 2 / 1;
  align-self: start;
  max-width: 43ch;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.4;
}

.starter-copy .action-chevron {
  grid-area: 1 / 2 / span 2;
  --action-icon-size: 1.25rem;
  color: var(--blue);
}

.launch[data-state="busy"] .starter-options { display: none; }

@keyframes starter-card-in {
  from { transform: translateY(14px) scale(.985); }
  to { transform: translateY(0) scale(1); }
}

@keyframes starter-receipt-in {
  from { transform: translate(14px, -12px) rotate(9deg) scale(.92); }
  to { transform: translate(0) rotate(-11deg) scale(1); }
}

@keyframes starter-book-in {
  from { transform: rotate(7deg) translateY(13px) scaleX(.84); }
  to { transform: rotate(-8deg) translateY(0) scaleX(1); }
}

#starter-options { scroll-margin-top: 4.2rem; }

@media (max-width: 665px) {
  .launch-stage { --startup-width: clamp(3.55rem, 18vw, 6rem); }
  .startup-scene { height: min(100%, 4.7rem); }
  .startup-scene .loading-window { width: 83%; }
  .loading-window-toolbar::before { box-shadow: .3rem 0 0 var(--card), .6rem 0 0 var(--card); }
  .starter-options { grid-template-columns: minmax(0, 1fr); }

  .starter-card {
    grid-template-columns: minmax(4.25rem, 29%) minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .starter-art img { object-position: 44% 60%; }
  .starter-copy { gap: .33rem .4rem; }
  .starter-name { font-size: clamp(1.24rem, 4.4vw, 1.65rem); }
  .starter-description { font-size: .8rem; }
  .starter-receipt { width: 2.2rem; margin-inline-start: 11%; }
  .starter-book { width: min(80%, 5.5rem); }
}
