/* Welcome view (views/welcome.mjs). Tokens only; class names start with .welcome- */

.welcome {
  display: grid;
  gap: var(--space-7);
  padding-top: var(--space-6);
  min-width: 0;
}

/* ------------------------------------------------------------------ continue strip */
.welcome-resume {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.welcome-resume-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.welcome-resume-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-2);
  row-gap: 2px;
}
.welcome-resume-label { color: var(--ink-3); font-size: var(--text-xs); flex-basis: 100%; }
.welcome-resume-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.welcome-resume-meta { color: var(--ink-2); font-size: var(--text-xs); }

/* ------------------------------------------------------------------ hero */
.welcome-hero { max-width: 900px; min-width: 0; }
.welcome-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-4);
  color: var(--ink-3);
  font: 600 var(--text-xs)/1 var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.welcome-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.welcome-tagline {
  margin: 0 0 var(--space-4);
  max-width: 21ch;
  font-size: var(--text-2xl);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.welcome-tagline-kicker {
  display: block;
  margin-top: 0.3em;
  font-size: 0.62em;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink-2);
}
.welcome-subhead {
  margin: 0;
  max-width: 60ch;
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.45;
  text-wrap: pretty;
}
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.welcome-fileline {
  margin: var(--space-3) 0 0;
  max-width: 70ch;
  color: var(--ink-3);
  font-size: var(--text-sm);
}
.welcome-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  border-radius: 3px;
}
.welcome-link:hover { text-decoration-thickness: 2px; }

.welcome-notraces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  animation: pop-in var(--dur-slow) var(--ease);
}
.welcome-notraces-item { display: flex; gap: var(--space-3); min-width: 0; }
.welcome-notraces-item h3 { font-size: var(--text-sm); margin-bottom: 4px; }
.welcome-notraces-item p { margin: 0; color: var(--ink-2); }
.welcome-notraces-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  flex: none;
}
.welcome-notraces > .hint { grid-column: 1 / -1; }

/* ------------------------------------------------------------------ funnel figure */
.welcome-figure { margin: 0; display: grid; gap: var(--space-3); min-width: 0; }
.welcome-figure-art {
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
}
.welcome-figure.is-loading .welcome-figure-art {
  aspect-ratio: 1200 / 720;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: welcome-pulse 1.2s var(--ease) infinite alternate;
}
.welcome-figure.is-loading .welcome-figure-caption { visibility: hidden; }
.welcome-funnel-svg { display: block; width: 100%; height: auto; }
.welcome-figure-hint { display: none; margin: 0; color: var(--ink-3); font-size: var(--text-xs); }
.welcome-figure-caption {
  max-width: 88ch;
  color: var(--ink-3);
  font-size: var(--text-xs);
  line-height: 1.55;
}

/* ------------------------------------------------------------------ sections */
.welcome-section { display: grid; gap: var(--space-4); min-width: 0; }
.welcome-section-head { display: grid; gap: 4px; }
.welcome-section-head p { margin: 0; }

/* Sample cards */
.welcome-samples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.welcome-sample-item { display: flex; min-width: 0; }
.welcome-sample {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  min-width: 0;
  padding: var(--space-4) var(--space-4) 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a.welcome-sample:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--shadow-pop);
  transform: translateY(-1px);
}
a.welcome-sample:hover .welcome-sample-icon { background: var(--accent-soft); color: var(--accent); }
.welcome-sample-top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.welcome-sample-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  flex: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.welcome-sample-view { color: var(--ink-3); font-size: var(--text-xs); font-weight: 500; }
.welcome-sample-name { font-size: var(--text-md); font-weight: 600; line-height: 1.3; letter-spacing: -0.005em; }
.welcome-sample-line { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.45; }
.welcome-sample-foot {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
}
.welcome-sample-count { color: var(--ink-2); font-weight: 500; }
.welcome-sample-meter {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.welcome-sample-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.welcome-sample-state { grid-column: 1 / -1; color: var(--ink-3); }
.welcome-sample-state.is-started { color: var(--ink-2); }

.welcome-sample.is-skeleton { gap: 10px; min-height: 196px; }
.welcome-skel {
  display: block;
  height: 12px;
  width: 60%;
  border-radius: 6px;
  background: var(--surface-2);
  animation: welcome-pulse 1.2s var(--ease) infinite alternate;
}
.welcome-skel.is-icon { width: 36px; height: 36px; border-radius: 9px; }
.welcome-skel.is-wide { width: 90%; }
.welcome-skel.is-short { width: 35%; margin-top: auto; }

.welcome-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-2);
}
.welcome-note p { margin: 0; flex: 1 1 260px; }

/* Method panel */
.welcome-steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.welcome-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.welcome-step p { margin: 0; color: var(--ink-2); }
.welcome-step strong { color: var(--ink); font-weight: 600; }
.welcome-step-num {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font: 500 var(--text-xs)/1 var(--font-mono);
  flex: none;
}

@keyframes welcome-pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  /* The funnel keeps a readable size and scrolls sideways inside its own box. */
  .welcome-figure-art { overflow-x: auto; overscroll-behavior-x: contain; }
  .welcome-figure-art > .welcome-funnel-svg { width: 760px; max-width: none; }
  .welcome-figure.is-ready .welcome-figure-hint { display: block; }
}

@media (max-width: 640px) {
  .welcome { gap: var(--space-6); padding-top: var(--space-5); }
  .welcome-tagline { font-size: var(--text-xl); line-height: 1.12; }
  .welcome-subhead { font-size: var(--text-md); }
  .welcome-actions .btn, .welcome-actions .setup-import, .welcome-actions .setup-filebtn { width: 100%; }
  .welcome-resume { flex-wrap: wrap; }
  .welcome-resume .btn { width: 100%; }
  .welcome-figure-art { border-radius: 10px; }
}
