@font-face {
  font-family: 'Cairo';
  src: url('fonts/Cairo.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --teal: #0d6b62;
  --teal-dark: #0a5049;
  --teal-soft: #e6f2ef;
  --ink: #10201e;
  --muted: #5d6f6c;
  --line: #e1e8e6;
  --bg: #f6f8f7;
  --card: #ffffff;
  --accent: #c9832a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 32, 30, .05), 0 8px 24px rgba(16, 32, 30, .06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}

img, svg { max-width: 100%; }

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

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.08rem; font-weight: 800; letter-spacing: -.2px; }
.brand-text small { color: var(--muted); font-size: .72rem; font-weight: 500; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}
.site-nav a:hover { color: var(--teal); background: var(--teal-soft); text-decoration: none; }

/* ------------------------------------------------ hero */
.hero {
  background: linear-gradient(180deg, #e9f4f1 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 26px 0 20px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 5.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.35;
}

.hero-sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .95rem;
  max-width: 46ch;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.field label {
  font-size: .74rem;
  font-weight: 700;
  color: var(--muted);
  padding-inline-start: 2px;
}

.field input,
.field select {
  width: 100%;
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  min-height: 46px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 107, 98, .13);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.quick-label { font-size: .8rem; color: var(--muted); font-weight: 600; }

.chip {
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: #fff;
  border: 1px solid #cfe2de;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.chip:hover { background: var(--teal-soft); }
.chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ------------------------------------------------ results */
.results { padding: 22px 16px 40px; }

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.results-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.count {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: .85rem;
  font-weight: 700;
  margin-inline-start: 4px;
}

.reset {
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}
.reset:hover { color: var(--teal); border-color: #cfe2de; }

.jobs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.job-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.job-card:hover {
  border-color: #c9ded9;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-link { color: inherit; text-decoration: none; display: block; flex: 1 1 auto; }
.card-link:hover { text-decoration: none; }

.job-title {
  margin: 0 0 2px;
  unicode-bidi: isolate;
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ink);
}

.job-card:hover .job-title { color: var(--teal-dark); }

.job-company {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 600;
}

.job-meta {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
  font-size: .84rem;
}

.job-meta .ico { font-size: .8rem; }

.job-salary {
  margin: 0 0 12px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--teal-dark);
}

.job-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f4;
  color: #4a5c59;
  border: 1px solid #e6ecea;
}

.tag-cat { background: var(--teal-soft); color: var(--teal-dark); border-color: #cfe6e1; }
.tag-src { background: #fdf4e7; color: #8a5b17; border-color: #f3e2c6; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #eef2f1;
  font-size: .78rem;
}

.card-foot .date { color: var(--muted); }
.card-foot .more { font-weight: 700; color: var(--teal); }

.empty {
  background: var(--card);
  border: 1px dashed #cfe0dc;
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-title { font-weight: 800; color: var(--ink); margin: 0 0 4px; }

.btn-ghost {
  font-family: inherit;
  font-size: .9rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border: 0;
  border-radius: 11px;
  padding: 10px 18px;
  cursor: pointer;
  margin-top: 8px;
}

/* ------------------------------------------------ job page */
.job-page { padding: 20px 16px 48px; max-width: 1040px; }

.crumbs {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.job-head { margin-bottom: 18px; }

.job-head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.3px;
}

.job-company-lg { margin: 0 0 12px; color: var(--muted); font-weight: 600; }

.head-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.job-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }

.job-main, .job-side > * {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.job-main h2, .source-box h2, .rel h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0 0 10px;
}

.lang-note {
  background: #fdf4e7;
  border: 1px solid #f3e2c6;
  color: #7d5316;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .84rem;
  margin: 0 0 12px;
}

.desc p { margin: 0 0 12px; font-size: .96rem; }
.desc p:last-child { margin-bottom: 0; }

.apply-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f1;
}

.btn-apply {
  display: block;
  text-align: center;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  padding: 14px 20px;
  border-radius: 13px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(13, 107, 98, .18);
}

.btn-apply:hover { background: var(--teal-dark); text-decoration: none; color: #fff; }

.apply-hint {
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

.job-side { display: flex; flex-direction: column; gap: 14px; }

.meta-table { margin: 0; padding: 18px; }

.m-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f4;
  font-size: .87rem;
}

.m-row:last-child { border-bottom: 0; }
.m-row dt { color: var(--muted); font-weight: 600; flex: none; }
.m-row dd { margin: 0; font-weight: 700; text-align: left; }

.source-box p { margin: 0 0 6px; font-size: .88rem; }
.source-box a { font-weight: 700; font-size: .88rem; }
.source-date { color: var(--muted); font-size: .78rem !important; margin-top: 8px !important; }

.rel { margin-top: 22px; }

.rel-list { display: grid; gap: 10px; }

.rel-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: inherit;
}

.rel-item:hover { border-color: #c9ded9; text-decoration: none; }
.rel-item strong { font-size: .93rem; }
.rel-item span { font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------ about */
.about { padding: 26px 16px 48px; max-width: 860px; }

.about h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); margin: 0 0 8px; font-weight: 800; }

.lead { color: var(--muted); margin: 0 0 22px; }

.about h2 { font-size: 1.05rem; font-weight: 800; margin: 26px 0 10px; }

.rules { margin: 0; padding-inline-start: 20px; color: #2b3a38; font-size: .94rem; }
.rules li { margin-bottom: 8px; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: .88rem;
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f1;
  text-align: right;
}

.table th { background: #f3f7f6; font-weight: 700; color: #334643; }
.table tr:last-child td { border-bottom: 0; }

.code {
  background: #10201e;
  color: #d6efe9;
  padding: 12px 14px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: .82rem;
  direction: ltr;
  text-align: left;
}

code {
  background: #eef4f3;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: .85em;
}

/* ------------------------------------------------ footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 22px 0 28px;
  margin-top: 10px;
}

.footer-note { margin: 0 0 6px; color: var(--muted); font-size: .84rem; }
.footer-meta { margin: 0; color: #8a9997; font-size: .78rem; }

/* ------------------------------------------------ responsive */
@media (min-width: 600px) {
  .search-form { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rel-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .search-form { grid-template-columns: 1.6fr 1fr 1fr 1fr; padding: 14px; }
  .field-search { grid-column: auto; }
  .jobs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .job-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .job-side { position: sticky; top: 78px; }
  .rel-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 40px 0 26px; }
}
