/* Landing + Workspace premium styles v2 */

/* Hero */
.hero {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 56px) 0 96px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(124, 58, 237, 0.12);
  color: #ddd6fe;
  font-size: 13px;
  margin-bottom: 22px;
}

.hero-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px #34d399;
  display: inline-block;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

/* Perspective grid behind hero */
.hero-mesh {
  position: absolute;
  inset: auto 0 -10% 0;
  height: 55%;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(15, 15, 26, 1), transparent 70%),
    repeating-linear-gradient(
      90deg,
      rgba(124, 58, 237, 0.18) 0 1px,
      transparent 1px 48px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(124, 58, 237, 0.12) 0 1px,
      transparent 1px 48px
    );
  transform: perspective(500px) rotateX(62deg);
  transform-origin: center top;
  mask-image: linear-gradient(to top, #000 20%, transparent 95%);
  opacity: 0.55;
}

/* Preview mock */
.preview-card {
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: linear-gradient(160deg, rgba(36, 28, 72, 0.95), rgba(15, 15, 26, 0.98));
  box-shadow:
    0 30px 80px rgba(124, 58, 237, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  padding: 18px;
}

.preview-card::before {
  content: "";
  position: absolute;
  inset: -40% 40% 60% -20%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35), transparent 65%);
  pointer-events: none;
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3f3f46;
}

.preview-dot:nth-child(1) { background: #f87171; }
.preview-dot:nth-child(2) { background: #fbbf24; }
.preview-dot:nth-child(3) { background: #34d399; }

.preview-body { display: grid; gap: 12px; }

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.18);
  color: #ddd6fe;
  font-size: 12px;
  width: fit-content;
}

.preview-result {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.75;
}

.preview-result strong {
  color: var(--text);
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.preview-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-meta span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
}

/* Stats */
.stats {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 40px 0;
  backdrop-filter: blur(8px);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-num {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  background: linear-gradient(120deg, #fff, #c4b5fd 50%, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 28px;
  min-height: 250px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(79, 70, 229, 0.15));
  border: 1px solid rgba(124, 58, 237, 0.35);
  margin-bottom: 20px;
  font-size: 24px;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}

.feature-card h3 { margin-bottom: 10px; }

.feature-card p {
  color: var(--text-muted);
  font-size: 14px;
}

.feature-list {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
}

.feature-list span::before {
  content: "→ ";
  color: #a78bfa;
}

/* Workflow */
.workflow-stage {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(18, 16, 32, 0.9);
  padding: 28px;
  min-height: 380px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.workflow-steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.wf-step {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  transition: all 0.25s ease;
}

.wf-step.is-active {
  border-color: rgba(124, 58, 237, 0.55);
  background: rgba(124, 58, 237, 0.18);
  color: #ddd6fe;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.25);
}

.workflow-panel { min-height: 230px; }

.typing-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: #e4e4e7;
  min-height: 1.6em;
}

.dots {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: bounceDot 1s ease-in-out infinite;
}

.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounceDot {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.result-line {
  opacity: 0;
  transform: translateY(12px);
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.result-line strong { color: var(--text); }

/* Templates */
.template-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.template-row .card {
  scroll-snap-align: start;
  cursor: pointer;
}

.template-tag {
  display: inline-block;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.12);
  color: #fdba74;
  margin-bottom: 12px;
}

/* Pricing */
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.price-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.is-featured {
  transform: scale(1.05);
  border-color: rgba(124, 58, 237, 0.55);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--grad);
  font-size: 12px;
  font-weight: 700;
}

.price-name {
  font-size: 18px;
  font-weight: 700;
}

.price-amount {
  font-size: 42px;
  font-weight: 800;
  margin: 12px 0 4px;
  letter-spacing: -0.03em;
}

.price-amount span {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.price-list {
  margin: 20px 0 28px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.price-list li {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  gap: 8px;
}

.price-list li::before {
  content: "✓";
  color: #a78bfa;
}

/* Testimonials */
.t-card {
  width: 340px;
  padding: 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.t-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 12px 0 16px;
}

.t-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.t-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.t-name { font-size: 13px; font-weight: 600; }
.t-role { font-size: 12px; color: var(--text-dim); }

/* Bottom CTA */
.bottom-cta {
  border-radius: 32px;
  padding: 72px 32px;
  text-align: center;
  background:
    radial-gradient(600px 220px at 20% 0%, rgba(124, 58, 237, 0.4), transparent),
    radial-gradient(500px 220px at 80% 100%, rgba(249, 115, 22, 0.22), transparent),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(124, 58, 237, 0.25);
  position: relative;
  overflow: hidden;
}

.shine-btn {
  position: relative;
  overflow: hidden;
}

.shine-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: shine 2.8s ease-in-out infinite;
}

@keyframes shine {
  0% { left: -80%; }
  55%, 100% { left: 120%; }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 56px;
  color: var(--text-dim);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: calc(var(--nav-h) + 24px) 20px 40px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px 28px;
  background: rgba(22, 18, 40, 0.92);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
  text-align: center;
}

.auth-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-footer a {
  color: #c4b5fd;
  font-weight: 600;
}

/* Workspace */
.ws-page {
  height: 100vh;
  padding-top: var(--nav-h);
  box-sizing: border-box;
  overflow: hidden;
}

.ws-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.ws-side {
  border-right: 1px solid var(--border);
  background: rgba(15, 15, 26, 0.55);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ws-side h2 {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-inline: 8px;
}

.ws-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding-inline: 4px;
}

.cat-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  transition: all 0.2s ease;
}

.cat-btn.is-active,
.cat-btn:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.15);
  color: #ddd6fe;
}

.tpl-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  padding-bottom: 8px;
}

.tpl-item {
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
  flex: 0 0 auto;
  opacity: 1 !important;
  transform: none !important;
}

.tpl-item:hover,
.tpl-item.is-active {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.12);
}

.tpl-item .t-name {
  font-size: 14px;
  margin-bottom: 4px;
}

.tpl-item .t-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.ws-main {
  padding: 24px 28px;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  overscroll-behavior: contain;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.quota {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.quota.is-low {
  border-color: rgba(249, 115, 22, 0.5);
  color: #fdba74;
}

.ws-empty {
  min-height: 50vh;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 20px;
  padding: 40px;
}

.ws-form-card,
.ws-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}

.ws-form-card h2,
.ws-result-card h2 {
  margin-bottom: 18px;
}

.gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.result-block {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.result-block:last-child { border-bottom: none; }

.result-block h3 {
  font-size: 13px;
  color: #c4b5fd;
  margin-bottom: 8px;
}

.result-block p {
  color: var(--text-muted);
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.75;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.user-chip .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

/* version tabs */
.ver-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ver-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.ver-tab.is-active {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.5);
  color: #ddd6fe;
}

/* platform pills */
.plat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.plat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.plat-pill.is-active {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.4);
  color: #fdba74;
}

/* works page */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.work-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}

.work-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.work-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.work-card p {
  color: var(--text-muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card time {
  display: block;
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 11px;
}

@media (max-width: 960px) {
  .hero-grid,
  .feature-grid,
  .price-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

  .price-card.is-featured { transform: none; }

  .ws-page {
    height: auto;
    overflow: visible;
  }

  .ws-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .ws-side {
    height: auto;
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }

  .ws-main {
    height: auto;
    overflow: visible;
  }
}
