/* ============================================================================
   JobSphere AI — design system (see Areas/Public/DESIGN.md)
   Light, premium theme. Tokens first, then components.
   ========================================================================== */

:root {
    /* palette — off-white base, pure-white elevated surfaces */
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-2: #eef3f1;
    --line: #e3eae8;
    --ink: #0f1a19;
    --muted: #586b68;
    --accent: #0f766e;
    --accent-strong: #115e56;
    --accent-weak: #d7f2ec;
    --accent-ink: #ffffff;

    /* category hues (strong text/rail color) + soft tint backgrounds */
    --cat-ai: #7e22ce;            --cat-ai-bg: #f3e8ff;
    --cat-data: #0369a1;          --cat-data-bg: #e0f2fe;
    --cat-backend: #047857;       --cat-backend-bg: #d1fae5;
    --cat-frontend: #c2410c;      --cat-frontend-bg: #ffedd5;
    --cat-fullstack: #4d7c0f;     --cat-fullstack-bg: #ecfccb;
    --cat-devops: #0e7490;        --cat-devops-bg: #cffafe;
    --cat-cybersecurity: #b91c1c; --cat-cybersecurity-bg: #fee2e2;
    --cat-mobile: #be185d;        --cat-mobile-bg: #fce7f3;
    --cat-sales: #b45309;         --cat-sales-bg: #fef3c7;
    --cat-presales: #b45309;      --cat-presales-bg: #fef3c7;
    --cat-other: #475569;         --cat-other-bg: #eef2f5;

    /* type */
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fs-xs: .78rem;  --fs-sm: .875rem; --fs-md: 1rem;   --fs-lg: 1.25rem;
    --fs-xl: 1.5rem;  --fs-2xl: 1.95rem; --fs-3xl: 2.6rem;

    /* spacing / radius */
    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 40px;
    --r-sm: 8px; --r: 12px; --r-lg: 16px;

    /* soft, diffuse shadows */
    --shadow-1: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.05);
    --shadow-2: 0 6px 16px rgba(16,24,40,.06), 0 2px 4px rgba(16,24,40,.04);
    --shadow-3: 0 18px 40px rgba(16,24,40,.10), 0 6px 12px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-feature-settings: "tnum" 1, "cv05" 1;
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.02em; color: var(--ink); }

.container { max-width: 1180px; }
.tnum { font-variant-numeric: tabular-nums; }
.text-accent { color: var(--accent) !important; }
.muted { color: var(--muted); }

/* accessible focus ring */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, .job-card:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 999;
    background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────── */
/* Single shared primary button. Hero "Search jobs" and the header "Find Jobs"
   CTA both use .btn-primary so they can never drift. .btn-accent is a legacy
   alias kept for existing usages across the views. */
.btn-primary, .btn-accent {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: 10px 18px; line-height: 1; white-space: nowrap;
    background: var(--accent); border: 1px solid var(--accent); color: var(--accent-ink);
    font-weight: 700; border-radius: var(--r-sm); cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn-primary:hover, .btn-accent:hover {
    background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink);
    text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-2);
}
.btn-primary:active, .btn-accent:active {
    background: var(--accent-strong); transform: translateY(0); box-shadow: var(--shadow-1);
}
.btn-primary:focus-visible, .btn-accent:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}

.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    font-weight: 600; border-radius: var(--r-sm);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-weak); text-decoration: none; }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
    /* sticky + z-index gives the header (and its fixed mobile menu) a stacking
       context ABOVE the hero. backdrop-filter already traps the fixed menu in the
       header's context, so without this the open menu would paint under the hero. */
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.navbar { padding: .6rem 0; }
.wordmark {
    font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
    color: var(--ink); display: inline-flex; align-items: center; gap: .55rem; letter-spacing: -.02em;
}
.wordmark:hover { text-decoration: none; }
.brand-dot {
    width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff; font-size: .95rem;
}
.nav-links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
/* plain nav links only — must NOT restyle the .btn-primary CTA */
.nav-links a:not(.btn-primary):not(.btn-accent) { color: var(--muted); font-weight: 500; padding: .45rem .75rem; border-radius: var(--r-sm); }
.nav-links a:not(.btn-primary):not(.btn-accent):hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-cta { margin-left: .35rem; display: inline-flex; }        /* consistent gap before the CTA cluster */
.nav-links .nav-social { margin-left: .1rem; }                  /* CTA -> LinkedIn: tight, intentional */

.nav-toggle {
    display: none; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    width: 42px; height: 42px; border-radius: var(--r-sm); font-size: 1.2rem;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    position: relative; overflow: hidden;
    border-bottom: 1px solid var(--line);
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4.5rem);
    background:
        radial-gradient(900px 380px at 82% -12%, var(--accent-weak), transparent 70%),
        radial-gradient(700px 320px at 10% 0%, rgba(15,118,110,.05), transparent 70%);
}
/* faint accent grid */
.hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .6;
    background-image:
        linear-gradient(rgba(15,118,110,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,118,110,.06) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(620px 320px at 82% 0%, #000, transparent 78%);
            mask-image: radial-gradient(620px 320px at 82% 0%, #000, transparent 78%);
}
.hero .container { position: relative; }
.hero-live {
    display: inline-flex; align-items: center; gap: .5rem; color: var(--muted);
    font-size: var(--fs-sm); background: var(--surface); border: 1px solid var(--line);
    padding: .35rem .7rem; border-radius: 999px; margin-bottom: 1.1rem; box-shadow: var(--shadow-1);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(15,118,110,.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(15,118,110,.4); } 70% { box-shadow: 0 0 0 8px rgba(15,118,110,0); } 100% { box-shadow: 0 0 0 0 rgba(15,118,110,0); } }
.hero-title { font-size: var(--fs-3xl); line-height: 1.05; margin: 0 0 1rem; max-width: 14ch; }
.hero-sub { color: var(--muted); font-size: var(--fs-lg); max-width: 46ch; margin: 0 0 1.75rem; }

/* Signature: elevated white search bar floating over the base */
.search {
    display: flex; gap: .5rem; background: var(--surface); border: 1px solid var(--line);
    padding: .5rem; border-radius: var(--r-lg); box-shadow: var(--shadow-3); flex-wrap: wrap; max-width: 780px;
}
.search .field { position: relative; display: flex; align-items: center; flex: 1 1 240px; }
.search .field i { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.search input, .search select {
    width: 100%; height: 50px; background: transparent; border: none; color: var(--ink);
    padding: 0 .8rem 0 2.3rem; font-size: var(--fs-md); border-radius: var(--r-sm);
}
.search input::placeholder { color: #9aa7a4; }
.search select { flex: 0 1 210px; cursor: pointer; }
.search .btn-primary, .search .btn-accent { height: 50px; padding: 0 1.4rem; white-space: nowrap; }

.chips { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chips .label { color: var(--muted); font-size: var(--fs-sm); margin-right: .25rem; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem;
    color: var(--cat, var(--accent));
    background: var(--cat-bg, var(--accent-weak));
    border: 1px solid transparent; padding: .35rem .75rem; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600;
}
.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip .count { color: inherit; opacity: .7; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── Section headers ─────────────────────────────────────── */
.section { padding: clamp(2.5rem, 5vw, 3.5rem) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-title { font-size: var(--fs-2xl); margin: 0; }
.section-sub { color: var(--muted); margin: .25rem 0 0; }

.page-head { border-bottom: 1px solid var(--line); background: var(--surface); padding: 2rem 0 1.6rem; }
.page-title { font-size: var(--fs-2xl); margin: 0; }
.page-sub { color: var(--muted); margin: .35rem 0 0; }
.crumb { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 .6rem; font-size: var(--fs-sm); color: var(--muted); flex-wrap: wrap; }
.crumb li::after { content: "/"; margin-left: .5rem; color: var(--line); }
.crumb li:last-child::after { content: ""; }

/* ── Job card (signature: category left rail) ───────────── */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }

.job-card {
    position: relative; display: block; background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-left: 3px solid var(--cat, var(--cat-other));
    border-radius: var(--r); padding: var(--s4) var(--s4) var(--s4) calc(var(--s4) + 2px);
    box-shadow: var(--shadow-1); min-height: 190px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.job-card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.job-card:hover .job-title { color: var(--accent); }

.job-row1 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.badge-cat {
    font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em;
    color: var(--cat, var(--cat-other));
    background: var(--cat-bg, var(--cat-other-bg));
    padding: .2rem .55rem; border-radius: 999px;
}
.badge-mode {
    font-size: var(--fs-xs); color: var(--muted); background: var(--surface-2);
    border: 1px solid var(--line); padding: .2rem .55rem; border-radius: 999px;
}
.job-title { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; line-height: 1.3; margin: 0 0 .4rem; color: var(--ink); }
.job-company { color: var(--ink); font-weight: 500; }
.job-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--muted); font-size: var(--fs-sm); margin: .35rem 0 .6rem; }
.job-meta .sep { opacity: .5; }
.job-desc { color: #5a6663; font-size: var(--fs-sm); margin: 0 0 .8rem; }
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.provenance { font-size: var(--fs-xs); color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.view-link { font-size: var(--fs-sm); color: var(--muted); }
.job-card:hover .view-link { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
    .stagger .job-card { opacity: 0; transform: translateY(10px); animation: fadeUp .5s ease forwards; }
    .stagger .job-card:nth-child(1) { animation-delay: .02s; }
    .stagger .job-card:nth-child(2) { animation-delay: .06s; }
    .stagger .job-card:nth-child(3) { animation-delay: .10s; }
    .stagger .job-card:nth-child(4) { animation-delay: .14s; }
    .stagger .job-card:nth-child(5) { animation-delay: .18s; }
    .stagger .job-card:nth-child(6) { animation-delay: .22s; }
    .stagger .job-card:nth-child(n+7) { animation-delay: .26s; }
    @keyframes fadeUp { to { opacity: 1; transform: none; } }
}

/* ── Category grid ───────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.cat-tile {
    display: flex; align-items: center; gap: .75rem; background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4);
    border-left: 3px solid var(--cat, var(--cat-other)); box-shadow: var(--shadow-1);
    transition: box-shadow .15s, transform .15s;
}
.cat-tile:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); text-decoration: none; }
.cat-ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none;
    color: var(--cat, var(--cat-other)); background: var(--cat-bg, var(--cat-other-bg)); }
.cat-name { font-weight: 600; display: block; }
.cat-count { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ── Filters ─────────────────────────────────────────────── */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); position: sticky; top: 84px; box-shadow: var(--shadow-1); }
.filters h2 { font-size: var(--fs-md); font-family: var(--font-body); margin: 0 0 .75rem; }
.filter-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .9rem 0 .35rem; }
.form-field {
    width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
    border-radius: var(--r-sm); padding: .55rem .7rem; font-size: var(--fs-sm);
}
.form-field:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-weak); }

.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; color: var(--muted); font-size: var(--fs-sm); flex-wrap: wrap; }
.sort-flag { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); padding: .25rem .6rem; border-radius: 999px; }

/* ── Detail page ─────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--s5); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow-1); }
.detail-title { font-size: var(--fs-2xl); line-height: 1.15; margin: .4rem 0 .5rem; }
.detail-company { color: var(--ink); font-weight: 500; font-size: 1.05rem; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; color: var(--muted); margin: .8rem 0; }
.skills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.skill { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: var(--fs-sm); padding: .28rem .6rem; border-radius: 999px; }
.desc h3 { font-size: var(--fs-md); font-family: var(--font-body); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.4rem 0 .5rem; }
.desc p { color: #3c4744; margin: 0 0 .8rem; }
.desc ul { color: #3c4744; margin: 0 0 1rem; padding-left: 1.2rem; }
.desc li { margin: .3rem 0; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

.apply-panel { position: sticky; top: 84px; box-shadow: var(--shadow-2); }
.apply-panel h2 { font-size: var(--fs-lg); }
.apply-facts { list-style: none; padding: 0; margin: 1.1rem 0 0; }
.apply-facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.apply-facts li span { color: var(--muted); }
.apply-facts li strong { text-align: right; }
.ext-note { font-size: var(--fs-xs); color: var(--muted); margin-top: .6rem; text-align: center; }

/* ── Empty state ─────────────────────────────────────────── */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.empty i { font-size: 2.2rem; color: #cbd5d1; display: block; margin-bottom: .6rem; }
.empty .suggests { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; justify-content: center; list-style: none; padding: 0; margin: 2rem 0 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block; min-width: 40px; text-align: center; padding: .5rem .7rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); font-variant-numeric: tabular-nums;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .active span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pagination .disabled span { opacity: .45; }

/* ── Footer (light, top border) ──────────────────────────── */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); margin-top: 3rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--muted); font-size: var(--fs-sm); }
.footer-links a:hover { color: var(--ink); }
.footer-note { color: var(--muted); font-size: var(--fs-sm); max-width: 46ch; }

/* Follow-us / LinkedIn */
.footer-social { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; color: var(--muted); font-size: var(--fs-sm); }
.footer-social a { color: var(--muted); display: inline-flex; line-height: 0; }
.footer-social a:hover { color: var(--accent); }
.nav-social a { color: var(--muted); display: inline-flex; line-height: 0; padding: .45rem .5rem; }
.nav-social a:hover { color: var(--accent); }

/* Developer credit — quietest element in the footer */
.dev-credit { color: #93a09d; font-size: .8rem; }
.dev-credit a { color: inherit; text-decoration: none; }
.dev-credit a:hover { color: var(--muted); text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
    .detail-grid { grid-template-columns: 1fr; }
    .apply-panel, .filters { position: static; }
}
@media (max-width: 768px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: fixed; inset: 60px 0 auto 0; flex-direction: column; align-items: stretch;
        background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem;
        gap: .25rem; transform: translateY(-120%); transition: transform .2s ease; z-index: 50; box-shadow: var(--shadow-2);
    }
    .nav-links.open { transform: translateY(0); }
    .nav-links a:not(.btn-primary):not(.btn-accent) { padding: .7rem .8rem; }
    .nav-social { display: none; }
    /* CTA moves to the TOP of the mobile menu as a full-width primary button.
       `order` only applies within this media query, so desktop is unaffected. */
    .nav-cta { order: -1; margin: 0 0 .5rem; width: 100%; }
    .nav-cta .btn-primary, .nav-cta .btn-accent { width: 100%; padding: .8rem 1rem; }
    .search { flex-direction: column; }
    .search .field, .search select, .search .btn-accent { flex: 1 1 auto; width: 100%; }
    .hero-title { font-size: var(--fs-2xl); max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .live-dot { animation: none; }
}
