/* ===== CSS VARIABLES — Deep Ocean Blue ===== */
:root {
  --navy:        #0a1628;
  --navy-mid:    #0d2137;
  --blue:        #0369a1;
  --blue-mid:    #0284c7;
  --blue-light:  #38bdf8;
  --cyan:        #06b6d4;
  --cyan-light:  #67e8f9;
  --teal:        #0d9488;
  --teal-light:  #2dd4bf;

  /* mapped to generic names used throughout */
  --green-mid:   #0284c7;
  --green-light: #38bdf8;
  --green-pale:  #e0f2fe;
  --lavender:    #0d9488;

  --text:   #0a1628;
  --muted:  #4a6580;
  --border: rgba(2,132,199,0.18);
  --shadow: 0 8px 32px rgba(2,132,199,0.15);
  --radius: 20px;

  --glass:        rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.7);
  --glass-shadow: 0 8px 32px rgba(2,132,199,0.18);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(2,132,199,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(6,182,212,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 80%, rgba(13,148,136,0.08) 0%, transparent 60%),
    linear-gradient(160deg, #f0f8ff 0%, #e0f4fe 30%, #e6fffe 60%, #f0fdfa 100%);
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
input, select { font-family: inherit; }

/* ===== FALLING DOODLES ===== */
.doodles-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.doodle {
  position: absolute; top: -120px;
  opacity: 0;
  animation: doodleFall linear infinite;
}
.doodle svg { display: block; }
@keyframes doodleFall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 0; }
  5%   { opacity: 0.35; }
  90%  { opacity: 0.25; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}
.doodle:nth-child(1)  { left:3%;   width:28px; animation-duration:18s; animation-delay:0s;   }
.doodle:nth-child(2)  { left:9%;   width:22px; animation-duration:22s; animation-delay:2s;   }
.doodle:nth-child(3)  { left:16%;  width:32px; animation-duration:16s; animation-delay:4s;   }
.doodle:nth-child(4)  { left:23%;  width:20px; animation-duration:21s; animation-delay:1s;   }
.doodle:nth-child(5)  { left:30%;  width:26px; animation-duration:19s; animation-delay:6s;   }
.doodle:nth-child(6)  { left:38%;  width:30px; animation-duration:15s; animation-delay:3s;   }
.doodle:nth-child(7)  { left:45%;  width:24px; animation-duration:24s; animation-delay:5s;   }
.doodle:nth-child(8)  { left:52%;  width:28px; animation-duration:18s; animation-delay:7s;   }
.doodle:nth-child(9)  { left:59%;  width:20px; animation-duration:21s; animation-delay:2.5s; }
.doodle:nth-child(10) { left:66%;  width:34px; animation-duration:16s; animation-delay:8s;   }
.doodle:nth-child(11) { left:73%;  width:22px; animation-duration:25s; animation-delay:9s;   }
.doodle:nth-child(12) { left:80%;  width:28px; animation-duration:19s; animation-delay:10s;  }


/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(135deg, rgba(10,22,40,0.97) 0%, rgba(2,132,199,0.95) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 2px 0 rgba(56,189,248,0.12), 0 4px 28px rgba(2,132,199,0.35);
  padding: 12px 6%;
  display: flex; align-items: center; gap: 16px;
  transition: padding 0.3s, box-shadow 0.3s;
}
.navbar.scrolled { padding-top: 8px; padding-bottom: 8px; box-shadow: 0 4px 30px rgba(2,132,199,0.5); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  flex-shrink: 0;
}
.brand-logo-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand-name {
  font-size: 1.55rem; font-weight: 900; color: #fff;
  letter-spacing: -0.5px; display: block; line-height: 1.1;
}
.brand-badge {
  font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.75);
  text-transform: uppercase; letter-spacing: 0.8px; display: block;
}
.nav-links { display: flex; gap: 32px; margin-left: auto; }
.nav-links a {
  font-size: 0.92rem; font-weight: 600; color: rgba(255,255,255,0.85);
  position: relative; transition: color 0.2s; padding: 4px 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.6));
  border-radius: 2px; transition: width 0.28s;
}
.nav-links a:hover, .nav-links a.active-link { color: #fff; }
.nav-links a:hover::after, .nav-links a.active-link::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 10px; margin-left: 20px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.18); border-radius: 25px; padding: 8px 16px;
  border: 1.5px solid rgba(255,255,255,0.35); transition: all 0.25s;
}
.search-box:focus-within {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.28);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.search-box input {
  border: none; background: transparent; outline: none;
  font-size: 0.88rem; width: 190px; color: #fff;
}
.search-box input::placeholder { color: rgba(255,255,255,0.65); }
.search-box > svg { width: 15px; height: 15px; color: rgba(255,255,255,0.8); }
.dark-toggle {
  background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 50%; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.3s; color: #fff;
}
.dark-toggle svg { width: 17px; height: 17px; transition: all 0.3s; }
.dark-toggle .icon-sun { display: none; }
.dark-toggle .icon-moon { display: block; }
.dark-toggle:hover {
  background: rgba(255,255,255,0.32);
  border-color: rgba(255,255,255,0.6);
  transform: rotate(20deg);
}


/* ===== HERO ===== */
.hero {
  min-height: auto;
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(2,132,199,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(6,182,212,0.07) 0%, transparent 60%),
    linear-gradient(160deg, #f0f8ff 0%, #e0f4fe 40%, #e6fffe 100%);
  display: flex; flex-direction: column;
  padding: 0 0 32px;
  overflow: visible; position: relative; z-index: 1;
}

/* ===== CATEGORY PILLS ===== */
.hero-cats {
  display: flex; flex-direction: row; align-items: center;
  gap: 28px;
  border-bottom: 2px solid rgba(2,132,199,0.10);
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
  justify-content: flex-start;
  position: sticky;
  top: 64px;
  z-index: 900;
  background: rgba(240,248,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(2,132,199,0.08);
  padding: 16px 6%;
}
.hero-cats::-webkit-scrollbar { display: none; }
.hcat { display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer; }
.hcat-circle {
  width: 56px; height: 56px;
  background: none;
  border: none;
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.cat-emoji { font-size: 2rem; line-height: 1; }
.cat-pill-img {
  width: 52px; height: 52px; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}
.hcat:hover .hcat-circle, .hcat.active .hcat-circle {
  transform: translateY(-7px) scale(1.1);
}
.hcat span {
  font-size: 0.71rem; font-weight: 700; color: var(--muted);
  text-align: center; max-width: 80px; line-height: 1.3; transition: color 0.2s;
}
.hcat:hover span, .hcat.active span { color: var(--blue-mid); }
.hcat-all { background: none; }
.hcat-all svg { width: 48px; height: 48px; }

/* ===== HERO BODY ===== */
.hero-body {
  display: flex; align-items: center;
  gap: 32px; flex: 1; padding: 16px 6% 0;
  min-height: 0;
}
.hero-content { flex: 1; max-width: 560px; }
.hero-sub {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(2,132,199,0.08);
  backdrop-filter: blur(12px);
  color: var(--blue-mid);
  font-size: 0.72rem; font-weight: 800;
  padding: 4px 12px; border-radius: 20px;
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px;
  border: 1px solid rgba(2,132,199,0.18);
}
.hero-sub svg { width: 12px; height: 12px; fill: var(--blue-mid); }
.hero-content h1 {
  font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 900;
  line-height: 1.15; color: #0a1628; margin-bottom: 10px; letter-spacing: -0.5px;
}
.hero-content h1 span {
  color: transparent;
  background: linear-gradient(135deg, #0284c7, #06b6d4, #0d9488);
  -webkit-background-clip: text; background-clip: text;
}
.hero-desc {
  font-size: 0.9rem; color: var(--muted);
  margin-bottom: 16px; line-height: 1.7; max-width: 460px;
}
.hero-stats {
  display: flex; gap: 24px; margin-bottom: 18px;
}
.hero-stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num {
  font-size: 1.4rem; font-weight: 900; color: var(--blue-mid); line-height: 1;
}
.stat-label { font-size: 0.68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 60%, #0d9488 100%);
  color: #fff; padding: 14px 30px; border-radius: 30px;
  font-weight: 700; font-size: 0.95rem; border: none; cursor: pointer;
  box-shadow: 0 6px 24px rgba(2,132,199,0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary svg { width: 17px; height: 17px; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(2,132,199,0.45); }

/* ===== HERO VISUAL ===== */
.hero-visual { flex: 1; display: flex; justify-content: center; align-items: center; }
.hero-circle {
  width: 280px; height: 280px;
  background: conic-gradient(from 180deg at 50% 50%,
    rgba(2,132,199,0.15),
    rgba(6,182,212,0.18),
    rgba(13,148,136,0.12),
    rgba(2,132,199,0.15));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border: 2px solid rgba(255,255,255,0.65);
  box-shadow: 0 20px 60px rgba(2,132,199,0.18), inset 0 0 40px rgba(255,255,255,0.30);
  animation: float 5s ease-in-out infinite;
}
.hero-main-img {
  width: 160px; height: 160px;
  object-fit: contain;
  border-radius: 50%;
  position: relative; z-index: 1;
  filter: drop-shadow(0 6px 18px rgba(2,132,199,0.28));
  pointer-events: none;
  -webkit-user-drag: none;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-22px); }
}
.badge {
  position: absolute;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 30px;
  padding: 9px 16px; font-size: 0.76rem; font-weight: 700;
  box-shadow: 0 8px 24px rgba(2,132,199,0.12);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.90);
  z-index: 2;
  animation: badgePulse 3.5s ease-in-out infinite;
}
.badge-phd     { top: 30px;    left: -24px;  color: #0284c7; animation-delay: 0s; }
.badge-postdoc { bottom: 55px; left: -44px;  color: #0d9488; animation-delay: 1.2s; }
.badge-funded  { top: 30px;    right: -44px; color: #0369a1; animation-delay: 0.6s; }
.badge-deadline{ bottom: 10px; right: -32px; color: #06b6d4; animation-delay: 2.4s; }
.badge-brand   {
  bottom: -20px; left: 50%; transform: translateX(-50%);
  color: #0284c7; animation-delay: 1.8s;
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(2,132,199,0.22);
  box-shadow: 0 6px 20px rgba(2,132,199,0.18);
}
.badge-brand-img {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 1.5px solid rgba(2,132,199,0.2);
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.06) translateY(-3px); }
}


/* ===== LISTINGS SECTION ===== */
.listings-section {
  padding: 48px 6% 80px;
  position: relative; z-index: 1;
}
.listings-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 28px;
}
.listings-title-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.listings-title-row h2 {
  font-size: 1.6rem; font-weight: 900; color: var(--text); letter-spacing: -0.5px;
}
.listings-count {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff; font-size: 0.75rem; font-weight: 800;
  padding: 4px 14px; border-radius: 20px;
}
.listings-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.listings-filters select {
  padding: 9px 14px; border-radius: 20px;
  border: 1.5px solid rgba(2,132,199,0.18);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  cursor: pointer; outline: none; transition: all 0.2s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230284c7' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.listings-filters select:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(2,132,199,0.12);
}

/* ===== POSITION CARDS GRID ===== */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.pos-card {
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(2,132,199,0.10);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(2,132,199,0.07);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 12px;
}
.pos-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(2,132,199,0.16);
  border-color: rgba(2,132,199,0.28);
}
.pos-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.pos-cat-badge {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 4px 12px; border-radius: 20px;
  flex-shrink: 0;
}
.pos-funding-badge {
  font-size: 0.68rem; font-weight: 800;
  padding: 4px 10px; border-radius: 20px; flex-shrink: 0;
}
.funded-full    { background: #dcfce7; color: #16a34a; }
.funded-partial { background: #fef9c3; color: #ca8a04; }
.funded-none    { background: #fee2e2; color: #dc2626; }
.pos-title {
  font-size: 1rem; font-weight: 800; color: var(--text);
  line-height: 1.4; margin: 0;
}
.pos-institution {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.84rem; font-weight: 600; color: var(--muted);
}
.pos-institution svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--blue-mid); }
.pos-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pos-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.75rem; color: var(--text);
  background: rgba(2,132,199,0.06);
  border: 1px solid rgba(2,132,199,0.12);
  border-radius: 20px; padding: 4px 10px;
}
.pos-meta-item svg { width: 12px; height: 12px; color: var(--blue-mid); flex-shrink: 0; }
.pos-desc {
  font-size: 0.84rem; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pos-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid rgba(2,132,199,0.08);
}
.pos-deadline {
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
}
.pos-deadline svg { width: 13px; height: 13px; }
.deadline-urgent { color: #dc2626; }
.deadline-soon   { color: #d97706; }
.deadline-ok     { color: #16a34a; }
.pos-apply-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff; border: none; border-radius: 20px;
  padding: 8px 18px; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 12px rgba(2,132,199,0.28);
}
.pos-apply-btn svg { width: 13px; height: 13px; }
.pos-apply-btn:hover { transform: scale(1.06); box-shadow: 0 5px 18px rgba(2,132,199,0.40); }

/* ===== LOADING SPINNER ===== */
.listings-loading {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 60px 20px; color: var(--muted);
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(2,132,199,0.15);
  border-top-color: #0284c7;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.listings-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 20px; color: var(--muted); text-align: center;
}
.listings-empty svg { width: 48px; height: 48px; opacity: 0.3; }
.listings-empty p { font-size: 1rem; font-weight: 700; color: var(--text); }
.listings-empty small { font-size: 0.84rem; }

/* ===== POSITION DETAIL MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26,10,46,0.45); backdrop-filter: blur(6px);
  z-index: 2000; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 32px 80px rgba(2,132,199,0.18);
  border: 1px solid rgba(255,255,255,0.85);
  animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { transform: scale(0.85) translateY(24px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  background: linear-gradient(135deg, rgba(2,132,199,0.06), rgba(255,255,255,0.85));
  border-bottom: 1px solid rgba(2,132,199,0.10);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(10px);
}
.modal-title {
  font-size: 1rem; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.modal-close {
  background: rgba(2,132,199,0.07); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.modal-close:hover { background: rgba(2,132,199,0.15); }
.modal-close svg { width: 14px; height: 14px; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.modal-section-title {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 8px;
}
.modal-desc {
  font-size: 0.92rem; color: var(--text); line-height: 1.8;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(2,132,199,0.08); color: #0284c7;
  border-radius: 20px; padding: 5px 12px;
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid rgba(2,132,199,0.14);
}
.modal-apply-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #0284c7, #06b6d4, #0d9488);
  color: #fff; border: none; border-radius: 30px;
  padding: 15px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 24px rgba(2,132,199,0.32);
  text-decoration: none;
}
.modal-apply-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(2,132,199,0.45); }
.modal-apply-btn svg { width: 18px; height: 18px; }

/* ===== CARD IMAGE ===== */
.pos-card-img {
  width: 100%; height: 160px; border-radius: 12px; overflow: hidden;
  margin-bottom: 2px;
}
.pos-card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.3s;
}
.pos-card:hover .pos-card-img img { transform: scale(1.04); }

/* ===== MODAL IMAGE ===== */
.modal-img-wrap {
  width: 100%; height: 200px; border-radius: 14px; overflow: hidden;
  margin-bottom: 4px;
}
.modal-img-wrap img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ===== MODAL INFO GRID ===== */
.modal-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.modal-info-item {
  background: rgba(2,132,199,0.06);
  border: 1px solid rgba(2,132,199,0.12);
  border-radius: 12px; padding: 10px 14px;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 0.88rem; font-weight: 700; color: var(--text);
}
.modal-info-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted);
}

/* ===== MODAL REQUIREMENTS LIST ===== */
.modal-req-list {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
  padding: 0;
}
.modal-req-list li {
  font-size: 0.88rem; color: var(--text); line-height: 1.5;
  padding-left: 18px; position: relative;
}
.modal-req-list li::before {
  content: '✓'; position: absolute; left: 0;
  color: #0284c7; font-weight: 800;
}
body.dark .modal-info-item {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.15);
}
body.dark .modal-req-list li { color: #e0f2fe; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff; padding: 13px 28px; border-radius: 30px;
  font-size: 0.88rem; font-weight: 600;
  z-index: 4000; opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none; white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== SCROLL HINT ===== */
.scroll-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; color: #0284c7;
  text-transform: uppercase; letter-spacing: 0.8px;
  margin: 8px 0 0 6%;
  animation: hintBob 2s ease-in-out infinite;
  pointer-events: none; opacity: 0.75;
}
.scroll-hint svg { width: 14px; height: 14px; }
@keyframes hintBob {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50%       { transform: translateY(4px); opacity: 1; }
}
body.dark .scroll-hint { color: #38bdf8; }

/* ===== ACTIVE PILL BOUNCE ===== */
@keyframes pillBounce {
  0%   { transform: translateY(-7px) scale(1.1); }
  40%  { transform: translateY(-12px) scale(1.15); }
  70%  { transform: translateY(-5px) scale(1.08); }
  100% { transform: translateY(-7px) scale(1.1); }
}
.hcat.active .hcat-circle {
  animation: pillBounce 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

/* ===== SCROLL REVEAL ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }


/* ===== DARK MODE — Deep Ocean Blue ===== */
body.dark {
  --text:  #e0f2fe;
  --muted: #64a0c0;
  --border: rgba(2,132,199,0.22);
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(2,132,199,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(6,182,212,0.10) 0%, transparent 60%),
    linear-gradient(160deg, #020d1a 0%, #041525 40%, #031a20 100%);
  color: #e0f2fe;
}
body.dark .dark-toggle .icon-sun  { display: block; }
body.dark .dark-toggle .icon-moon { display: none; }
body.dark .dark-toggle { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.3); }

body.dark .hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% 50%, rgba(2,132,199,0.12) 0%, transparent 70%),
    linear-gradient(160deg, #020d1a 0%, #041525 50%, #031a20 100%);
}
body.dark .hero-content h1 { color: #e0f2fe; }
body.dark .hero-desc { color: #64a0c0; }
body.dark .hero-sub {
  background: rgba(56,189,248,0.12);
  border-color: rgba(56,189,248,0.22);
  color: #38bdf8;
}
body.dark .hero-circle {
  background: conic-gradient(from 180deg,
    rgba(2,132,199,0.25),
    rgba(6,182,212,0.28),
    rgba(13,148,136,0.20),
    rgba(2,132,199,0.25));
  box-shadow: 0 30px 80px rgba(2,132,199,0.25), inset 0 0 60px rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.25);
}
body.dark .badge {
  background: rgba(4,21,37,0.95);
  border-color: rgba(56,189,248,0.2);
  color: #e0f2fe;
}
body.dark .stat-num { color: #38bdf8; }

body.dark .hcat-circle {
  background: none;
  border: none;
}
body.dark .hcat:hover .hcat-circle, body.dark .hcat.active .hcat-circle {
  background: none;
  box-shadow: none;
}
body.dark .hcat span { color: #64a0c0; }
body.dark .hcat:hover span, body.dark .hcat.active span { color: #38bdf8; }
body.dark .hero-cats {
  background: rgba(2,13,26,0.94);
  border-color: rgba(56,189,248,0.12);
  box-shadow: 0 4px 20px rgba(2,132,199,0.15);
}

body.dark .listings-title-row h2 { color: #e0f2fe; }
body.dark .listings-filters select {
  background-color: rgba(255,255,255,0.05);
  border-color: rgba(56,189,248,0.18);
  color: #e0f2fe;
}
body.dark .pos-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(56,189,248,0.12);
}
body.dark .pos-card:hover {
  border-color: rgba(56,189,248,0.32);
  box-shadow: 0 14px 40px rgba(2,132,199,0.22);
}
body.dark .pos-title { color: #e0f2fe; }
body.dark .pos-institution { color: #64a0c0; }
body.dark .pos-meta-item {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.15);
  color: #e0f2fe;
}
body.dark .pos-desc { color: #64a0c0; }
body.dark .pos-footer { border-color: rgba(56,189,248,0.10); }
body.dark .listings-empty p { color: #e0f2fe; }

body.dark .modal {
  background: rgba(4,21,37,0.98);
  border-color: rgba(56,189,248,0.15);
}
body.dark .modal-header {
  background: rgba(2,15,30,0.95);
  border-color: rgba(56,189,248,0.12);
}
body.dark .modal-title { color: #e0f2fe; }
body.dark .modal-close {
  background: rgba(56,189,248,0.10);
  color: #e0f2fe;
}
body.dark .modal-close:hover { background: rgba(56,189,248,0.18); }
body.dark .modal-desc { color: #e0f2fe; }
body.dark .modal-section-title { color: #64a0c0; }
body.dark .modal-tag {
  background: rgba(56,189,248,0.10);
  color: #38bdf8;
  border-color: rgba(56,189,248,0.18);
}

body.dark .search-box {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.2);
}
body.dark .search-box input { color: #e0f2fe; }
body.dark .search-box input::placeholder { color: rgba(224,242,254,0.5); }

body.dark .modal-overlay { background: rgba(2,10,20,0.7); }

/* ===== RESPONSIVE ===== */

/* ── Large desktop (≥ 1280px) ── */
@media (min-width: 1280px) {
  .navbar { padding: 14px 8%; }
  .hero-cats { padding: 16px 8%; }
  .scroll-hint { margin-left: 8%; }
  .hero-body { padding: 20px 8% 0; }
  .hero-circle { width: 320px; height: 320px; }
  .hero-main-img { width: 180px; height: 180px; }
  .listings-section { padding: 48px 8% 80px; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* ── Tablet / small desktop (≤ 1024px) ── */
@media (max-width: 1024px) {
  .hero { padding: 0 0 24px; }
  .hero-body { gap: 24px; padding: 14px 5% 0; }
  .hero-circle { width: 220px; height: 220px; }
  .hero-main-img { width: 120px; height: 120px; }
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ── Tablet portrait (≤ 900px) ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .navbar { padding: 12px 4%; gap: 10px; }
  .search-box input { width: 140px; }
  .hero { padding: 0 0 20px; min-height: auto; }
  .hero-cats { gap: 20px; top: 58px; padding: 14px 4%; }
  .hero-body { padding: 14px 4% 0; flex-direction: column; text-align: center; gap: 20px; }
  .hero-content { max-width: 100%; }
  .hero-btns { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; max-width: 480px; }
  .hero-circle { width: 200px; height: 200px; }
  .hero-main-img { width: 110px; height: 110px; }
  .badge-postdoc { left: -20px; }
  .listings-section { padding: 32px 4% 60px; }
  .listings-header { flex-direction: column; }
}

/* ── Mobile (360px – 700px) ── */
@media (min-width: 360px) and (max-width: 700px) {

  /* NAVBAR */
  .navbar { padding: 10px 4%; gap: 8px; flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .brand { gap: 8px; flex-shrink: 0; }
  .brand-icon { width: 36px; height: 36px; }
  .brand-name { font-size: 1.2rem; }
  .brand-badge { display: none; }
  .nav-links { display: none; }
  .nav-actions { gap: 8px; margin-left: 0; flex-shrink: 0; display: flex; align-items: center; }
  .search-box { padding: 7px 12px; flex: 1; min-width: 0; max-width: none; margin: 0 auto; }
  .search-box > svg { width: 15px; height: 15px; }
  .search-box input { width: 0; flex: 1; min-width: 0; font-size: 0.88rem; }

  /* HERO */
  .hero { padding: 0 0 16px; }
  .hero-cats { gap: 12px; top: 54px; padding: 12px 4%; }
  .hero-body { padding: 12px 4% 0; flex-direction: column; text-align: center; gap: 14px; }
  .hero-content { max-width: 100%; }
  .hero-sub { font-size: 0.68rem; padding: 4px 10px; margin-bottom: 8px; }
  .hero-content h1 { font-size: clamp(1.3rem, 5.5vw, 1.7rem); margin-bottom: 8px; line-height: 1.15; }
  .hero-desc { font-size: 0.82rem; margin-bottom: 10px; line-height: 1.6; margin-left: auto; margin-right: auto; }
  .hero-stats { gap: 16px; margin-bottom: 12px; justify-content: center; }
  .stat-num { font-size: 1.2rem; }
  .hero-btns { justify-content: center; }
  .btn-primary { padding: 10px 20px; font-size: 0.86rem; }

  /* CATEGORIES */
  .hcat-circle { width: 62px; height: 62px; }
  .hcat span { font-size: 0.68rem; max-width: 66px; }

  /* HERO VISUAL */
  .hero-circle { width: 150px; height: 150px; }
  .hero-main-img { width: 82px; height: 82px; }
  .badge { display: none; }

  /* LISTINGS */
  .listings-section { padding: 20px 4% 80px; }
  .listings-grid { grid-template-columns: 1fr; gap: 12px; }
  .listings-title-row h2 { font-size: 1.2rem; }
  .listings-filters { gap: 8px; flex-direction: column; }
  .listings-filters select { font-size: 0.78rem; padding: 7px 28px 7px 10px; width: 100%; }
  .pos-card { padding: 14px; }
  .pos-title { font-size: 0.9rem; }
  .pos-desc { font-size: 0.8rem; }

  /* MODAL */
  .modal-overlay { padding: 12px; align-items: center; justify-content: center; }
  .modal { border-radius: 20px; max-height: 90vh; overflow-y: auto; width: calc(100% - 24px); }
  .modal-header { padding: 16px 16px 12px; }
  .modal-title { font-size: 0.95rem; }
  .modal-close { width: 34px; height: 34px; }
  .modal-body { padding: 14px; gap: 14px; }
  .modal-apply-btn { padding: 13px; font-size: 0.92rem; }

  /* TOAST */
  .toast { font-size: 0.82rem; padding: 10px 18px; max-width: 92vw; white-space: normal; text-align: center; }

  /* SCROLL HINT */
  .scroll-hint { display: none; }
}

/* ── Small mobile (≤ 360px) ── */
@media (max-width: 360px) {

  /* NAVBAR */
  .navbar { padding: 7px 3%; gap: 6px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand-name { font-size: 1rem; }
  .search-box { padding: 5px 8px; }
  .search-box > svg { width: 13px; height: 13px; }
  .search-box input { font-size: 0.78rem; }

  /* HERO */
  .hero { padding: 0 0 12px; }
  .hero-cats { gap: 8px; }
  .hero-body { padding: 10px 3% 0; gap: 10px; }
  .hero-sub { font-size: 0.62rem; padding: 3px 8px; margin-bottom: 6px; }
  .hero-content h1 { font-size: clamp(1.1rem, 6vw, 1.4rem); margin-bottom: 6px; }
  .hero-desc { font-size: 0.76rem; margin-bottom: 8px; }
  .hero-stats { gap: 12px; margin-bottom: 10px; }
  .stat-num { font-size: 1rem; }
  .btn-primary { padding: 9px 16px; font-size: 0.8rem; }

  /* CATEGORIES */
  .hcat-circle { width: 52px; height: 52px; }
  .hcat span { font-size: 0.6rem; max-width: 56px; }

  /* HERO VISUAL */
  .hero-circle { width: 120px; height: 120px; }
  .hero-main-img { width: 65px; height: 65px; }

  /* LISTINGS */
  .listings-section { padding: 16px 3% 80px; }
  .listings-title-row h2 { font-size: 1.1rem; }
  .pos-card { padding: 12px; }
  .pos-title { font-size: 0.84rem; }
  .pos-cat-badge { font-size: 0.62rem; padding: 3px 8px; }
  .pos-funding-badge { font-size: 0.62rem; padding: 3px 8px; }
  .pos-institution { font-size: 0.78rem; }
  .pos-meta-item { font-size: 0.68rem; padding: 3px 8px; }
  .pos-desc { font-size: 0.76rem; }
  .pos-apply-btn { padding: 6px 12px; font-size: 0.74rem; }
  .pos-deadline { font-size: 0.68rem; }

  /* MODAL */
  .modal-overlay { padding: 8px; }
  .modal { width: calc(100% - 16px); border-radius: 16px; }
  .modal-header { padding: 12px 12px 10px; }
  .modal-title { font-size: 0.88rem; }
  .modal-close { width: 28px; height: 28px; }
  .modal-close svg { width: 12px; height: 12px; }
  .modal-body { padding: 12px; gap: 12px; }
  .modal-apply-btn { padding: 11px; font-size: 0.84rem; }

  /* TOAST */
  .toast { font-size: 0.72rem; padding: 8px 14px; }
}

/* ── Mobile (≤ 430px) bottom sheet modal ── */
@media (max-width: 430px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-header { border-radius: 20px 20px 0 0; }
}

/* ── Toast repositions to top-right on mobile ── */
@media (max-width: 768px) {
  .toast {
    bottom: auto;
    top: 16px;
    left: auto;
    right: 16px;
    transform: translateY(-80px);
    border-radius: 14px;
    font-size: 0.82rem;
    padding: 10px 18px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: left;
  }
  .toast.show { transform: translateY(0); }
  .doodles-bg { bottom: 62px; }
}
