/*
 * theme.css — KaamKatta. Deep Sahyadri green and marigold (zendu) on warm paper.
 * Direction: confident and warm, like Wellfound's listings with Linear's density,
 * set in Latin and Devanagari side by side (Mukta carries the Marathi).
 * Opens light; the dark set is its own palette (night forest, mint accent).
 */

:root {
  --canvas: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #efeee7;
  --border: #e2e0d6;
  --border-strong: #b5b2a5;
  --ink: #16201c;
  --muted: #5a635e;
  --accent: #0f6b51;
  --accent-hover: #0b5641;
  --accent-ink: #ffffff;
  --accent-text: #0c654c;
  --accent-strong: #094634;
  --accent-soft: #dcefe5;
  --accent-border: #a6d3bf;
  --success: #1d7a3e;
  --success-ink: #ffffff;
  --success-soft: #dff0e3;
  --success-strong: #17652f;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #f7ead9;
  --warning-strong: #8f4207;
  --danger: #b42318;
  --danger-ink: #ffffff;
  --danger-soft: #f8e1de;
  --danger-strong: #a01f15;
  --chart-1: #0f6b51;
  --chart-2: #d99a1e;
  --chart-3: #3a6db3;
  --chart-4: #b2476a;
  --chart-5: #6a58b4;
  --chart-6: #5b8a2a;

  --font-display: "Bricolage Grotesque", "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Figtree", "Mukta", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.03em;
  --eyebrow-tracking: 0.08em;

  --radius-btn: 10px;
  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  --shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.12);
  --btn-weight: 600;

  --x-hero-bg: #10291f;
  --x-hero-ink: #f5f1e4;
  --x-hero-muted: #b9c6bd;
  --x-hero-line: #24463a;
  --x-gold: #f2b33d;
  --x-gold-ink: #2a1c03;
  --x-saffron: #e8772e;
}

html[data-theme="dark"] {
  --canvas: #0e1613;
  --surface: #15201b;
  --surface-2: #1c2923;
  --border: #2a3a33;
  --border-strong: #46584f;
  --ink: #ebefe9;
  --muted: #9eaca4;
  --accent: #3cc08e;
  --accent-hover: #5ad1a3;
  --accent-ink: #05241a;
  --accent-text: #62d6a8;
  --accent-strong: #9be8c7;
  --accent-soft: #163a2d;
  --accent-border: #2b6b53;
  --success: #3aa860;
  --success-ink: #06200f;
  --success-soft: #16301f;
  --success-strong: #7fd39b;
  --warning: #d98a2b;
  --warning-ink: #261400;
  --warning-soft: #36260f;
  --warning-strong: #f0b770;
  --danger: #e0574b;
  --danger-ink: #2a0604;
  --danger-soft: #3a1a17;
  --danger-strong: #f29b92;
  --chart-1: #3cc08e;
  --chart-2: #f2b33d;
  --chart-3: #6c9be0;
  --chart-4: #e07aa0;
  --chart-5: #a593ec;
  --chart-6: #9ccc5c;

  --x-hero-bg: #08110d;
  --x-hero-ink: #f5f1e4;
  --x-hero-muted: #a8b6ad;
  --x-hero-line: #1f3a2f;
  --x-gold: #f2b33d;
  --x-gold-ink: #2a1c03;
  --x-saffron: #f08a45;
}

/* app.css — KaamKatta's own pieces: the bar, the search device, job cards,
   the match ring, the stepper, the AI cards. Tokens only. */

/* ---- Bar --------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(8px);
}
.brand-mark {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-family: "Mukta", var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1; padding-bottom: .1rem;
}
.brand-mark-sm { width: 1.5rem; height: 1.5rem; border-radius: 7px; font-size: .9rem; }
.brand-sub { display: block; font-family: "Mukta", var(--font-body); font-size: .7rem; font-weight: 600; line-height: 1; color: var(--muted); letter-spacing: .01em; }
.nav-link {
  display: inline-flex; align-items: center; gap: .5rem; height: 2.25rem; padding: 0 .75rem;
  border-radius: 8px; font-size: .875rem; font-weight: 600; color: var(--muted);
  transition: background-color .15s, color .15s;
}
.nav-link .icon { width: 1rem; height: 1rem; }
.nav-link:hover { color: var(--ink); background: var(--surface-2); }
.nav-link.is-active { color: var(--accent-strong); background: var(--accent-soft); }
.mobile-nav { min-width: 14rem; display: flex; flex-direction: column; }
.mobile-nav .nav-link { width: 100%; }

/* ---- Hero & search device ------------------------------------------------ */
.hero-band {
  background:
    radial-gradient(60rem 22rem at 85% -10%, color-mix(in srgb, var(--x-saffron) 32%, transparent), transparent 70%),
    var(--x-hero-bg);
  color: var(--x-hero-ink);
  border-bottom: 1px solid var(--x-hero-line);
}
.hero-sub { color: var(--x-hero-muted); }
.hero-hl {
  color: var(--x-gold-ink); background: var(--x-gold);
  padding: 0 .18em; border-radius: .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px;
  font-family: "Mukta", var(--font-body); font-weight: 600; font-size: .9rem;
  color: var(--x-hero-ink); background: color-mix(in srgb, var(--x-saffron) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--x-saffron) 55%, transparent);
}
.hero-title { font-family: "Mukta", var(--font-display); line-height: 1.08; }
.hero-chip {
  display: inline-flex; align-items: center; height: 1.875rem; padding: 0 .75rem; border-radius: 999px;
  border: 1px solid var(--x-hero-line); color: var(--x-hero-ink); font-weight: 500;
  background: color-mix(in srgb, var(--x-hero-ink) 6%, transparent);
  transition: background-color .15s, border-color .15s;
}
.hero-chip:hover { background: color-mix(in srgb, var(--x-hero-ink) 14%, transparent); border-color: var(--x-hero-muted); }

.search-device {
  display: flex; flex-direction: column; gap: .5rem; padding: .5rem;
  background: var(--surface); color: var(--ink); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
@media (min-width: 640px) { .search-device { flex-direction: row; align-items: stretch; } }
.search-cell {
  display: flex; align-items: center; gap: .625rem; min-width: 0; padding: 0 1rem; height: 3.25rem;
  border-radius: 12px; background: var(--surface-2); cursor: text;
}
.search-cell:focus-within { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.search-input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none;
  font-size: 1rem; color: var(--ink);
}
.search-input::placeholder { color: var(--muted); }
.search-go { height: 3.25rem; border-radius: 12px; }

/* ---- Filters ---------------------------------------------------------------- */
.filters { display: flex; flex-direction: column; gap: 1.5rem; }
.filter-group { display: flex; flex-direction: column; gap: .125rem; }
.filter-title { font-size: .75rem; font-weight: 700; letter-spacing: var(--eyebrow-tracking); text-transform: uppercase; color: var(--muted); margin-bottom: .375rem; }
.facet {
  display: flex; align-items: center; gap: .625rem; padding: .375rem .5rem; margin: 0 -.5rem;
  border-radius: 8px; font-size: .9rem; cursor: pointer; transition: background-color .15s;
}
.facet:hover { background: var(--surface-2); }
.facet input { width: 1rem; height: 1rem; accent-color: var(--accent); }
.facet-n { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.facet.is-empty { opacity: .55; }
.filters-toggle:checked ~ .filters { display: flex; }
@media (max-width: 1023px) {
  .filters { display: none; margin-top: 1rem; padding: 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
}
.mr-toggle {
  display: flex; align-items: center; gap: .625rem; padding: .7rem .8rem; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--x-saffron) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--x-saffron) 40%, var(--border));
  font-family: "Mukta", var(--font-body); font-weight: 600;
}
.mr-toggle input { width: 1rem; height: 1rem; accent-color: var(--x-saffron); }
.mr-toggle:has(input:checked) { border-color: var(--x-saffron); box-shadow: inset 0 0 0 1px var(--x-saffron); }

/* ---- Job cards ---------------------------------------------------------------- */
.job-card {
  position: relative; padding: 1.25rem; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .15s, box-shadow .2s, transform .2s;
}
.job-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-card); transform: translateY(-1px); }
.job-card.is-featured { border-left: 3px solid var(--x-gold); }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.job-card .badge, .job-card .skill, .job-card .mr-badge { position: relative; }
.feat-badge { background: color-mix(in srgb, var(--x-gold) 22%, var(--surface)); color: var(--ink); }
.mr-badge {
  display: inline-flex; align-items: center; gap: .3rem; height: 1.5rem; padding: 0 .5rem; border-radius: 6px;
  font-family: "Mukta", var(--font-body); font-size: .75rem; font-weight: 700; white-space: nowrap;
  color: var(--ink); background: color-mix(in srgb, var(--x-saffron) 20%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--x-saffron) 45%, transparent);
}

.skill {
  display: inline-flex; align-items: center; gap: .25rem; height: 1.5rem; padding: 0 .5rem; border-radius: 6px;
  font-size: .75rem; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--ink);
}
.skill-lg { height: 2rem; padding: 0 .75rem; font-size: .875rem; border-radius: 8px; }
.skill-yes { background: var(--success-soft); color: var(--success-strong); }
.skill-no { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--border-strong); }

.co-tile {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 2.75rem; height: 2.75rem; border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  background: var(--accent-soft); color: var(--accent-strong);
}
.co-tile-lg { width: 4rem; height: 4rem; border-radius: 16px; font-size: 1.35rem; }
.co-tile-sm { width: 2.25rem; height: 2.25rem; border-radius: 10px; font-size: .8rem; }

/* ---- Match ring ----------------------------------------------------------------- */
.match-ring {
  --ring-c: var(--chart-1);
  position: relative; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 999px;
  width: 2.75rem; height: 2.75rem;
  background: conic-gradient(var(--ring-c) calc(var(--p) * 1%), var(--surface-2) 0);
}
.match-ring::before { content: ""; position: absolute; inset: 4px; border-radius: inherit; background: var(--surface); }
.match-num { position: relative; font-family: var(--font-display); font-weight: 700; font-size: .8rem; line-height: 1; color: var(--ink); }
.match-num small { font-size: .6em; color: var(--muted); }
.match-lg { width: 4rem; height: 4rem; }
.match-lg::before { inset: 5px; }
.match-lg .match-num { font-size: 1.15rem; }
.match-hi { --ring-c: var(--chart-1); }
.match-mid { --ring-c: var(--x-gold); }
.match-lo { --ring-c: var(--border-strong); }

.bm-btn {
  display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 10px;
  color: var(--muted); border: 1px solid var(--border); background: var(--surface);
  transition: color .15s, background-color .15s, border-color .15s;
}
.bm-btn:hover { color: var(--ink); border-color: var(--border-strong); }
.bm-btn .icon { width: 1.05rem; height: 1.05rem; }
.bm-btn.is-saved { color: var(--x-gold-ink); background: var(--x-gold); border-color: var(--x-gold); }
.bm-btn.is-saved .icon { fill: currentColor; }

/* ---- Job page ---------------------------------------------------------------------- */
.fact { display: flex; flex-direction: column; gap: .125rem; padding: .875rem 1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.fact-k { font-size: .75rem; color: var(--muted); font-weight: 600; }
.fact-v { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.job-prose h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.job-prose ul { list-style: none; padding-left: 0; }
.job-prose li { position: relative; padding-left: 1.25rem; }
.job-prose li::before { content: ""; position: absolute; left: 0; top: .6em; width: .45rem; height: .45rem; border-radius: 2px; background: var(--accent); }
.apply-card { border-top: 4px solid var(--accent); }
.cv-attach { padding: .875rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.cover { padding: .75rem 1rem; border-left: 3px solid var(--accent-border); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: .9rem; color: var(--ink); white-space: pre-line; }

/* ---- AI cards --------------------------------------------------------------------------------- */
.ai-card { border-top: 4px solid var(--x-saffron); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 1.9rem; padding: 0 .8rem; border-radius: 7px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: background-color .15s, color .15s; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.seg input:focus-visible + span { box-shadow: var(--ring); }
.ai-loading { display: none; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; font-size: .9rem; font-weight: 600; color: var(--accent-strong); background: var(--accent-soft); }
.htmx-request .ai-loading, .htmx-request.ai-loading { display: flex; opacity: 1; }
.ai-result { display: flex; flex-direction: column; gap: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.ai-h { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; font-family: "Mukta", var(--font-display); font-size: 1rem; font-weight: 700; }
.ai-h .icon { color: var(--accent-text); }
.ai-list { display: flex; flex-direction: column; gap: .45rem; font-size: .925rem; }
.ai-list li { position: relative; padding-left: 1.2rem; }
.ai-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: .45rem; height: .45rem; border-radius: 999px; background: var(--x-saffron); }
.ai-fixes { display: flex; flex-direction: column; gap: .6rem; }
.ai-fixes li { padding: .75rem .9rem; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.ai-quote { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: .9rem 1rem; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-size: .95rem; }
.mr-tip { display: flex; align-items: flex-start; gap: .6rem; padding: .85rem 1rem; border-radius: 12px; font-size: .925rem; background: color-mix(in srgb, var(--x-saffron) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--x-saffron) 40%, var(--border)); }
.mr-tip .icon { flex-shrink: 0; margin-top: .2rem; color: var(--ink); }
.q-num { display: inline-grid; place-items: center; flex-shrink: 0; width: 1.6rem; height: 1.6rem; margin-right: .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }
.plan { display: flex; flex-direction: column; gap: .45rem; }
.plan li { display: flex; gap: .8rem; align-items: baseline; font-size: .925rem; }
.plan-day { flex-shrink: 0; min-width: 4.2rem; padding: .15rem .5rem; border-radius: 6px; text-align: center; font-size: .75rem; font-weight: 700; background: var(--x-saffron); color: var(--x-gold-ink); }

/* ---- Page heads, dashboards ----------------------------------------------------------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.kpi { padding: 1.1rem 1.25rem; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.kpi:first-child { background: var(--accent); border-color: var(--accent); }
.kpi:first-child, .kpi:first-child .text-muted, .kpi:first-child .icon { color: var(--accent-ink); }

.app-row { padding: 1rem 0; }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: .875rem; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; }
.stepper li::before {
  content: ""; position: absolute; top: .3rem; left: -50%; width: 100%; height: 2px; background: var(--border);
}
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before { background: var(--accent); }
.step-dot { position: relative; width: .75rem; height: .75rem; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--border-strong); }
.stepper li.is-done .step-dot { background: var(--accent); box-shadow: none; }
.stepper li.is-current .step-dot { box-shadow: 0 0 0 4px var(--accent-soft); }
.step-label { font-size: .7rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.stepper li.is-done .step-label { color: var(--ink); }
.stepper.is-stopped { opacity: .45; }

/* ---- Forms -------------------------------------------------------------------------------- */
.demo-box { padding: 1rem 1.25rem; border-radius: var(--radius-card); background: var(--accent-soft); color: var(--accent-strong); }
.role-card {
  position: relative; display: flex; flex-direction: column; gap: .25rem; padding: 1rem; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card .icon { color: var(--accent-text); margin-bottom: .25rem; }
.role-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.role-card:has(input:focus-visible) { box-shadow: var(--ring); }
.signup .company-field { display: none; }
.signup:has(#role-employer:checked) .company-field { display: flex; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.75rem 1rem; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-card); background: var(--surface-2);
}
.dropzone input[type="file"] { max-width: 100%; }
.note-box summary { list-style: none; color: var(--muted); }
.note-box summary::-webkit-details-marker { display: none; }
.note-box[open] summary { color: var(--ink); }

/* ---- Motion: results settle in after a filter change ----------------------------------------- */
@keyframes results-in { from { transform: translateY(6px); } to { transform: none; } }
#results.just-swapped .job-card { animation: results-in .28s var(--ease-out, ease-out) both; }
#results.just-swapped .job-card:nth-child(2) { animation-delay: .03s; }
#results.just-swapped .job-card:nth-child(3) { animation-delay: .06s; }
#results.just-swapped .job-card:nth-child(4) { animation-delay: .09s; }
html.reduced-motion #results.just-swapped .job-card { animation: none; }
