/* Scene Studio: a standalone, cinema-style page. The prompt sits at the top,
   then the scene's title and tabs: the scene animated in every style, the
   visitor's previous scenes, and their favorites. A dialog shows one style
   large. */

html:has(.ss),
html:has(.ss) body {
  background: #07080b;
}

.ss {
  --ss-bg: #07080b;
  --ss-panel: #111318;
  --ss-line: rgba(255, 255, 255, 0.1);
  --ss-ink: #ece8e1;
  --ss-muted: rgba(236, 232, 225, 0.6);
  --ss-faint: rgba(236, 232, 225, 0.42);
  --ss-glass: rgba(18, 20, 26, 0.55);
  --ss-serif: "Instrument Serif", Georgia, serif;
  --ss-sans: Inter, system-ui, sans-serif;
  --ss-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  background: var(--ss-bg);
  color: var(--ss-ink);
  font-family: var(--ss-sans);
  -webkit-font-smoothing: antialiased;
}

.ss a {
  color: inherit;
  text-decoration-color: rgba(236, 232, 225, 0.35);
  text-underline-offset: 3px;
}

.ss a:hover {
  text-decoration-color: currentColor;
}

.ss-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Page frame ---------- */

.ss-nav,
.ss-compose,
.ss-scene,
.ss-tabs,
.ss-about {
  width: min(1200px, calc(100% - 80px));
  margin-left: auto;
  margin-right: auto;
}

.ss-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 20px;
  font-size: 13px;
}

.ss-wordmark {
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none !important;
}

.ss-labs {
  color: var(--ss-muted) !important;
  text-decoration: none !important;
}

.ss-labs:hover {
  color: var(--ss-ink) !important;
}

/* ---------- Prompt ---------- */

.ss-compose {
  margin-bottom: 20px;
}

.ss-bar {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: var(--ss-panel);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ss-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.ss-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: #fff;
  font: 400 17px var(--ss-sans);
}

.ss-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.ss-input:focus {
  outline: none;
}

.ss-generate {
  border: 0;
  border-radius: 12px;
  padding: 0 26px;
  background: #fff;
  color: #07080b;
  font: 600 15px var(--ss-sans);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
}

.ss-generate:hover {
  background: #f1ece4;
}

.ss-generate:active {
  transform: translateY(1px);
}

.ss-generate:disabled {
  cursor: progress;
  opacity: 0.75;
}

.ss-generate:focus-visible,
.ss-pill:focus-visible,
.ss-thumb-open:focus-visible,
.ss-style-open:focus-visible,
.ss-icon:focus-visible,
.ss-more:focus-visible,
.ss-tablist [role="tab"]:focus-visible,
.ss-data summary:focus-visible,
.ss-wordmark:focus-visible,
.ss-labs:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ss-error {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(120, 28, 20, 0.7);
  color: #ffe1d9;
  font-size: 14px;
}

.ss-error[hidden] {
  display: none;
}

/* The shape new paintings are composed for. */
.ss-aspects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 4px 0;
}

.ss-aspects-label {
  margin-right: 4px;
  font-family: var(--ss-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ss-faint);
}

.ss-aspect {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--ss-muted);
  font: 500 13px var(--ss-sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ss-aspect:hover {
  color: var(--ss-ink);
  background: rgba(255, 255, 255, 0.06);
}

.ss-aspect[aria-checked="true"] {
  color: var(--ss-ink);
  border-color: rgba(255, 210, 122, 0.6);
  background: rgba(255, 210, 122, 0.1);
}

.ss-aspect svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.ss-aspect[aria-checked="true"] svg {
  stroke: #ffd27a;
}

.ss-aspect:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Example scenes to try, as a line of links under the shape chooser. */
.ss-ideas {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 12px 4px 0;
}

.ss-ideas .ss-aspects-label {
  margin-right: 0;
}

.ss-ideas-list {
  display: contents;
}

.ss-idea {
  padding: 2px 0;
  border: 0;
  background: none;
  font: 400 13px var(--ss-sans);
  cursor: pointer;
}

.ss-idea {
  color: var(--ss-muted);
  text-decoration: underline;
  text-decoration-color: rgba(236, 232, 225, 0.25);
  text-underline-offset: 3px;
}

.ss-idea:hover {
  color: var(--ss-ink);
  text-decoration-color: currentColor;
}

.ss-idea[aria-current] {
  color: #ffd27a;
  text-decoration-color: rgba(255, 210, 122, 0.6);
}

/* The shuffle button keeps one place at the start of the line. */
.ss-ideas-more {
  display: inline-grid;
  place-items: center;
  align-self: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-left: -6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: transparent;
  color: var(--ss-faint);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, transform 0.2s;
}

.ss-ideas-more:hover {
  color: var(--ss-ink);
  border-color: rgba(255, 255, 255, 0.35);
}

.ss-ideas-more:active {
  transform: rotate(180deg);
}

.ss-ideas-more svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ss-idea:focus-visible,
.ss-ideas-more:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 3px;
}

.ss-account-note {
  margin: 10px 4px 0;
  font-size: 13px;
  color: var(--ss-muted);
}

.ss-account-note[hidden] {
  display: none;
}

/* ---------- The scene ---------- */

.ss-scene {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 24px;
  margin-top: 36px;
}

.ss-meta {
  min-width: 0;
  flex: 1 1 420px;
}

.ss-kicker {
  margin: 0 0 8px;
  font-family: var(--ss-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffd27a;
}

.ss-kicker:empty {
  display: none;
}

.ss-meta h1 {
  font-family: var(--ss-serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  text-wrap: balance;
}

.ss-prompt-label {
  margin: 0;
  font-size: 15px;
  color: var(--ss-muted);
}

.ss-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ss-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px var(--ss-sans);
  color: var(--ss-ink);
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ss-pill[hidden] {
  display: none;
}

.ss-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.ss-pill svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.ss-heart-pill[aria-pressed="true"] {
  color: #ff7a8a;
  border-color: rgba(255, 122, 138, 0.5);
  background: rgba(255, 122, 138, 0.12);
}

.ss-heart-pill[aria-pressed="true"] svg {
  fill: currentColor;
}

/* Generation progress, under the title while a painting is being written. */
.ss-progress {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--ss-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ss-progress[hidden] {
  display: none;
}

.ss-progress p {
  margin: 0;
  flex: 1;
  font-family: var(--ss-serif);
  font-size: 24px;
}

.ss-elapsed {
  font-family: var(--ss-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ss-muted);
  font-variant-numeric: tabular-nums;
}

.ss-brush {
  display: flex;
  gap: 6px;
}

.ss-brush i {
  width: 8px;
  height: 26px;
  border-radius: 4px;
  animation: ss-stroke 1.1s ease-in-out infinite;
}

.ss-brush i:nth-child(1) { background: #ffd27a; }
.ss-brush i:nth-child(2) { background: #ff7a59; animation-delay: 0.15s; }
.ss-brush i:nth-child(3) { background: #8fc2ff; animation-delay: 0.3s; }

@keyframes ss-stroke {
  0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
  50% { transform: scaleY(1); opacity: 1; }
}

.ss-gallery {
  transition: opacity 0.4s, filter 0.4s;
}

.ss-gallery.ss-busy {
  opacity: 0.35;
  filter: saturate(0.4);
  pointer-events: none;
}

/* ---------- Tabs ---------- */

.ss-tabs {
  margin-top: 28px;
}

.ss-tablist {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ss-line);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ss-tablist [role="tab"] {
  position: relative;
  padding: 12px 16px 14px;
  border: 0;
  background: none;
  color: var(--ss-muted);
  font: 500 15px var(--ss-sans);
  white-space: nowrap;
  cursor: pointer;
}

.ss-tablist [role="tab"]:hover {
  color: var(--ss-ink);
}

.ss-tablist [role="tab"][aria-selected="true"] {
  color: var(--ss-ink);
}

.ss-tablist [role="tab"][aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #ffd27a;
}

.ss-tablist [role="tab"] span {
  margin-left: 4px;
  font-family: var(--ss-mono);
  font-size: 12px;
  color: var(--ss-faint);
}

.ss-tablist [role="tab"] span:empty {
  display: none;
}

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

.ss-panel-intro {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ss-muted);
}

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

.ss-legend-icon {
  color: var(--ss-ink);
}

/* ---------- Scene cards (previous scenes, favorites) ---------- */

.ss-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.ss-thumb {
  position: relative;
}

.ss-thumb[hidden] {
  display: none;
}

.ss-thumb-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ss-ink);
  cursor: pointer;
  border-radius: 12px;
}

.ss-thumb-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ss-panel);
}

.ss-thumb-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ss-thumb strong {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.ss-thumb-meta {
  font-family: var(--ss-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ss-faint);
}

.ss-thumb.is-broken .ss-thumb-frame {
  background: repeating-linear-gradient(135deg, #14161c 0 10px, #181a21 10px 20px);
}

.ss-thumb-heart {
  position: absolute;
  top: 10px;
  right: 10px;
}

.ss-more {
  display: block;
  margin: 28px auto 0;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--ss-ink);
  font: 500 14px var(--ss-sans);
  cursor: pointer;
}

.ss-more:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ss-more[hidden] {
  display: none;
}

/* ---------- Style gallery ---------- */

.ss-gallery-section {
  font-family: var(--ss-serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  margin: 56px 0 20px;
}

.ss-gallery-section:first-child {
  margin-top: 0;
}

/* Tiles take the shape the scene was painted for: two columns of
   landscape, three of square, four of portrait on wide screens. */
.ss-gallery {
  --ss-ratio: 16 / 9;
}

.ss-gallery[data-aspect="square"] {
  --ss-ratio: 1;
}

.ss-gallery[data-aspect="portrait"] {
  --ss-ratio: 9 / 16;
}

.ss-gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.ss-gallery:is([data-aspect="square"], [data-aspect="portrait"]) .ss-gallery-grid {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (min-width: 760px) {
  .ss-gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ss-gallery[data-aspect="square"] .ss-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .ss-gallery[data-aspect="portrait"] .ss-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

.ss-style-tile {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ss-panel);
}

.ss-style-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ss-ink);
  cursor: zoom-in;
}

.ss-style-open:focus-visible {
  outline-offset: -4px;
  border-radius: 16px;
}

/* The still (an image) sits under the live canvas, which is only sized, and
   so only visible, while the tile is on screen. */
.ss-style-frame {
  position: relative;
  display: block;
  aspect-ratio: var(--ss-ratio, 16 / 9);
  background: linear-gradient(110deg, #14161c 30%, #1d2028 50%, #14161c 70%) 0 0 / 300% 100%;
  animation: ss-shimmer 1.6s linear infinite;
}

.ss-style-frame:has(img[src]) {
  animation: none;
}

.ss-style-frame img,
.ss-style-frame canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ss-style-frame img:not([src]) {
  visibility: hidden;
}

@keyframes ss-shimmer {
  to { background-position: -300% 0; }
}

/* Below the picture, never over it: the names on the left, the GIF
   download on the right. */
.ss-style-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 16px 18px;
}

.ss-style-caption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.ss-style-footer .ss-icon {
  flex-shrink: 0;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
  backdrop-filter: none;
}

.ss-style-footer .ss-icon:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ss-style-footer .ss-icon[aria-pressed="true"] {
  border-color: rgba(255, 122, 138, 0.6);
}

/* While the GIF is made, a ring fills around the icon. */
.ss-icon-download {
  position: relative;
}

.ss-icon-download .ss-ring {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  transform: rotate(-90deg);
  display: none;
}

.ss-icon-download[aria-busy="true"] {
  cursor: progress;
  border-color: transparent;
}

.ss-icon-download[aria-busy="true"] .ss-ring {
  display: block;
}

.ss-ring circle {
  fill: none;
  stroke-width: 2.5;
}

.ss-ring-track {
  stroke: rgba(255, 255, 255, 0.14);
}

.ss-ring-fill {
  stroke: #ffd27a;
  stroke-linecap: round;
  stroke-dasharray: calc(var(--progress, 0) * 100) 100;
}

.ss-icon-download[aria-busy="true"] svg:not(.ss-ring) {
  animation: ss-nudge 1s ease-in-out infinite;
}

@keyframes ss-nudge {
  50% { transform: translateY(2px); }
}

.ss-gif-pill[aria-busy="true"] {
  cursor: progress;
  background: linear-gradient(90deg, rgba(255, 210, 122, 0.28) calc(var(--progress, 0) * 100%), rgba(255, 255, 255, 0.06) 0);
}

.ss-style-caption small {
  font-family: var(--ss-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ss-faint);
}

.ss-style-caption strong {
  font-size: 18px;
  font-weight: 600;
}

.ss-style-description {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ss-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ss-style-description.is-expandable {
  cursor: pointer;
}

.ss-style-description.is-expandable:hover {
  color: var(--ss-ink);
}

.ss-style-description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.ss-style-description:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

.ss-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 11, 15, 0.55);
  backdrop-filter: blur(10px);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}

.ss-icon[hidden] {
  display: none;
}

.ss-icon:hover {
  background: rgba(10, 11, 15, 0.8);
}

.ss-icon:active {
  transform: scale(0.92);
}

.ss-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.ss-icon[aria-pressed="true"] {
  color: #ff7a8a;
  border-color: rgba(255, 122, 138, 0.6);
}

.ss-icon[aria-pressed="true"] svg {
  fill: currentColor;
}

/* ---------- Viewer ---------- */

/* The viewer takes the scene's shape (--ss-ratio as width / height) and
   fits it on screen with room for the bar below. */
.ss-viewer {
  --ss-ratio: 1.7778;
  width: min(1600px, calc(100vw - 48px), calc((100vh - 140px) * var(--ss-ratio)));
  width: min(1600px, calc(100vw - 48px), calc((100dvh - 140px) * var(--ss-ratio)));
  max-width: none;
  max-height: none;
  height: fit-content;
  /* Tailwind's preflight zeroes every margin, which drops a dialog's own
     centering; put it back. */
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ss-ink);
  font-family: var(--ss-sans);
  overflow: visible;
}

.ss-viewer::backdrop {
  background: rgba(4, 5, 7, 0.88);
  backdrop-filter: blur(6px);
}

.ss-viewer[data-aspect="square"] {
  --ss-ratio: 1;
}

.ss-viewer[data-aspect="portrait"] {
  --ss-ratio: 0.5625;
}

/* A tall picture keeps its title and buttons beside it, not under it, so it
   can use the screen's full height. */
@media (min-width: 760px) {
  .ss-viewer[data-aspect="portrait"][open] {
    display: grid;
    grid-template-columns: 1fr 230px;
    align-items: end;
    gap: 24px;
    width: min(calc(100vw - 48px), calc((100vh - 48px) * var(--ss-ratio) + 254px));
    width: min(calc(100vw - 48px), calc((100dvh - 48px) * var(--ss-ratio) + 254px));
  }

  .ss-viewer[data-aspect="portrait"] .ss-viewer-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 0 4px;
  }

  .ss-viewer[data-aspect="portrait"] .ss-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .ss-viewer[data-aspect="portrait"] .ss-pill {
    justify-content: center;
  }
}

.ss-viewer-frame {
  position: relative;
  aspect-ratio: var(--ss-ratio);
  border-radius: 16px;
  overflow: hidden;
  background: #0b0c10;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95);
}

.ss-viewer-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ss-viewer-step {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 11, 15, 0.55);
  backdrop-filter: blur(10px);
  color: #fff;
  font: 400 28px/1 var(--ss-sans);
  cursor: pointer;
}

.ss-viewer-step:hover {
  background: rgba(10, 11, 15, 0.85);
}

.ss-viewer-prev {
  left: 14px;
}

.ss-viewer-next {
  right: 14px;
}

.ss-viewer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding-top: 16px;
}

.ss-viewer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ss-viewer-meta strong {
  font-family: var(--ss-serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
}

.ss-viewer-meta span {
  font-size: 14px;
  color: var(--ss-muted);
}

.ss-viewer-step:focus-visible,
.ss-viewer .ss-pill:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- About ---------- */

.ss-about {
  margin-top: 96px;
  padding-bottom: 80px;
}

.ss-about h2 {
  font-family: var(--ss-serif);
  font-weight: 400;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.05;
  margin: 0 0 20px;
}

.ss-about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1080px;
}

.ss-about-columns p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(236, 232, 225, 0.78);
}

.ss-data[hidden] {
  display: none;
}

.ss-data {
  margin-top: 36px;
  border: 1px solid var(--ss-line);
  border-radius: 14px;
  background: var(--ss-panel);
}

.ss-data summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 500;
  font-size: 15px;
}

.ss-data summary span {
  color: var(--ss-muted);
  font-weight: 400;
}

.ss-data p {
  margin: 0 18px 12px;
  font-size: 14px;
  color: var(--ss-muted);
}

.ss-data pre {
  margin: 0 18px 18px;
  max-height: 460px;
  overflow: auto;
  padding: 16px;
  border-radius: 10px;
  background: #0a0b0e;
  border: 1px solid var(--ss-line);
  color: #d7d2c8;
  font: 12px/1.55 var(--ss-mono);
}

.ss-fine {
  margin: 28px 0 0;
  font-size: 13px;
  color: var(--ss-faint);
}

@media (prefers-reduced-motion: reduce) {
  .ss-icon-download[aria-busy="true"] svg:not(.ss-ring),
  .ss-brush i,
  .ss-style-frame {
    animation: none;
  }
}

/* ---------- Phones ---------- */

@media (max-width: 900px) {
  .ss-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 720px) {
  .ss-nav,
  .ss-compose,
  .ss-scene,
  .ss-tabs,
  .ss-about {
    width: calc(100% - 32px);
    min-width: 0;
  }

  .ss-nav {
    padding: 18px 0 14px;
  }

  .ss-bar {
    flex-direction: column;
    border-radius: 16px;
  }

  .ss-generate {
    padding: 13px 0;
  }

  /* Three ideas on a phone, so they don't push the painting down. */
  .ss-idea:nth-child(n + 4) {
    display: none;
  }

  .ss-scene {
    margin-top: 24px;
  }

  .ss-meta {
    flex-basis: 100%;
  }

  .ss-meta h1 {
    font-size: 32px;
  }

  .ss-progress p {
    font-size: 19px;
  }

  .ss-gallery-section {
    font-size: 24px;
  }

  .ss-tablist [role="tab"] {
    padding: 12px 10px 14px;
    font-size: 14px;
  }

  .ss-viewer {
    width: min(calc(100vw - 16px), calc((100vh - 170px) * var(--ss-ratio)));
    width: min(calc(100vw - 16px), calc((100dvh - 170px) * var(--ss-ratio)));
  }

  .ss-viewer-frame {
    border-radius: 10px;
  }

  .ss-viewer-step {
    width: 36px;
    height: 36px;
    margin-top: -18px;
    font-size: 22px;
  }

  .ss-viewer-meta strong {
    font-size: 22px;
  }

  .ss-about {
    margin-top: 64px;
    padding-bottom: 64px;
  }

  .ss-about-columns {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 460px) {
  .ss-grid {
    grid-template-columns: 1fr;
  }
}
