/* ============================================================
   creation path · editorial-warm system
   ============================================================ */

:root {
  --bg: oklch(0.97 0.012 80);
  --bg-2: oklch(0.94 0.014 80);
  --paper: oklch(0.99 0.008 80);
  --ink: oklch(0.22 0.015 50);
  --ink-2: oklch(0.36 0.012 50);
  --ink-3: oklch(0.55 0.012 50);
  --ink-4: oklch(0.72 0.012 50);
  --line: oklch(0.88 0.018 80);
  --line-strong: oklch(0.78 0.02 80);
  --accent: oklch(0.62 0.13 40);
  --accent-soft: oklch(0.92 0.04 40);
  --sage: oklch(0.55 0.06 150);
  --sage-soft: oklch(0.92 0.03 150);

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --r-1: 6px;
  --r-2: 10px;
  --r-3: 16px;

  --shadow-1: 0 1px 0 oklch(0.88 0.018 80 / 0.6), 0 0.5px 0 oklch(1 0 0 / 0.5) inset;
  --shadow-2: 0 1px 2px oklch(0.5 0.01 50 / 0.06), 0 8px 24px -16px oklch(0.3 0.02 50 / 0.18);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: var(--mono); font-size: 0.86em; }
.dim { color: var(--ink-3); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 110%, var(--sage-soft) 0%, transparent 60%),
    var(--bg);
}
.app-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.app.screen-editor { background: var(--bg); }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 0; cursor: pointer; color: var(--ink);
  font-family: var(--serif); font-size: 18px; letter-spacing: -0.01em;
  padding: 0;
  white-space: nowrap;
}
.brand-name { white-space: nowrap; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name { font-style: italic; font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  padding: 2px;
}
.lang-btn {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 5px 10px; border-radius: 999px;
  color: var(--ink-3);
}
.lang-btn.is-active { background: var(--ink); color: var(--paper); }

/* ============================================================
   Buttons & atoms
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: var(--r-1);
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: oklch(0.16 0.015 50); }
.btn-primary:disabled { background: var(--ink-4); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.link-btn {
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  color: var(--ink-2); font-family: var(--sans); font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.link-btn:hover { color: var(--ink); }

.pill {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
  background: var(--paper);
}
.pill-muted { color: var(--ink-3); border-color: var(--line); }
.pill-accent { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.input {
  width: 100%;
  font-family: var(--sans); font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--paper); color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px oklch(0.22 0.015 50 / 0.08); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input-flat { border: 0; background: var(--bg-2); border-radius: 999px; padding: 9px 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3);
}

.chip {
  font-family: var(--mono); font-size: 11px; text-transform: lowercase;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--paper);
  color: var(--ink-2); cursor: pointer;
}
.chip.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   Welcome
   ============================================================ */
.welcome {
  display: flex; align-items: center; justify-content: center;
  flex: 1; padding: 60px 24px;
}
.welcome-inner { max-width: 720px; width: 100%; }
.welcome .display { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(40px, 6vw, 72px); line-height: 1.05; letter-spacing: -0.02em; margin: 18px 0 18px; }
.welcome .word { display: inline-block; opacity: 0; transform: translateY(8px); animation: rise 0.6s ease forwards; }
.welcome .word:nth-child(1){animation-delay:0.05s}
.welcome .word:nth-child(2){animation-delay:0.12s}
.welcome .word:nth-child(3){animation-delay:0.19s}
.welcome .word:nth-child(4){animation-delay:0.26s}
.welcome .word:nth-child(5){animation-delay:0.33s}
.welcome .word:nth-child(6){animation-delay:0.4s}
.welcome .word:nth-child(7){animation-delay:0.47s}
.welcome .word:nth-child(8){animation-delay:0.54s}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.lede { font-size: 18px; color: var(--ink-2); max-width: 56ch; margin: 0 0 28px; text-wrap: pretty; }
.welcome-actions { display: flex; align-items: center; gap: 18px; }
.welcome-meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.welcome-figure { margin-top: 56px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 24px; }

/* ============================================================
   Wizard
   ============================================================ */
.wizard {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 28px 56px;
  display: flex; flex-direction: column; gap: 28px;
  flex: 1;
}
.stepper { display: flex; flex-direction: column; gap: 10px; }
.stepper-meta { display: flex; align-items: baseline; gap: 14px; }
.stepper-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); }
.stepper-num { font-family: var(--serif); font-size: 28px; font-style: italic; color: var(--ink); white-space: nowrap; }
.stepper-meta { flex-wrap: nowrap; }
.stepper-num em { color: var(--ink-4); font-style: normal; margin: 0 4px; }
.roman { letter-spacing: 0.04em; }
.stepper-track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.stepper-tick { height: 3px; background: var(--line); border-radius: 999px; transition: background 0.3s ease; }
.stepper-tick.is-done { background: var(--ink-2); }
.stepper-tick.is-current { background: var(--accent); }

.wizard-body { flex: 1; }
.wizard-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* Step head */
.step { display: flex; flex-direction: column; gap: 28px; }
.step-head { display: flex; flex-direction: column; gap: 8px; max-width: 60ch; }
.step-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
.step-sub { font-size: 16px; color: var(--ink-2); margin: 0; text-wrap: pretty; }

/* Grids */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 880px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

.card-opt {
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 20px 18px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  font: inherit; color: inherit;
  min-height: 160px;
}
.card-opt:hover { border-color: var(--line-strong); }
.card-opt.is-selected {
  border-color: var(--ink);
  box-shadow: var(--shadow-2);
}
.opt-glyph {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-1);
  font-family: var(--serif); font-style: italic; font-size: 18px;
  color: var(--accent);
  background: var(--bg);
}
.opt-title { font-family: var(--serif); font-size: 20px; letter-spacing: -0.01em; }
.opt-desc { font-size: 13px; color: var(--ink-2); text-wrap: pretty; }
.opt-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: auto; text-transform: lowercase; letter-spacing: 0.04em; }

/* Step 3 form */
.ai-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.provider-row { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 720px) { .ai-form { grid-template-columns: 1fr; } }

/* Step 4 form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* Step 5 notebook */
.notebook-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper);
  padding: 22px;
}
.notebook-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-1);
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.notebook-name { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.notebook-empty { font-family: var(--mono); color: var(--ink-4); padding: 20px 0; }
.notebook-files {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 14px 0;
}
.nb-file {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  padding: 8px 10px; background: var(--bg); border: 1px dashed var(--line); border-radius: var(--r-1);
}
.nb-glyph { color: var(--accent); }
.notebook-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ok-line { font-family: var(--mono); font-size: 12px; color: var(--sage); display: inline-flex; align-items: center; gap: 6px; }

/* Step 6 structure */
.structure-card {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--paper);
  overflow: hidden;
}
.structure-meta {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex-wrap: wrap;
}
.structure-title { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

.tree { list-style: none; margin: 0; padding: 8px 0; }
.tree-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px;
  font-family: var(--mono); font-size: 13px;
  color: var(--ink-2);
  cursor: default;
}
.tree-glyph { color: var(--ink-3); display: inline-flex; }
.tree-name { flex: 1; }
.tree-name.is-dir { color: var(--ink); font-weight: 500; }
.tree-bytes { font-size: 11px; color: var(--ink-4); }

/* ============================================================
   Editor
   ============================================================ */
.editor {
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  gap: 0;
  flex: 1;
  min-height: 0;
  background: var(--bg);
}
@media (max-width: 1120px) {
  .editor { grid-template-columns: 220px 1fr 300px; }
}
@media (max-width: 920px) {
  .editor { grid-template-columns: 1fr; grid-auto-rows: min-content; }
}

.ed-left, .ed-right {
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.ed-right { border-right: 0; border-left: 1px solid var(--line); padding: 14px; gap: 14px; overflow-y: auto; }
.ed-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.ed-block { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px; border-bottom: 1px dashed var(--line); }
.ed-right .ed-block { padding: 0; border-bottom: 0; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--paper); overflow: hidden; }
.ed-block-grow { flex: 1; min-height: 0; }
.ed-right .ed-block-grow { display: flex; flex-direction: column; }

.ed-block-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.ed-left .ed-block-head { background: transparent; border-bottom: 0; padding: 4px 6px; }
.ed-block-title { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.ed-block-meta { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-4); }

.tree-compact { padding: 0; }
.tree-compact .tree-row { padding: 5px 8px; cursor: pointer; border-radius: 4px; }
.tree-compact .tree-row:hover { background: var(--bg-2); }
.tree-compact .tree-row.is-active { background: var(--ink); color: var(--paper); }
.tree-compact .tree-row.is-active .tree-glyph { color: var(--paper); }
.tree-compact .tree-row.is-dir { color: var(--ink); }

.skill-search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--bg);
  color: var(--ink-3);
}
.skill-search-input {
  flex: 1; border: 0; background: transparent;
  font-family: var(--mono); font-size: 12px;
  outline: none; color: var(--ink);
}
.skill-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 2px; max-height: calc(100vh - 360px); }
.skill-group { display: flex; flex-direction: column; gap: 2px; }
.skill-group-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-4); padding: 6px 4px 2px;
}
.skill-row {
  text-align: left; background: transparent; border: 0;
  padding: 7px 8px; border-radius: 4px; cursor: pointer;
  display: flex; flex-direction: column; gap: 1px;
}
.skill-row:hover { background: var(--bg-2); }
.skill-row.is-on { background: var(--accent-soft); }
.skill-name { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.skill-desc { font-size: 11px; color: var(--ink-3); }

/* Center editor */
.ed-tabs {
  display: flex; align-items: stretch; gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 0 6px;
}
.ed-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px;
  padding: 12px 14px;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
}
.ed-tab.is-active { color: var(--ink); border-color: var(--accent); }
.ed-tab-spacer { flex: 1; }
.ed-back {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px;
  color: var(--ink-3); padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.ed-back:hover { color: var(--ink); }

.code-area {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
}
.code {
  flex: 1; min-height: 0;
  margin: 0; padding: 18px 0;
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(to right, var(--bg-2) 0, var(--bg-2) 44px, transparent 44px),
    var(--paper);
}
.code-line { display: flex; padding: 0 18px 0 0; }
.code-num { width: 44px; text-align: right; padding-right: 14px; color: var(--ink-4); user-select: none; }
.code-text { white-space: pre; }
.code-line-ghost .ghost-text { color: var(--ink-4); font-style: italic; }
.cursor-blink { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.tk-c { color: var(--ink-4); font-style: italic; }
.tk-s { color: var(--sage); }
.tk-t { color: var(--accent); }
.tk-k { color: oklch(0.45 0.1 280); font-weight: 500; }

.code-foot {
  display: flex; justify-content: space-between;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}

/* Right column — agent */
.agent-thread {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
}
.msg { display: flex; flex-direction: column; gap: 4px; }
.msg-user { align-items: flex-end; }
.msg-bubble {
  font-size: 13px; line-height: 1.5;
  padding: 8px 12px; border-radius: 10px;
  max-width: 90%;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line);
}
.msg-user .msg-bubble { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg-skill .msg-bubble { font-family: var(--mono); font-size: 12px; background: var(--accent); color: var(--paper); border-color: var(--accent); }
.msg-edit-meta {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 4px;
}

.agent-input {
  display: flex; gap: 6px; padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.tab-row { display: inline-flex; gap: 4px; }
.tab {
  background: none; border: 0; cursor: pointer;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 6px 10px; color: var(--ink-3); border-radius: 4px;
}
.tab.is-on { background: var(--ink); color: var(--paper); }

/* Preview */
.preview { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; }
.browser-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 6px 6px 0 0;
}
.browser-chrome .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.d-r { background: oklch(0.7 0.15 25); }
.dot.d-y { background: oklch(0.85 0.13 90); }
.dot.d-g { background: oklch(0.75 0.13 150); }
.browser-url {
  margin-left: 8px;
  flex: 1;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.preview-stage {
  flex: 1; min-height: 180px;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px;
  background: var(--paper);
  overflow: hidden;
  position: relative;
  font-size: 11px;
}
/* Mini preview variants */
.prev-landing { padding: 16px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.prev-display { font-family: var(--serif); font-size: 22px; font-style: italic; line-height: 1.1; letter-spacing: -0.01em; }
.prev-lede { font-size: 11px; color: var(--ink-3); }
.prev-cta { font-family: var(--mono); font-size: 10px; color: var(--accent); margin-top: 4px; }
.prev-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.prev-strip > div { height: 32px; background: var(--bg-2); border: 1px dashed var(--line); border-radius: 4px; }

.prev-app { display: grid; grid-template-columns: 60px 1fr; height: 100%; }
.prev-app-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 10px 8px; display: flex; flex-direction: column; gap: 6px; }
.prev-app-row { height: 8px; background: var(--line); border-radius: 4px; }
.prev-app-row.a { background: var(--accent); }
.prev-app-main { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.prev-app-h { font-family: var(--serif); font-size: 18px; font-style: italic; }
.prev-app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.prev-app-grid > div { height: 30px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; }

.prev-ai { padding: 14px; display: flex; flex-direction: column; gap: 6px; height: 100%; }
.prev-ai-bubble { font-size: 11px; padding: 6px 10px; border-radius: 10px; max-width: 80%; }
.prev-ai-bubble.agent { background: var(--bg-2); align-self: flex-start; }
.prev-ai-bubble.user { background: var(--ink); color: var(--paper); align-self: flex-end; }
.prev-ai-input { margin-top: auto; padding: 8px; background: var(--bg-2); border-radius: 6px; font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* Console */
.console { padding: 10px 12px; font-family: var(--mono); font-size: 11px; line-height: 1.6; min-height: 200px; }
.console-line { display: flex; gap: 10px; }
.console-time { color: var(--ink-4); }
.console-text { color: var(--ink-2); }

.deploy-cta { width: 100%; justify-content: center; }
.dot-online { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); margin-left: auto; }

.dots { display: inline-flex; gap: 3px; }
.dots i { width: 4px; height: 4px; background: var(--ink-3); border-radius: 50%; animation: bob 1.2s ease-in-out infinite; }
.dots i:nth-child(2){ animation-delay: 0.15s; }
.dots i:nth-child(3){ animation-delay: 0.3s; }
@keyframes bob { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-3px); opacity: 1; } }

/* Tutor */
.tutor {
  position: fixed;
  bottom: 24px; left: 280px;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 14px;
  box-shadow: var(--shadow-2);
  z-index: 60;
  animation: pop 0.3s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.tutor::before {
  content: "";
  position: absolute; left: -8px; bottom: 22px;
  width: 14px; height: 14px;
  background: var(--paper);
  border-left: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: rotate(45deg);
}
.tutor-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tutor-icon { color: var(--accent); display: inline-flex; }
.tutor-title { font-family: var(--serif); font-style: italic; font-size: 16px; }
.tutor-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 2px; }
.tutor-body { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.tutor-foot { display: flex; gap: 6px; flex-wrap: wrap; }
.tutor-chip { font-family: var(--mono); font-size: 11px; background: var(--bg-2); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }

/* ============================================================
   Deploy modal
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: oklch(0.22 0.015 50 / 0.4);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: fade 0.25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 28px;
  box-shadow: 0 30px 80px -20px oklch(0.22 0.015 50 / 0.3);
  animation: pop 0.3s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-eyebrow { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--ink-3); padding: 4px; }
.modal-title { font-family: var(--serif); font-style: italic; font-size: 26px; line-height: 1.15; margin: 0 0 18px; }

.phase-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.phase { display: flex; align-items: center; gap: 12px; color: var(--ink-3); }
.phase.is-active { color: var(--ink); }
.phase.is-done { color: var(--sage); }
.phase-glyph { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.phase.is-done .phase-glyph { background: var(--sage-soft); color: var(--sage); }
.phase.is-active .phase-glyph { background: var(--accent-soft); color: var(--accent); }
.dot-pending { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-strong); }
.spinner { width: 14px; height: 14px; border: 1.5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.phase-label { font-size: 14px; }

.modal-progress { height: 2px; background: var(--line); border-radius: 999px; overflow: hidden; }
.modal-progress-fill { height: 100%; background: var(--accent); transition: width 0.5s ease; }

.success-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sage-soft); color: var(--sage);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  animation: pop 0.4s ease;
}
.url-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.url-label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); }
.url-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.url-code { flex: 1; font-family: var(--mono); font-size: 14px; color: var(--ink); background: transparent; word-break: break-all; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }

/* ============================================================
   Live app
   ============================================================ */
.live { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.live-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.live-url {
  flex: 1;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--mono); font-size: 12px; color: var(--ink-2);
  max-width: 460px;
  margin: 0 auto;
}
.live-stage { flex: 1; overflow: auto; padding: 24px; background: var(--bg-2); }

/* Live landing */
.live-landing { max-width: 920px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.ll-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.ll-cta { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.ll-hero { padding: 56px 40px 32px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ll-hero .display { font-family: var(--serif); font-style: italic; font-size: clamp(36px, 4.5vw, 56px); line-height: 1.05; margin: 0; }
.ll-actions { display: flex; gap: 10px; margin: 6px 0 18px; }
.ll-figure { width: 100%; color: var(--ink-3); }
.ll-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.ll-three article { padding: 24px 28px; border-right: 1px solid var(--line); }
.ll-three article:last-child { border-right: 0; }
.ll-three h4 { font-family: var(--serif); font-style: italic; font-size: 18px; margin: 0 0 6px; }
.ll-three p { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 720px) {
  .ll-three { grid-template-columns: 1fr; }
  .ll-three article { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Live site */
.live-site { max-width: 920px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.live-site-nav { display: flex; gap: 18px; align-items: center; padding: 16px 28px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.live-site-nav .brand-name { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink); margin-right: auto; }
.live-site-hero { padding: 48px 40px; }
.live-site-hero h1 { font-family: var(--serif); font-style: italic; font-size: 44px; margin: 0 0 12px; }
.live-site-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.live-site-grid article { padding: 24px; border-right: 1px solid var(--line); }
.live-site-grid article:last-child { border-right: 0; }
.live-site-grid h4 { font-family: var(--serif); font-style: italic; font-size: 18px; margin: 0 0 6px; }
.live-site-grid p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* Live app */
.live-app { max-width: 1100px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; display: grid; grid-template-columns: 220px 1fr; min-height: 540px; }
.live-app-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 22px; }
.live-app-brand { font-family: var(--serif); font-style: italic; font-size: 20px; }
.live-app-nav { display: flex; flex-direction: column; gap: 6px; }
.live-app-nav span { padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.live-app-nav .is-on { background: var(--ink); color: var(--paper); }
.live-app-main { padding: 28px 32px; display: flex; flex-direction: column; gap: 18px; }
.live-app-main h2 { font-family: var(--serif); font-style: italic; font-size: 28px; margin: 0; }
.live-app-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card-soft { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 14px 16px; }
.card-soft h4 { font-family: var(--serif); font-style: italic; font-size: 26px; margin: 0; }
.card-soft span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.live-app-table { border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; background: var(--paper); }
.lt-row { display: grid; grid-template-columns: 1fr 120px 80px; padding: 10px 16px; font-size: 14px; border-top: 1px solid var(--line); }
.lt-row:first-child { border-top: 0; }
.lt-row.lt-head { background: var(--bg-2); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.lt-row .ok { color: var(--sage); }
.lt-row .warn { color: var(--accent); }

/* Live AI */
.live-ai { max-width: 720px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; min-height: 540px; display: flex; flex-direction: column; }
.live-ai-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.live-ai-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 18px; }
.live-ai-name { font-family: var(--serif); font-style: italic; font-size: 18px; }
.live-ai-status { font-family: var(--mono); font-size: 11px; color: var(--sage); }
.live-ai-thread { flex: 1; padding: 22px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.bubble { padding: 10px 14px; border-radius: 14px; max-width: 80%; font-size: 14px; line-height: 1.5; }
.bubble.agent { background: var(--bg-2); align-self: flex-start; border: 1px solid var(--line); }
.bubble.user { background: var(--ink); color: var(--paper); align-self: flex-end; }
.live-ai-input { display: flex; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg-2); font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
