@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

@import "tailwindcss";

@theme {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --color-bg: #0a0a0f;
  --color-bg-alt: #0d0d12;
  --color-surface: #141418;
  --color-surface-2: #17171c;
  --color-surface-3: #1a1a22;
  --color-line: #222228;
  --color-line-strong: #2a2a32;
  --color-ink: #f8f8ff;
  --color-muted: #94949f;
  --color-subtle: #6b6b76;
  --color-brand: #6366f1;
  --color-brand-light: #818cf8;
  --color-brand-deep: #4f46e5;
  --color-emerald: #10b981;
  --color-lime: #22c55e;
  --color-sky: #3b82f6;
  --color-violet: #a855f7;
  --color-amber: #f59e0b;
  --color-rose: #ef4444;
}

@keyframes typing-blink {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 1; }
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); opacity: 1; }
  60% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); opacity: 0.85; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes caret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

@keyframes fill-prog {
  from { width: 0%; }
}

@keyframes empty-pulse {
  0%, 100% { border-color: #2a2a32; opacity: 0.85; }
  50% { border-color: #34343e; opacity: 1; }
}

@keyframes gen-sweep {
  0% { left: -45%; }
  100% { left: 100%; }
}

@keyframes log-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dev-workspace running heartbeat (emerald) */
@keyframes beat {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
}

@layer base {
  html {
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
  }

  body {
    background-color: #0a0a0f;
    color: #f8f8ff;
  }

  * {
    box-sizing: border-box;
  }

  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

  ::-webkit-scrollbar-track {
    background: #0d0d12;
  }

  ::-webkit-scrollbar-thumb {
    background: #2a2a32;
    border-radius: 9999px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
  }
}

@layer components {
  /* Auth pages: fixed radial glow behind the card (Sign In / Forgot Password) */
  .auth-glow {
    position: fixed;
    top: -20%;
    left: -10%;
    right: -10%;
    height: 70vh;
    background: radial-gradient(55% 55% at 50% 25%, rgba(99, 102, 241, 0.16), transparent 70%);
    pointer-events: none;
  }

  /* Brand mark logo */
  .brand-mark {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2) inset, 0 0 20px rgba(99, 102, 241, 0.3);
    border-radius: 10px;
  }

  /* Glass topbar */
  .glass-topbar {
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    background: rgba(10, 10, 15, 0.72);
  }

  /* Glass footer bar */
  .glass-footbar {
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    background: rgba(10, 10, 15, 0.88);
    border-top: 1px solid #222228;
  }

  /* Ambient background for hero/landing page */
  .ambient-bg {
    position: relative;
  }

  .ambient-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.14) 0%, rgba(79, 70, 229, 0.07) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .ambient-bg::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(34, 34, 40, 0.35) 1px, transparent 1px),
      linear-gradient(90deg, rgba(34, 34, 40, 0.35) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 100%);
  }

  .ambient-bg > * {
    position: relative;
    z-index: 1;
  }

  /* Primary brand button */
  .btn-brand {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 4px 16px rgba(99, 102, 241, 0.28);
    transition: all 0.15s ease;
  }

  .btn-brand:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 4px 24px rgba(99, 102, 241, 0.42);
  }

  /* Active nav item */
  .nav-item-active {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.22);
    color: #818cf8;
  }

  /* AI chat bubble */
  .bubble-ai {
    background: linear-gradient(135deg, rgba(20, 20, 26, 0.95) 0%, rgba(22, 22, 30, 0.95) 100%);
    border-color: rgba(99, 102, 241, 0.2);
  }

  /* User chat bubble */
  .bubble-user {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
  }

  /* Progress bar gradient fill */
  .bar-fill {
    background: linear-gradient(90deg, #4f46e5 0%, #6366f1 50%, #818cf8 100%);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    position: relative;
    overflow: hidden;
  }

  .bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2.5s ease infinite;
  }

  /* Shimmer bar for generating state */
  .shimmer-bar {
    position: relative;
    overflow: hidden;
  }

  .shimmer-bar::after {
    content: '';
    position: absolute;
    top: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.6), transparent);
    animation: gen-sweep 1.8s ease-in-out infinite;
  }

  /* Live indicator dot */
  .live-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    animation: live-pulse 2s ease infinite;
    display: inline-block;
    flex-shrink: 0;
  }

  /* Spec row with filled value */
  .spec-row-filled {
    border-left: 2px solid #6366f1;
    padding-left: 10px;
  }

  /* Spec row still awaiting input — dashed, gently pulsing */
  .spec-row-empty {
    background: transparent;
    border: 1px dashed #2a2a32;
    animation: empty-pulse 2.4s ease-in-out infinite;
  }

  /* Spec-panel chips (brand / green / gray / awaiting) */
  .spec-chip,
  .spec-chip-green,
  .spec-chip-gray,
  .spec-chip-empty {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 1;
    padding: 3px 9px;
    border-radius: 9999px;
    border: 1px solid;
  }
  .spec-chip       { background: rgba(99, 102, 241, 0.14); color: #818cf8; border-color: rgba(99, 102, 241, 0.28); }
  .spec-chip-green { background: rgba(16, 185, 129, 0.13); color: #10b981; border-color: rgba(16, 185, 129, 0.32); }
  .spec-chip-gray  { background: #1a1a22; color: #94949f; border-color: #2a2a32; }
  .spec-chip-empty {
    background: transparent;
    color: #6b6b76;
    border-style: dashed;
    border-color: #2a2a32;
    font-family: 'Inter', sans-serif;
    font-style: italic;
  }
  .spec-chip .ti,
  .spec-chip-green .ti,
  .spec-chip-gray .ti,
  .spec-chip-empty .ti { font-size: 12px; }

  /* AI-provider toggle: Gemini swatch (Claude swatch is a flat color inline) */
  .swatch-gemini {
    background: linear-gradient(135deg, #1a73e8, #9b59ff);
  }

  /* Quickstart card with gradient border */
  .quickstart-card {
    background: linear-gradient(135deg, rgba(20, 20, 28, 0.95) 0%, rgba(22, 22, 32, 0.95) 100%);
    border: 1px solid #222228;
    border-left: 3px solid #6366f1;
    box-shadow: -4px 0 20px rgba(99, 102, 241, 0.12);
  }

  /* 3D tilt card for hero preview */
  .card-tilt {
    transform: perspective(800px) rotateX(4deg) rotateY(-6deg) rotateZ(1deg);
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
  }

  .card-tilt:hover {
    transform: perspective(800px) rotateX(2deg) rotateY(-3deg) rotateZ(0.5deg);
  }

  /* Status dot pulse animation */
  .status-dot-pulse {
    animation: dot-pulse 1.4s ease infinite;
  }

  /* Terminal cursor */
  .log-running::after {
    content: '▮';
    animation: caret 1s step-end infinite;
    margin-left: 2px;
    color: #6366f1;
  }

  /* Reveal on scroll */
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Generating indeterminate progress */
  .gen-progress {
    background: linear-gradient(90deg, #17171c 0%, #1a1a22 100%);
    position: relative;
    overflow: hidden;
    height: 3px;
    border-radius: 9999px;
  }

  .gen-progress::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 45%;
    background: linear-gradient(90deg, transparent, #6366f1, #818cf8, transparent);
    animation: gen-sweep 1.8s ease-in-out infinite;
  }

  /* ── Dev Workspace (IDE layout) ───────────────────────────────────────── */

  /* Emerald "running" heartbeat dot */
  .beat {
    animation: beat 1.8s infinite;
  }

  /* Blinking block caret for live terminal prompts */
  .caret::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 14px;
    background: #818cf8;
    margin-left: 3px;
    vertical-align: -2px;
    animation: caret 1s steps(2) infinite;
  }

  /* Resizer handles between panes (visual affordance) */
  .rz {
    flex: 0 0 1px;
    background: #222228;
    position: relative;
    cursor: col-resize;
  }
  .rz::after {
    content: '';
    position: absolute;
    inset: 0 -3px;
  }
  .rz:hover {
    background: #4f46e5;
  }
  .rz-row {
    flex: 0 0 1px;
    background: #222228;
    cursor: row-resize;
  }
  .rz-row:hover {
    background: #4f46e5;
  }

  /* Subtle row hover for file lists */
  .hover-line:hover {
    background: rgba(255, 255, 255, 0.03);
  }

  /* Mini inline diff inside the AI chat */
  .mdiff {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    line-height: 19px;
  }
  .mdiff .r {
    display: flex;
    padding: 0 10px;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .mdiff .r.add {
    background: rgba(34, 197, 94, 0.10);
    color: #bbf0c0;
  }
  .mdiff .r.del {
    background: rgba(239, 68, 68, 0.11);
    color: #f7b9b9;
  }
  .mdiff .r.meta {
    color: #6b6b76;
  }
  .mdiff .r .s {
    flex: 0 0 16px;
    color: inherit;
    opacity: 0.7;
  }

  /* ── Setup-rail timeline ──────────────────────────────────────────────────
     One .step-node per wizard step. A pseudo-element draws a continuous thread
     behind the status dots; data-state (set server-side, then live by the
     terminal controller) drives the done / running / queued / failed look. */
  .step-node {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .step-node .step-rail {
    position: relative;
    flex: 0 0 18px;
    align-self: stretch;
    display: flex;
    justify-content: center;
  }
  .step-node .step-rail::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: var(--color-line);
  }
  .step-node--first .step-rail::before { top: 9px; }
  .step-node--last  .step-rail::before { bottom: auto; height: 9px; }
  .step-node[data-state="done"] .step-rail::before { background: rgba(16, 185, 129, 0.28); }

  /* status dot — its panel-coloured background "cuts" the thread cleanly */
  .step-node .step-dot {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 9999px;
    background: var(--color-bg-alt);
  }
  .step-node[data-state="running"] .step-dot,
  .step-node[data-state="failed"]  .step-dot { margin-top: 8px; }

  .step-node .step-body {
    min-width: 0;
    flex: 1;
    padding-bottom: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
  }
  .step-node--last .step-body { padding-bottom: 0; }
  .step-node .step-head { display: flex; align-items: center; gap: 8px; }
  .step-node .step-label { font-size: 12px; color: var(--color-muted); }
  .step-node .step-meta {
    margin-left: auto;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
  }

  /* per-state meta chips + step log: reveal only what's relevant */
  .step-node .step-badge,
  .step-node .step-queued,
  .step-node .step-log { display: none; }
  .step-node[data-state="pending"] .step-label { color: var(--color-subtle); }
  .step-node[data-state="pending"] .step-queued { display: inline-block; }
  .step-node[data-state="running"] .step-badge { display: inline-block; }
  .step-node[data-state="running"] .step-log,
  .step-node[data-state="failed"]  .step-log { display: block; }
  /* when a Run/Retry button is showing, it owns the trailing slot */
  .step-node .step-head:has(.step-retry:not(.hidden)) .step-queued { display: none; }

  /* running / failed — the single focal card */
  .step-node[data-state="running"] .step-body,
  .step-node[data-state="failed"]  .step-body {
    padding: 10px 12px;
    margin-bottom: 4px;
  }
  .step-node[data-state="running"] .step-body {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.32);
    box-shadow: 0 0 24px -10px rgba(245, 158, 11, 0.4);
  }
  .step-node[data-state="failed"] .step-body {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.32);
  }
  .step-node[data-state="running"] .step-label { color: #fcd34d; font-weight: 500; font-size: 13px; }
  .step-node[data-state="failed"]  .step-label { color: #fca5a5; font-weight: 500; font-size: 13px; }
}
