/* ═══════════════════════════════════════════════════════════════
   HN WHO IS HIRING — MARCH 2026
   Swiss Ink & Paper — 3 colors, 0 gradients, pure typography
   ═══════════════════════════════════════════════════════════════ */

/* ─── Reset ───────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── Palette: 3 colors only ──────────────────────────────────── */

:root {
  --paper: #FAFAF7;
  --ink:   #121212;
  --red:   #E8320E;

  /* Opacity variants (same base colors) */
  --ink-70: rgba(18, 18, 18, 0.7);
  --ink-50: rgba(18, 18, 18, 0.5);
  --ink-30: rgba(18, 18, 18, 0.3);
  --ink-15: rgba(18, 18, 18, 0.15);
  --ink-08: rgba(18, 18, 18, 0.08);
  --ink-04: rgba(18, 18, 18, 0.04);
  --red-15: rgba(232, 50, 14, 0.15);
  --red-08: rgba(232, 50, 14, 0.08);

  /* Typography */
  --serif:  'Instrument Serif', 'Georgia', serif;
  --sans:   'Hanken Grotesk', 'Helvetica Neue', sans-serif;
  --mono:   'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

/* ─── Base ────────────────────────────────────────────────────── */

html { font-size: 15px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--red);
  color: var(--paper);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--ink-30); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-50); }

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-30);
  transition: border-color 0.2s;
}
a:hover {
  border-bottom-color: var(--red);
  color: var(--red);
}

/* ─── Top Rule (decorative red bar) ───────────────────────────── */

.top-rule {
  height: 5px;
  background: var(--red);
  animation: rule-slide 0.6s ease-out;
}

@keyframes rule-slide {
  from { transform: scaleX(0); transform-origin: left; }
  to   { transform: scaleX(1); transform-origin: left; }
}

/* ─── Header / Masthead ───────────────────────────────────────── */

.header {
  background: var(--ink);
  color: var(--paper);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fade-down 0.4s ease-out;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.logo {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  display: flex;
  align-items: baseline;
  gap: 10px;
  letter-spacing: -0.01em;
  line-height: 1;
}

.logo-hn {
  background: var(--red);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.7rem;
  padding: 4px 7px 3px;
  letter-spacing: 1px;
  display: inline-block;
  position: relative;
  top: -2px;
}

.logo-date {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--ink-50);
  color: rgba(250, 250, 247, 0.4);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-stats {
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: rgba(250, 250, 247, 0.5);
  letter-spacing: 0.3px;
}
.header-stats .stat-val {
  font-weight: 700;
  color: var(--paper);
  margin-right: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1.5px solid rgba(250, 250, 247, 0.25);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-size: 0.78rem;
  font-family: var(--sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: var(--red);
  border-color: var(--red);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.72rem;
  color: var(--ink-50);
  border: 1.5px solid var(--ink-15);
}
.btn-sm:hover {
  color: var(--paper);
}

.btn.loading svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Tabs ────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  padding: 0 32px;
  border-bottom: 2px solid var(--ink);
}

.tab {
  padding: 14px 24px;
  border: none;
  background: none;
  color: var(--ink-50);
  font-size: 0.78rem;
  font-family: var(--sans);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--red);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Filters ─────────────────────────────────────────────────── */

.filters {
  padding: 20px 32px;
  border-bottom: 1px solid var(--ink-15);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-30);
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 28px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.2s;
}
.search-box input::placeholder {
  color: var(--ink-30);
  font-style: italic;
}
.search-box input:focus {
  border-bottom-color: var(--red);
}

.filter-input, select.filter-input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--ink-30);
  border-radius: 0;
  color: var(--ink);
  padding: 8px 4px;
  font-size: 0.82rem;
  font-family: var(--sans);
  transition: border-color 0.2s;
  outline: none;
  min-width: 130px;
}
.filter-input::placeholder {
  color: var(--ink-30);
}
.filter-input:focus {
  border-bottom-color: var(--red);
}

select.filter-input {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23121212' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 22px;
}

.filter-group {
  display: flex;
  gap: 4px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.chip-toggle input { display: none; }
.chip-toggle:hover {
  background: var(--ink);
  color: var(--paper);
}
.chip-toggle:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip-toggle.accent:has(input:checked) {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

/* ─── Results Header ──────────────────────────────────────────── */

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-50);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink-15);
}

/* ─── Results List ────────────────────────────────────────────── */

.results {
  padding: 0 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ─── Job Card ────────────────────────────────────────────────── */

.job-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-15);
  border-left: 4px solid transparent;
  border-radius: 0;
  padding: 20px 0 20px 20px;
  transition: all 0.15s;
  cursor: default;
  animation: card-in 0.3s ease-out both;
}
.job-card:hover {
  border-left-color: var(--red);
  background: var(--ink-04);
}
.job-card:first-child {
  border-top: 1px solid var(--ink-15);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.job-company {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.job-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ─── Badges ──────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  font-family: var(--sans);
}

.badge-default {
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
}
.badge-accent {
  border: 1.5px solid var(--red);
  color: var(--red);
  background: transparent;
}
.badge-filled {
  background: var(--red);
  color: var(--paper);
  border: 1.5px solid var(--red);
}

/* ─── Job Meta ────────────────────────────────────────────────── */

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: var(--ink-70);
}
.job-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.job-meta-item .icon {
  font-size: 0.85rem;
  opacity: 0.6;
}

.job-salary {
  color: var(--red);
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.8rem;
}

/* ─── Role Tags ───────────────────────────────────────────────── */

.job-roles {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.role-tag {
  background: transparent;
  border: 1px solid var(--ink-30);
  border-radius: 0;
  padding: 2px 10px;
  font-size: 0.73rem;
  color: var(--ink-70);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ─── Tech Tags ───────────────────────────────────────────────── */

.job-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}

.tech-tag {
  background: var(--ink-08);
  color: var(--ink);
  border-radius: 0;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.2px;
}

/* ─── Job Footer ──────────────────────────────────────────────── */

.job-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.78rem;
}
.job-footer a {
  color: var(--ink-50);
  border-bottom: 1px solid transparent;
  transition: all 0.15s;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.job-footer a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

.job-footer .separator {
  color: var(--ink-15);
}

/* ─── Email Link ──────────────────────────────────────────────── */

.job-email {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--red);
  color: var(--paper);
  padding: 3px 12px;
  font-size: 0.75rem;
  font-family: var(--mono);
  font-weight: 500;
  text-decoration: none;
  border-bottom: none;
  transition: opacity 0.15s;
  letter-spacing: 0.2px;
}
.job-email:hover {
  opacity: 0.85;
  color: var(--paper);
  border-bottom: none;
}

/* ─── Expand Button ───────────────────────────────────────────── */

.job-expand-btn {
  background: none;
  border: none;
  border-bottom: 1px dashed var(--ink-30);
  color: var(--ink-50);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 0;
  font-family: var(--mono);
  letter-spacing: 0.2px;
  transition: all 0.15s;
}
.job-expand-btn:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* ─── Full Text Expansion ─────────────────────────────────────── */

.job-full-text {
  display: none;
  margin-top: 14px;
  padding: 16px 0 16px 16px;
  border-left: 2px solid var(--ink);
  font-size: 0.82rem;
  color: var(--ink-70);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--sans);
}
.job-full-text.open { display: block; }

/* ─── Stats Dashboard ─────────────────────────────────────────── */

.stats-grid {
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

.stat-card {
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 24px 28px;
}
.stat-card h3 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-50);
  margin-bottom: 20px;
  font-weight: 600;
  font-family: var(--sans);
}
.stat-card.wide {
  grid-column: span 2;
}

.stat-big-number {
  font-family: var(--serif);
  font-size: 4.5rem;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--red);
  letter-spacing: -2px;
}

.stat-label {
  color: var(--ink-50);
  font-size: 0.85rem;
  font-family: var(--sans);
}

/* ─── Stat Bar Rows ───────────────────────────────────────────── */

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.stat-bar-label {
  width: 110px;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--ink-70);
  text-align: right;
  flex-shrink: 0;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.stat-bar-track {
  flex: 1;
  height: 22px;
  background: var(--ink-08);
  border-radius: 0;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.5s ease;
}
.stat-bar-fill.ink    { background: var(--ink); }
.stat-bar-fill.red    { background: var(--red); }

.stat-bar-count {
  width: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--ink);
}

/* ─── Stat Mini Grid ──────────────────────────────────────────── */

.stat-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-mini {
  background: var(--ink-04);
  border-radius: 0;
  padding: 16px 20px;
  text-align: center;
  border: 1px solid var(--ink-15);
}
.stat-mini-val {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -1px;
  color: var(--ink);
}
.stat-mini-val.accent { color: var(--red); }
.stat-mini-label {
  font-size: 0.72rem;
  color: var(--ink-50);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ─── Toast ───────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-family: var(--mono);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  letter-spacing: 0.2px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ─── Empty State ─────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-30);
}
.empty-state .symbol {
  font-family: var(--serif);
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--ink-15);
}
.empty-state p {
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--ink-50);
  letter-spacing: 0.3px;
}

/* ─── Loading ─────────────────────────────────────────────────── */

.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px;
  gap: 6px;
}
.loading-dot {
  width: 8px;
  height: 8px;
  background: var(--ink);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dot:nth-child(3) { animation-delay: 0.3s; }
.loading-dot.accent { background: var(--red); }

@keyframes dot-pulse {
  0%, 80%, 100% { transform: scaleY(1); opacity: 0.3; }
  40% { transform: scaleY(2.5); opacity: 1; }
}

/* ─── Animations ──────────────────────────────────────────────── */

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Stagger card animations */
.job-card:nth-child(1)  { animation-delay: 0.02s; }
.job-card:nth-child(2)  { animation-delay: 0.04s; }
.job-card:nth-child(3)  { animation-delay: 0.06s; }
.job-card:nth-child(4)  { animation-delay: 0.08s; }
.job-card:nth-child(5)  { animation-delay: 0.10s; }
.job-card:nth-child(6)  { animation-delay: 0.12s; }
.job-card:nth-child(7)  { animation-delay: 0.14s; }
.job-card:nth-child(8)  { animation-delay: 0.16s; }
.job-card:nth-child(9)  { animation-delay: 0.18s; }
.job-card:nth-child(10) { animation-delay: 0.20s; }

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
  html { font-size: 14px; }

  .header { padding: 14px 16px; }
  .header-stats { display: none; }
  .logo { font-size: 1.3rem; }

  .tabs { padding: 0 16px; }
  .tab { padding: 12px 16px; font-size: 0.73rem; }

  .filters { padding: 16px; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 100%; }
  .filter-group { flex-wrap: wrap; }
  .filter-input { min-width: 100%; }

  .results-header { padding: 12px 16px; }
  .results { padding: 0 16px 40px; }
  .job-card { padding: 16px 0 16px 12px; }
  .job-company { font-size: 1.05rem; }
  .job-card-header { flex-direction: column; gap: 6px; }

  .stats-grid {
    padding: 16px;
    grid-template-columns: 1fr;
  }
  .stat-card.wide { grid-column: span 1; }
  .stat-big-number { font-size: 3.5rem; }
}

@media (max-width: 480px) {
  .header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .header-right { width: 100%; justify-content: flex-end; }
  .job-badges { flex-wrap: wrap; }
  .job-meta { gap: 8px; }
  .stat-mini-grid { grid-template-columns: 1fr; }
}
