/* ==========================================================================
   repo-sight dashboard — "paper report" theme
   Warm cream/paper base with a forest-green / amber / brick accent system,
   Fraunces serif for display type over IBM Plex Sans + Mono. Severity maps
   directly onto the palette's own semantics: amber = warning, brick =
   critical/error, forest green = healthy.
   MVP v1: a single Overview report (no tab navigation), so the dashboard
   shell is a topbar rather than a side-by-side sidebar + main layout.
   bg #E7ECE6 · surface #F5F7F3 · raised #FFFFFF · border #C4CCC1
   text-primary #15201B · text-muted #48564D · text-faint #7C8A80
   accent (health/forest) #1F6F5C · critical (brick) #A8402A · warning (amber) #B8791F · info (slate) #3E6E8E
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap");

:root {
  --bg: #e7ece6;
  --bg-surface: #f5f7f3;
  --bg-raised: #ffffff;
  --border: #c4ccc1;
  --border-strong: #9ca89a;
  --border-subtle: #dce3d9;
  --text-primary: #15201b;
  --text-muted: #48564d;
  --text-faint: #7c8a80;
  --text-ghost: #9ca89a;
  --accent: #1f6f5c;
  --accent-ink: #0e3f33;
  --accent-dim: #dcebe4;
  --critical: #a8402a;
  --critical-ink: #6e2718;
  --critical-dim: #f3dad3;
  --warning: #b8791f;
  --warning-ink: #6b4a11;
  --warning-dim: #f3e4c8;
  --info: #3e6e8e;
  --info-ink: #1d3e51;
  --info-dim: #dce6ec;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", ui-serif, Georgia, serif;
  --shadow-xs: 0 1px 2px rgba(21, 32, 27, 0.05);
  --shadow-sm: 0 1px 2px rgba(21, 32, 27, 0.06), 0 4px 10px -4px rgba(21, 32, 27, 0.08);
}

/* Grid-paper texture, at a low opacity so it stays out of the way of
   dense content. */
body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(21, 32, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 32, 27, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Perforated "tear-rule" divider, used between the summary cards and the
   rest of the panel. */
.tear-rule {
  height: 14px;
  background-image: repeating-linear-gradient(90deg, var(--text-ghost) 0 12px, transparent 12px 20px);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 2px;
  margin: 22px 0;
}

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

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

::selection {
  background: var(--accent-dim);
}

button,
select,
input {
  font-family: inherit;
}

/* ==========================================================================
   Dashboard topbar
   ========================================================================== */

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.dash-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  row-gap: 10px;
}

.dash-topbar .brand {
  margin-right: 0;
  flex-shrink: 0;
}

.dash-meta {
  margin-right: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-meta-project {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.dash-meta-scan {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.dash-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-ghost {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ==========================================================================
   Main content
   ========================================================================== */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-header p {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 3px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 111, 92, 0.18), 0 10px 20px -10px rgba(31, 111, 92, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-ink);
  transform: translateY(-1px);
}

/* ==========================================================================
   Loading / error states
   ========================================================================== */

#loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 4px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loading-message {
  font-size: 13.5px;
  color: var(--text-muted);
}

#loading-progress {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
}

#loading-tip {
  font-size: 12px;
  color: var(--text-ghost);
  margin-top: 18px;
  max-width: 360px;
}

.error-panel {
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid rgba(168, 64, 42, 0.3);
  background: rgba(168, 64, 42, 0.07);
  border-radius: 8px;
  padding: 20px 24px;
  text-align: center;
}

.error-panel h2 {
  color: var(--critical);
  font-size: 14px;
  margin-bottom: 8px;
}

.error-panel p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   Overview panel
   ========================================================================== */

.overview-top {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.health-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  box-shadow: var(--shadow-sm);
}

.health-gauge {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.health-gauge svg {
  transform: rotate(-90deg);
}

.health-gauge-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.health-gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.health-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.health-gauge-score {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.health-gauge-grade {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  margin-top: 8px;
  color: var(--text-primary);
  border: 1.5px solid var(--text-primary);
  border-radius: 4px;
  padding: 2px 8px 1px;
  transform: rotate(-3deg);
  opacity: 0.85;
}

.health-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.health-meta-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 240px;
  line-height: 1.5;
}

.severity-counts {
  display: flex;
  gap: 14px;
  margin-top: 12px;
}

.severity-count-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.severity-count-label {
  font-size: 10.5px;
  color: var(--text-faint);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-width: 320px;
}

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow-xs);
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
}

.stat-card-value {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

/* Icon chip — small colored container for a stat's icon. Default =
   accent(forest); .amber = complexity metrics; .brick = technical-debt
   metrics (TODOs). */
.icon-chip {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent-dim);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-chip svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}
.icon-chip.amber {
  background: var(--warning-dim);
  color: var(--warning-ink);
}
.icon-chip.brick {
  background: var(--critical-dim);
  color: var(--critical-ink);
}

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.panel-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.panel-body {
  padding: 16px;
}

.longest-fn-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
}

.longest-fn-lines {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: 10px;
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  max-width: 300px;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--warning);
}

.progress-caption {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ==========================================================================
   Metric panels (Size & shape / Structure / Complexity detail) — same
   project-level fields the engine returns, laid out as small label+value
   pairs rather than another full stat-card row.
   ========================================================================== */

.metric-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 14px;
  padding: 16px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.metric-value {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
}

/* ==========================================================================
   Streak strip
   ========================================================================== */

.streak-strip {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-raised);
  box-shadow: var(--shadow-xs);
}

#streak-message {
  font-size: 12.5px;
  color: var(--text-muted);
}

#streak-visual {
  font-size: 13px;
  letter-spacing: 2px;
}

/* ==========================================================================
   Feedback widget (report page)
   ========================================================================== */

.feedback-widget {
  margin-top: 16px;
}

.feedback-prompt {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.feedback-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.feedback-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: 2px;
  color: var(--border-strong);
  transition: color 0.12s ease, transform 0.12s ease;
}

.feedback-star:hover {
  transform: translateY(-1px);
}

.feedback-star.is-active {
  color: var(--warning);
}

.feedback-textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  margin-bottom: 14px;
}

.feedback-textarea:focus {
  border-color: var(--accent);
}

.feedback-textarea::placeholder {
  color: var(--text-faint);
}

.feedback-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feedback-status {
  font-size: 12.5px;
  color: var(--text-faint);
}

.feedback-status.is-error {
  color: var(--critical);
}

.feedback-status.is-success {
  color: var(--accent);
}

.feedback-thanks {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   Landing page
   Marketing homepage shown when the URL has no ?scan= param. Same paper/
   forest-green tokens as the dashboard (bg #E7ECE6, accent #1F6F5C,
   Fraunces + IBM Plex) so the jump from homepage into a report never
   feels like a different product.
   ========================================================================== */

#landing-page {
  width: 100%;
}

#landing-page section > .eyebrow:first-child,
#landing-page > .eyebrow {
  margin-bottom: 12px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.eyebrow-invert {
  color: rgba(231, 236, 230, 0.75);
}
.eyebrow-invert .eyebrow-dot {
  background: #6fd6b4;
}

/* Lexer-token pills -- the page's one deliberate flourish: a nod to the
   engine's own TokenType enum (KEYWORD/IDENTIFIER/OPERATOR/PREPROCESSOR),
   as if the marketing copy is being tokenized the same way source is.
   Sits in normal inline flow (not absolutely positioned) so it can never
   collide with wrapping text at other viewport widths or font metrics. */
.token-pill {
  display: inline-block;
  position: relative;
  top: -1px;
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent-ink);
  background: var(--bg-raised);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}

.token-pill-inline {
  transform: rotate(-2deg);
}

/* ---------------------------------------------------------------------- */
/* Header / nav                                                           */
/* ---------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(231, 236, 230, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
  margin-right: auto;
}

.brand .brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.brand .brand-mark svg {
  width: 14px;
  height: 14px;
  stroke: var(--bg-raised);
}

.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.brand-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: -2px;
  animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
  0%, 45% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text-primary);
}

.btn-nav-cta {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */

.hero {
  padding: 76px 32px 88px;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-underline {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 26px;
}

.hero-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
}

.hero-form #new-scan-url {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.hero-form #new-scan-url:focus {
  border-color: var(--accent);
}

.hero-form #new-scan-url::placeholder {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 13px;
}

.hero-form .btn-primary {
  padding: 13px 22px;
  font-size: 14px;
}

.new-scan-error {
  color: var(--critical);
  font-size: 12.5px;
  margin-top: 12px;
}

.hero-fineprint {
  font-size: 12px;
  color: var(--text-ghost);
  margin-top: 12px;
}

/* Terminal preview card */
.hero-terminal {
  background: #11201a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 19, 0.2), 0 24px 48px -20px rgba(15, 23, 19, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-chrome .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-1 { background: #e0665a; }
.dot-2 { background: #dbb24a; }
.dot-3 { background: #5cbd8f; }

.terminal-title {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(219, 230, 222, 0.55);
}

.terminal-body {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: rgba(219, 230, 222, 0.82);
  padding: 20px 22px 24px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-body .t-strong {
  color: #f2f5f0;
  font-weight: 700;
}

.terminal-body .t-value {
  color: #f2f5f0;
  font-weight: 600;
}

.terminal-body .t-accent {
  color: #6fd6b4;
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Pipeline                                                                */
/* ---------------------------------------------------------------------- */

.pipeline {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 32px 80px;
}

.pipeline h2,
.features h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
  max-width: 640px;
}

.section-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.6;
}

.section-sub code {
  font-family: var(--mono);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.pipeline-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 20px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pipeline-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.pipeline-num {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.pipeline-card h3 {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.pipeline-card p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* Ad slot                                                                 */
/* ---------------------------------------------------------------------- */

.ad-slot {
  max-width: 1180px;
  margin: 0 auto 8px;
  padding: 0 32px;
}

.ad-slot-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  color: var(--text-ghost);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------- */
/* Features                                                                */
/* ---------------------------------------------------------------------- */

.features {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 32px 88px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.feature-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.feature-card-link {
  display: block;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feature-card-link:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--accent-dim);
  color: var(--accent-ink);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.feature-icon-c { background: var(--warning-dim); color: var(--warning-ink); }
.feature-icon-d { background: var(--critical-dim); color: var(--critical-ink); }
.feature-icon-e { background: var(--info-dim); color: var(--info-ink); }

.feature-card h3 {
  font-family: var(--display);
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------- */
/* CTA band + footer                                                       */
/* ---------------------------------------------------------------------- */

.cta-band {
  background: var(--text-primary);
  padding: 56px 32px;
}

.cta-band-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-band h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  color: #f4f7f2;
  margin-bottom: 8px;
}

.cta-band p {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(231, 236, 230, 0.68);
  max-width: 480px;
}

.btn-cta-band {
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-footer {
  background: var(--text-primary);
  border-top: 1px solid rgba(231, 236, 230, 0.1);
  padding: 44px 32px 36px;
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;  gap: 32px;
}

.site-footer .brand-name,
.site-footer .brand {
  color: #f4f7f2;
}

.site-footer .brand .brand-mark {
  background: #f4f7f2;
}

.site-footer .brand .brand-mark svg {
  stroke: var(--text-primary);
}

.footer-brand p {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(231, 236, 230, 0.55);
  margin-top: 12px;
  max-width: 260px;
}

.footer-col h4 {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(231, 236, 230, 0.45);
  margin-bottom: 12px;
}

.footer-col a,
.footer-col .footer-static {
  display: block;
  font-size: 13px;
  color: rgba(231, 236, 230, 0.72);
  text-decoration: none;
  margin-bottom: 10px;
}

.footer-col a:hover {
  color: #f4f7f2;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-terminal {
    max-width: 460px;
  }

  .pipeline-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .overview-top {
    flex-direction: column;
  }

  main {
    padding: 16px;
  }
}

@media (max-width: 640px) {
  .site-header-inner {
    padding: 12px 18px;
  }

  .site-nav {
    display: none;
  }

  .dash-topbar-inner {
    padding: 12px 18px;
  }

  .dash-actions {
    width: 100%;
  }

  .dash-actions .btn-ghost,
  .dash-actions .btn-primary {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  .hero {
    padding: 44px 18px 56px;
  }

  .hero-form {
    flex-direction: column;
  }

  .pipeline,
  .features {
    padding-left: 18px;
    padding-right: 18px;
  }

  .ad-slot {
    padding: 0 18px;
  }

  .pipeline-grid,
  .features-grid,
  .metric-panel-grid {
    grid-template-columns: 1fr;
  }

  .cta-band-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-brand {
    grid-column: auto;
  }

  .token-pill {
    display: none;
  }
}

/* ==========================================================================
   Legal pages (privacy.html, terms.html) — reuses existing tokens/header/
   footer, additive only, no changes to rules above.
   ========================================================================== */
.legal-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.legal-main h1 {
  font-family: var(--display);
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.legal-updated {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.85rem;
  margin-bottom: 40px;
}

.legal-main h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 36px 0 12px;
}

.legal-main p,
.legal-main li {
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 0.98rem;
  line-height: 1.65;
}

.legal-main ul {
  margin: 8px 0 8px 20px;
}

.legal-main li {
  margin-bottom: 6px;
}

.legal-main a {
  color: var(--accent);
}

.legal-main strong {
  color: var(--text-primary);
}
