:root {
  color-scheme: light;
  --paper: #ffffff;
  --screen: #fafaf8;
  --ink: #18181b;
  --ink-soft: #55555e;
  --line: rgba(24, 24, 27, 0.12);
  --line-strong: rgba(24, 24, 27, 0.24);
  --lavender: #ea3f76;
  --lavender-soft: #fdeef4;
  --coral: #f2683a;
  --green: #3d9a67;
  --gold: #c2531f;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", monospace;
  --sans: "JetBrains Mono", "SFMono-Regular", Consolas, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html,
body { min-width: 320px; min-height: 100%; margin: 0; }

html {
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input { font: inherit; }

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intro-stage {
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  place-items: center;
  padding: 8px;
  background: #fff;
}

.computer-scene {
  position: relative;
  width: min(94vw, 1560px, calc((100svh - 18px) * 1.547619));
  aspect-ratio: 1560 / 1008;
  transform-origin: 50% 49%;
  will-change: transform, opacity, filter;
}

.screen-workspace {
  position: absolute;
  z-index: 1;
  inset: 9.5% 12.2% 25.8%;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: clamp(27px, 3vw, 42px) minmax(0, 1fr) clamp(38px, 4vw, 54px) clamp(24px, 2.7vw, 36px);
  overflow: hidden;
  border-radius: 3px;
  background: var(--screen);
  box-shadow: inset 0 0 0 1px rgba(45, 47, 56, 0.04);
  color: var(--ink);
}

.device-bezel {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.workspace-topbar,
.workspace-statusbar {
  display: flex;
  min-width: 0;
  align-items: center;
  border-color: var(--line);
  font-family: var(--mono);
  font-size: clamp(11px, 0.82vw, 13px);
  font-weight: 400;
  letter-spacing: 0;
}

.workspace-topbar {
  gap: 14px;
  justify-content: space-between;
  padding: 0 clamp(10px, 1.45vw, 22px);
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 252, 0.97);
}

.workspace-tab,
.workspace-connection { display: inline-flex; align-items: center; }
.workspace-tab { min-width: 0; gap: 8px; color: var(--ink); font-weight: 400; }
.tab-glyph {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(87, 99, 201, 0.24);
  border-radius: 7px;
  background: linear-gradient(135deg, #5666db 0%, #7d88ea 58%, #9ea6ef 100%);
  box-shadow: 0 3px 7px rgba(89, 103, 213, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #fff;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.tab-glyph::after {
  position: absolute;
  top: -8px;
  left: -5px;
  width: 20px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  content: "";
  transform: rotate(-28deg);
}
.tab-glyph b {
  position: relative;
  z-index: 1;
  font: 600 10px/1 var(--mono);
  letter-spacing: -0.08em;
}
.tab-glyph i {
  position: absolute;
  z-index: 1;
  right: 4px;
  bottom: 4px;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #f6f7ff;
  box-shadow: 0 0 0 2px rgba(86, 102, 219, 0.25);
}
.workspace-tab:hover .tab-glyph {
  box-shadow: 0 5px 11px rgba(89, 103, 213, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px) rotate(-1.5deg);
}
.tab-version,
.workspace-path { color: var(--ink-soft); font-weight: 400; }
.workspace-path { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-connection { flex: 0 0 auto; gap: 5px; color: var(--ink-soft); font-weight: 400; text-transform: uppercase; }
.workspace-connection i,
.effort-toggle i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 144, 53, 0.12);
}
.workspace-connection.is-ready i { background: var(--green); box-shadow: 0 0 0 3px rgba(108, 167, 132, 0.13); }

.workspace-console {
  --agent-column-offset: calc(clamp(54px, 7.1vw, 94px) + clamp(10px, 1.4vw, 20px));
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(14px, 2.2vw, 34px) clamp(18px, 3.6vw, 56px) clamp(10px, 1.5vw, 22px);
  scrollbar-width: thin;
  scrollbar-color: rgba(108, 120, 216, 0.45) transparent;
}
.workspace-console::-webkit-scrollbar { width: 7px; }
.workspace-console::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 99px; background: rgba(108, 120, 216, 0.42); background-clip: padding-box; }

.agent-banner {
  display: flex;
  align-items: flex-start;
  gap: clamp(10px, 1.4vw, 20px);
  padding-bottom: clamp(10px, 1.4vw, 18px);
  border-bottom: 1px dashed var(--line);
}

.pet-button {
  position: relative;
  display: grid;
  width: clamp(54px, 7.1vw, 94px);
  height: clamp(54px, 7.1vw, 94px);
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.pet-button::after {
  position: absolute;
  z-index: -1;
  right: 4%;
  bottom: 7%;
  width: 64%;
  height: 15%;
  border-radius: 50%;
  background: rgba(108, 120, 216, 0.11);
  content: "";
  filter: blur(5px);
}
.pet-button picture {
  display: block;
  width: 100%;
  height: 100%;
}
.pet-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 240ms var(--ease);
}
.pet-button:hover img { transform: translateY(-3px) rotate(-2deg); }
.pet-button img.is-thinking { animation: pet-bounce 440ms var(--ease) 2; }
@keyframes pet-bounce {
  50% { transform: translateY(-6px) rotate(2deg); }
}

.agent-copy { min-width: 0; font-family: var(--mono); font-weight: 400; }
.agent-copy p { margin: 0; }
.shell-command { color: var(--ink-soft); font-size: clamp(11px, 0.9vw, 14px); font-weight: 400; }
.shell-command span { color: var(--lavender); }
.shell-command strong { color: var(--gold); font-weight: 400; }
.agent-copy h1 {
  margin: 4px 0 5px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.agent-copy h1 span { margin-left: .35em; color: var(--lavender); font-size: 0.42em; font-weight: 400; letter-spacing: 0; }
.agent-copy > p:not(.shell-command):not(.agent-path) { color: var(--ink); font-size: clamp(12px, 0.95vw, 15px); font-weight: 400; }
.agent-path { margin-top: 4px !important; color: var(--ink-soft); font-size: clamp(11px, 0.85vw, 13px); font-weight: 400; }

.console-log,
.console-runtime {
  max-width: 870px;
  margin-left: var(--agent-column-offset);
  font-family: var(--mono);
  font-size: clamp(12px, 1.02vw, 16px);
  font-weight: 400;
  line-height: 1.58;
}
.console-log { padding-top: clamp(10px, 1.4vw, 18px); }
.console-runtime { padding-top: 2px; }

.console-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 1.58em;
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}
.console-line + .console-line { margin-top: 3px; }
.console-line.is-command { margin-top: 12px; font-weight: 400; }
.console-line.is-command:first-child { margin-top: 0; }
.console-user { color: var(--lavender); }
.console-path { color: var(--green); }
.console-sign { color: var(--gold); }
.console-command { color: var(--ink); font-weight: 400; }
.console-line.is-output { color: var(--ink-soft); }
.console-line.is-output::before { color: var(--green); content: "\2192"; }
.console-line.is-project {
  display: grid;
  grid-template-columns: 30px minmax(166px, 188px) 1fr;
  gap: 10px;
  padding-left: 15px;
  color: var(--ink-soft);
}
.console-line.is-project span:first-child { color: var(--lavender); }
.console-line.is-project span:nth-child(2) { color: var(--ink); font-weight: 400; }
.console-line.is-quote { display: block; padding-left: 15px; color: var(--gold); font-size: 1.08em; font-weight: 400; }
.console-line.is-system { color: var(--green); }
.console-line.is-error { color: var(--coral); }
.console-line.is-thinking { color: var(--lavender); font-weight: 400; }
.console-line.is-thinking::before { color: #8490e4; content: "…"; font-weight: 400; }
.console-line.is-assistant {
  display: block;
  max-width: 70ch;
  margin-top: 7px;
  padding: 7px 10px 8px;
  border-left: 2px solid rgba(234, 63, 118, 0.6);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(238, 240, 255, 0.74), rgba(255, 255, 255, 0));
  color: var(--ink);
  font-weight: 400;
  line-height: 1.62;
  white-space: pre-wrap;
}
.console-line.is-assistant::before {
  display: block;
  margin-bottom: 3px;
  color: var(--lavender);
  content: "JENNY / REPLY";
  font-size: 0.76em;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.canvas-action {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  margin: 16px 0 4px;
  border: 1px solid rgba(90, 102, 197, 0.23);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 16px rgba(68, 78, 150, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 0.84em;
  font-weight: 400;
}
.canvas-action > span {
  display: flex;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(238, 240, 255, 0.88), rgba(249, 250, 255, 0.76));
  box-shadow: none;
  color: #6571cf;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-action > span::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: #8290ed;
  box-shadow: 0 0 0 3px rgba(130, 144, 237, 0.14);
  content: "";
}
.canvas-action a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(41, 42, 47, 0.06);
  border-radius: 7px;
  background: linear-gradient(135deg, #343640, #26272e);
  box-shadow: 0 3px 8px rgba(35, 36, 45, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.9em;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-decoration: none;
  transition: background 180ms var(--ease), box-shadow 180ms var(--ease), transform 180ms var(--ease);
}
.canvas-action a::after {
  margin-left: 7px;
  color: #cbd0ff;
  content: "↗";
  font-size: 1.18em;
  line-height: 1;
}
.canvas-action a:hover {
  background: linear-gradient(135deg, #4c5bd0, #6574e3);
  box-shadow: 0 5px 12px rgba(86, 102, 216, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.chat-composer {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(11px, 1.55vw, 23px);
  border-top: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 400;
}
.composer-prompt { color: var(--lavender); font-size: clamp(14px, 1.25vw, 19px); font-weight: 400; }
.chat-composer input {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 400;
}
.chat-composer input::placeholder { color: #6f727c; font-weight: 400; opacity: 1; }
.composer-send {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 0 2px;
  border: 1px solid rgba(108, 120, 216, 0.45);
  border-radius: 5px;
  background: var(--lavender-soft);
  color: var(--lavender);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}
.composer-send:hover { background: var(--lavender); color: #fff; transform: translate(1px, -1px); }
.chat-composer.is-waiting { background: linear-gradient(90deg, #fff, rgba(241, 243, 255, 0.76), #fff); }
.composer-send:disabled { cursor: wait; opacity: 0.6; transform: none; }

.workspace-statusbar {
  justify-content: space-between;
  gap: 10px;
  padding: 0 clamp(11px, 1.55vw, 23px);
  border-top: 1px solid var(--line);
  background: #fbfbfc;
  color: var(--ink-soft);
  font-size: clamp(11px, 0.85vw, 13px);
  font-weight: 400;
}
.status-left { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chevrons { color: var(--coral); letter-spacing: -0.1em; }
.status-hint { color: #a0a1a8; }
.effort-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.effort-toggle i { width: 5px; height: 5px; background: var(--lavender); box-shadow: none; }
.effort-command { color: var(--ink-soft); }
.effort-toggle:hover { color: var(--lavender); }

.noscript-entry {
  position: fixed;
  bottom: 20px;
  left: 50%;
  color: var(--ink);
  font-family: var(--mono);
  transform: translateX(-50%);
}

.intro-page.is-entering .chat-composer,
.intro-page.is-entering .workspace-statusbar,
.intro-page.is-entering .workspace-console { pointer-events: none; }
.intro-page.is-css-entering .computer-scene { animation: computer-exit 680ms var(--ease) forwards; }
@keyframes computer-exit {
  to { opacity: 0; filter: blur(7px); transform: scale(1.1); }
}

@media (max-width: 720px) {
  .intro-stage {
    min-height: 100dvh;
    padding: 0;
    place-items: stretch;
  }
  /* full-bleed terminal: no phone chrome, the terminal fills the screen */
  .computer-scene {
    position: relative;
    width: 100%;
    height: 100dvh;
    max-width: none;
    aspect-ratio: auto;
    background: var(--screen);
    border-radius: 0;
    padding: 0;
    box-shadow: none;
  }
  .device-bezel { display: none; }
  .screen-workspace {
    position: static;
    inset: auto;
    width: 100%;
    height: 100dvh;
    grid-template-rows: 44px minmax(0, 1fr) 52px 30px;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    background: var(--screen);
  }
  .workspace-topbar { gap: 7px; padding-inline: 16px; }
  .workspace-path { display: none; }
  .workspace-console {
    --agent-column-offset: 0px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 16px 14px;
  }
  .agent-banner {
    gap: 11px;
    margin-top: 0;
    padding-bottom: 14px;
  }
  .agent-path { display: block; }
  .pet-button { width: 50px; height: 50px; }
  .agent-copy h1 { font-size: 23px; }
  .agent-copy > p:not(.shell-command):not(.agent-path) { max-width: none; }
  .console-log,
  .console-runtime { max-width: none; margin-left: 0; font-size: 12px; }
  .console-log { padding-top: 14px; }
  .console-line.is-project { grid-template-columns: 26px minmax(118px, 1fr) minmax(0, 1fr); gap: 5px 9px; }
  .console-line.is-project span:last-child { grid-column: 2; }
  .canvas-action { margin: 12px 0 0; font-size: 0.82em; }
  .status-hint,
  .effort-command { display: none; }
}

@media (max-width: 374px) {
  .workspace-topbar,
  .chat-composer,
  .workspace-statusbar { padding-inline: 12px; }
  .workspace-console { padding-inline: 14px; }
  .agent-copy h1 { font-size: 22px; }
  .console-log,
  .console-runtime { font-size: 11.5px; }
}

@media (max-height: 800px) and (min-width: 721px) {
  .computer-scene { width: min(94vw, calc((100svh - 18px) * 1.547619)); }
  .screen-workspace { grid-template-rows: 29px minmax(0, 1fr) 38px 25px; }
  .workspace-console { --agent-column-offset: 63px; padding-top: 9px; padding-bottom: 5px; }
  .agent-banner { gap: 9px; padding-bottom: 7px; }
  .pet-button { width: 54px; height: 54px; }
  .agent-copy h1 { font-size: clamp(18px, 1.8vw, 23px); }
  .agent-path { margin-top: 2px !important; }
  .console-log { padding-top: 6px; }
  .console-line.is-command { margin-top: 6px; }
  .canvas-action { margin-top: 8px; }
}

@media (max-height: 640px) and (min-width: 721px) {
  .screen-workspace { grid-template-rows: 27px minmax(0, 1fr) 34px 22px; }
  .workspace-topbar,
  .workspace-statusbar { font-size: 10px; }
  .tab-glyph { width: 19px; height: 19px; }
  .workspace-console {
    --agent-column-offset: 54px;
    padding-top: 6px;
    padding-bottom: 2px;
  }
  .agent-banner { gap: 8px; padding-bottom: 4px; }
  .pet-button { width: 46px; height: 46px; }
  .agent-copy h1 {
    margin: 0 0 3px;
    font-size: 20px;
    line-height: 1;
  }
  .agent-copy > p:not(.shell-command):not(.agent-path) {
    font-size: 10.5px;
    line-height: 1.2;
  }
  .agent-path {
    font-size: 9.5px;
    line-height: 1.2;
  }
  .console-log,
  .console-runtime {
    font-size: 11px;
    line-height: 1.4;
  }
  .console-log { padding-top: 4px; }
  .console-line { min-height: 1.4em; gap: 7px; }
  .console-line + .console-line { margin-top: 1px; }
  .console-line.is-command { margin-top: 4px; }
  .console-line.is-project {
    grid-template-columns: 25px minmax(130px, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding-left: 12px;
  }
  .canvas-action {
    margin-top: 5px;
    font-size: 0.78em;
  }
  .canvas-action > span,
  .canvas-action a {
    min-height: 27px;
    padding-inline: 9px;
  }
  .composer-prompt { font-size: 13px; }
  .chat-composer input { font-size: 11px; }
  .composer-send { width: 20px; height: 20px; }
}

@media (max-height: 520px) and (min-width: 721px) {
  .workspace-console { padding-top: 2px; }
  .agent-banner { padding-bottom: 2px; }
  .console-log { padding-top: 2px; }
  .console-line {
    min-height: 1.34em;
    line-height: 1.34;
  }
  .canvas-action { margin-top: 2px; }
  .canvas-action > span,
  .canvas-action a { min-height: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.intro-page strong,
.intro-page b,
.intro-page h1 {
  font-weight: 400;
}
