/* ============================================================
   HENRY INSIGHTS · Global Styles
   ============================================================ */
:root {
  --blue:    #007AFF;
  --green:   #34C759;
  --red:     #FF3B30;
  --bg:      #f5f5f7;
  --bg-alt:  #fff;
  --bg-dark: #0a0a0a;
  --text-1:  #1d1d1f;
  --text-2:  #3a3a3c;
  --text-3:  #6e6e73;
  --text-4:  #aeaeb2;
  --border:  rgba(0,0,0,0.08);
  --radius:  14px;
  --shadow:  0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "PingFang SC", "SF Pro Text", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─── Layout ─── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(245,245,247,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
.nav.scrolled { background: rgba(255,255,255,0.95); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: var(--text-3);
}

.nav-links a:hover { color: var(--text-1); }

.nav-cta {
  background: var(--blue);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 13px;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ─── HERO ─── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-dark);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 70% 40%, rgba(0,122,255,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 70%, rgba(52,199,89,0.10) 0%, transparent 60%),
    #0a0a0a;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 96px;
  padding-bottom: 80px;
}

.hero-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  background: rgba(0,122,255,0.12);
  border: 1px solid rgba(0,122,255,0.25);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.0;
  color: #fff;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.3);
  font-size: 20px;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(8px); }
}

/* ─── SECTIONS ─── */
.section {
  padding: 96px 0;
  background: var(--bg-alt);
}
.section-alt { background: var(--bg); }
.section-dark {
  background: #0f0f0f;
  padding: 96px 0 80px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
  margin-bottom: 16px;
  line-height: 1.15;
}

.section-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 640px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: #0066dd; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,122,255,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text-1);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-3); }

.btn-lg { font-size: 17px; padding: 14px 32px; border-radius: 12px; }

.btn-generate {
  width: 100%;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 16px;
  border-radius: 12px;
  margin-top: 8px;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.btn-generate:hover:not(:disabled) {
  background: #0066dd;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,122,255,0.35);
}
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-generate.loading {
  background: #444;
  cursor: wait;
}

/* ─── TWO-COL LAYOUT ─── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ─── ABOUT CARD ─── */
.about-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 40px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
}

.stat-label {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ─── CARD GRID ─── */
.card-grid { display: grid; gap: 20px; }
.three-col { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) { .three-col { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card-coming { border-style: dashed; }

.card-icon { font-size: 28px; margin-bottom: 16px; }

.card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
}

.coming-badge {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0,122,255,0.1);
  color: var(--blue);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ─── GENERATOR CARD ─── */
.generator-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 40px;
  max-width: 680px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.gen-field { margin-bottom: 20px; }

.gen-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
}
.gen-label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

.gen-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.gen-input::placeholder { color: rgba(255,255,255,0.25); }
.gen-input:focus { border-color: var(--blue); background: rgba(0,122,255,0.06); }
.gen-input-mono { font-family: "SF Mono", "Menlo", monospace; font-size: 14px; }

.gen-key-wrap { position: relative; }
.gen-key-wrap .gen-input { padding-right: 48px; }

.gen-eye-btn {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.gen-eye-btn:hover { color: rgba(255,255,255,0.7); }

.gen-key-note {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  margin-top: 6px;
}

.gen-error {
  background: rgba(255,59,48,0.12);
  border: 1px solid rgba(255,59,48,0.25);
  color: #ff6b6b;
  font-size: 13px;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
}

/* ─── RECENT REPORTS ─── */
.recent-reports {
  margin-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
}

.recent-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
}

.report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 14px;
}
.report-item:last-of-type { border-bottom: none; }

.report-company { color: rgba(255,255,255,0.8); font-weight: 500; }
.report-meta { font-size: 12px; color: rgba(255,255,255,0.3); margin-top: 2px; }

.report-link {
  font-size: 12px;
  color: var(--blue);
  background: rgba(0,122,255,0.1);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s;
}
.report-link:hover { background: rgba(0,122,255,0.2); }

.recent-more {
  display: block;
  text-align: right;
  font-size: 13px;
  color: var(--blue);
  margin-top: 16px;
  transition: opacity 0.2s;
}
.recent-more:hover { opacity: 0.7; }

/* ─── LOADING OVERLAY ─── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-box {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
}

.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.overlay-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.dots::after {
  content: '.';
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: '.'; }
  25%  { content: '..'; }
  50%  { content: '...'; }
  75%  { content: ''; }
}

.overlay-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 24px;
  line-height: 1.5;
}

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

.overlay-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  width: 0%;
  transition: width 1.5s ease;
}

.overlay-steps {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.step {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  transition: all 0.3s;
}

.step.step-active {
  color: var(--blue);
  background: rgba(0,122,255,0.12);
}

.step.step-done {
  color: var(--green);
  background: rgba(52,199,89,0.12);
}

/* ─── FOOTER ─── */
.footer {
  background: #050505;
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

.footer-note {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,0.2);
}

/* ─── REPORTS PAGE ─── */
.reports-page {
  min-height: 100vh;
  background: var(--bg);
  padding-top: 80px;
}

.reports-page .container { padding: 48px 24px; }

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.report-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  cursor: pointer;
}
.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blue); }

.report-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.report-card-code {
  font-size: 12px;
  color: var(--text-3);
  font-family: monospace;
}

.report-card-date {
  font-size: 12px;
  color: var(--text-4);
  margin-top: 12px;
}

.report-card-view {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
}

/* rc-* aliases used by app.js renderFullReportsList */
.rc-name { font-size: 17px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; letter-spacing: -0.02em; }
.rc-date { font-size: 12px; color: var(--text-3); margin-bottom: 20px; }
.rc-btn  { font-size: 13px; font-weight: 600; color: var(--blue); }

/* report-item extras */
.report-name  { flex: 1; font-weight: 500; color: rgba(255,255,255,0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-date  { font-size: 12px; color: rgba(255,255,255,0.35); margin: 0 12px; white-space: nowrap; }
.report-arrow { color: var(--blue); font-size: 14px; }
.report-item  { cursor: pointer; transition: background 0.15s; border-radius: 8px; padding: 10px 8px; }
.report-item:hover { background: rgba(255,255,255,0.04); }
.sample-tag   { font-size: 11px; background: rgba(0,122,255,0.15); color: var(--blue); padding: 2px 7px; border-radius: 4px; }
.no-reports-hint { color: rgba(255,255,255,0.3); font-size: 13px; padding: 12px 0; }
.reports-section-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 48px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.reports-section-title:first-child { margin-top: 0; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-3);
}

.empty-state p { margin-top: 12px; font-size: 14px; }

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .generator-card { padding: 24px 20px; }
  .hero-title { font-size: 44px; }
  .section { padding: 60px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
}
