* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.5;
}

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 40px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 22px; font-weight: 700; }
.brand h1 span { color: var(--primary); }

.logo-3d {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 20px rgba(37,99,235,0.4);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(6deg); }
}

.step-counter {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.home { max-width: 1200px; margin: 0 auto; padding: 60px 24px; }
.hero { text-align: center; margin-bottom: 60px; }
.hero h2 { font-size: 44px; font-weight: 800; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--muted); font-size: 18px; }

.streams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  padding: 32px 24px;
  border-radius: 20px;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(37,99,235,0.15);
}

.icon-3d {
  width: 80px; height: 80px; margin: 0 auto 20px;
  border-radius: 20px;
  position: relative;
  transform-style: preserve-3d;
  animation: spin3d 8s linear infinite;
}

.icon-3d.eng { background: linear-gradient(135deg,#3b82f6,#1e40af); }
.icon-3d.agr { background: linear-gradient(135deg,#10b981,#047857); }
.icon-3d.med { background: linear-gradient(135deg,#ef4444,#991b1b); }
.icon-3d.pha { background: linear-gradient(135deg,#8b5cf6,#6d28d9); }

@keyframes spin3d {
  0% { transform: rotateY(0deg) rotateX(10deg); }
  100% { transform: rotateY(360deg) rotateX(10deg); }
}

.card h3 { font-size: 20px; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14px; }

/* Forms */
.form-wrap {
  max-width: 720px; margin: 40px auto;
  background: var(--card);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
}

.form-wrap h2 { margin-bottom: 8px; }
.form-wrap .sub { color: var(--muted); margin-bottom: 28px; }

.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.field input, .field select {
  width: 100%; padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px; font-size: 15px;
  transition: all 0.2s;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.1);
}

.btn {
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,99,235,0.45); }
.btn-outline {
  background: white; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }

.btn-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; }

/* Filters */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.filter-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
}
.filter-box h4 { margin-bottom: 12px; font-size: 14px; text-transform: uppercase;
  color: var(--primary); letter-spacing: 0.5px; }
.filter-box label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 14px; cursor: pointer;
}
.filter-box input[type="checkbox"] { accent-color: var(--primary); }

/* Results */
.result-card {
  background: white; border-radius: 14px; padding: 20px;
  margin-bottom: 14px;
  border-left: 5px solid var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  animation: slideIn 0.4s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.result-card h3 { margin-bottom: 8px; color: var(--primary-dark); }
.result-card .meta { color: var(--muted); font-size: 13px; line-height: 1.7; }
.result-card .meta strong { color: var(--text); }

.rank-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 4px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 700;
  margin-bottom: 8px;
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner {
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  width: 40px; height: 40px; border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .brand h1 { font-size: 16px; }
  .step-counter { font-size: 11px; padding: 6px 12px; }
  .hero h2 { font-size: 28px; }
  .form-wrap { padding: 24px; margin: 20px 12px; }
}


/* ===== New Code Added ===== */

/* ===== Top-bar nav actions ===== */
.nav-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  margin-right: 14px;
}

.btn-nav {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}
.btn-back { background: #f1f5f9; }
.btn-home { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-color: transparent; }
.btn-home:hover { color: #fff; filter: brightness(1.05); }

/* ===== Home hero with HD image ===== */
.hero-copy h2 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-copy p {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 24px;
  max-width: 520px;
}
.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-media::before {
  content: '';
  position: absolute;
  width: 92%;
  height: 92%;
  border-radius: 32px;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.18), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(6,182,212,0.18), transparent 60%);
  filter: blur(20px);
  z-index: 0;
}

@keyframes heroFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}

/* floating stat chips around the image */
.hero-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}
.hero-chip.c1 { top: 8%; left: -6%; }
.hero-chip.c2 { bottom: 14%; right: -6%; animation-delay: 1s; }
.hero-chip.c3 { bottom: 45%; left: -10%; animation-delay: 2s; }

@keyframes chipFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: 34px; }
  .hero-chip.c1, .hero-chip.c3 { left: 2%; }
  .hero-chip.c2 { right: 2%; }
}

@media (max-width: 640px) {
  .nav-actions { margin-right: 8px; gap: 6px; }
  .btn-nav { padding: 6px 10px; font-size: 11px; }
  .btn-nav span { display: none; } /* icon-only on tiny screens if needed */
}






/* =========================================================
   HERO (smaller image)
   ========================================================= */
.hero-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 40px;
  margin-bottom: 60px;
}

.hero-copy h2 {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-copy p {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 24px;
  max-width: 520px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-media::before {
  content: '';
  position: absolute;
  width: 85%;
  height: 85%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.20), transparent 65%),
              radial-gradient(circle at 70% 70%, rgba(6,182,212,0.20), transparent 65%);
  filter: blur(24px);
  z-index: 0;
}
/* Smaller image */
.hero-img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 340px;      /* 👈 reduced from 520px */
  border-radius: 24px;
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 6px 16px rgba(15, 23, 42, 0.08);
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}

/* Smaller floating chips */
.hero-chip {
  position: absolute;
  z-index: 2;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 8px 20px rgba(15,23,42,0.10);
  display: flex; align-items: center; gap: 6px;
  animation: chipFloat 4s ease-in-out infinite;
}
.hero-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}
.hero-chip.c1 { top: 6%;  left: 4%; }
.hero-chip.c2 { bottom: 12%; right: 4%; animation-delay: 1s; }
.hero-chip.c3 { bottom: 40%; left: 0%; animation-delay: 2s; }
@keyframes chipFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

/* =========================================================
   HOW IT WORKS (attractive cards)
   ========================================================= */
.how-section {
  margin-top: 90px;
  text-align: center;
}
.how-section > h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.how-section > p {
  color: var(--muted);
  margin-bottom: 42px;
  font-size: 16px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.how-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px 22px 26px;
  text-align: left;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 4px 14px rgba(15,23,42,0.04);
}
.how-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s;
}
.how-card::after {
  content: attr(data-step);
  position: absolute;
  top: 14px; right: 16px;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: rgba(37,99,235,0.07);
  z-index: 0;
}
.how-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 22px 40px rgba(37,99,235,0.15);
}
.how-card:hover::before { opacity: 1; }

.how-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  box-shadow: 0 10px 20px rgba(37,99,235,0.20);
  position: relative; z-index: 1;
}
.how-card:nth-child(1) .how-icon { background: linear-gradient(135deg,#3b82f6,#1e40af); color:#fff; }
.how-card:nth-child(2) .how-icon { background: linear-gradient(135deg,#06b6d4,#0e7490); color:#fff; }
.how-card:nth-child(3) .how-icon { background: linear-gradient(135deg,#8b5cf6,#6d28d9); color:#fff; }
.how-card:nth-child(4) .how-icon { background: linear-gradient(135deg,#10b981,#047857); color:#fff; }

.how-card h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  position: relative; z-index: 1;
}
.how-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  position: relative; z-index: 1;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: 80px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 24px 26px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 32px;
  align-items: flex-start;
}
.footer-brand h3 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px;
}
.footer-brand h3 span { color: var(--accent); }
.footer-brand p {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.6;
  max-width: 340px;
}
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.footer-col a,
.footer-col button {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  background: none; border: none; cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}
.footer-col a:hover,
.footer-col button:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #94a3b8;
}
.footer-bottom .copy { display: flex; align-items: center; gap: 6px; }
.footer-bottom .copy-symbol {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: 34px; }
  .footer-inner { grid-template-columns: 1fr; }
}

/* =========================================================
   RESULTS TABLE (top 3, colorful)
   ========================================================= */
.results-table-wrap {
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
    linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(15,23,42,0.12), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,0.12), transparent) 100% 0;
  background-repeat: no-repeat;
  background-color: #fff;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}

table.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 720px;
}
table.results-table thead th {
  background: linear-gradient(135deg, #1e40af, #06b6d4);
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
table.results-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  color: var(--text);
  vertical-align: middle;
}
table.results-table tbody tr:nth-child(odd) { background: #fbfdff; }
table.results-table tbody tr:hover { background: #eff6ff; }

.choice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.choice-1 { background: linear-gradient(135deg,#f59e0b,#d97706); }  /* gold  */
.choice-2 { background: linear-gradient(135deg,#94a3b8,#475569); }  /* silver */
.choice-3 { background: linear-gradient(135deg,#b45309,#78350f); }  /* bronze */


/* ===== Top-bar nav actions ===== */
.nav-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  margin-right: 14px;
}

.btn-nav {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}
.btn-back { background: #f1f5f9; }
.btn-home { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; border-color: transparent; }
.btn-home:hover { color: #fff; filter: brightness(1.05); }

/* ===== Home hero with HD image ===== */
.hero-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 40px;
  margin-bottom: 60px;
}

.hero-copy h2 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-copy p {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 24px;
  max-width: 520px;
}
.hero-cta {
  display: flex; gap: 12px; flex-wrap: wrap;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-media::before {
  content: '';
  position: absolute;
  width: 92%;
  height: 92%;
  border-radius: 32px;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,0.18), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(6,182,212,0.18), transparent 60%);
  filter: blur(20px);
  z-index: 0;
}
.hero-img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 300px;
  border-radius: 28px;
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.18),
    0 8px 20px rgba(15, 23, 42, 0.08);
  animation: heroFloat 6s ease-in-out infinite;
}
@keyframes heroFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}

/* floating stat chips around the image */
.hero-chip {
  position: absolute;
  z-index: 2;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15,23,42,0.10);
  display: flex; align-items: center; gap: 8px;
  animation: chipFloat 4s ease-in-out infinite;
}
.hero-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
}
.hero-chip.c1 { top: 8%; left: -6%; }
.hero-chip.c2 { bottom: 14%; right: -6%; animation-delay: 1s; }
.hero-chip.c3 { bottom: 45%; left: -10%; animation-delay: 2s; }
@keyframes chipFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-copy h2 { font-size: 34px; }
  .hero-chip.c1, .hero-chip.c3 { left: 2%; }
  .hero-chip.c2 { right: 2%; }
}

@media (max-width: 640px) {
  .nav-actions { margin-right: 8px; gap: 6px; }
  .btn-nav { padding: 6px 10px; font-size: 11px; }
  .btn-nav span { display: none; } /* icon-only on tiny screens if needed */
}

/* =========================================================
   Hero Tagline — editorial / professional
   ========================================================= */
.hero-tagline {
  font-size: 18px;
  line-height: 1.75;
  color: #64748b;
  margin-bottom: 28px;
  max-width: 540px;
  letter-spacing: -0.005em;
}

.hero-tagline .line {
  display: block;
}

.hero-tagline em {
  font-style: normal;
  font-weight: 600;
  color: #0f172a;
  position: relative;
}
.hero-tagline em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  opacity: 0.35;
}

/* Rotating word container */
.swap-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  min-height: 40px;
}

/* Animated word */
.hero-tagline .swap {
  position: relative;
  display: inline-block;
  padding: 2px 14px 4px 20px;
  color: #0f172a;
  background: linear-gradient(90deg, rgba(59,130,246,0.10), rgba(6,182,212,0.10));
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Small pulsing dot to the left of the word */
.hero-tagline .swap::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 0 rgba(59,130,246,0.6);
  animation: tagPulse 2.4s ease-in-out infinite;
}
@keyframes tagPulse {
  0%   { box-shadow: 0 0 0 0    rgba(59,130,246,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0    rgba(59,130,246,0); }
}

/* Word swap transitions */
.hero-tagline .swap.out {
  opacity: 0;
  transform: translateY(-10px);
}
.hero-tagline .swap.in {
  opacity: 1;
  transform: translateY(0);
}

/* Soft fading divider between the tagline lines */
.hero-tagline .line + .line {
  animation: fadeUp 0.7s ease both;
}
.hero-tagline .line:nth-child(1) { animation-delay: 0.05s; }
.hero-tagline .line:nth-child(2) { animation-delay: 0.15s; }
.hero-tagline .line:nth-child(3) { animation-delay: 0.25s; }
.hero-tagline .line:nth-child(4) { animation-delay: 0.35s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}







/* =========================================================
   Hero paragraph — animated chip swapper
   ========================================================= */
/* =========================================================
   Hero paragraph — slow floating chips
   ========================================================= */
.hero-multi {
  line-height: 2.4;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 620px;
}

.hero-line {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* Base chip — same shape as hero-chip */
.float-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 20px rgba(15,23,42,0.10);
  animation: chipFloat 4s ease-in-out infinite;
  will-change: transform;
}

/* Slow pulsing dot */
.float-chip::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.25);
}

/* --- Four different colors --- */
.float-chip.red {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.32);
}
.float-chip.yellow {
  background: linear-gradient(135deg, #f59e0b, #b45309);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.32);
}
.float-chip.teal {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.32);
}
.float-chip.blue {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.32);
}

/* Slow gentle float, like hero-chip */
@keyframes chipFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

/* Stagger so chips don't bob in sync */
.hero-line .float-chip:nth-child(1) { animation-delay: 0s;   }
.hero-line .float-chip:nth-child(2) { animation-delay: 1s;   }


/* =========================================================
   Under-construction toast
   ========================================================= */
#construction-toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translate(-50%, -12px);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px 14px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
  z-index: 9999;
  max-width: 420px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#construction-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#construction-toast .toast-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
#construction-toast .toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13.5px;
  color: #334155;
}
#construction-toast .toast-body strong {
  font-size: 14px;
  color: #0f172a;
}

@media (max-width: 520px) {
  #construction-toast {
    top: 76px;
    left: 12px;
    right: 12px;
    transform: translate(0, -12px);
    max-width: none;
  }
  #construction-toast.show {
    transform: translate(0, 0);
  }
}


/* Tooltip note on Download PDF button */
.btn-success {
  position: relative;
}
.btn-success .btn-note {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #fce9b3;
  color: #0d0c0c;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}
.btn-success .btn-note::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}
.btn-success:hover .btn-note {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}




/* =========================================================
   Scrolling Notice Bar
   ========================================================= */
.notice-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: #fdecec;
  border-bottom: 1px solid #f5c2c2;
  color: #7f1d1d;
  font-size: 14px;
  height: 44px;
  overflow: hidden;
  z-index: 200;
}

.notice-tag {
  position: relative;
  flex-shrink: 0;
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.6px;
  padding: 8px 22px 8px 16px;
  margin-left: 12px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.notice-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}

.notice-track {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  animation: noticeScroll 40s linear infinite;
  will-change: transform;
}
.notice-track:hover {
  animation-play-state: paused;
}

.notice-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #7f1d1d;
}

.notice-new {
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

@keyframes noticeScroll {
  0%   { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-50%) translateX(-50%); }
}

@media (max-width: 640px) {
  .notice-bar   { font-size: 12.5px; height: 40px; }
  .notice-tag   { font-size: 10.5px; padding: 6px 18px 6px 12px; }
}



/* =========================================================
   SIDE MENU
   ========================================================= */
.side-menu {
  position: fixed;
  top: 150px;              /* clears the notice bar + topbar */
  left: 16px;
  width: 250px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
  z-index: 90;
  font-size: 14px;
}

.side-menu-header {
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}
.side-menu-header .menu-icon { font-size: 15px; }

.side-menu-nav { display: flex; flex-direction: column; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid #eef2f7;
  background: #f5f8ff;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border-left: 4px solid transparent;
  text-align: left;
  width: 100%;
  font-size: 13.5px;
}
.menu-item:hover {
  background: #e6f0ff;
  color: #1e40af;
  border-left-color: #1e40af;
}
.menu-num {
  font-weight: 700;
  color: #1e40af;
  font-size: 12.5px;
  min-width: 22px;
}
.menu-parent { position: relative; justify-content: flex-start; }
.menu-caret {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  transition: transform 0.2s;
}
.menu-group.open .menu-caret { transform: rotate(180deg); }

.menu-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: #fbfdff;
}
.menu-sub.open { max-height: 600px; }

.menu-subitem {
  display: block;
  padding: 8px 14px 8px 44px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}
.menu-subitem:hover {
  background: #eef4ff;
  color: #1e40af;
}

/* Stream shortcuts at the top of the side menu */
.menu-section-label {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.menu-item.menu-stream {
  background: linear-gradient(90deg, #f0f7ff, #ffffff);
  font-weight: 600;
  color: #1e3a8a;
}
.menu-item.menu-stream .menu-num {
  color: #06b6d4;
  font-size: 13px;
}
.menu-item.menu-stream:hover {
  background: linear-gradient(90deg, #dbeafe, #eff6ff);
  border-left-color: #06b6d4;
  color: #1e40af;
}

.menu-divider {
  height: 6px;
  background: #eef2f7;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

/* On small screens, hide the fixed menu */



/* Desktop: push content right, keep menu always visible */
@media (min-width: 901px) {
  main.home { margin-left: 280px; }
  .mobile-menu-toggle,
  .mobile-menu-backdrop { display: none; }
}

/* Mobile: slide-in drawer */
@media (max-width: 900px) {
  .side-menu {
    top: 0;
    left: 0;
    width: 260px;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 1000;
  }
  .side-menu.open {
    transform: translateX(0);
  }
  .side-menu-header {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 16px 14px;
    font-size: 15px;
  }

  /* Hamburger button */
  .mobile-menu-toggle {
    position: fixed;
    top: 76px;                /* below notice-bar + topbar */
    left: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15,23,42,0.12);
    cursor: pointer;
    z-index: 1001;
  }
  .mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2.2px;
    background: #1e40af;
    border-radius: 2px;
    transition: all 0.25s ease;
  }
  /* Turn into X when open */
  .mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(7.2px) rotate(45deg);
  }
  .mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-7.2px) rotate(-45deg);
  }

  /* Dimmed backdrop */
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
  }
  .mobile-menu-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* Remove the desktop left padding */
  main.home { margin-left: 0; }
}



/* =========================================================
   College list page — grid of cards
   ========================================================= */
.colleges-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}

.college-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.college-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15,23,42,0.05);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.college-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37,99,235,0.35);
  box-shadow: 0 14px 30px rgba(37,99,235,0.12);
}

.college-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f5f8ff, #eef4ff);
  border-bottom: 1px solid #e2e8f0;
}
.college-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e40af, #1e3a8a);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.college-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 14.5px;
  line-height: 1.4;
}

.college-card-body {
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.field-label {
  flex-shrink: 0;
  min-width: 110px;
  color: #64748b;
  font-weight: 600;
  text-transform: capitalize;
}
.field-value {
  color: #0f172a;
  white-space: pre-line;
  word-break: break-word;
}

@media (max-width: 640px) {
  .college-grid { grid-template-columns: 1fr; }
  .field-label { min-width: 90px; font-size: 12px; }
}


/* =========================================================
   GLOBAL MOBILE COMPATIBILITY
   ========================================================= */

/* Prevent horizontal scroll caused by wide children */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Comfortable tap targets */
@media (max-width: 900px) {
  button, .btn, a.menu-item, a.menu-subitem, input[type="radio"], input[type="checkbox"] {
    min-height: 40px;
  }

  input, select, textarea {
    font-size: 16px;   /* prevents iOS auto-zoom on focus */
  }

  /* Card / form paddings */
  .form-wrap {
    margin: 16px 12px;
    padding: 20px 16px;
  }

  /* Stream cards — 2 across on tablets, 1 on phones */
  .streams {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
  }

  /* Hero image smaller still */
  .hero-img { width: 140px; height: 140px; }

  /* Topbar layout tweaks */
  .topbar {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand h1 { font-size: 15px; }
  .brand h1 span { display: inline; }
  .logo-3d { width: 32px; height: 32px; }
  .step-counter { font-size: 11px; padding: 5px 10px; }

  /* Nav buttons (Home / Back) */
  .nav-actions { gap: 6px; margin-right: 6px; }
  .btn-nav { padding: 6px 10px; font-size: 11px; }

  /* Results table wrap — allow horizontal scroll instead of squashing */
  .results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.results-table { min-width: 720px; }

  /* Filter grid stacks in one column */
  .filter-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  /* Footer stacks nicely */
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* Very small phones (<= 420px) */
@media (max-width: 420px) {
  .hero-copy h2 { font-size: 26px; }
  .hero-multi { font-size: 14px; line-height: 1.9; }

  .card h3 { font-size: 16px; }
  .icon-3d { width: 60px; height: 60px; }

  .btn { padding: 10px 18px; font-size: 13.5px; }
  .btn-row { flex-direction: column; gap: 8px; }
  .btn-row .btn { width: 100%; }
}

@media (hover: none) and (pointer: coarse) {
  /* Disable hover-only effects on touch devices */
  .card:hover,
  .how-step:hover,
  .college-card:hover {
    transform: none;
  }

  /* Bigger checkboxes for finger taps */
  input[type="checkbox"], input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  /* More padding on menu items */
  .menu-item, .menu-subitem {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}




/* =========================================================
   Filter grid — 2-column rows with fixed headings
   ========================================================= */

/* Override the default auto-fill grid for the filter container */
#filter-container.filter-grid {
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

/* Category block still spans full width on row 0 (unchanged) */
#filter-container .filter-box[style*="grid-column"] {
  grid-column: 1 / -1;
}

/* Each filter box: fixed header + scrollable body */
.filter-box {
  display: flex;
  flex-direction: column;
  max-height: 320px;          /* box height */
  padding: 0;                 /* padding moves to inner parts */
  overflow: hidden;           /* we scroll the body, not the box */
}

.filter-box-head {
  flex-shrink: 0;
  padding: 14px 16px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}
.filter-box-head h4 {
  margin: 0 0 8px;
  font-size: 13.5px;
  letter-spacing: 0.4px;
  color: var(--primary);
  text-transform: uppercase;
}
.filter-select-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.filter-box-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 14px;
  scrollbar-width: thin;
}
.filter-box-body::-webkit-scrollbar { width: 6px; }
.filter-box-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.filter-box-body label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13.5px;
  color: #334155;
  cursor: pointer;
}

/* Mobile: single column */
@media (max-width: 900px) {
  #filter-container.filter-grid {
    grid-template-columns: 1fr;
  }
  .filter-box { max-height: 260px; }
}