/* ============================================================
   AI Stack Builder — style.css
   stack.buildations.com
   ============================================================ */

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

:root {
  --black:   #0A0A0A;
  --white:   #F5F5F0;
  --yellow:  #F5E642;
  --blue:    #1A3BFF;
  --green:   #2EFF6E;
  --red:     #FF2E2E;
  --border:  rgba(255,255,255,0.07);
  --card-bg: rgba(255,255,255,0.03);
  --font:    'Poppins', sans-serif;
  --mono:    'JetBrains Mono', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }

/* ─── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* ─── Site Header ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s;
}
.site-logo:hover { opacity: 0.6; }

.logo-mark {
  width: 26px;
  height: 26px;
  background: var(--white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: var(--black);
  flex-shrink: 0;
}

.logo-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.35;
}

.header-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.header-right { display: flex; align-items: center; }

.header-cta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  background: var(--white);
  padding: 7px 16px;
  border-radius: 100px;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.header-cta:hover { opacity: 0.8; }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 112px clamp(16px, 5vw, 80px) 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(48px, 9vw, 120px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.6;
  opacity: 0.5;
  max-width: 44ch;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-shrink: 0;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-n {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--yellow);
}

.stat-l {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.35;
}

/* ─── App ────────────────────────────────────────────────────── */
.app {
  padding: 0;
  max-width: 100%;
}

/* ─── Progress Bar ───────────────────────────────────────────── */
.progress-bar {
  padding: 24px clamp(16px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.01);
}

.progress-track {
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}

.progress-steps {
  display: flex;
  gap: 0;
  justify-content: space-between;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  flex: 1;
  max-width: 140px;
}

.progress-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.3s;
  background: transparent;
}

.progress-step.active .progress-step-num {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

.progress-step.done .progress-step-num {
  background: rgba(46,255,110,0.15);
  border-color: var(--green);
  color: var(--green);
}

.progress-step-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.3;
  text-align: center;
  transition: opacity 0.2s;
}

.progress-step.active .progress-step-label { opacity: 1; }
.progress-step.done .progress-step-label { opacity: 0.6; }

/* ─── Panels ─────────────────────────────────────────────────── */
.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 360px);
}

/* ─── Wizard Panel ───────────────────────────────────────────── */
.panel-wizard {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.wizard-steps {
  flex: 1;
  padding: clamp(24px, 4vw, 48px);
  overflow-y: auto;
}

.step-panel { display: none; animation: fadeUp 0.35s ease; }
.step-panel.visible { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.step-heading {
  margin-bottom: 28px;
}

.step-num {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
  opacity: 0.7;
  margin-bottom: 8px;
}

.step-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  opacity: 0.45;
  line-height: 1.5;
}

/* ─── Cards Grid ─────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  gap: 10px;
}

.cards-grid.col-2 { grid-template-columns: 1fr 1fr; }
.cards-grid.col-1 { grid-template-columns: 1fr; }
.cards-grid.col-auto { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.sel-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.sel-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.sel-card.selected {
  border-color: var(--yellow);
  background: rgba(245,230,66,0.06);
}

.sel-card.selected::before {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
}

.card-icon {
  font-size: 20px;
  line-height: 1;
  opacity: 0.6;
}

.card-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-provider {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.35;
}

.card-desc {
  font-size: 12px;
  opacity: 0.5;
  line-height: 1.4;
}

.card-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid;
  opacity: 0.8;
  align-self: flex-start;
  margin-top: 2px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.card-tag {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  opacity: 0.7;
}

.card-specs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.card-spec {
  font-size: 11px;
  opacity: 0.4;
  font-family: var(--mono);
}

.card-spec strong {
  color: var(--white);
  opacity: 1;
  font-weight: 600;
}

.card-stars {
  font-size: 10px;
  opacity: 0.3;
  margin-top: 2px;
}

.card-complexity {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-top: 2px;
}

.complexity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}

.complexity-dot.filled {
  background: var(--yellow);
}

/* Model tier styles */
.tier-flagship { border-left: 2px solid rgba(245,230,66,0.4); }
.tier-efficient { border-left: 2px solid rgba(46,255,110,0.3); }
.tier-reasoning { border-left: 2px solid rgba(26,59,255,0.5); }
.tier-opensource { border-left: 2px solid rgba(255,165,0,0.4); }

/* ─── Wizard Nav ─────────────────────────────────────────────── */
.wizard-nav {
  padding: 20px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.01);
}

.btn-back {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-back:hover { border-color: rgba(255,255,255,0.3); color: var(--white); }
.btn-back:disabled { opacity: 0.2; cursor: not-allowed; }

.btn-next {
  background: var(--yellow);
  border: none;
  color: var(--black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 6px;
  transition: all 0.2s;
  flex: 1;
  max-width: 220px;
}
.btn-next:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,230,66,0.2); }
.btn-next:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-generate {
  background: var(--yellow);
  border: none;
  color: var(--black);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 32px;
  border-radius: 6px;
  transition: all 0.25s;
  flex: 1;
  max-width: 280px;
}
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(245,230,66,0.25); }

/* ─── Architecture Diagram Panel ─────────────────────────────── */
.panel-output {
  background: rgba(255,255,255,0.015);
  display: flex;
  flex-direction: column;
}

.arch-preview {
  flex: 1;
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
}

.arch-preview-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.3;
  margin-bottom: 32px;
}

.arch-diagram {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.arch-diagram svg {
  width: 100%;
  max-width: 480px;
  height: auto;
}

.arch-legend {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  opacity: 0.5;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── Full Output ─────────────────────────────────────────────── */
.output-full {
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeUp 0.5s ease;
}

.output-full.hidden { display: none; }

.output-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 8px;
}

/* Stack summary */
.stack-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

/* Cost card */
.cost-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.cost-range {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--yellow);
  margin-bottom: 6px;
}

.cost-note {
  font-size: 12px;
  opacity: 0.4;
  line-height: 1.5;
}

.complexity-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.complexity-label {
  font-size: 13px;
  opacity: 0.6;
}

.complexity-dots {
  display: flex;
  gap: 4px;
}

.cdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.cdot.on { background: var(--yellow); }

/* Capabilities */
.cap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.8;
}

.cap-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Limitations */
.lim-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lim-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.7;
}

.lim-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
  margin-top: 6px;
}

.lim-item.ok .lim-dot { background: var(--green); }

/* Code block */
.code-block {
  background: #111;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}

.code-lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.4;
}

.code-copy {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.code-copy:hover { border-color: rgba(255,255,255,0.3); color: var(--white); }

.code-content {
  padding: 20px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  overflow-x: auto;
  white-space: pre;
  max-height: 320px;
  overflow-y: auto;
}

/* CTA */
.output-cta {
  background: linear-gradient(135deg, rgba(245,230,66,0.08) 0%, rgba(245,230,66,0.03) 100%);
  border: 1px solid rgba(245,230,66,0.2);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.output-cta-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.output-cta-sub {
  font-size: 12px;
  opacity: 0.5;
  margin-top: 4px;
}

.output-cta-btn {
  background: var(--yellow);
  color: var(--black);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.output-cta-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* Reset button */
.btn-reset {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  align-self: flex-start;
}
.btn-reset:hover { border-color: rgba(255,255,255,0.3); color: var(--white); }

/* ─── Site Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: 32px clamp(16px, 5vw, 80px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  font-size: 12px;
  opacity: 0.3;
}
.footer-copy a { text-decoration: underline; opacity: 0.7; }
.footer-copy a:hover { opacity: 1; }

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.3;
  transition: opacity 0.2s;
}
.footer-links a:hover { opacity: 0.7; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .panels { grid-template-columns: 1fr; }
  .panel-output { border-top: 1px solid var(--border); }
  .arch-diagram { min-height: 280px; }
  .hero { padding-top: 80px; }
  .hero-stats { gap: 20px; }
  .cards-grid.col-2 { grid-template-columns: 1fr; }
  .header-center { display: none; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 48px; }
  .progress-step-label { display: none; }
  .hero-stats { gap: 16px; }
  .stat-n { font-size: 24px; }
}
