/* ── mellawork Design System ─────────────────────── */
/* Vanilla CSS — matches the design spec from design.md */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── Custom Properties ── */
:root {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --border: #e5e5e5;
  --text-primary: #0a0a0a;
  --text-secondary: #6b6b6b;
  --accent: #f97316;
  --accent-hover: #ea6c0a;
  --accent-muted: #fff3e8;
  --nav-shadow: 0 1px 0 var(--border);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --border: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-muted: #1a0d00;
  --nav-shadow: 0 1px 0 var(--border);
  --card-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 150ms ease, color 150ms ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeUp 0.5s ease both;
}

.fade-in-1 { animation-delay: 0ms; }
.fade-in-2 { animation-delay: 80ms; }
.fade-in-3 { animation-delay: 160ms; }
.fade-in-4 { animation-delay: 240ms; }

.fade-up {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.fade-up-1 { animation-delay: 0ms; }
.fade-up-2 { animation-delay: 80ms; }
.fade-up-3 { animation-delay: 160ms; }
.fade-up-4 { animation-delay: 240ms; }
.fade-up-5 { animation-delay: 320ms; }
.fade-up-d1 { animation-delay: 0.05s; }
.fade-up-d2 { animation-delay: 0.15s; }
.fade-up-d3 { animation-delay: 0.25s; }
.fade-up-d4 { animation-delay: 0.35s; }
.fade-up-d5 { animation-delay: 0.45s; }

/* ── Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  box-shadow: var(--nav-shadow);
  transition: background 150ms ease, box-shadow 150ms ease;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-wordmark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 22px;
  width: auto;
}

.brand-logo-dark {
  display: none;
}

[data-theme="dark"] .brand-logo-light {
  display: none;
}

[data-theme="dark"] .brand-logo-dark {
  display: block;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 150ms ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ── Hero ── */
.hero {
  padding-top: 96px;
  padding-bottom: 64px;
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

/* ── Search Bar ── */
.search-bar {
  display: flex;
  margin-top: 32px;
  max-width: 560px;
}

.search-bar input {
  flex-grow: 1;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  transition: border-color 150ms ease;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

.search-bar .search-clear {
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.search-bar .search-clear:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.search-bar .search-submit {
  padding: 14px 24px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 0 4px 4px 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 150ms ease;
}

.search-bar button:hover {
  background: var(--accent-hover);
}

/* ── Filter Bar ── */
.filter-bar {
  margin-top: 48px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.results-summary {
  font-size: 14px;
  color: var(--text-secondary);
}

.clear-search {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.clear-search:hover {
  color: var(--accent-hover);
}

.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
  transition: all 150ms ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ── Jobs List ── */
.jobs-list {
  padding-bottom: 32px;
}

.job-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: all 150ms ease;
  border-left: 3px solid transparent;
  padding-left: 0;
}

.job-card:hover {
  background: var(--surface);
  border-left-color: var(--accent);
  padding-left: 16px;
}

.job-card.hidden {
  display: none;
}

.job-monogram {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
}

.job-info {
  flex-grow: 1;
  min-width: 0;
}

.job-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.3;
}

.job-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}

.job-meta .separator {
  margin: 0 6px;
  color: var(--border);
}

.remote-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.2px;
}

.job-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.job-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.job-type-chip {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
}

.job-posted {
  font-size: 12px;
  color: var(--text-secondary);
}

.job-arrow {
  color: var(--text-secondary);
  font-size: 18px;
  padding-top: 2px;
  flex-shrink: 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--border);
}

.pagination-link {
  min-width: 108px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.pagination-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

.pagination-link-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination-status {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── Job Detail Page ── */
.back-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 32px;
  margin-top: 32px;
  transition: color 150ms ease;
}

.back-link:hover {
  color: var(--accent);
}

.job-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-bottom: 80px;
}

@media (min-width: 768px) {
  .job-layout {
    grid-template-columns: 65fr 30fr;
  }
}

.job-header {
  opacity: 0;
  animation: fadeUp 500ms ease forwards;
  animation-delay: 0ms;
}

.job-detail-title {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.job-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.job-meta-sep {
  color: var(--border);
  user-select: none;
}

.apply-btn {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 32px;
  background-color: var(--accent);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.apply-btn:hover {
  background-color: var(--accent-hover);
}

.posted-date {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

@media (max-width: 767px) {
  .apply-btn {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* ── Job Content Sections ── */
.job-section {
  margin-top: 40px;
  opacity: 0;
  animation: fadeUp 500ms ease forwards;
}

.job-section:nth-child(2) { animation-delay: 80ms; }
.job-section:nth-child(3) { animation-delay: 160ms; }
.job-section:nth-child(4) { animation-delay: 240ms; }
.job-section:nth-child(5) { animation-delay: 320ms; }
.job-section:nth-child(6) { animation-delay: 400ms; }

.job-section h2 {
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.job-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.job-section ul {
  list-style: none;
  padding: 0;
}

.job-section ul li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.job-section ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── Skills Grid ── */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: 4px;
}

/* ── Sidebar ── */
.sidebar-card {
  background-color: var(--surface);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 0;
  transition: background-color 150ms ease, border-color 150ms ease;
  opacity: 0;
  animation: fadeUp 500ms ease forwards;
  animation-delay: 200ms;
}

@media (min-width: 768px) {
  .sidebar-card {
    position: sticky;
    top: 80px;
  }
}

.sidebar-card h3 {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.sidebar-contact-heading {
  margin-top: 24px;
}

.sidebar-details {
  list-style: none;
  padding: 0;
}

.sidebar-details li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 150ms ease;
}

.sidebar-details li:last-child {
  border-bottom: none;
}

.sidebar-label {
  color: var(--text-secondary);
}

.sidebar-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.sidebar-value a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 150ms ease;
}

.sidebar-value a:hover {
  color: var(--accent-hover);
}

/* ── About Page ── */
.prose {
  max-width: 720px;
}

.prose p {
  font-weight: 400;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.values {
  margin-top: 64px;
  padding-bottom: 96px;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 28px 24px;
  transition: background 150ms ease, border-color 150ms ease;
}

.value-card-icon {
  color: var(--accent);
  width: 24px;
  height: 24px;
}

.value-card h3 {
  font-weight: 600;
  font-size: 15px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.value-card p {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Contact Page ── */
.contact-form {
  max-width: 560px;
  margin-top: 40px;
}

.form-alert {
  max-width: 560px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid #fca5a5;
  background: #fff1f2;
  color: #9f1239;
  font-size: 14px;
}

[data-theme="dark"] .form-alert {
  border-color: #7f1d1d;
  background: #2b1115;
  color: #fecdd3;
}

.field-error {
  margin-top: -6px;
  margin-bottom: 12px;
  color: #dc2626;
  font-size: 13px;
}

[data-theme="dark"] .field-error {
  color: #fda4af;
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: border-color 150ms ease, background 150ms ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-secondary);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form .field-invalid {
  border-color: #dc2626;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 150ms ease;
}

.contact-form button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.contact-form button:hover {
  background: var(--accent-hover);
}

.success {
  max-width: 560px;
  margin-top: 40px;
  text-align: center;
  padding: 48px 0;
}

.success svg {
  color: var(--accent);
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}

.success h2 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.success p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.email-line {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding-bottom: 96px;
}

.email-line a {
  color: var(--accent);
  text-decoration: none;
}

.hidden-md-block {
  display: block;
}



@media (max-width: 640px) {
   .hidden-md-block {
    display: none;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-bar input {
    border-radius: 4px;
  }

  .search-bar button {
    border-radius: 4px;
    margin-top: 12px;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    flex-direction: column;
  }

  .pagination-link {
    width: 100%;
  }
}

.email-line a:hover {
  text-decoration: underline;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color 150ms ease;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer .brand-logo {
  height: 24px;
}

.footer-tagline {
  margin-top: 12px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .search-bar {
    max-width: 100%;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-right {
    gap: 16px;
  }

  .job-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .job-arrow {
    display: none;
  }
}
