:root {
  --bg: #050505;
  --ink: #f4f2ec;
  --muted: rgba(244, 242, 236, 0.58);
  --line: rgba(255, 255, 255, 0.1);
  --danger: #ff8d86;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: "Manrope", sans-serif;
  --display: "Unbounded", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

button, input, select { font: inherit; color: inherit; }

.mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
}

.orb-a {
  width: 46rem;
  height: 46rem;
  left: -12rem;
  top: -16rem;
  background: radial-gradient(circle, rgba(150, 255, 214, 0.2), transparent 68%);
  animation: drift 22s var(--ease) infinite alternate;
}

.orb-b {
  width: 38rem;
  height: 38rem;
  right: -12rem;
  top: -8rem;
  background: radial-gradient(circle, rgba(138, 126, 255, 0.22), transparent 66%);
  animation: drift 26s var(--ease) infinite alternate-reverse;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

.muted { color: var(--muted); }

.error {
  color: var(--danger);
  font-size: 0.92rem;
  margin: 0.85rem 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 0 0 0.9rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 242, 236, 0.72);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-mark {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.05em;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.bezel {
  display: block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 2rem;
  padding: 0.375rem;
}

.bezel-core {
  background: #0a0a0a;
  border-radius: calc(2rem - 0.375rem);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.bezel-tight {
  border-radius: 1.15rem;
  padding: 0.2rem;
}

.bezel-tight .bezel-core {
  border-radius: calc(1.15rem - 0.2rem);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  background: transparent;
  transition: transform 0.7s var(--ease), background 0.7s var(--ease), color 0.7s var(--ease);
}

.btn:active { transform: scale(0.98); }

.btn.primary {
  background: #f4f2ec;
  color: #111;
  padding: 0.35rem 0.35rem 0.35rem 1.15rem;
}

.btn.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.btn.sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.btn.primary.sm { padding: 0.45rem 0.9rem; }

.btn-ico {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.06);
  transition: transform 0.7s var(--ease);
}

.btn-ico svg { width: 0.9rem; height: 0.9rem; }

.btn.primary:hover .btn-ico {
  transform: translate(2px, -1px) scale(1.05);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.9rem;
}

.field span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

input, select {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  padding: 0.9rem 1rem;
  color-scheme: dark;
}

.bezel-tight:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
}

.auth-screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: 6rem 1.5rem;
}

.auth-split {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 4.5rem;
  align-items: center;
}

.auth-aside { animation: rise 0.9s var(--ease) both; }

.auth-headline {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.7rem, 4.8vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.auth-copy {
  margin: 1.4rem 0 0;
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.auth-points {
  list-style: none;
  margin: 2.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(244, 242, 236, 0.86);
}

.dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #d7ffe9;
  box-shadow: 0 0 0 5px rgba(150, 255, 214, 0.12);
  animation: pulse 2.6s var(--ease) infinite;
}

.auth-bezel { animation: rise 0.9s var(--ease) 0.12s both; }

.auth-card { padding: 1.6rem 1.45rem 1.4rem; }

.auth-card-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.auth-card-head p.muted { margin: 0.45rem 0 1.2rem; }

.account-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.pill {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: transform 0.7s var(--ease), background 0.7s var(--ease), color 0.7s var(--ease);
}

.pill:hover { color: var(--ink); }

.pill.active {
  background: #f4f2ec;
  color: #111;
  border-color: transparent;
}

.pill:active { transform: scale(0.98); }

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 7.5rem 1.5rem 6rem;
}

.island-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 1.15rem 1rem 0;
}

.island-bezel {
  pointer-events: auto;
  width: max-content;
  max-width: calc(100vw - 2rem);
  border-radius: 999px;
}

.island {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.3rem 0.3rem 0.3rem 0.85rem;
}

.island-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  padding-right: 0.45rem;
  white-space: nowrap;
}

.mark-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #d7ffe9;
  box-shadow: 0 0 0 4px rgba(150, 255, 214, 0.14);
}

.island-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.island-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.35rem;
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: transform 0.7s var(--ease), background 0.7s var(--ease), color 0.7s var(--ease), opacity 0.7s var(--ease);
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.active {
  color: #111;
  background: #f4f2ec;
}

.tab-btn:active { transform: scale(0.98); }

.burger {
  display: none;
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.burger span {
  position: absolute;
  left: 0.72rem;
  right: 0.72rem;
  top: 50%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.7s var(--ease);
}

.burger span:first-child { transform: translateY(-4px); }
.burger span:last-child { transform: translateY(4px); }

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-right: 0.25rem;
}

.live i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #d7ffe9;
  display: block;
  animation: pulse 2.4s var(--ease) infinite;
}

.context {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  animation: rise 0.9s var(--ease) both;
}

.who {
  font-size: 0.95rem;
  color: var(--muted);
  padding-bottom: 0.7rem;
}

.branch-field {
  display: grid;
  gap: 0.4rem;
  min-width: min(100%, 280px);
}

.branch-field span {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace { animation: rise 0.9s var(--ease) 0.08s both; }

.section-head { margin: 0 0 1.5rem; }

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.045em;
  line-height: 1;
}

.section-head p.muted {
  margin: 0.7rem 0 0;
  max-width: 52ch;
  line-height: 1.5;
}

.section-head p.lead { max-width: 68ch; }

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }

.chat-core { padding: 0.85rem; }

.log {
  min-height: 380px;
  max-height: 52dvh;
  overflow: auto;
  padding: 1.1rem 1.15rem;
  border-radius: 1.25rem;
  background: #070707;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.55rem;
  margin-top: 0.75rem;
  align-items: center;
}

.composer-field { margin: 0; min-width: 0; }

.confirm {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
}

.confirm code {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #d7ffe9;
}

.hints { padding: 1.25rem 1.1rem 1.15rem; }

.hint-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.45rem 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.7s var(--ease), background 0.7s var(--ease);
}

.hint-chip::after {
  content: "↗";
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  transition: transform 0.7s var(--ease);
}

.hint-chip:hover { background: rgba(255, 255, 255, 0.06); }

.hint-chip:hover::after { transform: translate(2px, -1px) scale(1.05); }

.hint-chip:active { transform: scale(0.98); }

.side-note {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.connect-core { padding: 1.15rem; }

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
}

.form-row .field { margin: 0; }

.form-row .btn { margin-bottom: 0.15rem; }

.connect-next { margin-top: 2.25rem; }

.connect-next h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); }

.branch-list {
  display: grid;
  gap: 0.65rem;
}

.branch-empty { margin: 0; }

.branch-row {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.branch-row.active .bezel { border-color: rgba(215, 255, 233, 0.45); }

.branch-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1.15rem;
}

.branch-item strong {
  display: block;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.branch-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.addon-grid {
  display: grid;
  gap: 0.85rem;
}

.addon-item {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.15rem 1.2rem;
}

.addon-item .btn { flex-shrink: 0; margin-top: 0.1rem; }

.addon-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.addon-note {
  margin: 0.45rem 0 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.addon-flag {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
}

.addon-flag.live {
  color: #d7ffe9;
  border-color: rgba(215, 255, 233, 0.35);
}

.addon-item strong {
  display: block;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.tool {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.key-list {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.65rem;
}

.key-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.95rem 1.15rem;
  font-size: 0.92rem;
}

.key-item-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  align-items: center;
}

.key-issue {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 1.25rem;
  background: #070707;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.key-issue-label,
.key-issue-head span {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.key-issue-label { margin: 0; }

.key-issue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.key-reveal {
  margin: 0.45rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.mcp-steps {
  margin: 0 0 1.25rem;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: 0.7rem;
  max-width: 72ch;
  line-height: 1.5;
}

.mcp-config {
  margin: 0.55rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}

.mcp-hint {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
}

code {
  font-family: var(--mono);
  font-size: 0.84em;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(4rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3%, 4%, 0) scale(1.08); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

@media (max-width: 768px) {
  .auth-screen {
    padding: 2rem 1rem 2.5rem;
    align-items: start;
  }

  .auth-split,
  .bento,
  .form-row,
  .addon-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .span-8,
  .span-4 { grid-column: auto; }

  .auth-headline { font-size: clamp(2.4rem, 11vw, 3.3rem); }

  .app-shell {
    width: 100%;
    padding: 6.25rem 1rem 3rem;
  }

  .context { flex-direction: column; align-items: stretch; }

  .composer { grid-template-columns: 1fr; }

  .composer .btn,
  .auth-actions .btn,
  .form-row .btn { width: 100%; }

  .live { display: none; }

  .burger { display: block; }

  .island-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.2rem;
    padding: 2rem 1.25rem 2.5rem;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(40px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.7s var(--ease);
  }

  .island-brand,
  .island-tools { position: relative; z-index: 2; }

  body.nav-open { overflow: hidden; }

  body.nav-open .island-nav {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open .burger span:first-child { transform: rotate(45deg); }
  body.nav-open .burger span:last-child { transform: rotate(-45deg); }

  .island-nav .tab-btn {
    opacity: 0;
    transform: translateY(3rem);
    text-align: left;
    font-family: var(--display);
    font-size: clamp(2rem, 8vw, 2.8rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    padding: 0.2rem 0;
    background: transparent;
    color: var(--ink);
    border-radius: 0;
  }

  body.nav-open .island-nav .tab-btn {
    opacity: 1;
    transform: translateY(0);
  }

  body.nav-open .island-nav .tab-btn:nth-child(1) { transition-delay: 0.1s; }
  body.nav-open .island-nav .tab-btn:nth-child(2) { transition-delay: 0.15s; }
  body.nav-open .island-nav .tab-btn:nth-child(3) { transition-delay: 0.2s; }
  body.nav-open .island-nav .tab-btn:nth-child(4) { transition-delay: 0.25s; }

  .island-nav .tab-btn.active {
    background: transparent;
    color: #d7ffe9;
  }
}
