/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f13;
  --surface: #16161d;
  --surface2: #1e1e27;
  --amber: #F5A623;
  --amber-dim: rgba(245,166,35,0.12);
  --amber-glow: rgba(245,166,35,0.06);
  --text: #f0ede8;
  --text-muted: rgba(240,237,232,0.55);
  --text-dim: rgba(240,237,232,0.3);
  --border: rgba(255,255,255,0.07);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === NAVIGATION === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(24px, 5vw, 80px);
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15,15,19,0.85);
}
.nav-inner { width: 100%; display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; }
.nav-logo { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.nav-tag { font-size: 0.75rem; color: var(--amber); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; }

/* === HERO === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px clamp(24px, 5vw, 80px) 80px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(245,166,35,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 10% 80%, rgba(245,166,35,0.03) 0%, transparent 60%);
}
.hero-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 80px, rgba(245,166,35,0.04) 80px, rgba(245,166,35,0.04) 81px),
    repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(245,166,35,0.04) 80px, rgba(245,166,35,0.04) 81px);
  opacity: 0.6;
}
.hero-content { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; width: 100%; }
.hero-kicker { font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber); font-weight: 500; margin-bottom: 24px; }
.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 900;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}
.hero-headline em { color: var(--amber); font-style: italic; }
.hero-sub { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--text-muted); max-width: 560px; line-height: 1.7; margin-bottom: 56px; font-weight: 300; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); width: fit-content; }
.hero-stat { background: var(--bg); padding: 28px 36px; }
.stat-num { display: block; font-family: 'Playfair Display', serif; font-size: 2.5rem; font-weight: 700; color: var(--amber); line-height: 1; margin-bottom: 8px; }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); max-width: 140px; line-height: 1.4; }

/* === PROBLEM === */
.problem { padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 80px); }
.problem-inner { max-width: 1280px; margin: 0 auto; }
.problem-label, .solution-label, .proof-label, .philosophy-label { font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--amber); font-weight: 500; margin-bottom: 20px; }
.problem-headline, .solution-headline, .proof-headline { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--text); margin-bottom: 28px; }
.problem-body { font-size: 1.05rem; color: var(--text-muted); max-width: 640px; line-height: 1.8; font-weight: 300; margin-bottom: 56px; }
.problem-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.problem-card { background: var(--surface); padding: 40px 36px; }
.problem-icon { width: 48px; height: 48px; background: var(--amber-dim); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.problem-card h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.problem-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.7; }

/* === SOLUTION === */
.solution { padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 80px); background: var(--surface); }
.solution-inner { max-width: 1280px; margin: 0 auto; }
.solution-body { font-size: 1.05rem; color: var(--text-muted); max-width: 640px; line-height: 1.8; font-weight: 300; margin-bottom: 64px; }
.solution-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; background: var(--border); border: 1px solid var(--border); }
.step { background: var(--bg); padding: 40px 36px; position: relative; }
.step::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--amber); }
.step-num { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 900; color: var(--amber-dim); line-height: 1; margin-bottom: 20px; }
.step-body h3 { font-family: 'Playfair Display', serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.step-body p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; }

/* === PROOF === */
.proof { padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 80px); }
.proof-inner { max-width: 1280px; margin: 0 auto; }
.proof-headline { margin-bottom: 64px; }
.proof-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-bottom: 64px; }
.proof-stat { padding: 32px; border: 1px solid var(--border); background: var(--surface); }
.proof-num { display: block; font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 900; color: var(--amber); line-height: 1; margin-bottom: 12px; }
.proof-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.proof-quote { max-width: 700px; padding: 48px; background: var(--surface); border-left: 3px solid var(--amber); }
.proof-quote blockquote { font-family: 'Playfair Display', serif; font-size: clamp(1.4rem, 2.5vw, 2rem); font-style: italic; color: var(--text); line-height: 1.4; margin-bottom: 20px; }
.proof-quote cite { font-size: 0.8rem; color: var(--text-muted); font-style: normal; }

/* === PHILOSOPHY === */
.philosophy { padding: clamp(80px, 12vw, 140px) clamp(24px, 5vw, 80px); background: var(--surface); }
.philosophy-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.philosophy-headline { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--text); margin-top: 20px; }
.philosophy-col-right p { font-size: 1rem; color: var(--text-muted); line-height: 1.85; margin-bottom: 20px; font-weight: 300; }

/* === CLOSING === */
.closing { padding: clamp(100px, 15vw, 160px) clamp(24px, 5vw, 80px); text-align: center; position: relative; overflow: hidden; }
.closing::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(245,166,35,0.08) 0%, transparent 70%); border-radius: 50%; }
.closing-inner { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
.closing-headline { font-family: 'Playfair Display', serif; font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; color: var(--text); margin-bottom: 28px; }
.closing-body { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto; line-height: 1.8; font-weight: 300; }

/* === FOOTER === */
.footer { padding: 48px clamp(24px, 5vw, 80px); border-top: 1px solid var(--border); }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-brand { display: flex; align-items: baseline; gap: 16px; }
.footer-logo { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.footer-tagline { font-size: 0.8rem; color: var(--text-muted); }
.footer-meta { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-dim); flex-wrap: wrap; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero-stats { grid-template-columns: 1fr; width: 100%; }
  .hero-stat { padding: 20px 24px; }
  .stat-num { font-size: 2rem; }
  .philosophy-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .proof-stats { grid-template-columns: 1fr 1fr; }
  .proof-num { font-size: 2rem; }
}
@media (max-width: 480px) {
  .proof-stats { grid-template-columns: 1fr; }
  .problem-grid { grid-template-columns: 1fr; }
  .solution-steps { grid-template-columns: 1fr; }
}

/* === APP SHARED === */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px; display: flex; align-items: center;
  padding: 0 clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--border);
  background: rgba(15,15,19,0.9); backdrop-filter: blur(12px);
}
.app-nav-inner { max-width: 1280px; width: 100%; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.app-nav-brand { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; color: var(--text); text-decoration: none; }
.app-nav-links { display: flex; gap: 24px; }
.app-nav-links a { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.app-nav-links a:hover, .app-nav-links a.active { color: var(--amber); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 6px; font-size: 0.85rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--amber); color: #0f0f13; }
.btn-primary:hover { background: #f0b84a; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* === CASE DASHBOARD === */
.cases-page { padding-top: 64px; min-height: 100vh; }
.cases-header { padding: 48px clamp(24px, 5vw, 80px) 24px; max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.cases-header h1 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; }
.cases-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }
.cases-table-wrap { padding: 0 clamp(24px, 5vw, 80px) 80px; max-width: 1280px; margin: 0 auto; }
.cases-table { width: 100%; border-collapse: collapse; }
.cases-table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 500; }
.cases-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.88rem; vertical-align: middle; }
.cases-table tr:hover td { background: var(--surface); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 500; }
.status-pending { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.status-generating { background: var(--amber-dim); color: var(--amber); }
.status-ready { background: rgba(34,197,94,0.12); color: #22c55e; }
.status-failed { background: rgba(239,68,68,0.12); color: #ef4444; }
.status-filed, .status-closed { background: rgba(59,130,246,0.12); color: #60a5fa; }
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.empty-state h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--text); margin-bottom: 12px; }

/* === INTAKE FORM === */
.form-page { padding-top: 64px; min-height: 100vh; }
.form-wrap { max-width: 720px; margin: 0 auto; padding: 48px clamp(16px, 3vw, 40px) 80px; }
.form-wrap h1 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.form-wrap .form-sub { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 40px; }
.field-section { margin-bottom: 40px; }
.field-section-title { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); font-weight: 500; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.field input, .field select, .field textarea { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 0.9rem; color: var(--text); font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.2s; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--amber); }
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 0.75rem; color: var(--text-dim); }
.error-msg { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: 6px; padding: 12px 16px; color: #fca5a5; font-size: 0.85rem; margin-bottom: 24px; display: none; }
.error-msg.visible { display: block; }
.success-msg { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); border-radius: 6px; padding: 12px 16px; color: #86efac; font-size: 0.85rem; margin-bottom: 24px; display: none; }
.success-msg.visible { display: block; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* === CASE DETAIL === */
.detail-page { padding-top: 64px; min-height: 100vh; }
.detail-wrap { max-width: 1280px; margin: 0 auto; padding: 48px clamp(24px, 5vw, 80px) 80px; display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-back { display: flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; margin-bottom: 32px; transition: color 0.2s; }
.detail-back:hover { color: var(--amber); }
.detail-main h1 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; margin-bottom: 4px; }
.detail-main .case-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 32px; }
.case-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 40px; }
.case-info-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.case-info-item .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.case-info-item .value { font-size: 0.95rem; color: var(--text); }
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.doc-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.doc-card-title { font-weight: 600; font-size: 0.9rem; }
.doc-card-actions { display: flex; gap: 8px; }
.doc-card-body { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; max-height: 200px; overflow-y: auto; white-space: pre-wrap; }
.doc-preview-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); margin-bottom: 6px; }
.generate-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.generate-panel h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.generate-form { display: flex; flex-direction: column; gap: 16px; }
.loading-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(15,15,19,0.3); border-top-color: #0f0f13; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-loading .loading-spinner { border-color: rgba(255,255,255,0.3); border-top-color: white; }