@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-Thin.ttf") format("truetype");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-ExtraLight.ttf") format("truetype");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono Local";
  src: url("assets/mono/RobotoMono-Proportional-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #000000;
  --surface: #050505;
  --surface-strong: #0d0d0d;
  --text: #ffffff;
  --muted: #b7b7b7;
  --line: #2a2a2a;
  --line-strong: #ffffff;
  --font-mono: "Roboto Mono Local", "SFMono-Regular", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
}

.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Homepage shell */
.homePage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.siteHeader {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--line);
}

.siteNav {
  width: min(1280px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark,
.navLinks a {
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.navLinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 2.2vw, 28px);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

.navLinks a {
  color: inherit;
  text-underline-offset: 4px;
  transition: color 160ms ease;
}

.navLinks a:hover,
.navLinks a[aria-current="page"] {
  color: var(--text);
}

.homeMain {
  min-height: 0;
  display: grid;
}

/* The hero canvas remains full-bleed; only the call to action sits above it. */
.hero {
  position: relative;
  min-height: 480px;
  overflow: hidden;
  background: var(--bg);
}

.heroCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.heroContent {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: clamp(40px, 8vh, 84px) 24px;
  flex-direction: column;
  pointer-events: none;
}

.heroCta,
button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.heroCta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: auto;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

button.primary {
  border-color: var(--line-strong);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
}

.heroCta:hover,
button:hover:not(:disabled) {
  background: var(--text);
  color: var(--bg);
}

.heroCta:hover {
  background: var(--bg);
  color: var(--text);
  transform: translateY(-1px);
}

button.primary:hover:not(:disabled) {
  background: var(--bg);
  color: var(--text);
}

.wordmark:focus-visible,
.navLinks a:focus-visible,
.heroCta:focus-visible,
.fullscreenSiteLink:focus-visible,
.siteFooter a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Footer mirrors the navbar rhythm and keeps project context understated. */
.siteFooter {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line);
}

.footerInner {
  width: min(1280px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.footerInner p {
  margin: 0;
}

.footerTitle {
  color: var(--text);
  font-weight: 700;
  text-transform: uppercase;
}

.footerMeta {
  justify-self: end;
}

.studio {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 16px;
}

.studioStandalone {
  padding-top: 28px;
}

/* Text pages: about/process copy is edited in the matching HTML sections. */
.contentPage {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(48px, 8vw, 116px) 0 clamp(72px, 10vw, 140px);
}

.textDocument {
  display: grid;
  gap: clamp(56px, 8vw, 104px);
}

.pageIntro {
  max-width: 980px;
  display: grid;
  gap: clamp(18px, 3vw, 30px);
}

.aboutIntro,
.processIntro,
.examplesIntro {
  position: relative;
  max-width: none;
  min-height: 560px;
  padding: 56px;
  align-content: end;
  overflow: hidden;
  isolation: isolate;
}

.aboutIntro::before,
.aboutIntro::after,
.processIntro::before,
.processIntro::after,
.examplesIntro::before,
.examplesIntro::after {
  position: absolute;
  inset: 0;
  content: "";
}

.aboutIntro::before {
  z-index: -2;
  background-image: url("assets/about-ascii-portrait.png");
  background-position: center;
  background-size: cover;
  opacity: 0.84;
}

.aboutIntro::after {
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.64) 48%,
      rgba(0, 0, 0, 0.16) 100%
    ),
    linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.14) 50%,
      rgba(0, 0, 0, 0.72) 100%
    );
}

.processIntro::before {
  z-index: -2;
  background-image: url("assets/process.gif");
  background-position: center;
  background-size: cover;
  opacity: 0.72;
}

.processIntro::after {
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.94) 0%,
      rgba(0, 0, 0, 0.76) 48%,
      rgba(0, 0, 0, 0.2) 100%
    ),
    linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.22) 52%,
      rgba(0, 0, 0, 0.84) 100%
    );
}

.examplesIntro::before {
  z-index: -2;
  background-image: url("assets/process-showcase.gif");
  background-position: center;
  background-size: cover;
  opacity: 0.72;
}

.examplesIntro::after {
  z-index: -1;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.94) 0%,
      rgba(0, 0, 0, 0.76) 48%,
      rgba(0, 0, 0, 0.2) 100%
    ),
    linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.9) 0%,
      rgba(0, 0, 0, 0.22) 52%,
      rgba(0, 0, 0, 0.84) 100%
    );
}

.aboutIntro .kicker,
.aboutIntro h1,
.aboutIntro .lede,
.processIntro .kicker,
.processIntro h1,
.processIntro .lede,
.examplesIntro .kicker,
.examplesIntro h1,
.examplesIntro .lede {
  position: relative;
  z-index: 1;
}

.aboutIntro .lede,
.processIntro .lede,
.examplesIntro .lede {
  max-width: 690px;
}

.pageIntroCompact {
  max-width: 840px;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.pageIntro h1 {
  margin: 0;
  color: var(--text);
  font-size: 8rem;
  font-weight: 700;
  line-height: 0.9;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.pageIntroCompact h1 {
  font-size: 7rem;
}

.lede {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.5;
}

.textSection {
  display: grid;
  grid-template-columns: minmax(360px, 0.42fr) minmax(0, 760px);
  gap: clamp(28px, 4vw, 56px);
  padding-top: clamp(28px, 5vw, 52px);
  border-top: 1px solid var(--line);
}

.textSection h2 {
  margin: 0;
  color: var(--text);
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.04;
  text-transform: uppercase;
}

.sectionBody {
  display: grid;
  gap: 18px;
}

.sectionBody p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.68;
}

.sectionBody a {
  color: var(--text);
  text-decoration-color: var(--muted);
  text-underline-offset: 4px;
}

.sectionBody a:hover {
  text-decoration-color: var(--text);
}

.stageList {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  list-style: none;
}

.stageList li {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.stageList li:first-child {
  padding-top: 0;
  border-top: 0;
}

.stageList strong {
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.5;
  text-transform: uppercase;
}

.stageList span {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.68;
}

.gallerySection {
  display: grid;
  gap: 24px;
  padding-top: clamp(28px, 5vw, 52px);
  border-top: 1px solid var(--line);
}

.examplesGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.galleryCard {
  margin: 0;
}

.galleryMedia {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.galleryMedia[role="button"] {
  cursor: pointer;
}

.galleryMedia[role="button"]:hover,
.galleryMedia[role="button"]:focus-visible {
  border-color: var(--line-strong);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 0 0 6px rgba(255, 255, 255, 0.12);
  outline: none;
}

.galleryMedia img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  object-fit: cover;
  object-position: center;
}

.galleryModal {
  width: min(1120px, calc(100% - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.58);
}

.galleryModal::backdrop {
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(4px);
}

.galleryModalInner {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.galleryModalHeader {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.galleryModalActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.galleryModalDownload,
.galleryModalClose {
  display: inline-flex;
  flex: 0 0 46px;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.galleryModalDownload:hover,
.galleryModalClose:hover {
  background: var(--text);
  color: var(--bg);
}

.galleryModalDownload svg,
.galleryModalClose svg {
  width: 20px;
  height: 20px;
}

.galleryModalStage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}

.galleryModalImage {
  display: block;
  width: 100%;
  max-height: min(72vh, 920px);
  margin: 0 auto;
  background: var(--bg);
  object-fit: contain;
}

body.modalOpen {
  overflow: hidden;
}

.sectionHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sectionHeader h1,
.sectionHeader h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.sectionHeader p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.toolbar,
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.presets span {
  color: var(--muted);
}

.uploadControl {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.uploadControl input {
  max-width: 230px;
  color: var(--text);
  font: inherit;
}

.uploadControl input::file-selector-button {
  min-height: 40px;
  margin-right: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.uploadControl input::file-selector-button:hover {
  background: var(--text);
  color: var(--bg);
}

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

.stage.imageMode .canvasWrap {
  height: clamp(320px, 56svh, 620px);
  min-height: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.stage.imageMode .canvasWrap:active {
  cursor: grabbing;
}

.layout {
  display: grid;
  gap: 16px;
}

.rendererLayout {
  grid-template-columns: 1fr;
}

.stageColumn {
  width: min(100%, 980px);
  min-width: 0;
  justify-self: center;
  display: grid;
  gap: 16px;
}

.controls {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.controlsHeader {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.controlsHeader h2 {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
}

.controlsHeader p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.settingsSection {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}

.settingsSection summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.settingsSection summary::-webkit-details-marker {
  display: none;
}

.settingsSection summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

.settingsSection[open] summary::after {
  content: "-";
}

.settingsSection summary:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

.settingsSectionBody {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.control.inline {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.control input[type="text"],
.control select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--text);
}

.control input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--text);
}

.control output {
  color: var(--text);
  font-size: 0.78rem;
}

.stage {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.outputStage {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 10px;
}

.canvasWrap {
  min-height: 320px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

#output {
  display: block;
  width: auto;
  height: auto;
  margin: auto;
}

.outputActions {
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.outputBrandText {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.fullscreenIconButton {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.fullscreenIcon {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
}

.fullscreenIcon span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-color: currentColor;
}

.fullscreenIcon span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 2px solid;
  border-left: 2px solid;
}

.fullscreenIcon span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 2px solid;
  border-right: 2px solid;
}

.fullscreenIcon span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.fullscreenIcon span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid;
  border-left: 2px solid;
}

.fullscreenSiteLink {
  display: none;
  color: var(--text);
  font-size: clamp(0.9rem, 1.4vw, 1.2rem);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#video {
  display: none;
}

.status,
.stats {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

@media (min-width: 981px) {
  .rendererLayout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: start;
    gap: 20px;
  }

  .stageColumn {
    position: sticky;
    top: 16px;
    z-index: 2;
    width: 100%;
    justify-self: stretch;
  }

  .canvasWrap {
    min-height: clamp(360px, 52svh, 620px);
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar button {
    flex: 1 1 130px;
  }

  .uploadControl,
  .imageTools {
    width: 100%;
  }

  .uploadControl {
    align-items: flex-start;
    flex-direction: column;
  }

  .uploadControl input {
    width: 100%;
    max-width: 100%;
  }

  .controls {
    padding: 16px;
  }

  .settingsSectionBody {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 980px) {
  .hero {
    min-height: 430px;
  }

  .pageIntro h1,
  .pageIntroCompact h1 {
    font-size: 5.5rem;
  }

  .aboutIntro,
  .processIntro,
  .examplesIntro {
    min-height: 520px;
    padding: 40px;
  }

  .lede {
    font-size: 1.22rem;
  }

  .textSection {
    grid-template-columns: 1fr;
  }

  .textSection h2 {
    font-size: 2rem;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .siteNav {
    width: calc(100% - 24px);
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .navLinks {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    font-size: 0.72rem;
  }

  .hero {
    min-height: 390px;
  }

  .heroContent {
    padding: 32px 12px 44px;
  }

  .heroCta {
    min-height: 46px;
    padding: 12px 16px;
  }

  .studio {
    width: calc(100% - 24px);
    padding: 20px 0 36px;
  }

  .contentPage {
    width: calc(100% - 24px);
    padding: 40px 0 72px;
  }

  .textDocument {
    gap: 52px;
  }

  .pageIntro h1,
  .pageIntroCompact h1 {
    font-size: 3rem;
  }

  .aboutIntro,
  .processIntro,
  .examplesIntro {
    min-height: 520px;
    padding: 28px 18px;
  }

  .aboutIntro::before,
  .processIntro::before,
  .examplesIntro::before {
    background-position: 58% center;
    opacity: 0.68;
  }

  .aboutIntro::after {
    background:
      linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.94) 0%,
        rgba(0, 0, 0, 0.74) 58%,
        rgba(0, 0, 0, 0.22) 100%
      ),
      linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.2) 48%,
        rgba(0, 0, 0, 0.78) 100%
      );
  }

  .processIntro::after {
    background:
      linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 58%,
        rgba(0, 0, 0, 0.24) 100%
      ),
      linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.24) 48%,
        rgba(0, 0, 0, 0.8) 100%
      );
  }

  .examplesIntro::after {
    background:
      linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.8) 58%,
        rgba(0, 0, 0, 0.24) 100%
      ),
      linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.24) 48%,
        rgba(0, 0, 0, 0.8) 100%
      );
  }

  .lede {
    font-size: 1.05rem;
  }

  .textSection {
    gap: 20px;
    padding-top: 28px;
  }

  .gallerySection {
    gap: 18px;
    padding-top: 28px;
  }

  .examplesGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .galleryMedia {
    padding: 0;
  }

  .galleryModal {
    width: calc(100% - 24px);
  }

  .galleryModalInner {
    padding: 10px;
  }

  .galleryModalHeader {
    display: flex;
    justify-content: flex-end;
  }

  .galleryModalActions {
    justify-content: flex-end;
  }

  .galleryModalDownload,
  .galleryModalClose {
    flex: 0 0 46px;
  }

  .galleryModalImage {
    max-height: 62vh;
  }

  .textSection h2 {
    font-size: 1.55rem;
  }

  .sectionBody p,
  .stageList span {
    font-size: 0.96rem;
  }

  .stageList li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .sectionHeader {
    display: grid;
    align-items: start;
  }

  .footerInner {
    width: calc(100% - 24px);
    min-height: auto;
    padding: 16px 0;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footerMeta {
    justify-self: start;
  }

  .sectionHeader h1,
  .sectionHeader h2 {
    font-size: 1.5rem;
  }

  .toolbar,
  .presets {
    padding: 10px;
  }

  .uploadControl {
    width: 100%;
    flex-wrap: wrap;
  }

  .uploadControl input {
    max-width: 100%;
  }

  .imageTools {
    width: 100%;
  }

  .rendererLayout {
    display: block;
  }

  .stage {
    position: sticky;
    top: 0;
    top: env(safe-area-inset-top, 0px);
    z-index: 4;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.62);
  }

  .controls {
    margin-top: 16px;
  }

  .canvasWrap {
    height: clamp(180px, 36svh, 260px);
    min-height: 0;
  }

  .stage.imageMode .canvasWrap {
    height: clamp(180px, 36svh, 260px);
  }
}

.outputStage:fullscreen,
.outputStage:-webkit-full-screen {
  --fullscreen-safe-inset: clamp(48px, 5vmin, 96px);
  position: relative;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  background: var(--bg);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.outputStage:fullscreen .canvasWrap,
.outputStage:-webkit-full-screen .canvasWrap {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
}

.outputStage:fullscreen .fullscreenIconButton,
.outputStage:-webkit-full-screen .fullscreenIconButton {
  top: 16px;
  right: 16px;
  width: 58px;
  min-height: 58px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  opacity: 0;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.outputStage:fullscreen .fullscreenIconButton:hover,
.outputStage:fullscreen .fullscreenIconButton:focus-visible,
.outputStage:-webkit-full-screen .fullscreenIconButton:hover,
.outputStage:-webkit-full-screen .fullscreenIconButton:focus-visible {
  border-color: var(--line-strong);
  background: var(--bg);
  opacity: 1;
}

.outputStage:fullscreen .outputActions,
.outputStage:-webkit-full-screen .outputActions {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 52px;
  padding: 0 var(--fullscreen-safe-inset) calc(var(--fullscreen-safe-inset) - 16px);
}

.outputStage:fullscreen .fullscreenSiteLink,
.outputStage:-webkit-full-screen .fullscreenSiteLink {
  position: absolute;
  right: var(--fullscreen-safe-inset);
  bottom: var(--fullscreen-safe-inset);
  z-index: 2;
  display: inline-flex;
  max-width: min(360px, calc(100% - (var(--fullscreen-safe-inset) * 2)));
  text-align: right;
}

@media (max-width: 640px) {
  .outputActions {
    align-items: stretch;
  }

  .outputStage:fullscreen,
  .outputStage:-webkit-full-screen {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .outputStage:fullscreen .fullscreenSiteLink,
  .outputStage:-webkit-full-screen .fullscreenSiteLink {
    right: var(--fullscreen-safe-inset);
    bottom: var(--fullscreen-safe-inset);
  }

  .outputStage:fullscreen .outputActions,
  .outputStage:-webkit-full-screen .outputActions {
    grid-column: 1;
    grid-row: 2;
  }
}
