:root {
  --bg: #f6f8fa;
  --card: #fff;
  --text: #1c2733;
  --muted: #5b6b7a;
  --line: #e2e8ee;
  --brand: #0b6e4f;
  --brand-dark: #08523b;
  --brand-soft: #e6f4ee;
  --wa: #1fa855;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Sinhala", "Noto Sans Tamil", "Iskoola Pota", "Nirmala UI", sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--brand); }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 800; font-size: 1.25rem; color: var(--brand); text-decoration: none; }
.logo span { color: var(--text); }
.nav a { margin-left: 16px; text-decoration: none; font-weight: 600; color: var(--text); }
.nav a:hover { color: var(--brand); }

/* Hero / search */
.hero { background: var(--brand); color: #fff; padding: 28px 0 32px; }
.hero h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.25; }
.hero p { margin: 0 0 18px; opacity: .9; }
.search { display: grid; gap: 10px; grid-template-columns: 1fr; }
.search input, .search select {
  width: 100%; height: 48px; padding: 0 12px; font: inherit; color: var(--text);
  border: 0; border-radius: var(--radius); background: #fff;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; font: inherit; font-weight: 700;
  border: 0; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-dark); }
.search .btn { background: #ffd54a; color: #1c2733; }
.search .btn:hover { background: #ffca1f; }
.btn.wa { background: var(--wa); }
.btn.wa:hover { background: #178a45; }
.btn.ghost { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 8px; }
.chip {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); font: inherit; font-size: .95rem; cursor: pointer; color: var(--text);
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.result-bar { display: flex; justify-content: space-between; align-items: center; margin: 12px 0; color: var(--muted); }
.result-bar button { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; }

/* Job cards */
.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.job-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit;
}
.job-card:hover, .job-card:focus-visible { border-color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.job-card h2 { margin: 0 0 2px; font-size: 1.1rem; color: var(--brand); }
.job-card .company { margin: 0; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-dark);
}
.tag.closed { background: #fde8e8; color: #9b1c1c; }
.salary { font-weight: 700; color: var(--text); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.more { margin: 16px 0 0; text-align: center; }

/* Work From Home opportunities */
.wfh { background: var(--brand-soft); border-bottom: 1px solid var(--line); padding: 32px 0 28px; }
.wfh-label {
  display: inline-block; margin: 0 0 8px; padding: 3px 12px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.wfh h2 { margin: 0 0 6px; font-size: 1.5rem; line-height: 1.25; color: var(--brand); }
.wfh-sub { margin: 0 0 20px; max-width: 62ch; color: var(--muted); }
.wfh-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.wfh-card {
  display: flex; flex-direction: column; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none;
  box-shadow: 0 2px 8px rgba(16, 40, 32, .06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.wfh-card:hover, .wfh-card:focus-visible { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(16, 40, 32, .14); }
.wfh-img { aspect-ratio: 1846 / 768; overflow: hidden; background: var(--brand-soft); }
.wfh-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.wfh-card:hover .wfh-img img, .wfh-card:focus-visible .wfh-img img { transform: scale(1.06); }
.wfh-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.wfh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag.outline { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.wfh-card h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.35; color: var(--brand); }
.wfh-card p { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }
.wfh-earn { margin: auto 0 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--brand-soft); }
.wfh-earn small { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wfh-earn strong { font-size: 1.15rem; color: var(--brand-dark); }
.wfh-card .btn { width: 100%; }
.wfh-card:hover .btn, .wfh-card:focus-visible .btn { background: var(--brand-dark); }
.wfh-note { margin: 16px 0 0; font-size: .85rem; color: var(--muted); }
@media (min-width: 600px) { .wfh-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .wfh h2 { font-size: 1.75rem; } }
@media (prefers-reduced-motion: reduce) {
  .wfh-card, .wfh-img img { transition: none; }
  .wfh-card:hover, .wfh-card:focus-visible { transform: none; }
  .wfh-card:hover .wfh-img img, .wfh-card:focus-visible .wfh-img img { transform: none; }
}

/* Opportunity details page */
.opp-hero { display: block; width: 100%; height: auto; border-radius: 12px; margin-bottom: 16px; background: var(--brand-soft); }
.opp-earn { font-size: 1.3rem; color: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { background: var(--brand); }
.apply-note { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.caution { margin: 20px 0 0; padding: 12px 14px; border-radius: var(--radius); background: #fff8e1; border: 1px solid #f3dd91; color: #5c4a00; font-size: .95rem; }
.caution ul { margin: 6px 0 0; }

/* Detail page */
.back { display: inline-block; margin: 16px 0 8px; text-decoration: none; font-weight: 600; }
.job-detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; margin-bottom: 24px; }
.job-detail h1 { margin: 0 0 4px; font-size: 1.5rem; line-height: 1.25; }
.job-detail h2 { font-size: 1.1rem; margin: 24px 0 6px; }
.job-detail ul { margin: 0; padding-left: 20px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; padding: 14px; background: var(--bg); border-radius: var(--radius); }
.facts dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.facts dd { margin: 0; font-weight: 600; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.notice { padding: 12px 14px; border-radius: var(--radius); background: #fde8e8; color: #9b1c1c; font-weight: 600; }

/* Post a job */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; margin: 32px 0; text-align: center; }
.post h2 { margin: 0 0 4px; }
.post p { margin: 0 0 14px; color: var(--muted); }
.post .actions { max-width: 420px; margin: 0 auto; }

footer { padding: 24px 0 40px; color: var(--muted); font-size: .9rem; text-align: center; }
.warn { max-width: 640px; margin: 0 auto 8px; }
.footer-links { margin: 0 0 8px; }
.footer-links a { margin: 0 8px; color: var(--muted); }

/* Ads: clearly labelled, kept away from buttons */
.ad-slot { margin: 24px 0; min-height: 100px; text-align: center; }
.ad-slot:empty { display: none; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
.ad-slot small { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.job-list > li.ad-slot { margin: 4px 0; }
.ad-slot.ad-top { margin: 0 auto; padding: 8px 12px; min-height: 90px; max-width: 1100px; }

/* Content pages */
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; margin: 16px 0 24px; }
.prose h1 { margin-top: 0; line-height: 1.25; font-size: 1.6rem; }
.prose h2 { margin: 28px 0 6px; font-size: 1.2rem; }
.prose p, .prose li { max-width: 68ch; }
.prose .lead { color: var(--muted); font-size: 1.05rem; }
.guide-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.guide-list a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--bg); }
.guide-list a:hover { border-color: var(--brand); }
.guide-list strong { display: block; color: var(--brand); }
.guide-list span { color: var(--muted); font-size: .95rem; }
@media (min-width: 640px) { .prose { padding: 32px; } }

@media (min-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .search { grid-template-columns: 2fr 1fr 1fr auto; }
  .job-detail { padding: 28px; }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .actions { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* Mobile */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button { -webkit-tap-highlight-color: rgba(11, 110, 79, .15); }
h1, h2, h3, dd, .company { overflow-wrap: anywhere; }
.btn, .chip { touch-action: manipulation; }

/* Job-type chips: one swipeable row on phones, wrapping on larger screens */
.filters { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 4px; padding: 2px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; white-space: nowrap; min-height: 44px; padding: 0 16px; }
.result-bar button { min-height: 44px; padding: 0 4px; }
.footer-links a { display: inline-block; padding: 8px 4px; }

@media (max-width: 639px) {
  .site-header .wrap { height: auto; min-height: 56px; flex-wrap: wrap; gap: 0 8px; }
  .nav { display: flex; align-items: center; }
  .nav a { margin-left: 0; padding: 14px 8px; font-size: .95rem; }
  .nav a[href="index.html"] { display: none; }
  .hero { padding: 22px 0 24px; }
  .wfh { padding: 24px 0 20px; }
  .wfh-body { padding: 14px; }
  .job-card { padding: 14px; }
  .opp-earn { font-size: 1.15rem; }
  .actions .btn { min-height: 52px; }
}

@media (min-width: 640px) {
  .filters { flex-wrap: wrap; overflow: visible; margin: 20px 0 8px; padding: 0; }
  .chip { min-height: 0; padding: 8px 14px; }
}

@media (hover: none) {
  .wfh-card:hover { transform: none; box-shadow: 0 2px 8px rgba(16, 40, 32, .06); border-color: var(--line); }
  .wfh-card:hover .wfh-img img { transform: none; }
}

/* Load animations (fade and slide only, so no layout shift; skipped when reduced motion is requested) */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @keyframes fade-in { from { opacity: 0; } }
  @keyframes fade-up { from { opacity: 0; transform: translateY(18px); } }

  .site-header { animation: fade-in .5s ease backwards; }
  .hero h1, .hero p, .hero .search,
  .wfh-label, .wfh h2, .wfh-sub, .wfh-note,
  .job-detail, .prose, .back { animation: fade-up .6s cubic-bezier(.22, .8, .3, 1) backwards; }
  .hero h1 { animation-delay: .05s; }
  .hero p { animation-delay: .12s; }
  .hero .search { animation-delay: .2s; }
  .wfh-label { animation-delay: .3s; }
  .wfh h2 { animation-delay: .36s; }
  .wfh-sub { animation-delay: .42s; }
  .wfh-note { animation-delay: .9s; }

  .wfh-card { animation: fade-up .6s cubic-bezier(.22, .8, .3, 1) backwards; }
  .wfh-card:nth-child(1) { animation-delay: .5s; }
  .wfh-card:nth-child(2) { animation-delay: .58s; }
  .wfh-card:nth-child(3) { animation-delay: .66s; }
  .wfh-card:nth-child(4) { animation-delay: .74s; }
  .wfh-card:nth-child(n+5) { animation-delay: .82s; }

  .job-list.first > li { animation: fade-up .5s ease backwards; animation-delay: .9s; }

  .btn, .chip { transition: background-color .2s ease, border-color .2s ease, transform .15s ease; }
  .btn:active, .chip:active { transform: scale(.97); }
  .job-card { transition: border-color .2s ease, box-shadow .2s ease; }
}

/* Apply Now popup and form page */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.modal-box { background: var(--card); border-radius: 12px; padding: 20px; width: 100%; max-width: 480px; margin: auto; }
.modal-box h2 { margin-top: 0; }
.apply-form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.apply-form input:not(.hp), .apply-form select, .apply-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.apply-form .hp { position: absolute; left: -9999px; }
.form-error { color: #b3261e; font-size: .9rem; margin: 0 0 8px; }
.modal-box.wide { max-width: 560px; }
.sub-frame { display: block; width: 100%; height: 65vh; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }

/* Apply form: 16px fields stop iOS zooming in on focus */
.apply-form input:not(.hp), .apply-form select, .apply-form textarea { font-size: 16px; min-height: 48px; }
.apply-form textarea { resize: vertical; min-height: 88px; }
@media (max-width: 639px) {
  /* Subscribe popup as a bottom sheet: easier to reach with a thumb */
  .modal { padding: 0; align-items: flex-end; }
  .modal-box, .modal-box.wide {
    max-width: none; margin: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
    border-radius: 16px 16px 0 0; padding: 16px 16px 0; overscroll-behavior: contain;
  }
  .modal-box h2 { font-size: 1.15rem; padding-right: 4px; }
  .sub-frame { height: 70vh; height: 70dvh; min-height: 0; }
  .modal-box.wide .actions { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
