:root {
  --bg: #070707;
  --lime: #c8f060;
  --lime-deep: #b6e04a;
  --ink: #141414;
  --card: #161616;
  --card-2: #1b1b1b;
  --line: rgba(255, 255, 255, 0.06);
  --muted: #989898;
  --text: #f2f2f2;
  --field: #242424;
  --radius: 28px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Geist, Manrope, "Segoe UI", sans-serif;
  letter-spacing: -0.02em;
  overflow: hidden;
}

button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(980px 460px at 50% -120px, rgba(88, 112, 28, 0.55), transparent 68%),
    radial-gradient(700px 280px at 70% 8%, rgba(40, 58, 12, 0.35), transparent 70%),
    #070707;
}
.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: center top;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  padding: 0;
}
.word {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.045em;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.06em;
  flex: none;
}
.mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 15px;
}

.top-actions { display: flex; align-items: center; gap: 10px; }
.login, .ghost {
  background: rgba(18, 18, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.login:hover, .ghost:hover { border-color: rgba(255, 255, 255, 0.22); }
.ghost { color: var(--muted); }

.stage {
  height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(18px, 3vw, 64px);
  align-items: center;
  padding: 0 28px 128px;
  max-width: 1480px;
  margin: 0 auto;
}

.copy { max-width: 640px; padding-bottom: 12px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1a1a1a;
  border: 1px solid #2c2c2c;
  color: #c6c6c6;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
h1 {
  margin: 20px 0 0;
  font-size: clamp(44px, 4.8vw, 80px);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: -0.055em;
}
h1 span { color: var(--lime); }
.lead {
  margin: 22px 0 0;
  max-width: 460px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.cta {
  margin-top: 28px;
  border: 0;
  background: var(--lime);
  color: #171717;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.03em;
  padding: 16px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(200, 240, 96, 0.28);
}
.cta:hover { background: #d4f56e; }
.cta:disabled { opacity: 0.6; cursor: progress; }
.cta.small { margin-top: 0; padding: 12px 18px; font-size: 15px; box-shadow: none; }

.panel {
  position: relative;
  height: min(600px, calc(100vh - 230px));
  min-height: 380px;
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.badge {
  position: absolute;
  top: -16px;
  right: 34px;
  transform: rotate(-7deg);
  background: var(--lime);
  color: #171717;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.03em;
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}
.spark {
  width: 12px;
  height: 12px;
  background: #171717;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  position: relative;
}
.spark::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -6px;
  width: 6px;
  height: 6px;
  background: #171717;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.thread {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 6px 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.bubble {
  background: #f2f2f2;
  color: #1a1a1a;
  border-radius: 18px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  letter-spacing: -0.025em;
  max-width: min(100%, 420px);
}
.msg-body { min-width: 0; flex: 1; }
.msg.assistant .msg-body p {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.03em;
}
.shot {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 8px;
  display: block;
  margin-left: auto;
}
.user-stack { display: flex; flex-direction: column; align-items: flex-end; max-width: min(100%, 440px); }

.well {
  margin-top: 12px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  min-height: 180px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.well.grow { flex: 1; min-height: 220px; }
.well img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
}
.well.grow img { max-height: none; aspect-ratio: 16/10; }
.wand {
  width: 42px;
  height: 42px;
  color: var(--lime);
}
.pending .wand { animation: pulse 1.3s ease-in-out infinite; }
.status {
  position: absolute;
  bottom: 12px;
  color: #8d8d8d;
  font-size: 13px;
  font-weight: 600;
}
.img-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
}
.img-actions a, .img-actions button {
  background: rgba(10, 10, 10, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}
.error {
  color: #ffb4b4;
  font-size: 14px;
  font-weight: 650;
  margin: 4px 0 0;
}

.composer { display: flex; flex-direction: column; gap: 8px; }
.field {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--field);
  border-radius: 999px;
  padding: 6px 6px 6px 8px;
  border: 1px solid transparent;
}
.field:focus-within { border-color: rgba(200, 240, 96, 0.45); }
textarea {
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  padding: 9px 4px;
  max-height: 120px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 600;
  font-size: 14px;
}
textarea::placeholder { color: #8f8f8f; font-weight: 600; }
.icon-btn, .send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  flex: none;
  background: transparent;
  color: #9a9a9a;
}
.send {
  background: var(--lime);
  color: #171717;
}
.send[hidden] { display: none !important; }
.send:disabled { background: #3a3a3a; color: #777; }
.icon-btn svg, .send svg { width: 18px; height: 18px; }
.file-chip {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #222;
  border-radius: 14px;
  padding: 6px 8px 6px 6px;
  font-size: 13px;
  font-weight: 650;
}
.file-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 9px; }
.file-chip button {
  border: 0;
  background: transparent;
  color: #aaa;
  font-size: 18px;
  line-height: 1;
}

.features {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 0;
  height: 104px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  z-index: 4;
  pointer-events: none;
}
.feature { pointer-events: auto; }
.feature {
  position: relative;
  height: 280px;
  text-align: left;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 28px;
  padding: 22px 22px 0;
  color: var(--text);
}
.feature:hover { border-color: rgba(200, 240, 96, 0.28); }
.feature.active { box-shadow: inset 0 0 0 1px rgba(200, 240, 96, 0.35); }
.ficon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #1c1c1c;
  color: var(--lime);
}
.ficon svg { width: 26px; height: 26px; }
.flabel {
  display: block;
  margin-top: 18px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
}
.fhint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}
.tools {
  position: absolute;
  top: -18px;
  left: 46%;
  transform: translateX(-20%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 10px 14px;
  color: #d7d7d7;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.tools svg { width: 18px; height: 18px; }
.tool-t { font-weight: 700; font-size: 16px; letter-spacing: -0.04em; }

.auth {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #141414;
  color: var(--text);
  border-radius: 24px;
  padding: 28px;
  width: min(420px, calc(100vw - 32px));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.auth::backdrop { background: rgba(0, 0, 0, 0.62); }
.auth h2 { margin: 14px 0 6px; font-size: 26px; letter-spacing: -0.045em; }
.auth p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.auth label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #cfcfcf; }
.auth input {
  background: #222;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 650;
}
.auth-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.hello {
  color: #bdbdbd;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin: 8px 4px;
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .stage {
    height: auto;
    grid-template-columns: 1fr;
    padding: 20px 16px 140px;
  }
  .panel { height: 68vh; min-height: 440px; }
  h1 { font-size: 46px; }
  .features { height: 96px; gap: 10px; left: 10px; right: 10px; }
  .tools { display: none; }
  .topbar { padding: 16px 16px 0; }
}

@keyframes pulse {
  0%, 100% { transform: rotate(-18deg) scale(1); opacity: 1; }
  50% { transform: rotate(-8deg) scale(1.08); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .pending .wand { animation: none; }
}

/* ---------- chat app screen ---------- */
.lime { color: var(--lime); }
.app[hidden] { display: none !important; }
.app {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: #0b0b0b;
}
.app.collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app.collapsed .sidebar { visibility: hidden; }

.sidebar {
  background: #050505;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 0;
  min-width: 0;
  overflow: hidden;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.side-close { display: none; }
.new-chat {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  background: var(--lime);
  color: #151515;
  font-weight: 750;
  font-size: 16px;
  padding: 14px 20px;
}
.new-chat:hover { background: #d4f56e; }
.new-chat svg { width: 18px; height: 18px; }
.side-label { margin: 26px 6px 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.chat-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.chat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 0 6px 0 8px;
  color: #e6e6e6;
}
.chat-item:hover, .chat-item.active { background: #161616; }
.chat-item.active { box-shadow: inset 0 0 0 1px rgba(200, 240, 96, 0.2); }
.chat-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 11px 0;
  text-align: left;
  font-size: 15px;
  font-weight: 550;
}
.chat-open svg { width: 19px; height: 19px; flex: none; color: #cfcfcf; }
.chat-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-del {
  border: 0;
  background: none;
  color: #777;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  opacity: 0;
  flex: none;
}
.chat-item:hover .chat-del, .chat-del:focus-visible { opacity: 1; }
.chat-del:hover { color: #ffb4b4; background: #222; }
.chat-empty { color: #6f6f6f; font-size: 14px; padding: 6px; }
.side-foot {
  border-top: 1px solid var(--line);
  margin: 0 -12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.side-user { color: #bdbdbd; font-size: 14px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(800px 300px at 50% -80px, rgba(88, 112, 28, 0.18), transparent 70%),
    #0b0b0b;
}
.main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 66px 66px;
}
.main > * { position: relative; }
.main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.main-head .icon-btn { color: #d0d0d0; border-radius: 10px; }
.main-head .icon-btn:hover { background: #1a1a1a; }
.icon-btn svg { width: 20px; height: 20px; }
.chat-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 28px 20px 12px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.welcome { text-align: center; max-width: 760px; margin: 50px auto 0; }
.welcome[hidden] { display: none; }
.mark.xl {
  width: 78px;
  height: 78px;
  border-radius: 22px;
  font-size: 34px;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(200, 240, 96, 0.28);
}
.welcome h3 { margin: 26px 0 0; font-size: 40px; font-weight: 800; letter-spacing: -0.045em; }
.welcome p { color: var(--muted); font-size: 18px; line-height: 1.6; max-width: 650px; margin: 14px auto 0; font-weight: 500; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; text-align: left; }
.step {
  display: flex;
  gap: 10px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 16px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  color: #e9e9e9;
}
.step:hover { border-color: rgba(200, 240, 96, 0.35); }
.step b { color: var(--lime); font-weight: 750; }

.app-thread { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.app-thread .bubble { font-weight: 600; font-size: 15.5px; max-width: min(100%, 560px); white-space: pre-wrap; }
.app-thread .user-stack { max-width: min(100%, 600px); }
.app-thread .msg.assistant .msg-body p { font-weight: 500; font-size: 16px; line-height: 1.6; white-space: pre-wrap; letter-spacing: -0.015em; }
.app-thread .mark.sm { margin-top: 2px; }
.app-thread .well { max-width: 560px; }
.app-thread .well img { max-height: 520px; object-fit: contain; background: #0a0a0a; }
.typing { display: inline-flex; gap: 5px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8a8a8a; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.dock { padding: 10px 20px 22px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 820px; margin: 0 auto 16px; }
.chips[hidden] { display: none; }
.chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 550;
  color: #eaeaea;
}
.chip-btn:hover { border-color: rgba(200, 240, 96, 0.35); }
.app-composer {
  max-width: 1024px;
  margin: 0 auto;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 14px 14px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.app-composer:focus-within { border-color: rgba(200, 240, 96, 0.4); }
.app-composer textarea { padding: 4px 0; font-size: 17px; font-weight: 500; min-height: 52px; max-height: 200px; }
.app-composer textarea::placeholder { font-weight: 500; }
.composer-row { display: flex; align-items: center; justify-content: space-between; }
.photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: #bcbcbc;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}
.photo-btn:hover { background: #1f1f1f; color: #fff; }
.photo-btn svg { width: 20px; height: 20px; }
.round-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: #f2f2f2;
  color: #111;
  display: grid;
  place-items: center;
}
.round-send svg { width: 20px; height: 20px; }
.round-send:disabled { background: #3a3a3a; color: #777; cursor: default; }
.scrim[hidden], .file-chip[hidden] { display: none; }

@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    visibility: visible !important;
  }
  .app.side-open .sidebar { transform: none; }
  .side-close { display: grid; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 55; }
  .steps { grid-template-columns: 1fr; }
  .welcome { margin-top: 10px; }
  .welcome h3 { font-size: 30px; }
  .welcome p { font-size: 16px; }
  .main-scroll { padding: 20px 16px 8px; }
  .dock { padding: 8px 16px 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .chip-btn { white-space: nowrap; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .typing i { animation: none; opacity: 0.6; }
}
