:root {
  --bg-dark: #0a0e27;
  --bg-cream: #faf5f0;
  --bg-mid: #111638;
  --fg-light: #f0ece6;
  --fg-dark: #1a1a2e;
  --accent: #ff5a3c;
  --accent-soft: #ff7a62;
  --muted: #8b8fa3;
  --border: rgba(255,255,255,0.08);
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background: var(--bg-dark);
  color: var(--fg-light);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-logo {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
}
.site-logo span { color: var(--accent); }
.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--fg-light); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 15px;
}
.btn-primary:hover { background: var(--accent-soft); }

/* ===== HERO ===== */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  padding: 120px 40px 80px;
  background: linear-gradient(165deg, var(--bg-dark) 0%, #0f1440 50%, var(--bg-dark) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,90,60,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
}
.hero-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  line-height: 1.08;
  font-weight: 400;
  margin-bottom: 28px;
  color: #fff;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lede {
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 16px; }
.flow-card {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}
.flow-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,90,60,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 8px;
}
.flow-label { font-size: 13px; color: var(--muted); text-align: center; }
.flow-arrow { color: var(--muted); font-size: 20px; }

/* ===== SECTION ===== */
.section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 16px;
}
.section h2 {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 12px;
}
.section p { color: var(--muted); max-width: 600px; }

/* ===== SCOPER FORM ===== */
.scoper-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 140px 40px 80px;
}
.scoper-header { text-align: center; margin-bottom: 48px; }
.scoper-header h1 {
  font-family: var(--serif);
  font-size: 2.8rem;
  color: #fff;
  margin-bottom: 16px;
}
.scoper-header p { color: var(--muted); font-size: 18px; }
.brief-form { display: flex; flex-direction: column; gap: 20px; }
.brief-textarea {
  width: 100%;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  color: var(--fg-light);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  resize: vertical;
  min-height: 180px;
  transition: border-color 0.2s;
}
.brief-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,90,60,0.12);
}
.brief-textarea::placeholder { color: var(--muted); }
.form-hint { font-size: 13px; color: var(--muted); }
.char-count { font-size: 13px; color: var(--muted); text-align: right; }
.btn-generate {
  background: var(--accent);
  color: #fff;
  padding: 16px 40px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  align-self: flex-start;
}
.btn-generate:hover { background: var(--accent-soft); }
.btn-generate:active { transform: scale(0.98); }
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Loading state */
.generating {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255,90,60,0.08);
  border: 1px solid rgba(255,90,60,0.2);
  border-radius: 12px;
  color: var(--accent-soft);
  font-size: 15px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,90,60,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCOPE VIEW ===== */
.scope-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 140px 40px 80px;
}
.scope-header { margin-bottom: 40px; }
.scope-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.scope-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: #fff;
  margin-bottom: 16px;
}
.scope-summary { color: var(--muted); font-size: 17px; line-height: 1.7; }
.scope-section {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
}
.scope-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 16px;
}
.stories-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.story-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.story-as-a { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.story-text { font-size: 15px; color: var(--fg-light); }
.tech-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tech-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.tech-key { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.tech-value { font-size: 15px; color: var(--fg-light); }
.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,90,60,0.1);
  border: 1px solid rgba(255,90,60,0.25);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  color: var(--accent-soft);
  font-weight: 600;
}
.wireframe-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.wireframe-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.wireframe-page { font-size: 13px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.wireframe-desc { font-size: 14px; color: var(--muted); }
.risks-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.risk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.risk-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 7px; }
.confidence-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.confidence-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  border-radius: 4px;
  transition: width 0.5s ease;
}
.confidence-label { font-size: 14px; color: var(--fg-light); font-weight: 600; min-width: 40px; }

/* Error page */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.error-page h1 { font-size: 2rem; color: #fff; margin-bottom: 16px; }
.error-page p { color: var(--muted); }
.error-page a { color: var(--accent); }

/* New scope link */
.new-scope-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 32px;
  transition: color 0.2s;
}
.new-scope-link:hover { color: var(--fg-light); }