:root {
  --bg: #f7f8fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --text: #141824;
  --muted: #5c6475;
  --border: #e2e6ef;
  --primary: #4f46e5;
  --primary-2: #06b6d4;
  --primary-soft: #eef0ff;
  --shadow: 0 1px 2px rgba(20, 24, 36, .05), 0 8px 24px rgba(20, 24, 36, .06);
  --radius: 14px;

  --src-hn: #f97316;
  --src-devto: #0f766e;
  --src-conversation: #dc2626;
  --src-globalvoices: #7c3aed;
  --success: #15803d;
  --error: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017; --bg-alt: #121621; --surface: #171c28; --text: #e8ebf3; --muted: #9aa3b5;
    --border: #262d3d; --primary: #818cf8; --primary-2: #22d3ee; --primary-soft: #1e2140; --success: #4ade80; --error: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1017; --bg-alt: #121621; --surface: #171c28; --text: #e8ebf3; --muted: #9aa3b5;
  --border: #262d3d; --primary: #818cf8; --primary-2: #22d3ee; --primary-soft: #1e2140; --success: #4ade80; --error: #f87171;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.container { width: min(1140px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--primary); margin: 0 0 6px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #fff; font-size: .8rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px;
  width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 20px; border-radius: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: 0; }
.btn-ghost { background: transparent; }
.btn-small { padding: 9px 14px; font-size: .9rem; }
.btn.center { display: flex; margin: 28px auto 0; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

/* Hero */
.hero {
  padding: 88px 0 72px; position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 85% 10%, color-mix(in srgb, var(--primary-2) 18%, transparent), transparent 70%),
    radial-gradient(700px 400px at 10% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%);
}
.hero-inner { max-width: 780px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); font-weight: 800; }
.grad { background: linear-gradient(135deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 40px; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.8rem; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .9rem; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head p { margin: 0; }
.news-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.news-actions input {
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; min-width: 220px;
}

/* Chips & tabs */
.chips, .tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip, .tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 7px 16px; font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
}
.chip[aria-selected="true"], .tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .count { opacity: .6; margin-left: 4px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.news-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: transform .15s ease, border-color .15s; }
.news-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.news-card h3 { font-size: 1.02rem; font-weight: 600; margin: 0; }
.news-card h3 a { color: var(--text); }
.news-card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); margin-top: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--primary)); }
.empty { grid-column: 1 / -1; text-align: center; padding: 48px; color: var(--muted); }
.skeleton { height: 150px; background: linear-gradient(90deg, var(--surface), var(--bg-alt), var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.post-card { padding: 24px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; }
.post-card:hover { border-color: var(--primary); }
.post-card h3 { font-size: 1.2rem; margin: 0; }
.post-card p { margin: 0; color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--primary-soft); color: var(--primary); font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.post-dialog {
  width: min(720px, calc(100% - 32px)); max-height: 85vh; border: 1px solid var(--border); border-radius: 18px;
  padding: 40px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.post-dialog::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(4px); }
.post-dialog .close { position: absolute; top: 16px; right: 16px; }
.post-dialog h3 { margin-top: 1.4em; }

/* Careers */
.track-panel { padding: 28px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; margin-bottom: 28px; }
.track-panel h3 { font-size: 1.4rem; }
.track-panel h4 { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.pill-list li { border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: .85rem; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.timeline strong { display: block; font-size: .85rem; color: var(--primary); }
.salary { margin-top: 18px; padding: 12px 16px; border-radius: 10px; background: var(--primary-soft); font-size: .9rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.guide { padding: 24px; }
.guide h3 { font-size: 1.1rem; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist label { display: flex; gap: 10px; padding: 6px 0; cursor: pointer; font-size: .93rem; }
.checklist input { accent-color: var(--primary); width: 17px; height: 17px; margin-top: 3px; flex-shrink: 0; }
.progress { height: 8px; background: var(--bg-alt); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width .3s ease; }
.steps { padding-left: 20px; margin: 0; }
.steps li { margin-bottom: 10px; font-size: .93rem; }
.links { list-style: none; padding: 0; margin: 0; }
.links li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; color: var(--muted); }
.links li:last-child { border: 0; }
.links a { font-weight: 600; }

/* Student resources */
.tutor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 28px; }
.tutor-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.tutor-card h3 { margin: 0; font-size: 1.2rem; }
.tutor-card p { margin: 0; }
.tutor-card .btn { margin-top: auto; align-self: flex-start; }
.tutor-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--primary-soft); }
.contact-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.contact-card { padding: 28px; }
.contact-card form { display: grid; gap: 14px; margin-top: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-card label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; }
.contact-card input, .contact-card select, .contact-card textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font: inherit; font-weight: 400;
}
.contact-card textarea { resize: vertical; }
.contact-card input:focus, .contact-card select:focus, .contact-card textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); border-color: var(--primary); }
.contact-card form.validated :invalid { border-color: var(--error); }
.contact-card .btn-primary { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; font-size: .93rem; }
.form-status:empty { display: none; }
.form-status.success { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); padding: 12px 14px; border-radius: 10px; }
.form-status.error { color: var(--error); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner p { margin: 4px 0; }

/* Responsive */
@media (max-width: 820px) {
  .nav-toggle { display: block; background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: flex-start;
    gap: 4px; padding: 12px 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 8px 0; }
  .track-panel { grid-template-columns: 1fr; padding: 20px; }
  .contact-wrap, .form-row { grid-template-columns: 1fr; }
  .contact-card { padding: 20px; }
  .news-actions, .news-actions input { width: 100%; min-width: 0; }
  .news-actions input { flex: 1; }
  .news-grid, .blog-grid, .guide-grid { grid-template-columns: 1fr; }
  .post-dialog { padding: 28px 20px; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 56px 0; }
}
