/* Ashfox design tokens: neutral greys, one copper accent, hairline borders, small radii. */
:root {
  color-scheme: dark;
  --bg-canvas: #0b0b0c;
  --bg-l1: #111113;
  --bg-l2: #18181b;
  --bg-l3: #212125;
  --bg-overlay: rgba(11, 11, 12, 0.84);
  --text-1: #ededef;
  --text-2: #b6b6bc;
  --text-3: #8a8a92;
  --text-4: #626269;
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --copper: #e69a43;
  --copper-soft: rgba(230, 154, 67, 0.12);
  --copper-line: rgba(230, 154, 67, 0.4);
  --sage: #4cc38a;
  --coral: #f06a5f;
  --radius-card: 8px;
  --radius-stage: 10px;
  --radius-inner: 6px;
  --max-width: 1200px;
  --header-height: 52px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-gap: clamp(48px, 6vw, 80px);
  --text-display: clamp(2.5rem, 6vw, 4.25rem);
  --text-heading: clamp(1.375rem, 2.2vw, 1.75rem);
  --text-body: 0.9375rem;
  --text-sm: 0.8125rem;
  --text-xs: 0.75rem;
  --font-sans: Inter, system-ui, -apple-system, 'Segoe UI', 'Noto Sans KR', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-enter: 300ms;
  font-family: var(--font-sans);
  font-synthesis: none;
  font-feature-settings: 'cv01', 'ss02';
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  min-width: min(320px, 100%);
  overflow-x: clip;
  background: var(--bg-canvas);
  color: var(--text-1);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(230, 154, 67, 0.3);
  color: var(--text-1);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-inner);
  background: var(--text-1);
  color: var(--bg-canvas);
  font-size: var(--text-sm);
  font-weight: 550;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-inner);
  font-size: var(--text-sm);
  font-weight: 540;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.button-primary {
  border: 1px solid var(--text-1);
  background: var(--text-1);
  color: var(--bg-canvas);
}

.button-primary:hover {
  border-color: #ffffff;
  background: #ffffff;
}

.button-ghost {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
}

.button-ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
}

.segmented-strip {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-inner);
  background: var(--bg-l1);
}

.segmented-strip button {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  padding: 4px 10px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.segmented-strip button:hover:not(:disabled) {
  color: var(--text-1);
}

.segmented-strip button[aria-pressed='true'],
.segmented-strip button[aria-selected='true'] {
  background: var(--bg-l3);
  color: var(--text-1);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

/* Highlighted .ashfox source, shared by the landing scenes and the asset studio. */
.code-line {
  display: inline;
}

.code-line::before {
  content: attr(data-line);
  display: inline-block;
  width: 2.4em;
  margin-right: 0.9em;
  text-align: right;
  color: var(--text-4);
  user-select: none;
}

.tok-kw {
  color: var(--copper);
}

.tok-str {
  color: #8fd19e;
}

.tok-num {
  color: #9dc5f8;
}

.tok-cmt {
  color: var(--text-4);
  font-style: italic;
}

.tok-hex {
  color: #f4bf75;
}

.tok-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  background: var(--swatch);
  vertical-align: -1px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Site shell: header, language menu, footer, 404. */
.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    background-color var(--dur-enter) var(--ease-out),
    border-color var(--dur-enter) var(--ease-out);
}

body.landing-page .site-header {
  position: fixed;
  inset: 0 0 auto;
  border-bottom-color: transparent;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.landing-page .site-header.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: var(--bg-overlay);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner,
.footer-inner {
  width: min(100%, calc(var(--max-width) + var(--gutter) * 2));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-1);
}

.brand img {
  display: block;
  width: 22px;
  height: 22px;
}

.primary-nav {
  display: flex;
  gap: 4px;
}

.primary-nav a {
  padding: 4px 10px;
  border-radius: var(--radius-inner);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease-out);
}

.primary-nav a:hover,
.primary-nav a[aria-current='page'] {
  color: var(--text-1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-inner);
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease-out);
}

.header-icon:hover {
  color: var(--text-1);
}

.header-setup {
  height: 30px;
  padding: 0 12px;
}

.language-menu {
  position: relative;
}

.language-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-inner);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-3);
  list-style: none;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}

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

.language-menu summary:hover,
.language-menu[open] summary {
  color: var(--text-1);
}

.language-menu nav {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--bg-l2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.language-menu nav a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: var(--text-sm);
  color: var(--text-2);
}

.language-menu nav a:hover,
.language-menu nav a[aria-current='true'] {
  background: var(--bg-l3);
  color: var(--text-1);
}

.site-footer {
  border-top: 1px solid var(--line-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  padding-top: 28px;
  padding-bottom: 32px;
}

.footer-inner p {
  flex: 1 1 280px;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: var(--text-sm);
  color: var(--text-3);
}

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

.missing-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 112px var(--gutter);
}

.missing-page h1 {
  margin: 0 0 12px;
  font-size: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.missing-page p {
  margin: 0 0 24px;
  color: var(--text-3);
}

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

@media (max-width: 720px) {
  .header-inner {
    gap: 12px;
  }
  .header-setup,
  .header-icon {
    display: none;
  }
  .primary-nav a {
    padding: 4px 6px;
  }
}

/* Landing: live world hero, request/source/output stage, how it works, engines, finale. */
.landing {
  --landing-width: min(100%, calc(var(--max-width) + var(--gutter) * 2));
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 86svh, 780px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 80% at 80% 30%, rgba(230, 154, 67, 0.14), transparent 60%),
    linear-gradient(180deg, #15171c 0%, var(--bg-canvas) 100%);
}

.hero-world {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}

.hero-world[data-ready='true'] {
  opacity: 1;
}

.hero-world canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 11, 12, 0.88) 0%, rgba(11, 11, 12, 0.55) 42%, transparent 72%),
    linear-gradient(
      180deg,
      rgba(11, 11, 12, 0.5) 0%,
      transparent 22%,
      transparent 70%,
      var(--bg-canvas) 100%
    );
  pointer-events: none;
}

.hero-inner {
  width: var(--landing-width);
  margin: 0 auto;
  padding: calc(var(--header-height) + 48px) var(--gutter) 72px;
}

.hero h1 {
  max-width: 12ch;
  margin: 0 0 18px;
  font-size: var(--text-display);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.02;
  animation: rise var(--dur-enter) var(--ease-out) both;
}

.hero-lede {
  max-width: 34rem;
  margin: 0 0 28px;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text-2);
  animation: rise var(--dur-enter) 80ms var(--ease-out) both;
}

.prompt {
  max-width: 36rem;
  animation: rise var(--dur-enter) 160ms var(--ease-out) both;
}

.prompt-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: rgba(17, 17, 19, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.prompt-text {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-1);
}

.prompt-copy {
  flex: none;
  min-width: 72px;
}

.prompt-hint {
  margin: 8px 0 0;
  font-size: var(--text-xs);
  color: var(--text-3);
}

.hero-browse {
  display: inline-flex;
  gap: 6px;
  margin-top: 20px;
  font-size: var(--text-sm);
  font-weight: 540;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-out);
}

.hero-browse:hover {
  color: var(--copper);
}

.hero-caption {
  position: absolute;
  right: var(--gutter);
  bottom: 20px;
  font-size: var(--text-xs);
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease-out);
}

.hero-caption:hover {
  color: var(--text-1);
}

.section {
  width: var(--landing-width);
  margin: 0 auto;
  padding: var(--section-gap) var(--gutter) 0;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 28px;
}

.section-head h2,
.finale h2 {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 620;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--text-3);
}

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

.scene {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.scene:nth-child(even) {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.scene:nth-child(even) .scene-brief {
  order: 2;
}

.scene-brief {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.scene-kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--copper);
}

.scene-request {
  margin: 0;
  font-size: clamp(1.375rem, 2.3vw, 1.875rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-1);
  text-wrap: pretty;
}

.scene-caret {
  color: var(--copper);
  font-weight: 500;
}

.scene-ghost {
  visibility: hidden;
}

.scene-cursor {
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin: 0 1px -0.12em;
  background: var(--copper);
  animation: blink 900ms steps(1) infinite;
}

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

.scene-source {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-l1);
  overflow: hidden;
}

.scene-bar,
.scene-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.scene-bar {
  border-bottom: 1px solid var(--line-soft);
}

.scene-bar a:hover,
.scene-caption a:hover {
  color: var(--copper);
}

.scene-code {
  height: 220px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-2);
  tab-size: 2;
  mask-image: linear-gradient(180deg, #000 70%, transparent);
}

.scene-code:focus-visible,
.scene-code:hover {
  mask-image: none;
}

.scene-output {
  position: relative;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-stage);
  background: radial-gradient(80% 70% at 50% 45%, var(--bg-l2), var(--bg-l1));
  overflow: hidden;
}

.scene-output::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
}

.scene-view {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(320px, 36vw, 460px);
}

.scene-caption {
  border-top: 1px solid var(--line-soft);
}

.scene-caption strong {
  font-weight: 600;
  color: var(--text-1);
}

/* Scene choreography, opted into by landing.js: type the request, settle the source, land the output. */
.landing.has-scenes .scene-kicker,
.landing.has-scenes .scene-source,
.landing.has-scenes .scene-output {
  transition:
    opacity 560ms var(--ease-out),
    transform 560ms var(--ease-out);
}

.landing.has-scenes .scene:not(.is-in) .scene-kicker {
  opacity: 0;
  transform: translateY(8px);
}

.landing.has-scenes .scene:not(.is-typed) .scene-source {
  opacity: 0;
  transform: translateY(14px);
}

.landing.has-scenes .scene:not(.is-built) .scene-output {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
}

.landing.has-scenes .scene.is-built .scene-output::before {
  animation: sweep 900ms var(--ease-out);
}

.stage-3d {
  position: absolute;
  inset: 0;
}

.stage-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-sprites {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage-sprites li {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-inner);
  transition: transform var(--dur-enter) var(--ease-out);
}

.stage-sprites li:hover {
  transform: translateY(-4px);
}

.stage-sprites img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
}

/* Live view loading: landing.js opts in with .has-live. Until the scene is ready the view shows a
   moving skeleton with a spinner, a progress bar and the current phase instead of a static card. */
.scene-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 14px;
  pointer-events: none;
}

.landing.has-live .stage-3d:not([data-phase='ready'], [data-phase='failed']) .scene-loading {
  display: grid;
}

.landing.has-live .stage-3d:not([data-phase='ready'], [data-phase='failed']) .stage-poster {
  opacity: 0;
}

.landing.has-live .stage-3d:not([data-phase='ready'], [data-phase='failed'])::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(230, 154, 67, 0.11) 50%,
    transparent 70%
  );
  background-size: 250% 100%;
  animation: shimmer 1.6s linear infinite;
}

.stage-3d canvas {
  animation: appear 700ms var(--ease-out);
}

.scene-spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--line-soft);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.scene-progress {
  position: relative;
  width: 200px;
  height: 2px;
  border-radius: 2px;
  background: var(--line-soft);
  overflow: hidden;
}

.scene-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--copper);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  transition: transform 240ms var(--ease-out);
}

.scene-loading .mono-label {
  font-size: var(--text-sm);
  color: var(--text-2);
}

.stage-3d[data-phase='building'] .scene-progress::after {
  animation: pulse-bar 1s ease-in-out infinite;
}

.scene-toggle {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 3;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(17, 17, 19, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.scene-toggle button {
  min-width: 76px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.scene-toggle button:hover {
  color: var(--text-1);
}

.scene-toggle button[aria-pressed='true'] {
  background: var(--copper);
  color: #17110a;
}

.stage-sound {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(100% - 48px, 420px);
}

.stage-wave {
  width: 100%;
  height: auto;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-step {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-l1);
}

.how-step h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.how-step p {
  flex: 1;
  margin: 0 0 16px;
  font-size: var(--text-sm);
  color: var(--text-3);
}

.how-command {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-inner);
  background: var(--bg-canvas);
  font-size: var(--text-xs);
  color: var(--text-2);
  white-space: nowrap;
  overflow-x: auto;
}

.how-command span {
  color: var(--text-4);
}

.engine-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  list-style: none;
  overflow: hidden;
}

.engine-row li + li {
  border-left: 1px solid var(--line-soft);
}

.engine-row a {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.engine-row a:hover {
  background: var(--bg-l1);
}

.engine-row strong {
  font-size: var(--text-body);
  font-weight: 600;
}

.engine-row code {
  font-size: var(--text-xs);
  color: var(--text-3);
}

.finale {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding-bottom: var(--section-gap);
  text-align: center;
}

.finale .prompt {
  width: 100%;
  text-align: left;
  animation: none;
}

.finale .hero-browse {
  margin-top: 0;
}

/* Sections settle in once as they enter; landing.js opts in so content stays visible without JS. */
.landing.has-reveal .section:not(.is-in) {
  opacity: 0;
  transform: translateY(16px);
}

@media (prefers-reduced-motion: reduce) {
  .landing.has-live .stage-3d::before,
  .scene-spinner,
  .stage-3d canvas {
    animation: none;
  }
}

.landing.has-reveal .section {
  transition:
    opacity 600ms var(--ease-out),
    transform 600ms var(--ease-out);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-bar {
  50% {
    opacity: 0.4;
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes sweep {
  0% {
    opacity: 1;
    transform: scaleX(0);
  }
  70% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

@media (max-width: 960px) {
  .scene,
  .scene:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
  }
  .scene:nth-child(even) .scene-brief {
    order: 0;
  }
  .scene-code {
    height: 180px;
  }
  .how-steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .engine-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .engine-row li + li {
    border-left: 0;
  }
  .engine-row li {
    border-top: 1px solid var(--line-soft);
  }
  .engine-row li:nth-child(-n + 2) {
    border-top: 0;
  }
  .engine-row li:nth-child(even) {
    border-left: 1px solid var(--line-soft);
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: 0;
  }
  .hero-shade {
    background: linear-gradient(180deg, rgba(11, 11, 12, 0.6), var(--bg-canvas));
  }
  .prompt-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }
  .hero-caption {
    display: none;
  }
}

/* Asset studio: a filterable gallery, and a full-height detail view (live stage + inspector panel). */
.studio {
  --studio-glass: rgba(14, 14, 16, 0.78);
  --studio-panel-width: 400px;
  --studio-inline: max(var(--gutter), calc((100% - var(--max-width)) / 2));
  display: block;
  min-height: calc(100svh - var(--header-height));
}

.studio button {
  font: inherit;
}

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

/* ---------- Top bar: title, domain filter, genre, search in one compact row ---------- */
.studio-head {
  position: sticky;
  z-index: 20;
  top: var(--header-height);
  padding: 0 var(--studio-inline);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-overlay);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.studio-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'title chips tools';
  align-items: center;
  gap: 10px 20px;
  min-height: 56px;
  padding: 10px 0;
}

.studio-title {
  grid-area: title;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.studio-count {
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}

.studio-chips {
  grid-area: chips;
  display: flex;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}

.studio-chips::-webkit-scrollbar {
  display: none;
}

.studio-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 520;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out);
}

.studio-chip:hover {
  color: var(--text-1);
}

.studio-chip[aria-pressed='true'] {
  background: var(--bg-l3);
  color: var(--text-1);
}

.studio .tab-count {
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
}

.studio-chip[aria-pressed='true'] .tab-count {
  color: var(--copper);
}

.studio-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-select {
  position: relative;
  display: block;
}

.studio-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 11px;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  border-right: 1.5px solid var(--text-3);
  border-bottom: 1.5px solid var(--text-3);
  transform: rotate(45deg);
  pointer-events: none;
}

.studio-select select {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-inner);
  outline: 0;
  appearance: none;
  background: var(--bg-l1);
  color: var(--text-2);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.studio-select select:hover,
.studio-select select:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--text-1);
}

.studio-select select.is-set {
  border-color: var(--copper-line);
  color: var(--copper);
}

.studio-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 232px;
  height: 32px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-inner);
  background: var(--bg-l1);
  color: var(--text-4);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.studio-search:focus-within {
  border-color: var(--copper-line);
  color: var(--text-2);
}

.studio-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-1);
  font-size: var(--text-sm);
}

.studio-search input::placeholder {
  color: var(--text-4);
}

.studio-search input::-webkit-search-cancel-button {
  display: none;
}

.studio-search kbd {
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--text-4);
  font-size: 0.6875rem;
  line-height: 1.5;
}

/* ---------- Gallery: a dense grid of thumbnail cards ---------- */
.studio-gallery {
  padding: 20px var(--studio-inline) 72px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 10px;
}

.asset-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-l1);
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms var(--ease-out),
    background-color 180ms var(--ease-out);
}

.asset-card:hover {
  border-color: var(--copper-line);
  background: var(--bg-l2);
}

.asset-card-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    radial-gradient(110% 90% at 50% 20%, rgba(255, 255, 255, 0.055), transparent 62%), var(--bg-l2);
}

.asset-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 360ms var(--ease-out);
}

.asset-card:hover .asset-card-media img {
  transform: scale(1.05);
}

/* A 3D card waits on its client render: dim the vector placeholder under a soft shimmer, then
   fade the real thumbnail in. */
.asset-card-media img[data-thumb-src][src*='.svg'] {
  opacity: 0.28;
  filter: grayscale(1);
}

.asset-card-media img.is-rendered {
  animation: studio-fade 360ms var(--ease-out);
}

.asset-card-media:has(img[data-thumb-src][src*='.svg'])::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 70%
  );
  background-size: 220% 100%;
  animation: studio-shimmer 1.4s linear infinite;
}

.asset-card-media img.thumb-pixel {
  width: 46%;
  height: 46%;
  image-rendering: pixelated;
}

.asset-card-media img.thumb-wave {
  object-fit: cover;
  opacity: 0.85;
}

.thumb-fallback {
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.asset-card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 9px;
}

.asset-card-body strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--text-sm);
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card-kicker {
  flex: 0 0 auto;
  color: var(--text-4);
  font-size: 0.6875rem;
}

.studio-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 72px 20px;
  text-align: center;
}

.studio-empty h2 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
}

.studio-empty p {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* ---------- Detail view ---------- */
.studio[data-studio-mode='workbench'] .studio-head {
  display: none;
}

.studio-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--studio-panel-width);
  height: calc(100svh - var(--header-height));
  min-height: 520px;
}

.studio-detail[hidden] {
  display: none;
}

.detail-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #070708;
}

.detail-nav {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 48px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-canvas);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 520;
  cursor: pointer;
}

.detail-back:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.detail-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-step button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-inner);
  background: transparent;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.detail-step button:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--text-1);
}

.detail-step button:disabled {
  opacity: 0.35;
  cursor: default;
}

.detail-position {
  min-width: 64px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.studio-3d,
.studio-2d,
.studio-audio {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------- 3D stage ---------- */
.studio-3d {
  overflow: hidden;
}

.studio-3d:fullscreen {
  background: #070708;
}

.studio-3d-host {
  position: absolute;
  inset: 0;
}

.studio-3d-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.studio-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-2);
  font-size: var(--text-sm);
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(230, 154, 67, 0.06), transparent 70%),
    rgba(7, 7, 8, 0.55);
}

.studio-loading[hidden] {
  display: none;
}

.studio-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: studio-spin 0.8s linear infinite;
}

.studio-loading-track {
  width: 180px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.studio-loading-fill {
  width: 0;
  height: 100%;
  background: var(--copper);
  transition: width 240ms var(--ease-out);
}

.hud-top {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}

.hud-pill,
.hud-menu > summary,
.hud-icon,
.motion-bar,
.hud-tris,
.spectator-hud {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--studio-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hud-pill {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
}

.hud-pill button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 520;
  cursor: pointer;
}

.hud-pill button:hover {
  color: var(--text-1);
}

.hud-pill button[aria-pressed='true'] {
  background: var(--copper-soft);
  color: var(--copper);
}

.hud-menu {
  position: relative;
}

.hud-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 540;
  list-style: none;
  cursor: pointer;
}

.hud-menu > summary::-webkit-details-marker {
  display: none;
}

.hud-menu > summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur-fast) var(--ease-out);
}

.hud-menu[open] > summary {
  color: var(--text-1);
}

.hud-menu[open] > summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.hud-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-stage);
  background: rgba(17, 17, 19, 0.94);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7);
  animation: studio-pop 160ms var(--ease-out);
}

.hud-menu-panel .segmented-strip {
  flex-wrap: wrap;
}

.hud-menu-label {
  margin-top: 2px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.hud-menu-lod {
  display: grid;
  gap: 8px;
}

.hud-menu-lod[hidden] {
  display: none;
}

.hud-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--text-2);
  font-size: 1rem;
  cursor: pointer;
}

.hud-icon:hover {
  color: var(--text-1);
}

.hud-tris {
  position: absolute;
  z-index: 4;
  bottom: 12px;
  left: 12px;
  padding: 4px 9px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.spectator-hud {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 300px);
  padding: 6px 10px;
  color: var(--text-3);
  font-size: var(--text-xs);
}

.spectator-badge {
  color: var(--copper);
  font-weight: 560;
}

.spectator-speed {
  color: var(--text-1);
  font-family: var(--font-mono);
}

.motion-bar {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 6px;
}

.motion-bar[hidden] {
  display: none;
}

.motion-play {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: var(--text-1);
  color: var(--bg-canvas);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.motion-play[data-vfx-replay] {
  background: var(--copper-soft);
  color: var(--copper);
}

.motion-clips {
  display: flex;
  flex: 0 1 auto;
  gap: 2px;
  min-width: 0;
  max-width: 42%;
  overflow-x: auto;
  scrollbar-width: none;
}

.motion-clips::-webkit-scrollbar {
  display: none;
}

.motion-clips button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-xs);
  white-space: nowrap;
  cursor: pointer;
}

.motion-clips button:hover {
  color: var(--text-1);
}

.motion-clips button[aria-pressed='true'] {
  background: var(--bg-l3);
  color: var(--text-1);
}

.motion-scrub {
  flex: 1 1 120px;
  min-width: 80px;
  accent-color: var(--copper);
}

.motion-bar .segmented-strip {
  flex: 0 0 auto;
  border-color: transparent;
  background: transparent;
}

.motion-bar .segmented-strip button {
  padding: 4px 7px;
  font-size: var(--text-xs);
}

/* ---------- 2D stage ---------- */
.studio-2d {
  display: flex;
  flex-direction: column;
}

.studio-2d .hud-top {
  position: static;
  justify-content: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-canvas);
}

.studio-2d-viewport {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 24px;
  overflow: auto;
}

.studio-2d[data-backdrop='checker'] .studio-2d-viewport {
  background-color: #121214;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-size: 16px 16px;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
}

.studio-2d[data-backdrop='obsidian'] .studio-2d-viewport {
  background: #000000;
}

.studio-2d[data-backdrop='light'] .studio-2d-viewport {
  background: #e9ecf1;
}

.studio-2d-canvas {
  position: relative;
  display: grid;
  place-items: center;
}

.studio-2d-canvas.has-pixel-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: var(--pixel-size, 4px) var(--pixel-size, 4px);
}

.inspector-sprite-preview {
  display: block;
  image-rendering: pixelated;
}

.inspector-tile-grid {
  border: 1px solid var(--line-strong);
  background-repeat: repeat;
  image-rendering: pixelated;
}

.nineslice-stage,
.crosshair-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.nineslice-viewport {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.nineslice-box {
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  image-rendering: pixelated;
}

.nineslice-caption {
  color: var(--text-1);
  font-size: var(--text-xs);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.nineslice-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 3px;
  background: rgba(230, 154, 67, 0.85);
  cursor: nwse-resize;
}

.nineslice-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--studio-glass);
  color: var(--text-2);
  font-size: var(--text-xs);
}

.nineslice-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nineslice-toolbar input[type='range'] {
  width: 96px;
  accent-color: var(--copper);
}

.nineslice-meta strong {
  color: var(--text-1);
  font-family: var(--font-mono);
  font-weight: 500;
}

.crosshair-preview {
  display: grid;
  place-items: center;
  width: min(360px, 100%);
  height: 220px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-stage);
}

.crosshair-preview[data-crosshair-theme='dark'] {
  background: #000000;
}

.crosshair-preview[data-crosshair-theme='light'] {
  background: #e9ecf1;
}

.crosshair-preview[data-crosshair-theme='hud'] {
  background: linear-gradient(180deg, #1b2d44 0%, #314b63 58%, #253429 59%, #18211b 100%);
}

.crosshair-preview img {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
}

/* ---------- Audio stage ---------- */
.studio-audio {
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(70% 60% at 50% 45%, rgba(230, 154, 67, 0.07), transparent 70%);
}

.studio-audio[hidden] {
  display: none;
}

.audio-card {
  display: grid;
  gap: 16px;
  width: min(760px, 100%);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-stage);
  background: var(--bg-l1);
}

.audio-wave-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 200;
  border-radius: var(--radius-inner);
  background: var(--bg-canvas);
}

.audio-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.audio-controls .button[aria-pressed='true'].button-ghost {
  border-color: var(--copper-line);
  color: var(--copper);
}

.audio-time {
  margin-left: auto;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

/* ---------- Inspector panel ---------- */
.studio-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line-soft);
  background: var(--bg-canvas);
}

.panel-head {
  display: grid;
  gap: 6px;
  padding: 20px 20px 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.panel-specs {
  margin: 0;
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.panel-summary {
  margin: 0;
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.inspector-tabs {
  display: flex;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.inspector-tabs button {
  position: relative;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 520;
  cursor: pointer;
}

.inspector-tabs button:hover {
  color: var(--text-1);
}

.inspector-tabs button[aria-selected='true'] {
  color: var(--text-1);
}

.inspector-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--copper);
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.panel-pane {
  padding: 16px 20px 24px;
}

.panel-pane[data-panel-source] {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0;
}

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

.panel-source-bar {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 8px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-canvas);
}

.panel-source-bar code {
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-source-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.panel-source-actions button,
.panel-source-actions a {
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-xs);
  line-height: 26px;
  white-space: nowrap;
  cursor: pointer;
}

.panel-source-actions button:hover,
.panel-source-actions a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.panel-source-actions button[aria-pressed='true'] {
  color: var(--copper);
}

.panel-code {
  flex: 1 1 auto;
  margin: 0;
  padding: 14px 16px 24px 4px;
  overflow: auto;
  color: var(--text-2);
  font-size: 0.78rem;
  line-height: 1.6;
  tab-size: 2;
}

.specs-table {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 0 0 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  overflow: hidden;
  font-size: var(--text-sm);
}

.specs-table dt,
.specs-table dd {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.specs-table dt {
  color: var(--text-3);
  background: var(--bg-l1);
  white-space: nowrap;
}

.specs-table dd {
  overflow-wrap: anywhere;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}

.specs-table dt:nth-last-of-type(1),
.specs-table dd:nth-last-of-type(1) {
  border-bottom: 0;
}

.specs-tags-wrap h4 {
  margin: 0 0 8px;
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
}

.specs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-xs);
  cursor: pointer;
}

.tag-chip:hover {
  border-color: var(--copper-line);
  color: var(--copper);
}

.use-snippets {
  display: grid;
  gap: 12px;
}

.use-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  background: var(--bg-l1);
}

.use-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: var(--text-xs);
}

.use-card-head strong {
  font-weight: 560;
}

.use-copy-btn.button {
  height: 26px;
  padding: 0 10px;
  font-size: var(--text-xs);
}

.use-card pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--text-2);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* ---------- Responsive ---------- */
@media (max-width: 1079px) {
  .studio-bar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'title tools'
      'chips chips';
  }

  .studio-tools {
    justify-content: flex-end;
  }

  .studio-detail {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
  }

  .detail-stage {
    height: min(68svh, 620px);
    min-height: 380px;
  }

  .studio-panel {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .panel-body {
    overflow: visible;
  }

  .panel-code {
    max-height: 560px;
  }
}

@media (max-width: 720px) {
  .studio-head {
    position: static;
  }

  .studio-bar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'title'
      'tools'
      'chips';
  }

  .studio-tools {
    width: 100%;
  }

  .studio-search {
    flex: 1 1 auto;
    width: auto;
  }

  .studio-search kbd {
    display: none;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  .asset-card-kicker {
    display: none;
  }

  .studio-gallery {
    padding-top: 14px;
  }

  .hud-pill button {
    padding: 0 8px;
  }

  .motion-bar {
    flex-wrap: wrap;
  }

  .motion-clips {
    max-width: 100%;
  }

  .motion-bar .segmented-strip {
    display: none;
  }

  .spectator-keys {
    display: none;
  }
}

@keyframes studio-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes studio-fade {
  from {
    opacity: 0;
  }
}

@keyframes studio-shimmer {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

@keyframes studio-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* Obsidian 3-Column Documentation Portal (/docs/ & /ko/docs/) */
.docs-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px clamp(20px, 3vw, 48px) 96px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 216px;
  gap: 48px;
  align-items: start;
}

.docs-sidebar,
.page-toc {
  position: sticky;
  top: calc(var(--header-height) + 28px);
  max-height: calc(100vh - var(--header-height) - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.docs-search-trigger {
  width: 100%;
  height: 36px;
  padding: 0 13px;
  margin-bottom: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  background: var(--bg-l1);
  color: var(--text-3);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition:
    color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.docs-search-trigger:hover {
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.22);
  background: var(--bg-l2);
}

.docs-search-trigger kbd {
  font-size: 11px;
  color: var(--text-4);
}

.docs-nav section {
  margin-bottom: 24px;
}

.docs-nav h2 {
  margin: 0 0 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
}

.docs-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: var(--text-sm);
  color: var(--text-3);
  transition:
    color 140ms var(--ease-out),
    background-color 140ms var(--ease-out);
}

.docs-nav a:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
}

.docs-nav a[aria-current='page'] {
  color: var(--text-1);
  background: var(--copper-soft);
  box-shadow: inset 2px 0 0 var(--copper);
  font-weight: 540;
}

.docs-mobile-nav,
.doc-mobile-toc {
  display: none;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-l1);
  padding: 10px 14px;
}

.doc-article {
  min-width: 0;
  max-width: 740px;
}

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: var(--text-sm);
  color: var(--text-4);
}

.doc-breadcrumb a:hover {
  color: var(--text-1);
}

.translation-notice,
.doc-article blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 2px solid var(--copper);
  border-radius: 0 var(--radius-inner) var(--radius-inner) 0;
  background: var(--bg-l1);
  font-size: var(--text-sm);
  color: var(--text-2);
}

.doc-article blockquote p {
  margin: 0;
  font-size: var(--text-sm);
}

.doc-article h1,
.doc-article h2,
.doc-article h3 {
  word-break: keep-all;
}

.doc-article h1 {
  margin: 0 0 22px;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 640;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.doc-article h2 {
  margin: 48px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-1);
}

.doc-article h3 {
  margin: 30px 0 10px;
  font-size: 1.0625rem;
  font-weight: 590;
  letter-spacing: -0.015em;
  color: var(--text-1);
}

.doc-article p,
.doc-article li {
  font-size: 1.0625rem;
  color: var(--text-2);
  line-height: 1.65;
}

.doc-article code:not(pre code) {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  background: var(--bg-l2);
  color: var(--text-1);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.doc-article a:not(.copy-code) {
  color: var(--copper);
  text-decoration: underline;
  text-decoration-color: rgba(230, 154, 67, 0.38);
  text-underline-offset: 3px;
}

.doc-article a:not(.copy-code):hover {
  text-decoration-color: var(--copper);
}

.doc-article pre {
  position: relative;
  margin: 22px 0;
  padding: 46px 18px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-inner);
  background: var(--bg-l1);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
  font-size: var(--text-sm);
  line-height: 1.62;
  font-variant-numeric: tabular-nums;
}

.doc-article pre::before {
  content: '';
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-soft);
  pointer-events: none;
}

.code-lang {
  position: absolute;
  top: 9px;
  left: 14px;
  padding: 2px 9px;
  border-radius: 9999px;
  border: 1px solid var(--line-soft);
  background: var(--bg-l2);
  color: var(--text-3);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 560;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
  pointer-events: none;
}

.copy-code {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9999px;
  padding: 3px 11px;
  background: var(--bg-l2);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 510;
  cursor: pointer;
  transition:
    color 160ms var(--ease-out),
    border-color 160ms var(--ease-out),
    background-color 160ms var(--ease-out);
}

.copy-code:hover {
  color: var(--text-1);
  border-color: var(--copper-line);
  background: var(--bg-l3);
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.doc-article th,
.doc-article td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.doc-article th {
  color: var(--text-1);
  font-weight: 590;
  border-bottom-color: var(--line-strong);
}

.doc-pagination {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.doc-pagination a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg-l1);
  transition:
    border-color 160ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.doc-pagination a:hover {
  border-color: var(--copper-line);
  transform: translateY(-1px);
}

.doc-pagination span {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-4);
}

.doc-pagination strong {
  display: block;
  margin-top: 4px;
  font-size: var(--text-body);
  font-weight: 560;
  color: var(--text-1);
}

.doc-end {
  margin-top: 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
  color: var(--text-3);
}

.doc-end a {
  color: var(--copper);
}

.page-toc p {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
}

.page-toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid transparent;
  font-size: var(--text-sm);
  color: var(--text-3);
  transition:
    color 140ms var(--ease-out),
    border-color 140ms var(--ease-out);
}

.page-toc a.toc-level-3 {
  padding-left: 22px;
}

.page-toc a:hover,
.page-toc a[aria-current='true'] {
  color: var(--text-1);
  border-left-color: var(--copper);
}

.docs-search-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(17, 17, 20, 0.92);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.78);
  color: var(--text-1);
  overflow-x: hidden;
  overflow-y: auto;
}

.docs-search-dialog::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
}

.docs-search-dialog input {
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text-1);
  font-size: var(--text-body);
  outline: none;
}

.docs-search-results {
  max-height: min(360px, calc(100dvh - 110px));
  overflow-y: auto;
  padding: 8px;
}

.docs-search-results a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
}

.docs-search-results a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.docs-search-results strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-1);
}

.docs-search-results span {
  font-size: var(--text-sm);
  color: var(--text-4);
}

@media (max-width: 1060px) {
  .docs-shell {
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 32px;
  }
  .page-toc {
    display: none;
  }
  .doc-mobile-toc {
    display: block;
  }
}

@media (max-width: 780px) {
  .docs-shell {
    grid-template-columns: 1fr;
    padding: 24px 16px 64px;
    gap: 0;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-mobile-nav {
    display: block;
  }
  .doc-pagination {
    grid-template-columns: 1fr;
  }
}
