/* ── Hero ── */
.hero {
  background: var(--bg-base);
  padding: var(--space-20) var(--space-8) var(--space-24);
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Ambient glow layer */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(15,118,110,0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% -10%, rgba(37,99,235,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* ── Infinite grid background ── */
.hero-grid-base,
.hero-grid-reveal {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-grid-base { opacity: 0.04; z-index: 0; }
.hero-grid-reveal {
  opacity: 0.35;
  z-index: 0;
  mask-image: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), black, transparent);
  -webkit-mask-image: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), black, transparent);
}
.hero-grid-base svg,
.hero-grid-reveal svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: var(--space-5);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-4);
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent-light), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto var(--space-10);
}

/* ── Search bar ── */
.hero-search {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  margin: 0 auto var(--space-8);
}
.hero-search-row {
  display: flex;
  gap: var(--space-3);
  position: relative;
}
.hero-search-input-wrap {
  flex: 1;
  position: relative;
}
.hero-search-input {
  width: 100%;
  height: 62px;
  padding: 0 90px 0 var(--space-6);
  font-size: var(--text-md);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.hero-search-input::placeholder { color: transparent; }

/* ── Animated placeholder ── */
.hero-animated-ph {
  position: absolute;
  left: 24px;
  right: 100px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  overflow: hidden;
  height: 26px;
  display: flex;
  align-items: center;
}
.hero-ph-text {
  display: block;
  font-size: var(--text-md);
  font-family: var(--font-body);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  will-change: transform, opacity;
}
@keyframes ph-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
@keyframes ph-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-ph-text.ph-out { animation: ph-slide-out 0.3s ease forwards; }
.hero-ph-text.ph-in  { animation: ph-slide-in  0.35s ease forwards; }
.hero-search-input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 4px var(--accent-glow);
}
.hero-search-input.field-flagged--warning {
  border-color: var(--signal-warning-text) !important;
  box-shadow: 0 0 0 3px var(--signal-warning-bg) !important;
}
.hero-search-input.field-flagged--blocked {
  border-color: var(--signal-danger-text) !important;
  box-shadow: 0 0 0 3px var(--signal-danger-bg) !important;
}
.hero-char-counter {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.25s ease;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}
.hero-char-counter--visible { opacity: 1; }
.hero-char-counter--warn { color: var(--signal-warning-text); font-weight: 500; }
.hero-char-counter--danger { color: var(--signal-warning); font-weight: 600; }
.hero-search-btn {
  height: 62px;
  padding: 0 var(--space-8);
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-deep);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-accent);
}
.hero-search-btn:hover { background: var(--accent-primary); }
.hero-search-btn:active { transform: scale(0.98); }
.hero-search-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.hero-search-btn svg { flex-shrink: 0; }
.hero-search-btn .btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hero-spin 0.6s linear infinite;
}
.hero-search-btn.btn-loading .btn-spinner { display: inline-block; }
.hero-search-btn.btn-loading .btn-icon { display: none; }
@keyframes hero-spin { to { transform: rotate(360deg); } }

/* ── Moderation notice (landing page) ──
   Overall severity (container, title, description, input border) is driven
   by whether ANY flag is non-overridable (prompt_injection). Individual flag
   cards are colored per-flag — a mixed set shows red + amber side by side. */
.hero-moderation-error {
  color: var(--signal-warning-text);
  background: var(--signal-warning-bg);
  border: 1px solid var(--signal-warning-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  animation: hero-mod-in 0.3s ease;
}
.hero-moderation-error.is-blocked {
  color: var(--signal-danger-text);
  background: var(--signal-danger-bg);
  border-color: var(--signal-danger-border);
}
@keyframes hero-mod-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-moderation-title {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  color: var(--signal-warning-text);
}
.hero-moderation-error.is-blocked .hero-moderation-title {
  color: var(--signal-danger-text);
}
.hero-moderation-desc {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}
/* Flag card — default amber; --blocked variant overrides to red (per-flag) */
.hero-moderation-flag {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--signal-warning-border);
  border-radius: var(--radius-md);
}
.hero-moderation-flag--blocked {
  border-color: var(--signal-danger-border);
}
.hero-moderation-flag:last-child { margin-bottom: 0; }
.hero-moderation-flag-category {
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: 0.5px;
  margin-bottom: var(--space-1);
  color: var(--signal-warning-text);
  font-family: var(--font-mono);
}
.hero-moderation-flag--blocked .hero-moderation-flag-category {
  color: var(--signal-danger-text);
}
.hero-moderation-flag-excerpt {
  font-style: italic;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}
.hero-moderation-flag-reason {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
}
/* Override section — only rendered when no flag is non-overridable */
.hero-moderation-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-3);
  color: var(--signal-warning-text);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.hero-moderation-divider::before,
.hero-moderation-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--signal-warning-border);
}
.hero-moderation-ack {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.hero-moderation-ack input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--signal-warning-text);
  cursor: pointer;
}
.hero-moderation-ack label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
  cursor: pointer;
}
/* Ghost/outline button — deliberately demoted below the implicit primary
   action (editing the query and re-submitting). */
.hero-moderation-continue {
  display: inline-flex;
  align-self: center;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 38px;
  margin-top: var(--space-3);
  padding: 0 var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--signal-warning-text);
  background: transparent;
  border: 1px solid var(--signal-warning-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.hero-moderation-continue:hover:not(:disabled) {
  background: var(--signal-warning-bg);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}
.hero-moderation-continue:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.hero-client-error {
  color: var(--signal-danger-text);
  background: var(--signal-danger-bg);
  border: 1px solid var(--signal-danger-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  width: 100%;
  text-align: left;
  display: none;
  animation: hero-mod-in 0.3s ease;
}

/* ── Trust badges ── */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.trust-badge-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
}

/* ── How it works ── */
.section {
  padding: var(--space-20) var(--space-8);
}
.section-inner {
  max-width: 1000px;
  margin: 0 auto;
}
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-primary);
  text-align: center;
  margin-bottom: var(--space-3);
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  letter-spacing: -0.5px;
  margin-bottom: var(--space-12);
}

/* Pipeline steps */
.pipeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  position: relative;
}
.pipeline::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border-dim);
  z-index: 0;
}
.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.pipeline-icon {
  width: 72px; height: 72px;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.pipeline-step:hover .pipeline-icon {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}
.pipeline-icon svg {
  width: 36px; height: 36px;
  color: var(--accent-deep);
}
.pipeline-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.pipeline-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* ── Why supplydar ── */
.why-section {
  background: var(--bg-surface);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.why-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8) 28px;
  border: 1px solid var(--border-default);
  transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.why-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}
.why-card-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}
.why-card-icon svg {
  width: 28px; height: 28px;
  color: var(--accent-deep);
}
.why-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.why-card p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.6;
}

/* ── Scroll-triggered reveals ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 240ms; }
.reveal-d4 { transition-delay: 320ms; }
.reveal-d5 { transition-delay: 400ms; }

/* ── Pipeline line pulse ── */
.pipeline::before {
  background: linear-gradient(90deg, transparent, var(--accent-deep), var(--accent-primary), var(--accent-deep), transparent) !important;
  height: 1px !important;
  opacity: 0.5;
}

/* ── Section divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  max-width: 600px;
  margin: 0 auto;
}

/* ── CTA section ── */
.cta-section {
  text-align: center;
  padding: var(--space-20) var(--space-8);
}
.cta-section h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.cta-section p {
  font-size: var(--text-base);
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px var(--space-8);
  font-size: var(--text-base);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--accent-deep);
  border: none;
  border-radius: var(--radius-lg);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition: background var(--dur-fast) var(--ease-out);
}
.cta-btn:hover { background: var(--accent-primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { padding: var(--space-12) var(--space-5) var(--space-16); }
  .hero h1 { font-size: 34px; }
  .hero-sub { font-size: var(--text-base); }
  .hero-search-row { flex-direction: column; }
  .hero-search-input { height: 54px; font-size: var(--text-base); padding-right: 70px; }
  .hero-animated-ph { right: 75px; }
  .hero-ph-text { font-size: var(--text-base); }
  .hero-search-btn { height: 52px; justify-content: center; }
  .trust-badges { gap: var(--space-4); }

  .section { padding: 56px var(--space-5); }
  .section-title { font-size: var(--text-xl); }

  .pipeline {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    max-width: 280px;
    margin: 0 auto;
  }
  .pipeline::before { display: none; }

  .why-grid { grid-template-columns: 1fr; }

  .cta-section { padding: 56px var(--space-5); }
  .cta-section h2 { font-size: 26px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-grid-base, .hero-grid-reveal { display: none; }
}
