/* ─── Agentic CLI — minimal splash ─── */

:root {
  --bg: #0a0c10;
  --bg-deep: #07080c;
  --surface: rgba(148, 163, 184, 0.06);
  --border: rgba(148, 163, 184, 0.12);
  --border-hover: rgba(148, 163, 184, 0.22);
  --text: #e8ecf2;
  --muted: #8490a4;
  --dim: #4a5264;
  --glass: rgba(160, 185, 220, 0.07);
  --glass-edge: rgba(180, 200, 230, 0.16);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.splash {
  min-height: 100%;
  font-family: var(--font);
  font-weight: 400;
  background: linear-gradient(168deg, #0d1017 0%, var(--bg) 42%, var(--bg-deep) 100%);
  color: var(--text);
  letter-spacing: -0.011em;
}

/* ─── Ambient background ─── */

.splash__bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.splash__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.splash__orb--1 {
  width: 42vw;
  height: 42vw;
  top: -8%;
  right: -6%;
  background: radial-gradient(circle, rgba(100, 130, 180, 0.14) 0%, transparent 70%);
  animation: orb-drift-1 22s ease-in-out infinite alternate;
}

.splash__orb--2 {
  width: 36vw;
  height: 36vw;
  bottom: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(80, 110, 160, 0.1) 0%, transparent 70%);
  animation: orb-drift-2 26s ease-in-out infinite alternate;
}

.splash__orb--3 {
  width: 28vw;
  height: 28vw;
  top: 38%;
  left: 42%;
  background: radial-gradient(circle, rgba(120, 145, 190, 0.08) 0%, transparent 70%);
  animation: orb-drift-3 18s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-4%, 6%) scale(1.08); }
}

@keyframes orb-drift-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(5%, -4%) scale(1.06); }
}

@keyframes orb-drift-3 {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(calc(-50% + 3%), calc(-50% - 5%)) scale(1.1); }
}

.splash__mesh {
  position: absolute;
  inset: -10%;
  width: 120%;
  height: 120%;
  opacity: 0.55;
  animation: mesh-float 28s ease-in-out infinite alternate;
}

.splash__mesh-layer--b {
  animation: mesh-counter 34s ease-in-out infinite alternate;
  transform-origin: center;
}

.splash__mesh-nodes circle {
  animation: node-pulse 4s ease-in-out infinite;
}

.splash__mesh-nodes circle:nth-child(2) { animation-delay: -0.8s; }
.splash__mesh-nodes circle:nth-child(3) { animation-delay: -1.6s; }
.splash__mesh-nodes circle:nth-child(4) { animation-delay: -2.4s; }
.splash__mesh-nodes circle:nth-child(5) { animation-delay: -3.2s; }
.splash__mesh-nodes circle:nth-child(6) { animation-delay: -4s; }

@keyframes mesh-float {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(-2%, 1.5%) rotate(0.6deg); }
}

@keyframes mesh-counter {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(1.5%, -1%) scale(1.02); }
}

@keyframes node-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.65; }
}

.splash__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, black 10%, transparent 75%);
  animation: grid-shift 40s linear infinite;
}

@keyframes grid-shift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 80px 80px, 80px 80px; }
}

.splash__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, transparent 20%, var(--bg) 85%);
}

/* ─── Page shell ─── */

.splash__page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem clamp(1.5rem, 5vw, 2.5rem) 2.5rem;
  display: flex;
  flex-direction: column;
}

/* ─── Header ─── */

.splash__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(4rem, 12vh, 7rem);
}

.splash__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s;
}

.splash__logo:hover {
  opacity: 0.75;
}

.splash__logo-mark {
  display: block;
  flex-shrink: 0;
  color: var(--text);
}

.splash__logo-text {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.splash__status {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ─── Hero ─── */

.splash__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vh, 5rem);
}

.splash__hero {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 0.8s var(--ease) 0.05s forwards;
}

.splash__title {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
  max-width: 18ch;
}

.splash__lead {
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 2.5rem;
}

/* ─── Form ─── */

.splash__field {
  display: flex;
  align-items: stretch;
  max-width: 26rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.25s;
}

.splash__field:focus-within {
  border-color: var(--border-hover);
}

.splash__input {
  flex: 1;
  min-width: 0;
  padding: 0.8125rem 1.25rem;
  border: none;
  border-radius: 999px 0 0 999px;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
}

.splash__input:-webkit-autofill,
.splash__input:-webkit-autofill:hover,
.splash__input:-webkit-autofill:focus,
.splash__input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  border-radius: 999px 0 0 999px;
  -webkit-box-shadow: 0 0 0 1000px #0b0d12 inset !important;
  box-shadow: 0 0 0 1000px #0b0d12 inset !important;
  transition: background-color 99999s ease-out 0s;
}

.splash__input::placeholder {
  color: var(--dim);
}

.splash__input:focus {
  outline: none;
}

.splash__btn {
  flex-shrink: 0;
  margin: 4px;
  padding: 0 1.25rem;
  border: none;
  border-radius: 999px;
  background: #e8ecf2;
  color: var(--bg);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.splash__btn:hover {
  opacity: 0.88;
}

.splash__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.splash__honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.splash__form-msg {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.splash__form-msg.is-success {
  color: #94a8c4;
}

.splash__form-msg.is-error {
  color: #b89aa0;
}

/* ─── Terminal preview (liquid glass) ─── */

.splash__preview {
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 0.8s var(--ease) 0.15s forwards;
  border-radius: 16px;
  border: 1px solid var(--glass-edge);
  background: linear-gradient(
    145deg,
    rgba(180, 200, 230, 0.1) 0%,
    rgba(120, 140, 180, 0.04) 42%,
    rgba(100, 125, 170, 0.06) 100%
  );
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(200, 215, 240, 0.12),
    inset 0 -1px 0 rgba(80, 100, 140, 0.08),
    0 8px 40px rgba(4, 6, 12, 0.55),
    0 0 0 0.5px rgba(160, 185, 220, 0.08);
  overflow: hidden;
  isolation: isolate;
}

.splash__preview::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(190, 210, 240, 0.06) 0%,
    transparent 38%
  );
  pointer-events: none;
  z-index: 0;
}

.splash__preview::after {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(200, 220, 245, 0.3) 50%,
    transparent
  );
  pointer-events: none;
  z-index: 2;
}

.splash__preview-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.125rem;
  background: rgba(120, 140, 180, 0.06);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.splash__preview-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.splash__preview-status {
  font-family: var(--mono);
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.splash__preview-status.is-fail {
  color: #9aa3b5;
}

.splash__preview-body {
  position: relative;
  z-index: 1;
  padding: 1.125rem 1.125rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.8;
  min-height: 8.5rem;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.splash__preview-body .line {
  display: block;
  min-height: 1.8em;
}

.splash__preview-body .dim { color: var(--dim); }
.splash__preview-body .cmd { color: var(--text); }
.splash__preview-body .warn { color: var(--muted); }
.splash__preview-body .err { color: #9aa3b5; }

/* ─── Footer ─── */

.splash__footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: clamp(3rem, 10vh, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--dim);
}

.splash__copy {
  letter-spacing: 0.01em;
}

/* ─── Motion ─── */

@keyframes fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 540px) {
  .splash__field {
    flex-direction: column;
    border-radius: 14px;
    padding: 4px;
  }

  .splash__input,
  .splash__input:-webkit-autofill,
  .splash__input:-webkit-autofill:hover,
  .splash__input:-webkit-autofill:focus,
  .splash__input:-webkit-autofill:active {
    border-radius: 10px 10px 0 0;
  }

  .splash__btn {
    margin: 0;
    padding: 0.8125rem 1.25rem;
    border-radius: 10px;
  }

  .splash__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__orb,
  .splash__mesh,
  .splash__mesh-layer--b,
  .splash__mesh-nodes circle,
  .splash__grid {
    animation: none;
  }

  .splash__hero,
  .splash__preview {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
