:root {
  --disc: min(63svh, 70vw, 560px);
  background: #050507;
}
body { display: grid; grid-template-rows: 1fr auto; min-height: 100svh; }
main { display: grid; place-items: center; padding: 38px 0 15px; overflow: clip; }
.composition { width: 100%; text-align: center; }
h1.wordmark {
  position: static; transform: none; display: block; width: fit-content; margin: 0 auto 5px;
  font-size: clamp(40px, 6.7svh, 72px); font-weight: 800; line-height: 1.18;
  letter-spacing: -.071em; padding: 0 .075em .07em 0; color: #e6e5ec;
  background: linear-gradient(168deg, #f8f6fa 16%, #dfdce4 53%, #aaa8b5 95%);
  background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.world { position: relative; display: grid; place-items: center; min-height: var(--disc); }
.space { position: absolute; width: var(--disc); aspect-ratio: 1; pointer-events: none; isolation: isolate; }
.sphere { position: absolute; inset: 0; }
.still, .surface { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.controls {
  --control-height: 56px;
  --control-radius: 12px;
  --action-size: 48px;
  --clear-size: 44px;
  --action-inset: calc((var(--control-height) - var(--action-size)) / 2);
  position: relative; width: min(640px, calc(var(--disc) * 1.24), calc(100% - 48px)); z-index: 1;
}
.source {
  position: relative; display: grid; place-items: center;
  font-size: clamp(17px, 2.5svh, 23px); font-weight: 680; letter-spacing: -.045em;
  color: #b6b2c2; margin: 0 0 clamp(16px, 3.2svh, 32px); line-height: 1.25; min-height: 1.25em;
}
.service-word { grid-area: 1 / 1; visibility: hidden; white-space: nowrap; }
.service-word.visible { visibility: visible; }
.service-word span { display: inline-block; }
.input-shell, #key-area { width: 100%; }
.input-shell input, #api-key {
  height: var(--control-height); border-radius: var(--control-radius); padding-left: 20px;
  border-color: rgb(224 217 231 / 21%); background: rgb(17 15 23 / 74%);
}
.input-shell input { display: block; padding-right: calc(var(--action-size) + 22px); }
[data-link-ready] .input-shell input { padding-right: calc(var(--action-inset) + var(--action-size) + var(--clear-size) + 6px); }
.input-shell input:not(:focus) { text-overflow: ellipsis; }
.input-shell input::placeholder { color: #c3bdc9; }
.input-shell input:hover { border-color: rgb(224 217 231 / 30%); }
.input-shell input:focus { border-color: rgb(222 206 226 / 55%); box-shadow: none; }
.field-action {
  position: absolute; top: 50%; right: var(--action-inset);
  width: var(--action-size); height: var(--action-size); transform: translateY(-50%);
  isolation: isolate; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px;
  color: #e2dce7; background: transparent; cursor: pointer; touch-action: manipulation;
  --tile-color: rgb(54 47 60 / 80%);
}
.field-action::before {
  content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: 8px; background: var(--tile-color);
}
.field-download { --tile-color: rgb(70 54 74 / 84%); color: #f0eaf3; }
.field-action svg { display: block; width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .field-action:hover:enabled { --tile-color: rgb(80 65 84 / 88%); }
}
.field-action:active:enabled { --tile-color: rgb(95 78 100 / 90%); }
.field-action:focus-visible { outline: 2px solid #d5c7d9; outline-offset: -2px; }
.field-action:disabled { cursor: wait; }
[data-link-ready] #paste-button {
  right: calc(var(--action-inset) + var(--action-size) + 2px);
  width: var(--clear-size); height: var(--clear-size); color: #c4bdcb;
}
[data-link-ready] #paste-button::before { content: none; }
[data-link-ready] #paste-button:is(:hover, :focus-visible, :active) { color: #f0eaf3; }
[data-link-ready] #clear-icon { width: 20px; height: 20px; }
.activity-ring { display: none; width: 19px; height: 19px; border: 2px solid #aa91aa66; border-top-color: #f1e0f3; border-radius: 50%; }
.is-busy .tray-icon { display: none; }
.is-busy .activity-ring { display: block; animation: clip-spin .9s linear infinite; }
@keyframes clip-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .is-busy .activity-ring { animation: none; } }
.controls .status {
  width: max-content; max-width: 100%; top: 100%; left: 50%; transform: translateX(-50%);
  margin: 10px 0 0; padding: 4px 10px; background: #100e18ed; border-radius: 8px; line-height: 1.4;
}
form[aria-busy="true"] #reel-url { color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; }
form[aria-busy="true"] + .status[data-state="busy"] {
  display: grid; align-content: center; pointer-events: none; text-align: left;
  top: 0; left: 0; width: calc(100% - var(--action-size) - 16px); min-height: var(--control-height);
  margin: 0; padding: 2px 6px 2px 20px; transform: none; background: transparent; color: #e7dfe9;
}
.credit { text-align: center; padding: 12px 24px max(20px, env(safe-area-inset-bottom)); }
.byline { color: #99969f; font-size: 13px; letter-spacing: .005em; }
.credit p { margin: 7px auto 0; color: #686570; font-size: 10px; line-height: 1.5; max-width: 620px; }
@media (max-width: 600px) {
  :root { --disc: min(85vw, 55svh, 420px); }
  main { padding: 18px 0; }
  h1.wordmark { font-size: clamp(38px, 9.5vw, 54px); }
  .controls { --control-height: 64px; width: min(calc(100% - 36px), 445px); }
  .source { margin-bottom: clamp(22px, 4.2svh, 42px); }
  .credit p { max-width: 345px; }
}
@media (max-height: 540px) {
  main { padding: 18px 0; }
  .world { min-height: max(245px, var(--disc)); }
  h1.wordmark { font-size: 36px; }
  .credit { padding-top: 4px; }
}
