/* =========================================================================
   getFreelancer.com — design system
   Light default + dark theme via [data-theme="dark"].
   ========================================================================= */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  /* brand */
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --amber: #ffb020;
  --amber-600: #f59e0b;
  --grad: linear-gradient(90deg, var(--violet), var(--cyan));

  /* light theme surfaces */
  --bg: #f7f8fc;
  --bg-2: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f9fafe;
  --text: #0b1020;
  --text-muted: #5b647c;
  --border: #e6e9f2;
  --border-2: #d9deeb;

  --shadow-sm: 0 1px 2px rgba(16, 24, 64, .06), 0 1px 3px rgba(16, 24, 64, .04);
  --shadow-md: 0 4px 16px rgba(16, 24, 64, .08);
  --shadow-lg: 0 18px 50px rgba(16, 24, 64, .14);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --maxw: 1180px;
  --gap: 24px;

  --ff-display: 'Sora', system-ui, sans-serif;
  --ff-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* source brand hues */
  --src-golance: #16a34a;
  --src-freelancer: #29b2fe;
  --src-codeclerks: #6366f1;
  --src-seoclerks: #0ea5e9;
  --src-listingdock: #64748b;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-2: #0e1426;
  --surface: #141a2e;
  --surface-2: #182039;
  --text: #eef2fb;
  --text-muted: #9aa6c2;
  --border: #232c48;
  --border-2: #2c365a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--ff-display); color: var(--text); line-height: 1.18; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.18rem; font-weight: 700; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 20px; }
.section.narrow { max-width: 720px; }
.muted { color: var(--text-muted); }
.small { font-size: .86rem; }
.x-small { font-size: .78rem; }
.center { text-align: center; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }

.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.18em; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: 600 .95rem/1 var(--ff-body);
  padding: .72em 1.15em; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-cta { color: #1a1206; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(180deg, #ffc44f 0%, var(--amber) 48%, var(--amber-600) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 8px 20px rgba(245, 158, 11, .38), 0 2px 4px rgba(150, 90, 0, .22); }
.btn-cta:hover { transform: translateY(-1px);
  background: linear-gradient(180deg, #ffce5e 0%, #ffb728 48%, #f59e0b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 12px 26px rgba(245, 158, 11, .5), 0 3px 6px rgba(150, 90, 0, .28); }
.btn-cta .ic { transition: transform .15s ease; }
.btn-cta:hover .ic { transform: translateX(3px); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(124, 92, 255, .3); }
.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; justify-content: center; }
.link-muted { color: var(--text-muted); font-weight: 600; }
.link-muted:hover { color: var(--violet); }

/* ---- Cards ------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--ff-display); font-weight: 700; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-text strong { color: var(--violet); }
.brand-logo-mark { width: 30px; height: 30px; flex: none; display: block;
  filter: drop-shadow(0 4px 10px rgba(124, 92, 255, .35)); }
.primary-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.primary-nav > a { color: var(--text); font-weight: 600; font-size: .95rem; }
.primary-nav > a:hover, .primary-nav > a.is-active { color: var(--violet); text-decoration: none; }
.nav-search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 7px 14px; color: var(--text-muted); }
.nav-search input { border: 0; background: transparent; outline: none; color: var(--text); width: 150px; font-size: .9rem; }
.nav-cta { padding: .55em 1.1em; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.theme-toggle:hover { color: var(--violet); }
.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: inline; }
.nav-toggle { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; align-items: center; justify-content: center; }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 70px 0 48px; text-align: center;
  background-color: var(--bg);
  background-image: url('../img/hero-bg-light.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
[data-theme="dark"] .hero { background-image: url('../img/hero-bg-dark.png'); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(62% 70% at 50% 45%, color-mix(in srgb, var(--bg) 78%, transparent), transparent 75%); }
[data-theme="dark"] .hero::after {
  background: radial-gradient(70% 75% at 50% 45%, color-mix(in srgb, var(--bg) 62%, transparent), color-mix(in srgb, var(--bg) 30%, transparent) 78%); }
.hero-inner { position: relative; z-index: 1; max-width: 880px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--violet);
  background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 22%, transparent);
  padding: 6px 14px; border-radius: var(--radius-pill); margin-bottom: 18px; backdrop-filter: blur(6px); }
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); margin-bottom: .35em; }
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 28px; }
.hero-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 8px 8px 8px 18px; box-shadow: var(--shadow-md); max-width: 680px; margin: 0 auto 22px; color: var(--text-muted); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 1.02rem; color: var(--text); }
.stat-chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.stat-chips .chip { backdrop-filter: blur(6px); }
.chip { display: inline-flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 9px 16px; font-size: .9rem; box-shadow: var(--shadow-sm); }
.chip .ic { color: var(--violet); }

/* ---- Trust strip ------------------------------------------------------- */
.trust-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.trust-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; }
.source-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.source-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 6px 14px 6px 8px; border-radius: var(--radius-pill); }

/* ---- Section heads ----------------------------------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 8px 0 20px; }
.page-head { margin-bottom: 24px; }

/* ---- Category grid ----------------------------------------------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-grid-lg { grid-template-columns: repeat(3, 1fr); }
.cat-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; transition: transform .12s ease, box-shadow .15s ease, border-color .15s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-2); text-decoration: none; }
.cat-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 13px;
  background:
    radial-gradient(70% 65% at 27% 22%, rgba(255, 255, 255, .55), transparent 62%),
    linear-gradient(135deg, color-mix(in srgb, var(--c, var(--violet)) 30%, transparent), color-mix(in srgb, var(--c, var(--violet)) 8%, transparent));
  color: var(--c, var(--violet)); margin-bottom: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 0 0 1px color-mix(in srgb, var(--c, var(--violet)) 22%, transparent);
  transition: transform .12s ease; }
.cat-tile:hover .cat-icon { transform: scale(1.06); }
.cat-icon .ic { width: 22px; height: 22px; }
.cat-name { font-family: var(--ff-display); font-weight: 700; color: var(--text); }
.cat-tile-lg { flex-direction: row; align-items: flex-start; gap: 14px; }
.cat-tile-lg .cat-body { display: flex; flex-direction: column; gap: 4px; }
.cat-tile.is-featured { border-color: transparent; background:
  linear-gradient(var(--surface), var(--surface)) padding-box,
  var(--grad) border-box; border: 1.5px solid transparent; }

/* ---- Tags -------------------------------------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.tag { font-size: .8rem; font-weight: 600; color: var(--violet); background: color-mix(in srgb, var(--violet) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--violet) 18%, transparent); padding: 4px 11px; border-radius: var(--radius-pill); }
.tag:hover { text-decoration: none; background: color-mix(in srgb, var(--violet) 16%, transparent); }
.tag-sm { color: var(--text-muted); background: var(--surface-2); border-color: var(--border); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.subcats { margin-bottom: 18px; }

/* ---- Project list / cards --------------------------------------------- */
.project-list { display: flex; flex-direction: column; gap: 14px; }
.project-card { display: flex; align-items: center; gap: 20px; padding: 18px 20px; transition: transform .1s ease, box-shadow .15s ease, border-color .15s; }
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-2); transform: translateY(-1px); }
.project-main { flex: 1; min-width: 0; }
.project-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.project-title { font-size: 1.12rem; margin: 0 0 6px; }
.project-title a { color: var(--text); }
.project-title a:hover { color: var(--violet); }
.project-snippet { color: var(--text-muted); font-size: .95rem; line-height: 1.55; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-cta { display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: center; flex: none; width: auto; min-width: 168px; max-width: 200px; }
.dot { display: inline-flex; align-items: center; gap: 5px; }

/* source badges */
.source-badge { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.brand-logo { width: 22px; height: 22px; flex: none; border-radius: 6px; display: inline-block; }
.pill-soft { font-size: .76rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); padding: 4px 11px; border-radius: var(--radius-pill); }

/* ---- Filter bar -------------------------------------------------------- */
.filter-bar { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); margin-bottom: 26px; flex-wrap: wrap; }
.field { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-muted); }
.field.grow { flex: 1; min-width: 220px; }
.field input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: .95rem; }

/* ---- Layout with rail -------------------------------------------------- */
.layout-with-rail { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.rail-card { padding: 18px; position: sticky; top: 84px; }
.rail-card h4 { margin-bottom: 12px; }
.rail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-list a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text-muted); font-size: .92rem; }
.rail-list a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.rail-list a.is-active { background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet); font-weight: 600; }
.result-meta { margin-bottom: 14px; }

/* ---- Project detail ---------------------------------------------------- */
.project-detail { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.detail-head { margin-bottom: 18px; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.detail-body { padding: 26px 28px; margin-bottom: 18px; }
.prose { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.detail-tags { padding: 18px 22px; margin-bottom: 22px; }
.detail-aside { position: sticky; top: 84px; }
.apply-card { padding: 24px; }
.apply-title { margin-bottom: 4px; }
.meta-list { list-style: none; margin: 18px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.meta-list li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; font-size: .92rem; }
.meta-list li .ic { color: var(--violet); }
.meta-list li span { color: var(--text-muted); }
.meta-list li b { color: var(--text); }
.apply-card .btn-cta { margin-bottom: 12px; }
.mobile-apply-bar { display: none; }

/* ---- Breadcrumb -------------------------------------------------------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--violet); }

/* ---- Pagination -------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 30px; }
.page-link { min-width: 40px; text-align: center; padding: 9px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; }
.page-link:hover { border-color: var(--violet); text-decoration: none; }
.page-link.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.page-gap { padding: 9px 4px; color: var(--text-muted); }

/* ---- Empty / error states --------------------------------------------- */
.empty-state { padding: 36px; text-align: center; }
.empty-state .btn { margin-top: 12px; }
.error-hero { text-align: center; padding: 40px 0 24px; }
.error-code { font-family: var(--ff-display); font-weight: 800; font-size: 4rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ---- Contact form ------------------------------------------------------ */
.contact-form { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.contact-form input, .contact-form textarea { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 14px; font: inherit; color: var(--text); outline: none; }
.contact-form input:focus, .contact-form textarea:focus, .field input:focus { border-color: var(--violet); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { position: relative; background: var(--bg-2); border-top: 1px solid var(--border); margin-top: 50px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 44px 20px 20px; }
.footer-brand .muted { max-width: 280px; margin-top: 10px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a, .footer-col span { color: var(--text-muted); font-size: .9rem; }
.footer-col a:hover { color: var(--violet); }
.footer-source { display: flex; align-items: center; gap: 8px; }
.footer-bottom { position: relative; overflow: hidden; border-top: 1px solid var(--border);
  padding: 30px 20px; background-color: #e3e7f3;
  background-image: url('../img/footer-bg-light.png'); background-size: cover;
  background-position: center; background-repeat: no-repeat; }
/* Soft scrim (tinted with the band's own base color) keeps the centered
   text readable without graying out the artwork. */
.footer-bottom::before { content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(227, 231, 243, .28), rgba(227, 231, 243, .5)); }
.footer-bottom .wrap { position: relative; z-index: 1; text-align: center; }
.footer-bottom .muted { color: var(--text); }
.footer-bottom .ic { color: var(--violet); }

[data-theme="dark"] .footer-bottom { background-color: #090d1a; background-image: url('../img/footer-bg.png'); }
[data-theme="dark"] .footer-bottom::before {
  background: linear-gradient(rgba(9, 13, 26, .25), rgba(9, 13, 26, .45)); }
[data-theme="dark"] .footer-bottom .muted { color: rgba(255, 255, 255, .9); }
[data-theme="dark"] .footer-bottom .ic { color: #fff; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-grid-lg { grid-template-columns: repeat(2, 1fr); }
  .project-detail { grid-template-columns: 1fr; }
  .detail-aside { position: static; order: -1; }
  .mobile-apply-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    box-shadow: 0 -10px 28px rgba(11, 16, 32, .12);
  }
  #main:has(.mobile-apply-bar) { padding-bottom: 84px; }
  .layout-with-rail { grid-template-columns: 1fr; }
  .rail-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px; box-shadow: var(--shadow-md); }
  .primary-nav.is-open { display: flex; }
  .nav-search { width: 100%; }
  .nav-search input { width: 100%; }
  .nav-cta { text-align: center; justify-content: center; }
  .project-card { flex-direction: column; align-items: stretch; gap: 14px; }
  .project-cta { width: 100%; max-width: none; min-width: 0; flex-direction: row; }
  .project-cta .btn { flex: 1; justify-content: center; white-space: normal; text-align: center; line-height: 1.25; }
  .cat-grid, .cat-grid-lg { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}
