/* Sketch to Asset: page-specific additions on top of house-style.css */

.stage {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 90% at 50% 38%, #2a2833 0%, #17161c 55%, #0e0e11 100%);
  touch-action: none;
  user-select: none;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.stage canvas:active { cursor: grabbing; }

/* mode switch: the two main views, big and always visible */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.mode {
  display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px;
  border: 1px solid var(--rule); background: transparent; text-align: left;
}
.mode .icon { width: 28px; height: 28px; flex-basis: 28px; color: var(--muted); }
.mode strong { display: block; font: 400 30px / 1 'Instrument Serif', serif; letter-spacing: -0.02em; }
.mode small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.mode:hover { border-color: var(--accent); }
.mode[aria-selected='true'] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mode[aria-selected='true'] strong, .mode[aria-selected='true'] .icon { color: var(--accent); }

/* the sketch column, always beside the stage */
.stage-layout { grid-template-columns: 230px minmax(0, 1fr) 320px; }
.sketch-col { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sketch-col img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; border: 1px solid var(--rule); background: #efece4; }
.sketch-col figcaption { font-size: 13px; }
.sketch-col figcaption .num { font-size: 10px; color: var(--accent); margin-right: 6px; font-variant-numeric: tabular-nums; }
.sketch-col figcaption small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.5; color: var(--muted); }

.stage-hint {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 7px 11px; border: 1px solid var(--glass-line); border-radius: 4px;
  background: var(--glass); backdrop-filter: blur(10px);
  font-size: 10px; color: var(--muted); white-space: nowrap;
  transition: opacity 0.4s;
}
.stage-hint.fade { opacity: 0; }

.stage-status {
  position: absolute; right: 18px; bottom: 18px;
  padding: 7px 11px; border: 1px solid var(--glass-line); border-radius: 4px;
  background: var(--glass); backdrop-filter: blur(10px);
  font-size: 10px; color: var(--ink);
}
.stage-status[data-state='loading']::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px;
  border-radius: 50%; background: var(--accent); animation: pulse 1s infinite alternate;
}
@keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }

.no-webgl {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.no-webgl img { height: 88%; }

/* rail swatches: sketch-to-render split */
.rail-item .swatch { background-size: cover; background-position: center; }
.rail-item small { display: block; }

.card .stats { list-style: none; margin: 12px 0 0; padding: 0; font-size: 11px; }
.card .stats li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--rule); }
.card .stats li:last-child { border-bottom: 1px solid var(--rule); }
.card .stats .pips { letter-spacing: 3px; color: var(--accent); }
.card .count { display: block; margin-bottom: 6px; }

.pipeline { list-style: none; margin: 16px 0 0; padding: 0; }
.pipeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 12px; }
.pipeline li:last-child { border-bottom: 1px solid var(--rule); }
.pipeline b { font-weight: 600; color: var(--ink); }
.pipeline span { color: var(--muted); line-height: 1.6; }
.drawer-body figure { margin: 16px 0 0; }
.drawer-body figure img { width: 100%; display: block; border: 1px solid var(--rule); }
.drawer-body figcaption { margin-top: 6px; font-size: 11px; color: var(--muted); }

@media (max-width: 1100px) {
  .stage-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .stage-layout > aside { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .stage { aspect-ratio: 4 / 5; }
  .stage-layout { grid-template-columns: 1fr; }
  .sketch-col { flex-direction: row; align-items: center; }
  .sketch-col img { width: 72px; flex: 0 0 72px; }
  .mode { min-height: 62px; padding: 10px 12px; gap: 10px; }
  .mode strong { font-size: 24px; }
  .mode .icon { width: 22px; height: 22px; flex-basis: 22px; }
  .stage-hint { bottom: 60px; }
  .stage-status { bottom: 60px; }
  .pipeline li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 480px) {
  .stage-status { right: 10px; }
}

/* Make yours: signup, agent skill and making-of, side by side */
.make-yours { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.make-yours .action { min-height: 64px; text-decoration: none; }

/* shared footer row: the runtime mounts its navigation and cookie settings here */
.exploration-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 24px;
  max-width: 1600px; margin: 40px auto 0; box-sizing: border-box;
  padding: 14px 4.2% max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule); background: var(--bg); color: var(--muted); font-size: 12px;
}
.exploration-credit { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.exploration-credit strong { font: 400 20px / 1 'Instrument Serif', serif; letter-spacing: -0.02em; color: var(--ink); }
.exploration-bar .making-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
.exploration-bar .making-of {
  padding: 10px 0 3px; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  font-size: 10px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase;
}
.exploration-bar .making-of:hover { color: var(--accent); border-color: var(--accent); }
.exploration-bar a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[data-exploration-controls].exploration-bar #scenario-exploration-analytics .scenario-exploration-controls { background: transparent; border: 0; padding: 0; }
@media (max-width: 800px) {
  .exploration-bar { padding-left: 16px; padding-right: 16px; }
  .exploration-bar #scenario-exploration-analytics { width: 100%; }
}

/* WebGL context lost: rendering stays off until the visitor asks to restart */
.stage-recover {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--glass); color: var(--ink); font-size: 13px; text-align: center; padding: 16px;
}
.stage-recover[hidden] { display: none; }
.stage-recover button { min-height: 40px; padding: 0 18px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 13px 'Instrument Sans', sans-serif; }
.stage-recover button:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* keep the way back to the gallery readable on phones too */
@media (max-width: 480px) {
  .brand span { display: inline; margin-left: 4px; font-size: 11px; }
  .brand img { width: 84px; height: 21px; }
}

/* masthead links keep a comfortable tap height at every width */
.masthead .brand, .masthead .create { min-height: 36px; }
