/* ═══════════════════════════════════════════════════════════════════════════
   HiCAIN Website — Design System
   Dark theme, gradient accents, optimised for technical content
   ════════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --bg:          #0a0e14;
  --surface:     #0d1117;
  --surface-2:   #161b22;
  --border:      #21262d;
  --border-2:    #30363d;
  --text:        #e6edf3;
  --muted:       #8b949e;
  --accent:      #58a6ff;
  --green:       #3fb950;
  --green-2:     #64c8a0;
  --red:         #f85149;
  --purple:      #bc8cff;
  --orange:      #e3b341;
  --cyan:        #39d0d8;
  --teal:        #20b2aa;
  --yellow:      #d2993a;

  /* Gradient */
  --grad-start:  #58a6ff;
  --grad-end:    #3fb950;
  --grad:        linear-gradient(135deg, var(--grad-start), var(--grad-end));

  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 4px 24px rgba(0,0,0,.5);
  --font:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }
h1,h2,h3,h4,h5 { line-height: 1.25; font-weight: 700; }
ul { list-style: none; padding: 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 780px; margin: 0 auto; }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* ── Utility: gradient text ─────────────────────────────────────────────── */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary, .btn-outline, .btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.3rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; cursor: pointer;
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--grad); color: #000;
}
.btn-primary:hover { opacity: .88; text-decoration: none; }
.btn-outline {
  border: 1px solid var(--border-2); color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); text-decoration: none; }
.btn-link { color: var(--accent); font-weight: 600; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,14,20,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar {
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 1.5rem; height: 60px;
}
.brand {
  display: flex; align-items: baseline; gap: .2rem;
  font-size: 1.4rem; font-weight: 800; text-decoration: none;
  flex-shrink: 0;
}
.brand-hi   { color: var(--accent); }
.brand-cain { color: var(--green-2); }
.brand-sub  { font-size: .65rem; color: var(--muted); font-weight: 400; margin-left: .3rem; letter-spacing: .08em; }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin-left: auto;
}
.nav-links a {
  color: var(--muted); padding: .4rem .7rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500; transition: color .15s, background .15s;
  text-decoration: none;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.btn-cta {
  background: var(--grad) !important;
  color: #000 !important; font-weight: 700 !important;
  padding: .35rem .9rem !important; border-radius: var(--radius) !important;
}
.btn-cta:hover { opacity: .85; }

.btn-secondary-cta {
  border: 1px solid var(--border-2) !important;
  color: var(--text) !important;
  padding: .35rem .9rem !important; border-radius: var(--radius) !important;
}
.btn-secondary-cta:hover { border-color: var(--accent) !important; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 7rem 0 5rem;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(88,166,255,.08) 0%, transparent 70%);
}
.hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2358a6ff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; max-width: 820px; }
.hero-badge {
  display: inline-block; margin-bottom: 1.5rem;
  background: rgba(63,185,80,.1); border: 1px solid rgba(63,185,80,.3);
  color: var(--green); padding: .3rem .9rem; border-radius: 99px; font-size: .82rem; font-weight: 600;
}
.hero-title { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; margin-bottom: 1.2rem; }
.hero-subtitle { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin-bottom: 2rem; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 3rem; }
.hero-stats { display: flex; gap: 2.5rem; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ── Tech strip ─────────────────────────────────────────────────────────── */
.tech-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1rem 0; background: var(--surface); }
.tech-strip-inner { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tech-chip {
  display: inline-block; padding: .25rem .75rem;
  border-radius: 99px; font-size: .8rem; font-weight: 600;
  border: 1px solid;
}
.chip-cuda   { color: #76b900; border-color: rgba(118,185,0,.4);   background: rgba(118,185,0,.08); }
.chip-rocm   { color: #ed1c24; border-color: rgba(237,28,36,.4);   background: rgba(237,28,36,.08); }
.chip-ib     { color: var(--accent); border-color: rgba(88,166,255,.4); background: rgba(88,166,255,.08); }
.chip-roce   { color: var(--purple); border-color: rgba(188,140,255,.4); background: rgba(188,140,255,.08); }
.chip-ofed   { color: var(--orange); border-color: rgba(227,179,65,.4); background: rgba(227,179,65,.08); }
.chip-mpi    { color: var(--yellow); border-color: rgba(210,153,58,.4); background: rgba(210,153,58,.08); }
.chip-doca   { color: var(--cyan); border-color: rgba(57,208,216,.4); background: rgba(57,208,216,.08); }
.chip-ucx    { color: var(--teal); border-color: rgba(32,178,170,.4); background: rgba(32,178,170,.08); }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section-padded { padding: 5rem 0; }
.section-dark { background: var(--surface); }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2rem; margin-bottom: .5rem; }
.section-header p { color: var(--muted); font-size: 1.05rem; }

/* ── Mission / two-col ──────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.mission-text h2 { font-size: 2rem; margin-bottom: 1rem; }
.mission-text p { color: var(--muted); margin-bottom: 1rem; line-height: 1.7; }
.mission-pillars { display: grid; gap: 1.25rem; }
.pillar { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; }
.pillar-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.pillar h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.pillar p { color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ── Projects grid ──────────────────────────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.project-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .2s, box-shadow .2s;
  position: relative;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(88,166,255,.2); }
.project-card.featured { border-color: rgba(63,185,80,.4); }
.project-card.featured:hover { border-color: var(--green); }
.project-badge { font-size: .75rem; font-weight: 600; color: var(--muted); }
.badge-live { color: var(--green); }
.badge-dev { color: var(--orange); }
.project-icon { font-size: 2.2rem; }
.project-card h3 { font-size: 1.35rem; }
.project-card p { color: var(--muted); font-size: .9rem; line-height: 1.6; flex: 1; }
.project-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.project-tags span { font-size: .72rem; padding: .15rem .55rem; background: rgba(88,166,255,.08); border: 1px solid rgba(88,166,255,.2); color: var(--accent); border-radius: 4px; }

/* ── Tech grid ──────────────────────────────────────────────────────────── */
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.tech-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: block; text-decoration: none; transition: border-color .2s;
}
.tech-card:hover { border-color: var(--accent); text-decoration: none; }
.tech-logo { font-size: 2rem; margin-bottom: .75rem; font-weight: 800; }
.tc-green  { color: #76b900; }
.tc-red    { color: #ed1c24; }
.tc-blue   { color: var(--accent); }
.tc-purple { color: var(--purple); }
.tc-orange { color: var(--orange); }
.tc-yellow { color: var(--yellow); }
.tc-cyan   { color: var(--cyan); }
.tc-teal   { color: var(--teal); }
.tech-card h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--text); }
.tech-card p { font-size: .83rem; color: var(--muted); line-height: 1.5; }

/* ── CTA band ───────────────────────────────────────────────────────────── */
.cta-band { background: linear-gradient(135deg, rgba(88,166,255,.07), rgba(63,185,80,.07)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3.5rem 0; }
.cta-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { font-size: 1.6rem; margin-bottom: .4rem; }
.cta-band p { color: var(--muted); }
.cta-band-actions { display: flex; gap: 1rem; flex-shrink: 0; }

/* ── Page hero (inner pages) ────────────────────────────────────────────── */
.page-hero { padding: 4rem 0 2.5rem; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(88,166,255,.05) 0%, transparent 100%); }
.page-hero h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.page-hero-sub { color: var(--muted); font-size: 1.1rem; }

/* ── Technologies page ──────────────────────────────────────────────────── */
.tech-section { padding: 4rem 0; }
.tech-section-alt { background: var(--surface); }
.tech-detail-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.tech-icon-lg { font-size: 2.5rem; font-weight: 800; }
.tech-detail-header h2 { margin: 0; font-size: 1.8rem; }
.tech-vendor { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.tech-body p { color: var(--muted); margin-bottom: 1rem; line-height: 1.7; }
.tech-body h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .5rem; }
.tech-topics { list-style: disc; padding-left: 1.2rem; }
.tech-topics li { color: var(--muted); font-size: .9rem; padding: .15rem 0; }
.tech-links-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem; }
.resource-link {
  display: block; padding: .55rem .8rem; border-radius: var(--radius);
  background: rgba(88,166,255,.06); border: 1px solid rgba(88,166,255,.15);
  color: var(--accent); font-size: .85rem; font-weight: 500; text-decoration: none;
  transition: background .15s;
}
.resource-link:hover { background: rgba(88,166,255,.15); text-decoration: none; }
.resource-link.ext::after { content: " ↗"; }

/* ── Projects page ──────────────────────────────────────────────────────── */
.project-detail { max-width: 960px; }
.project-detail-header { display: flex; align-items: flex-start; gap: 1.25rem; margin-bottom: 2rem; }
.project-detail-icon { font-size: 3rem; }
.project-status-badge { font-size: .78rem; font-weight: 700; margin-bottom: .3rem; }
.project-tagline { color: var(--muted); font-size: .95rem; }
.project-detail h2 { font-size: 2rem; margin: .2rem 0 .1rem; }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: .3rem 0; color: var(--muted); font-size: .9rem; }
.feature-list li::before { content: "→ "; color: var(--accent); font-weight: 600; }
.project-sidebar { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.project-sidebar h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .2rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.tag-list li { font-size: .72rem; padding: .15rem .55rem; background: rgba(88,166,255,.08); border: 1px solid rgba(88,166,255,.2); color: var(--accent); border-radius: 4px; }
.course-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .75rem; }
.course-preview { display: flex; gap: .6rem; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; }
.course-preview-icon { font-size: 1.4rem; font-weight: 800; flex-shrink: 0; }
.course-preview small { color: var(--muted); font-size: .78rem; }
.roadmap-list { display: flex; flex-direction: column; gap: 1rem; max-width: 760px; }
.roadmap-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.roadmap-item.done { border-color: rgba(63,185,80,.3); }
.roadmap-item.active { border-color: rgba(227,179,65,.4); background: rgba(227,179,65,.04); }
.rm-status { font-size: 1.2rem; flex-shrink: 0; }
.roadmap-item div { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.roadmap-item strong { color: var(--text); }

/* ── About page ─────────────────────────────────────────────────────────── */
.narrow h2 { font-size: 1.6rem; margin: 2rem 0 .75rem; }
.narrow p { color: var(--muted); margin-bottom: 1rem; line-height: 1.7; }
.narrow ul { list-style: disc; padding-left: 1.2rem; margin-bottom: 1rem; }
.narrow ul li { color: var(--muted); padding: .2rem 0; }
.about-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.about-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.about-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.about-card p { color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* ── Community page ─────────────────────────────────────────────────────── */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; margin-bottom: 3rem; }
.community-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; display: block; text-decoration: none; transition: border-color .2s; }
.community-card:hover { border-color: var(--accent); text-decoration: none; }
.community-icon { font-size: 2rem; margin-bottom: .75rem; }
.community-card h3 { font-size: 1.05rem; margin-bottom: .4rem; color: var(--text); }
.community-card p { font-size: .85rem; color: var(--muted); line-height: 1.5; margin-bottom: .75rem; }
.community-link { font-size: .8rem; color: var(--accent); }
.contribute-steps { display: flex; flex-direction: column; gap: 1rem; max-width: 760px; }
.contribute-step { display: flex; gap: 1.25rem; align-items: flex-start; }
.step-num { width: 2rem; height: 2rem; border-radius: 50%; background: var(--grad); color: #000; font-weight: 800; font-size: .9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contribute-step h4 { font-size: .95rem; margin-bottom: .2rem; }
.contribute-step p { color: var(--muted); font-size: .88rem; }
.contribute-step code { background: rgba(88,166,255,.1); padding: .1rem .35rem; border-radius: 3px; font-size: .82rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 3.5rem 0 0; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-brand p { color: var(--muted); font-size: .85rem; line-height: 1.6; margin-top: .75rem; }
.footer-brand-logo { font-size: 1.6rem; }
.footer-social { display: flex; gap: .75rem; margin-top: 1rem; }
.footer-social a { font-size: .82rem; color: var(--muted); }
.footer-social a:hover { color: var(--accent); }
.footer-col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .75rem; }
.footer-col ul li { padding: .25rem 0; }
.footer-col a { font-size: .85rem; color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.25rem 0; }
.footer-bottom p { font-size: .75rem; color: var(--muted); line-height: 1.5; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .course-preview-grid { grid-template-columns: 1fr; }
  .tech-detail .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 1rem; gap: .25rem; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem 1rem; }
  .hero { padding: 4rem 0 3rem; }
  .hero-stats { gap: 1.5rem; }
  .cta-band-inner { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
}
