/* Canonical Labs — Lookalike Finder
   Palette + type lifted verbatim from canonical.cc so this lab is visually
   indistinguishable from the others (Dilution Lab, Fund Modeler, …). */

:root {
  /* electric-blue gradient + palette — exact canonical.cc values */
  --bg-from: #1e3a8a;   /* blue-900 */
  --bg-mid:  #1e40af;   /* blue-800 */
  --bg-to:   #1d4ed8;   /* blue-700 */

  --ink:     #ffffff;
  --muted:   rgba(255, 255, 255, 0.7);
  --subtle:  rgba(255, 255, 255, 0.85);
  --faint:   rgba(255, 255, 255, 0.45);

  --accent:       #2563eb;   /* blue-600 */
  --accent-hover: #1d4ed8;   /* blue-700 */
  --accent-soft:  #bfdbfe;   /* blue-200 — the signature pale-blue accent + glow */

  /* warm "in-progress" accent — the yellow/orange used in the Power Law
     (#facc15) and Semiconductor (#f97316) labs. Active step = yellow, done = grey. */
  --active:        #facc15;  /* yellow-400 */
  --active-strong: #f97316;  /* orange-500 */
  --active-glow:   rgba(250, 204, 21, 0.5);
  --done-grey:     rgba(255, 255, 255, 0.42);
  --pending-grey:  rgba(255, 255, 255, 0.28);

  /* white-card interior palette */
  --card-bg:     #ffffff;
  --card-soft:   rgba(255, 255, 255, 0.95);
  --card-ink:    #0f172a;    /* slate-900 */
  --card-soft-ink: #475569;  /* slate-600 */
  --card-muted:  #64748b;    /* slate-500 */
  --card-faint:  #94a3b8;    /* slate-400 */
  --card-line:   #e2e8f0;    /* slate-200 */
  --card-tint:   #f8fafc;    /* slate-50 */

  --positive: #059669;
  --warning:  #b45309;

  /* amber accents for use INSIDE white cards (yellow #facc15 is unreadable there,
     so we use the readable end of the same warm family) */
  --card-accent:        #d97706;  /* amber-600 — accent text/links on white */
  --card-accent-bright: #f59e0b;  /* amber-500 — score rings + axis bars */
  --card-accent-deep:   #b45309;  /* amber-700 — hover */
  --card-accent-tint:   #fffbeb;  /* amber-50  — top-match wash */

  --font: 'Aeonik Regular', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-from) 0%, var(--bg-mid) 50%, var(--bg-to) 100%);
  background-attachment: fixed;
  color: var(--subtle);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-soft); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #ffffff; }

.tabular, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Header + footer are inherited from the global canonical.cc stylesheet.
   Just the mobile menu (the shared site script is home-page-specific). */
.nav-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-mobile[hidden] { display: none; }

/* ── hero ────────────────────────────────────────────────────────────── */
.hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 9rem 2rem 2.5rem;   /* top clears the fixed shared header */
  text-align: center;
}
/* identical element + rule to canonical.cc/labs/power-law (span.lab-eyebrow):
   font-size 0.75rem → 12px at the default 16px root. */
.lab-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.25rem);
  font-weight: 300;
  line-height: 1.05;
  color: #fff;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}
.hero p {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  font-weight: 300;
}

/* ── search box ──────────────────────────────────────────────────────── */
.search {
  max-width: 720px;
  margin: 2.75rem auto 0;
  padding: 0 2rem;
}
.search-row {
  display: flex;
  gap: 0.75rem;
}
.search input {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.65rem;
  padding: 1rem 1.15rem;
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
  border-color: var(--active);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.14);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.65rem;
  padding: 1rem 1.6rem;
  background: #fff;
  color: var(--bg-from);
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4); }
.btn:disabled { cursor: progress; transform: none; box-shadow: none; }
.btn-spinner {
  display: none;
  width: 15px; height: 15px; flex-shrink: 0;
  border: 2px solid rgba(30, 58, 138, 0.25);
  border-top-color: var(--bg-from);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.search-hint {
  margin: 0.85rem 0.2rem 0;
  font-size: 0.8rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.search-hint .quota { color: var(--active); }

/* ── stage / stepper ─────────────────────────────────────────────────── */
.stage { max-width: 980px; margin: 3rem auto 0; padding: 0 2rem; scroll-margin-top: 6.5rem; }

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--pending-grey);
  transition: color 0.3s ease;
}
.step .dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.74rem; font-variant-numeric: tabular-nums; line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--pending-grey);
  background: transparent;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
/* active = warm yellow + glow + pulse */
.step.active { color: var(--active); font-weight: 500; }
.step.active .dot {
  background: var(--active);
  color: #1e293b;
  border-color: var(--active);
  animation: glow 1.4s ease-in-out infinite;
}
/* completed = grey, with a check */
.step.done { color: var(--done-grey); }
.step.done .dot {
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
  color: var(--done-grey);
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 9px var(--active-glow); }
  50%      { box-shadow: 0 0 20px var(--active-glow); }
}

/* live status row: spinner + yellow message */
.run-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 1.5rem;
  margin-bottom: 2rem;
}
.run-status .status-text { color: var(--active); font-size: 1rem; }
.spinner {
  width: 16px; height: 16px; flex-shrink: 0;
  border: 2px solid rgba(250, 204, 21, 0.25);
  border-top-color: var(--active);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── cards ───────────────────────────────────────────────────────────── */
.card {
  background-color: var(--card-soft);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  color: var(--card-soft-ink);
  padding: 1.75rem;
}

/* source profile summary */
.source-card { margin-bottom: 1.75rem; }
.source-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.source-name { font-size: 1.4rem; font-weight: 600; color: var(--card-ink); margin: 0; }
.source-sub { color: var(--card-muted); font-size: 0.9rem; margin: 0.15rem 0 0; }
.label {
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--card-faint); margin: 1.25rem 0 0.6rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  background: var(--card-tint);
  border: 1px solid var(--card-line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: var(--card-soft-ink);
}
.chip .w { color: var(--card-accent); font-variant-numeric: tabular-nums; margin-left: 0.35rem; font-size: 0.72rem; font-weight: 600; }
.arc { margin: 0.4rem 0 0; color: var(--card-soft-ink); font-size: 0.92rem; }

/* profile / match link buttons (LinkedIn · X · source) */
.links { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.link-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 500;
  padding: 0.34rem 0.7rem; border-radius: 999px;
  border: 1px solid var(--card-line); background: var(--card-tint);
  color: var(--card-soft-ink); cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.link-btn:hover { border-color: var(--card-accent-bright); color: var(--card-accent); background: #fff; }
.link-btn svg { width: 13px; height: 13px; }

/* lightweight feedback affordance on every profile */
.fb { margin-top: 0.25rem; }
.fb-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.78rem; color: var(--card-muted);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.fb-toggle:hover { color: var(--card-accent); }
.fb-form { margin-top: 0.65rem; }
.fb-form textarea {
  width: 100%; resize: vertical; min-height: 58px;
  font-family: var(--font); font-size: 0.85rem; color: var(--card-ink);
  border: 1px solid var(--card-line); border-radius: 0.5rem;
  padding: 0.55rem 0.7rem; outline: none;
}
.fb-form textarea:focus { border-color: var(--card-accent-bright); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12); }
.fb-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.fb-send {
  background: var(--card-accent); color: #fff; border: none; cursor: pointer;
  border-radius: 0.5rem; padding: 0.4rem 0.95rem; font: inherit; font-size: 0.8rem; font-weight: 600;
  transition: background 0.15s ease;
}
.fb-send:hover { background: var(--card-accent-deep); }
.fb-cancel { background: none; border: none; cursor: pointer; color: var(--card-muted); font: inherit; font-size: 0.8rem; }
.fb-thanks { color: var(--positive); font-size: 0.82rem; font-weight: 500; }

/* results grid */
.results-title {
  text-align: center; color: #fff; font-weight: 300;
  font-size: 1.75rem; margin: 0.5rem 0 1.75rem;
}
.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.match {
  display: flex; flex-direction: column; gap: 0.85rem;
  border: 1px solid var(--card-line);
  animation: rise 0.5s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.match:hover { transform: translateY(-4px); box-shadow: 0 26px 32px -12px rgba(0, 0, 0, 0.32); }
.match.top {
  border-color: var(--card-accent-bright);
  background: linear-gradient(150deg, #fff 0%, var(--card-accent-tint) 100%);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.match-badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--card-accent-deep); background: var(--card-accent-tint);
  border: 1px solid var(--card-accent-bright); border-radius: 999px;
  padding: 0.2rem 0.6rem; margin-bottom: -0.2rem;
}
.match-head { display: flex; align-items: center; justify-content: space-between; gap: 0.85rem; }
.match-name { font-size: 1.2rem; font-weight: 600; color: var(--card-ink); margin: 0; }
.match-role { color: var(--card-muted); font-size: 0.85rem; margin: 0.1rem 0 0; }

/* circular score gauge */
.score { position: relative; width: 58px; height: 58px; flex-shrink: 0; }
.score svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.score .ring-bg { fill: none; stroke: var(--card-line); }
.score .ring-fg { fill: none; stroke: var(--card-accent-bright); stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1); }
.score .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.92rem; font-weight: 600; color: var(--card-ink);
  letter-spacing: -0.02em;
}

.match-arc { font-size: 0.9rem; color: var(--card-soft-ink); margin: 0; }

.axes { display: flex; flex-direction: column; gap: 0.4rem; }
.axis { font-size: 0.78rem; }
.axis-top { display: flex; justify-content: space-between; color: var(--card-muted); margin-bottom: 0.2rem; }
.axis-bar { height: 5px; background: var(--card-line); border-radius: 3px; overflow: hidden; }
.axis-fill { height: 100%; background: var(--card-accent-bright); border-radius: 3px; transition: width 0.7s ease; }

.match-note {
  font-size: 0.85rem; color: var(--card-soft-ink);
  border-top: 1px solid var(--card-line); padding-top: 0.85rem; margin: 0;
}
.match-note b { color: var(--card-ink); font-weight: 600; }

/* notices */
.notice {
  max-width: 640px; margin: 2rem auto 0; padding: 1.1rem 1.35rem;
  border-radius: 0.65rem; font-size: 0.92rem;
  /* warm yellow/orange — matches the in-progress accent used across the labs */
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: var(--subtle);
}
.notice b { color: var(--active); }
/* genuine failures stay red so they read as errors, not warnings */
.notice.error { background: rgba(252, 165, 165, 0.08); border-color: rgba(252, 165, 165, 0.5); }
.notice.error b { color: #fecaca; }

/* methodology */
.method { max-width: 760px; margin: 5rem auto 0; padding: 0 2rem; }
.method h2 { color: #fff; font-weight: 300; font-size: 1.6rem; text-align: center; margin-bottom: 0.5rem; }
.method-sub { text-align: center; color: var(--muted); margin: 0 0 2.25rem; font-weight: 300; }
.method-steps { display: grid; gap: 1rem; }
.method-step {
  display: flex; gap: 1rem; align-items: flex-start;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem; padding: 1.1rem 1.3rem;
}
.method-num {
  font-family: var(--mono); color: var(--active); font-size: 0.85rem;
  flex-shrink: 0; padding-top: 0.1rem; min-width: 1.5rem;
}
.method-step h3 { color: #fff; font-size: 0.98rem; font-weight: 500; margin: 0 0 0.2rem; }
.method-step p { color: var(--muted); font-size: 0.88rem; margin: 0; }

/* Give the inherited global footer breathing room from the methodology section. */
.method { margin-bottom: 5rem; }

/* namespaced so it never collides with the global Tailwind `.hidden` the
   inherited canonical header relies on (class="hidden md:flex"). */
.is-hidden { display: none !important; }

@media (max-width: 560px) {
  .search-row { flex-direction: column; }
  .nav { padding-top: 1.25rem; }
  .hero { padding-top: 3.5rem; }
}
