/* ==========================================================================
   Ghostlight demo stage - functional widgets for driving the tools, styled to
   the night-garden system (dark panels, teal accent, mono labels). Loaded only
   on /ghostlight/demo/* pages (see base.njk). The accent comes from --a/--al/
   --argb set on .demo, never hard-coded, per the site convention.
   ========================================================================== */

.demo { --a: #5eead4; --al: #5eead4; --argb: 94, 234, 212; }
.demo .wrap { padding-top: 8px; padding-bottom: 64px; }

/* Scenario intro shared by every stage page */
.demo-intro { border-left: 2px solid rgba(var(--argb), 0.5); padding: 4px 0 4px 20px; max-width: 720px; margin: 0 0 34px; }
.demo-intro .tools { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: rgba(var(--argb), 0.85); letter-spacing: 0.02em; }

/* A labelled stage panel wrapping each interactive widget */
.stage { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-2); border-radius: 14px; padding: 26px; margin-bottom: 22px; }
.stage > h2 { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.stage > .hint { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.stage .readout { margin-top: 16px; font-family: var(--mono); font-size: 13px; color: rgba(var(--argb), 0.9); min-height: 1.2em; }
.stage .readout:empty::before { content: "waiting for the agent..."; color: var(--faint); }

/* Big primary target button */
.demo-btn {
  width: 100%; max-width: 420px; height: 88px; border-radius: 14px; cursor: pointer;
  font-family: var(--sans); font-size: 20px; font-weight: 600; color: #0b1220;
  background: var(--a); border: none; box-shadow: 0 10px 28px -12px rgba(var(--argb), 0.7);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.demo-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(var(--argb), 0.85); }
.demo-btn:active { transform: translateY(0); }

/* Text field */
.demo-field {
  width: 100%; max-width: 420px; height: 58px; padding: 0 18px; box-sizing: border-box;
  font-family: var(--sans); font-size: 17px; color: var(--ink); background: #0a090c;
  border: 1.5px solid var(--line-2); border-radius: 12px; outline: none;
  transition: border-color 0.2s ease;
}
.demo-field:focus { border-color: rgba(var(--argb), 0.7); }
.demo-field::placeholder { color: var(--faint); }

/* Drag lane */
.demo-drag { height: 150px; border: 2px dashed rgba(var(--argb), 0.4); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--ink-3); user-select: none; }

/* Scroll region: a tall inner column with a marker at the far end */
.demo-scroll { height: 220px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 12px; background: #0a090c; padding: 0 18px; }
.demo-scroll .tall { height: 720px; display: flex; flex-direction: column; }
.demo-scroll .top { padding-top: 18px; color: var(--ink-3); font-size: 14px; }
.demo-scroll .bottom { margin-top: auto; padding-bottom: 18px; }
.demo-scroll .marker { display: inline-block; padding: 8px 14px; border-radius: 8px; font-family: var(--mono); font-size: 13px; color: #0b1220; background: var(--a); }

/* Form */
.demo-form { display: grid; gap: 18px; max-width: 560px; }
.demo-form label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 7px; }
.demo-form input[type="text"], .demo-form input[type="email"], .demo-form select, .demo-form textarea {
  width: 100%; padding: 11px 14px; box-sizing: border-box; font-family: var(--sans); font-size: 15px;
  color: var(--ink); background: #0a090c; border: 1.5px solid var(--line-2); border-radius: 10px; outline: none;
  transition: border-color 0.2s ease;
}
.demo-form textarea { min-height: 92px; resize: vertical; }
.demo-form input:focus, .demo-form select:focus, .demo-form textarea:focus { border-color: rgba(var(--argb), 0.7); }
.demo-form .checks { display: flex; flex-wrap: wrap; gap: 16px; }
.demo-form .check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.demo-form .check input { width: 17px; height: 17px; accent-color: var(--a); }
.demo-form .submit { justify-self: start; padding: 12px 26px; border-radius: 8px; border: none; cursor: pointer; font-size: 15px; font-weight: 600; color: #0b1220; background: var(--a); }
.demo-ok { margin-top: 20px; padding: 16px 18px; border-radius: 12px; background: rgba(var(--argb), 0.1); border: 1px solid rgba(var(--argb), 0.3); color: var(--ink-2); font-size: 14px; }
.demo-ok[hidden] { display: none; }
.demo-ok .safe { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* Signals: a row of action buttons + a live log */
.demo-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.demo-action { padding: 11px 18px; border-radius: 9px; cursor: pointer; font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--ink); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-2); transition: border-color 0.2s ease, background 0.2s ease; }
.demo-action:hover { border-color: rgba(var(--argb), 0.5); background: rgba(var(--argb), 0.08); }
.demo-log { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; background: #0a090c; border: 1px solid var(--line-2); border-radius: 10px; padding: 14px 16px; min-height: 96px; max-height: 260px; overflow-y: auto; color: var(--ink-3); }
.demo-log .row { white-space: pre-wrap; word-break: break-word; }
.demo-log .row .lv { color: var(--faint); }
.demo-log .row.warn .lv { color: var(--amber); }
.demo-slow[hidden] { display: none; }
.demo-slow { margin-top: 16px; padding: 14px 18px; border-radius: 12px; background: rgba(var(--argb), 0.1); border: 1px solid rgba(var(--argb), 0.3); color: var(--ink-2); font-size: 14px; }

/* Reading room prose */
.reading { max-width: 720px; }
.reading h2 { font-size: 24px; font-weight: 500; color: var(--ink); margin: 36px 0 12px; }
.reading h3 { font-size: 17px; font-weight: 600; color: var(--ink-2); margin: 26px 0 8px; }
.reading p { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); margin: 0 0 18px; }
.reading ul { margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
.reading li { margin-bottom: 8px; line-height: 1.7; }
.reading blockquote { margin: 24px 0; border-left: 2px solid rgba(var(--argb), 0.5); padding: 4px 0 4px 20px; font-style: italic; color: var(--ink-3); }

/* Capture Studio: an artifact workbench, with no network behavior */
.studio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.studio-stage { position: relative; overflow: hidden; }
.studio-step { margin-bottom: 14px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(var(--argb), 0.78); }
.studio-picker { display: flex; align-items: center; gap: 14px; min-height: 72px; box-sizing: border-box; padding: 13px 16px; border: 1px dashed rgba(var(--argb), 0.38); border-radius: 12px; background: rgba(var(--argb), 0.035); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.studio-picker:hover { border-color: rgba(var(--argb), 0.72); background: rgba(var(--argb), 0.075); transform: translateY(-1px); }
.studio-picker-mark { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 50%; background: var(--a); color: #0b1220; font: 600 24px/1 var(--sans); box-shadow: 0 0 24px rgba(var(--argb), 0.25); }
.studio-picker-mark-file { font-size: 13px; font-family: var(--mono); }
.studio-picker strong, .studio-picker small { display: block; }
.studio-picker strong { color: var(--ink); font-size: 14px; font-weight: 550; }
.studio-picker small { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.studio-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.studio-preview, .studio-note { display: grid; place-items: center; min-height: 210px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; background: radial-gradient(circle at 50% 15%, rgba(var(--argb), 0.06), transparent 55%), #0a090c; }
.studio-preview img { display: block; width: 100%; max-height: 310px; object-fit: contain; }
.studio-note { place-items: stretch; padding: 18px; box-sizing: border-box; }
.studio-note pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.7 var(--mono); color: var(--ink-2); }
.studio-empty { align-self: center; justify-self: center; font-family: var(--mono); font-size: 11.5px; color: var(--faint); letter-spacing: 0.04em; }
.studio-replay { margin-top: 0; }
.studio-drop { position: relative; display: grid; place-items: center; min-height: min(56vw, 470px); overflow: hidden; border: 1px dashed rgba(var(--argb), 0.42); border-radius: 16px; outline: none; background: radial-gradient(circle at center, rgba(var(--argb), 0.08), transparent 52%), #0a090c; transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.studio-drop:focus-visible, .studio-drop.is-ready { border-color: var(--a); box-shadow: inset 0 0 0 1px rgba(var(--argb), 0.2), 0 0 34px rgba(var(--argb), 0.13); background-color: rgba(var(--argb), 0.04); }
.studio-drop.has-replay { border-style: solid; }
.studio-drop-empty { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--ink-2); }
.studio-drop-empty[hidden] { display: none; }
.studio-drop-empty strong { font-size: 17px; font-weight: 550; }
.studio-drop-empty small { color: var(--muted); font-size: 12px; }
.studio-orbit { position: relative; display: block; width: 70px; height: 70px; margin-bottom: 10px; border: 1px solid rgba(var(--argb), 0.28); border-radius: 50%; }
.studio-orbit::before, .studio-orbit::after { content: ""; position: absolute; border: 1px solid rgba(var(--argb), 0.15); border-radius: 50%; }
.studio-orbit::before { inset: 8px; }
.studio-orbit::after { inset: 20px; background: rgba(var(--argb), 0.1); }
.studio-orbit i { position: absolute; z-index: 1; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: var(--a); box-shadow: 0 0 16px rgba(var(--argb), 0.8); }
.studio-drop img { display: block; width: 100%; height: 100%; max-height: 620px; object-fit: contain; }
.studio-drop img[hidden] { display: none; }
.studio-privacy { margin: 4px 0 0; padding-left: 18px; border-left: 1px solid rgba(var(--argb), 0.3); font: 11.5px/1.6 var(--mono); color: var(--faint); }

/* Scenario index cards on the demo landing page */
.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; max-width: 1100px; margin: 8px 0 0; }
.scenario { display: block; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line-2); border-radius: 14px; padding: 22px; color: inherit; transition: transform 0.2s ease, border-color 0.2s ease; }
.scenario:hover { transform: translateY(-4px); border-color: rgba(var(--argb), 0.45); color: inherit; }
.scenario-featured { grid-column: 1 / -1; min-height: 154px; padding-right: min(38%, 390px); background: radial-gradient(circle at 82% 45%, rgba(251, 191, 36, 0.13), transparent 25%), linear-gradient(135deg, rgba(94, 234, 212, 0.055), rgba(255, 255, 255, 0.018)); border-color: rgba(94, 234, 212, 0.22); }
.scenario-featured h3 { font-size: 24px; }
.scenario-featured .n { color: var(--amber); }
.scenario .n { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(var(--argb), 0.8); }
.scenario h3 { font-size: 19px; color: var(--ink); margin: 8px 0 6px; }
.scenario p { margin: 0 0 12px; font-size: 14px; color: var(--ink-3); line-height: 1.6; }
.scenario .tools { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

@media (max-width: 720px) {
  .studio-grid { grid-template-columns: 1fr; gap: 0; }
  .studio-drop { min-height: 360px; }
  .scenario-featured { padding-right: 22px; }
}
