:root {
  color-scheme: dark;
  --bg: #101115;
  --panel: rgba(20, 22, 28, 0.56);
  --panel-hover: rgba(20, 22, 28, 0.78);
  --panel-strong: rgba(20, 22, 28, 0.92);
  --text: #f5f7fb;
  --muted: #b8c0cc;
  --line: rgba(255, 255, 255, 0.16);
  --focus: #8ad8ff;
  --accent: #19d3ff;
  --accent-text: #071014;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background:
    radial-gradient(circle at 22% 18%, rgba(25, 211, 255, 0.14), transparent 28rem),
    linear-gradient(135deg, #101115 0%, #19151e 42%, #111818 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.landing-page {
  min-height: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(16, 17, 21, 0.12), #101115 92%),
    radial-gradient(circle at 18% 24%, rgba(255, 79, 135, 0.2), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(98, 230, 167, 0.16), transparent 30rem),
    #101115;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

.landing-nav {
  position: fixed;
  z-index: 10;
  top: 14px;
  left: 14px;
  right: 14px;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 17, 21, 0.58);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.landing-logo,
.main-nav,
.hero-actions,
.hero-proof,
.preview-hud,
.feature-list div,
.landing-footer,
.footer-links {
  display: flex;
  align-items: center;
}

.landing-logo {
  min-height: 44px;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.main-nav {
  justify-content: center;
  gap: 18px;
}

.language-switcher {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.language-switcher select {
  width: 100%;
  min-width: 126px;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  outline: 0;
  cursor: pointer;
}

.language-switcher:hover,
.language-switcher:focus-within {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.12);
}

.main-nav a,
.nav-launch,
.primary-link,
.secondary-link {
  text-decoration: none;
}

.main-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-launch {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--text);
  color: #101115;
  font-weight: 700;
  white-space: nowrap;
}

.landing-hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 118px clamp(18px, 7vw, 92px) 90px;
  overflow: hidden;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(16, 17, 21, 0.82), rgba(16, 17, 21, 0.34) 54%, rgba(16, 17, 21, 0.78)),
    linear-gradient(180deg, rgba(16, 17, 21, 0.2), rgba(16, 17, 21, 0.92));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  text-align: center;
}

.hero-kicker,
.section-kicker {
  margin: 0 0 12px;
  color: #62e6a7;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0 auto;
  max-width: 7ch;
  font-size: clamp(4.6rem, 13vw, 10.5rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.hero-lede {
  max-width: 56ch;
  margin: 24px auto 0;
  color: rgba(245, 247, 251, 0.82);
  font-size: clamp(1.1rem, 2.2vw, 1.46rem);
  line-height: 1.45;
}

.hero-actions {
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-link {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 14px 34px rgba(25, 211, 255, 0.22);
}

.primary-link.compact {
  margin-top: 18px;
}

.secondary-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.primary-link svg,
.secondary-link svg,
.nav-launch svg,
.hero-proof svg,
.preview-hud svg,
.feature-list svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.hero-proof {
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.hero-proof span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 247, 251, 0.86);
  font-size: 0.9rem;
}

.hero-scroll {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 24px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: translateX(-50%);
  animation: scrollPulse 1500ms ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero-scroll {
    animation: none;
  }
}

@keyframes scrollPulse {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 7px;
  }
}

.preview-section,
.steps-section,
.feature-band,
.privacy-section {
  padding: clamp(64px, 10vw, 132px) clamp(18px, 7vw, 92px);
}

.section-copy {
  margin: 0 auto;
  max-width: 760px;
  text-align: center;
}

.section-copy h2 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.section-copy p:not(.section-kicker) {
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.62;
}

.preview-stage {
  position: relative;
  width: min(1100px, 100%);
  margin-top: 34px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11151b;
  box-shadow: var(--shadow);
}

.preview-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.preview-hud {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  flex-wrap: wrap;
  gap: 9px;
}

.preview-hud span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 17, 21, 0.58);
  color: rgba(245, 247, 251, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 32px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1100px;
}

.step-grid article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
}

.step-grid svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.step-grid h3 {
  margin: 28px 0 10px;
  font-size: 1.32rem;
}

.step-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.feature-band {
  background:
    linear-gradient(90deg, rgba(25, 211, 255, 0.12), rgba(255, 79, 135, 0.08)),
    rgba(255, 255, 255, 0.03);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  margin-left: auto;
  margin-right: auto;
  max-width: 980px;
}

.feature-list div {
  gap: 12px;
  min-height: 64px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(245, 247, 251, 0.9);
}

.feature-list svg {
  color: #ffe66d;
}

.privacy-section {
  min-height: 68vh;
  display: grid;
  align-items: center;
  justify-items: center;
  background:
    radial-gradient(circle at 78% 45%, rgba(98, 230, 167, 0.13), transparent 28rem),
    #101115;
}

.landing-footer {
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 7vw, 92px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-copy {
  max-width: 760px;
}

.footer-copy span {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 800;
}

.footer-copy p {
  margin: 0;
  max-width: 74ch;
  font-size: 0.92rem;
  line-height: 1.55;
}

.footer-links {
  flex: 0 0 auto;
  gap: 14px;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: rgba(245, 247, 251, 0.82);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.legal-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(25, 211, 255, 0.13), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(255, 79, 135, 0.11), transparent 26rem),
    #101115;
}

.legal-shell {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: 118px 0 72px;
}

.legal-content {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: var(--shadow);
}

.legal-content h1 {
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.98;
}

.legal-content section {
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.legal-content h2 {
  margin: 0 0 10px;
  font-size: 1.18rem;
}

.legal-content p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.62;
}

.legal-content p:last-child {
  margin-bottom: 0;
}

.legal-updated {
  margin-bottom: 26px;
  color: var(--muted);
}

.studio-shell {
  min-height: 100vh;
  padding: clamp(12px, 2vw, 24px);
}

.stage {
  position: relative;
  min-height: calc(100vh - clamp(24px, 4vw, 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #14171c;
  background-size: 48px 48px;
  box-shadow: var(--shadow);
}

.stage[data-background="light"] {
  background:
    linear-gradient(90deg, rgba(16, 17, 21, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(16, 17, 21, 0.08) 1px, transparent 1px),
    #f7f4ee;
}

.stage[data-background="dark"] {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #14171c;
}

.stage[data-background="camera"] {
  background: #101115;
}

.camera,
.paint-canvas,
.guide-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera {
  object-fit: cover;
  opacity: 0.2;
  transform: scaleX(-1);
}

.stage[data-background="light"] .camera,
.stage[data-background="dark"] .camera,
.stage[data-background="transparent"] .camera {
  opacity: 0.16;
}

.stage[data-background="camera"] .camera {
  opacity: 0.62;
}

.camera.is-unmirrored {
  transform: none;
}

.paint-canvas,
.guide-canvas {
  touch-action: none;
}

.topbar,
.toolbox,
.hint-bar,
.privacy-badge,
.export-toast {
  position: absolute;
  z-index: 2;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
}

.topbar {
  top: 16px;
  left: 16px;
  right: 16px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 34%, #ffffff 0 12%, transparent 13%),
    conic-gradient(from 150deg, #19d3ff, #ff4f87, #ffe66d, #62e6a7, #19d3ff);
  flex: 0 0 auto;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-strip span {
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbox {
  left: 16px;
  bottom: 16px;
  width: min(332px, calc(100% - 32px));
  max-height: calc(100vh - 64px);
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: background 160ms ease, opacity 160ms ease;
}

.toolbox:hover,
.toolbox:focus-within {
  background: var(--panel-hover);
}

.toolbox.is-collapsed {
  width: auto;
}

.toolbox.is-collapsed > :not(.tool-row:first-child) {
  display: none;
}

.tool-row {
  display: flex;
  gap: 8px;
}

.toolbox > .tool-row:first-child {
  padding-right: 52px;
  position: relative;
}

.toolbox-toggle {
  position: absolute;
  top: 0;
  right: 0;
}

.toolbox.is-collapsed > .tool-row:first-child {
  padding-right: 0;
}

.toolbox.is-collapsed .toolbox-toggle {
  position: static;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
}

.panel-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.panel-close svg {
  width: 17px;
  height: 17px;
}

.icon-button,
.segment,
.swatch,
.custom-color {
  min-height: 44px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.icon-button {
  width: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.camera-cta {
  position: relative;
}

#demoButton {
  position: relative;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-button.primary,
.icon-button.is-active,
.segment.is-active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  box-shadow: inset 0 -4px 0 rgba(7, 16, 20, 0.2);
}

.camera-cta.is-camera-needed {
  background: linear-gradient(135deg, #19d3ff 0%, #ffe66d 100%);
  color: #071014;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 0 3px rgba(25, 211, 255, 0.24),
    0 14px 34px rgba(25, 211, 255, 0.3),
    inset 0 -4px 0 rgba(7, 16, 20, 0.18);
  animation: cameraNeedPulse 1500ms ease-in-out infinite;
}

.camera-cta.is-active {
  background: linear-gradient(135deg, #68df9f 0%, #19d3ff 100%);
  color: #071014;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 0 3px rgba(104, 223, 159, 0.22),
    0 14px 34px rgba(104, 223, 159, 0.24),
    inset 0 -4px 0 rgba(7, 16, 20, 0.18);
  animation: none;
}

.camera-cta.is-camera-needed::after {
  content: "Start";
  position: absolute;
  left: 50%;
  bottom: -9px;
  translate: -50% 0;
  min-width: 34px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ff4f87;
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(255, 79, 135, 0.28);
  pointer-events: none;
}

.camera-cta.is-active::after {
  content: "An";
  position: absolute;
  left: 50%;
  bottom: -9px;
  translate: -50% 0;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #68df9f;
  color: #071014;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(104, 223, 159, 0.28);
  pointer-events: none;
}

.camera-cta.is-camera-starting {
  animation: cameraStartingPulse 900ms ease-in-out infinite;
}

.camera-cta.is-camera-starting::after {
  content: "...";
}

#demoButton.is-active {
  background: linear-gradient(135deg, #ffe66d 0%, #fa4a88 100%);
  color: #071014;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 0 3px rgba(250, 74, 136, 0.2),
    0 14px 34px rgba(250, 74, 136, 0.24),
    inset 0 -4px 0 rgba(7, 16, 20, 0.18);
}

#demoButton.is-active::after {
  content: "Demo";
  position: absolute;
  left: 50%;
  bottom: -9px;
  translate: -50% 0;
  min-width: 38px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fa4a88;
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 6px 14px rgba(250, 74, 136, 0.28);
  pointer-events: none;
}

@keyframes cameraNeedPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(25, 211, 255, 0.2),
      0 14px 34px rgba(25, 211, 255, 0.24),
      inset 0 -4px 0 rgba(7, 16, 20, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(255, 230, 109, 0.2),
      0 18px 42px rgba(255, 230, 109, 0.3),
      inset 0 -4px 0 rgba(7, 16, 20, 0.18);
  }
}

@keyframes cameraStartingPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .camera-cta.is-camera-needed,
  .camera-cta.is-camera-starting,
  .startup-camera-action.is-camera-starting {
    animation: none;
  }
}

.icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.icon-button.is-confirming {
  background: #ff4f87;
  color: #19030a;
  border-color: transparent;
}

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

.segmented-four {
  grid-template-columns: repeat(4, 1fr);
}

.segmented-three {
  grid-template-columns: repeat(3, 1fr);
}

.segmented-five {
  grid-template-columns: repeat(5, 1fr);
}

.segment {
  border-radius: 8px;
  padding: 0 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-segment,
.brush-segment {
  display: grid;
  place-items: center;
  position: relative;
  padding: 0;
}

.icon-segment svg,
.brush-segment svg {
  width: 20px;
  height: 20px;
}

.brush-segment.is-active::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.brush-preview {
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    rgba(255, 255, 255, 0.05);
  background-size: 18px 18px;
}

.brush-preview canvas {
  width: 100%;
  height: 54px;
}

.control {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
}

.control input {
  width: 100%;
  min-height: 32px;
  accent-color: var(--accent);
}

.compact-control {
  gap: 5px;
  font-size: 0.86rem;
}

.stencil-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

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

.stencil-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.stencil-option,
.stencil-upload {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.stencil-option svg,
.stencil-upload svg {
  width: 20px;
  height: 20px;
}

.stencil-option.is-active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  box-shadow: inset 0 -4px 0 rgba(7, 16, 20, 0.2);
}

.stencil-upload {
  position: relative;
  overflow: hidden;
}

.stencil-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.stencil-clear {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.stencil-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(6, 44px);
  gap: 8px;
  align-items: center;
}

.swatch,
.custom-color {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.swatch {
  background: var(--swatch);
}

.rainbow-swatch {
  background:
    conic-gradient(from 90deg, #ff4f87, #ffe66d, #62e6a7, #19d3ff, #8f6bff, #ff4f87);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.swatch.is-active,
.custom-color:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.custom-color {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--custom-color, #19d3ff);
  color: var(--custom-ink, rgba(7, 16, 20, 0.88));
}

.custom-color svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.34));
}

.custom-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.hint-bar {
  right: 16px;
  bottom: 16px;
  max-width: min(520px, calc(100% - 408px));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-badge {
  top: 84px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
}

.app-legal-links {
  position: absolute;
  z-index: 2;
  top: 132px;
  right: 16px;
  display: inline-flex;
  gap: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.app-legal-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.app-legal-links a:hover {
  color: var(--text);
}

.privacy-badge svg {
  width: 17px;
  height: 17px;
}

.export-toast {
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-hover);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.export-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.export-toast svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 220ms ease;
}

.stage.is-exporting::after {
  border-color: rgba(255, 230, 109, 0.86);
  box-shadow:
    inset 0 0 42px rgba(25, 211, 255, 0.22),
    inset 0 0 90px rgba(255, 79, 135, 0.18);
}

.hint-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 500;
}

.hint-title svg {
  width: 16px;
  height: 16px;
}

.hint-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.gesture-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.gesture-svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gesture-svg circle {
  fill: var(--accent);
  stroke: none;
}

.startup-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 17, 21, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.startup-overlay:focus {
  outline: none;
}

.startup-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.startup-overlay.is-complete .startup-panel {
  border-color: rgba(98, 230, 167, 0.52);
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(98, 230, 167, 0.18),
    0 0 54px rgba(98, 230, 167, 0.16);
  animation: onboardingSuccessPop 620ms ease-out both;
}

.startup-overlay.is-complete #onboardingAction {
  color: var(--text);
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1.02;
  text-align: center;
}

.startup-overlay.is-complete .onboarding-practice {
  grid-template-columns: 1fr;
  min-height: 112px;
  place-items: center;
}

.startup-overlay.is-complete .onboarding-practice-art,
.startup-overlay.is-complete .startup-dismiss {
  display: none;
}

.startup-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.startup-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}

.startup-action.primary {
  border-color: transparent;
  color: var(--accent-text);
  background: var(--accent);
  font-weight: 700;
}

.startup-camera-action {
  min-height: 62px;
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #19d3ff 0%, #ffe66d 100%);
  box-shadow:
    0 0 0 4px rgba(25, 211, 255, 0.18),
    0 18px 48px rgba(25, 211, 255, 0.25);
}

.startup-camera-action span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.startup-camera-action strong,
.startup-camera-action small {
  display: block;
  letter-spacing: 0;
}

.startup-camera-action strong {
  font-size: 1rem;
}

.startup-camera-action small {
  color: rgba(7, 16, 20, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
}

.startup-camera-action.is-camera-starting {
  animation: cameraStartingPulse 900ms ease-in-out infinite;
}

.startup-action svg {
  width: 19px;
  height: 19px;
}

.startup-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.startup-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
}

.startup-icon svg {
  width: 22px;
  height: 22px;
}

.startup-head h1 {
  margin: 0 0 4px;
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: 0;
}

.startup-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.startup-head p {
  margin: 0;
  color: var(--muted);
}

.startup-head .overlay-instruction {
  margin-top: 8px;
  max-width: 36ch;
  color: var(--text);
  font-size: 0.94rem;
  line-height: 1.35;
}

.onboarding-progress {
  position: relative;
  min-height: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.onboarding-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--onboarding-progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #19d3ff, #62e6a7);
  transition: width 240ms ease;
}

.onboarding-progress span {
  position: relative;
  z-index: 1;
  min-height: 22px;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.onboarding-practice {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.onboarding-practice p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.3;
}

.onboarding-practice-art {
  position: relative;
  min-height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 35%, rgba(25, 211, 255, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
}

.onboarding-paint-line,
.onboarding-erase-target {
  position: absolute;
  pointer-events: none;
}

.onboarding-paint-line {
  left: 16px;
  top: 28px;
  width: 82px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #19d3ff, #ff4b93, #ffe66d);
  box-shadow: 0 0 18px rgba(25, 211, 255, 0.58);
  opacity: 0;
  transform: scaleX(0.12) rotate(-7deg);
  transform-origin: left center;
}

.onboarding-erase-target {
  right: 18px;
  top: 17px;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  opacity: 0;
}

.onboarding-practice[data-mode="pinch"] .onboarding-paint-line,
.onboarding-practice[data-mode="painting"] .onboarding-paint-line {
  opacity: 1;
  animation: onboardingPaint 1s ease-in-out infinite;
}

.onboarding-practice[data-mode="eraser"] .onboarding-erase-target,
.onboarding-practice[data-mode="erasing"] .onboarding-erase-target {
  opacity: 1;
}

.onboarding-practice[data-mode="erasing"] .onboarding-erase-target {
  animation: onboardingErase 760ms ease-in-out infinite;
}

.onboarding-practice[data-mode="paused"] .onboarding-paint-line {
  opacity: 0.42;
  transform: scaleX(1) rotate(-7deg);
  animation: none;
}

.onboarding-practice[data-mode="complete"] {
  border-color: rgba(98, 230, 167, 0.54);
  background: rgba(98, 230, 167, 0.12);
}

.onboarding-practice[data-mode="complete"] .onboarding-paint-line {
  opacity: 1;
  transform: scaleX(1) rotate(-7deg);
}

.calibration-list {
  display: grid;
  gap: 8px;
}

.calibration-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 20px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  text-align: left;
}

.calibration-step:not(.is-active),
.startup-overlay:not(.is-complete) .calibration-step.is-done {
  display: none;
}

.startup-overlay.is-complete .calibration-step.is-done {
  display: grid;
}

button.calibration-step {
  width: 100%;
  cursor: pointer;
}

button.calibration-step:hover,
button.calibration-step:focus-visible {
  border-color: rgba(25, 211, 255, 0.86);
  box-shadow: 0 0 0 4px rgba(25, 211, 255, 0.14);
  outline: none;
}

.calibration-step::after {
  content: "";
  width: 10px;
  height: 10px;
  justify-self: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.42;
}

.calibration-step svg,
.calibration-step .gesture-svg {
  width: 18px;
  height: 18px;
}

.calibration-step.is-active {
  color: var(--text);
  border-color: rgba(25, 211, 255, 0.72);
  background: rgba(25, 211, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(25, 211, 255, 0.12);
  min-height: 52px;
  font-weight: 800;
}

.calibration-step.is-active::after {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(25, 211, 255, 0.8);
  opacity: 1;
}

.calibration-step.is-done {
  color: var(--accent-text);
  background: var(--accent);
  border-color: transparent;
}

.calibration-step.is-done::after {
  content: "✓";
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  border-color: currentColor;
  opacity: 1;
}

.startup-dismiss {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--accent-text);
  background: var(--accent);
  cursor: pointer;
}

.startup-dismiss:not(.is-ready) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--line);
}

.startup-dismiss.is-ready {
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(98, 230, 167, 0.15);
}

@keyframes onboardingPaint {
  0% {
    transform: scaleX(0.12) rotate(-7deg);
  }

  55%,
  100% {
    transform: scaleX(1) rotate(-7deg);
  }
}

@keyframes onboardingErase {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  65%,
  100% {
    opacity: 0.12;
    transform: scale(0.58);
  }
}

@keyframes onboardingSuccessPop {
  0% {
    transform: scale(0.985);
  }

  45% {
    transform: scale(1.018);
  }

  100% {
    transform: scale(1);
  }
}

.startup-legal-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: -4px;
}

.startup-legal-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
  text-decoration: none;
}

.startup-legal-links a:hover {
  color: var(--text);
}

button:hover,
.custom-color:hover {
  border-color: rgba(255, 255, 255, 0.34);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .landing-nav {
    grid-template-columns: 1fr auto auto;
    left: 10px;
    right: 10px;
    gap: 10px;
  }

  .main-nav {
    display: none;
  }

  .nav-launch {
    max-width: 42vw;
    min-height: 44px;
    overflow: hidden;
    padding: 0 10px;
    font-size: 0.88rem;
    text-overflow: ellipsis;
  }

  .language-switcher {
    max-width: 72px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
  }

  .language-switcher select {
    min-width: 0;
    width: 68px;
    padding: 0 4px;
    font-size: 0.72rem;
    text-align: center;
  }

  .landing-logo {
    min-width: 0;
  }

  .landing-logo span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .landing-hero {
    min-height: 100svh;
    padding: 96px 18px 78px;
  }

  .landing-hero::after {
    background:
      linear-gradient(180deg, rgba(16, 17, 21, 0.42), rgba(16, 17, 21, 0.94)),
      linear-gradient(90deg, rgba(16, 17, 21, 0.8), rgba(16, 17, 21, 0.42));
  }

  .hero-copy h1 {
    max-width: 7.2ch;
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .hero-lede {
    font-size: 1.04rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

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

  .preview-section,
  .steps-section,
  .feature-band,
  .privacy-section {
    padding: 58px 18px;
  }

  .section-copy h2 {
    font-size: clamp(2.1rem, 12vw, 3.2rem);
  }

  .preview-stage canvas {
    min-height: 360px;
    object-fit: cover;
  }

  .preview-hud {
    position: static;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
  }

  .step-grid,
  .feature-list {
    grid-template-columns: 1fr;
  }

  .step-grid article {
    min-height: 180px;
  }

  .landing-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 18px;
  }

  .footer-links {
    flex-wrap: wrap;
  }

  .studio-shell {
    padding: 0;
  }

  .stage {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

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

  .status-strip {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .toolbox {
    width: calc(100% - 24px);
    max-height: calc(100vh - 48px);
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toolbox.is-collapsed {
    width: auto;
    max-width: calc(100% - 24px);
    right: auto;
  }

  .startup-actions {
    grid-template-columns: 1fr;
  }

  .onboarding-practice {
    grid-template-columns: 1fr;
  }

  .privacy-badge {
    top: 116px;
    left: 12px;
    right: auto;
  }

  .app-legal-links {
    top: 164px;
    left: 12px;
    right: auto;
  }

  .export-toast {
    top: 212px;
    bottom: auto;
  }

  .hint-bar {
    display: none;
  }
}
