/* ============================================================
   Ross Carter — personal site
   Dark, modern, self-contained. No external fonts required.
   ============================================================ */

:root {
  --bg:        #08090d;
  --bg-soft:   #0e1017;
  --panel:     rgba(255, 255, 255, 0.03);
  --border:    rgba(255, 255, 255, 0.08);
  --text:      #e7e9ee;
  --muted:     #8b909e;
  --accent:    #7c5cff;
  --accent-2:  #21d4c2;
  --grad:      linear-gradient(110deg, var(--accent-2), var(--accent));
  --max:       1080px;
  --mono:      ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- background canvas ---------- */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* fades toward the bottom so content stays readable */
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(8,9,13,0.85), rgba(8,9,13,0));
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--grad);
  color: #05060a;
  font-weight: 800;
}
.nav nav { display: flex; gap: clamp(14px, 3vw, 34px); }
.nav nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav nav a:hover { color: var(--text); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(70px, 12vh, 140px) clamp(20px, 5vw, 40px);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 44px;
}
.section-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.95rem;
}
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(20px, 5vw, 40px);
}
.eyebrow {
  font-family: var(--mono);
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 26px;
}
.lede {
  max-width: 640px;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  margin-bottom: 34px;
}
.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary {
  background: var(--grad);
  color: #05060a;
  box-shadow: 0 8px 30px -10px var(--accent);
}
.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--panel);
}
.btn.ghost:hover { border-color: var(--accent); }

.scroll-hint {
  position: absolute;
  bottom: 34px; left: clamp(20px, 5vw, 40px);
  background: none; border: none; color: var(--muted);
  font-size: 1.4rem; cursor: pointer;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(8px);} }

/* ---------- cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}
.card-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 9px;
  border-radius: 6px;
}
.card-links { display: flex; gap: 18px; }
.card-links a { color: var(--accent); font-size: 0.9rem; font-weight: 600; }
.card-links a:hover { text-decoration: underline; }

/* ---------- stack ---------- */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.stack-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}
.stack-col h4 { color: var(--accent-2); font-family: var(--mono); font-size: 0.85rem; margin-bottom: 14px; letter-spacing: 0.05em; }
.stack-col ul { list-style: none; }
.stack-col li { padding: 6px 0; color: var(--muted); border-bottom: 1px solid var(--border); }
.stack-col li:last-child { border-bottom: none; }

/* ---------- section lede ---------- */
.section-lede { color: var(--muted); max-width: 680px; margin: -24px 0 32px; font-size: 1.05rem; }

/* ---------- metrics ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 10px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
}
.metric-num {
  display: block;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.metric-label { color: var(--muted); font-size: 0.85rem; font-family: var(--mono); }
.metric-src { color: var(--muted); font-size: 0.8rem; margin: 12px 0 40px; }
.metric-src a { color: var(--accent); }

/* ---------- publications (card grid) ---------- */
.pub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.pub-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.pub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 92, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}
.pub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.pub-venue { color: var(--accent-2); font-size: 0.85rem; }
.pub-cites {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}
.pub-card-title { font-size: 1.05rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.pub-card-authors { color: var(--muted); font-size: 0.9rem; margin-top: 10px; }
.pub-card-link {
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.pub-card:hover .pub-card-link { text-decoration: underline; }
.pub-foot { color: var(--muted); font-size: 0.95rem; margin-top: 28px; }
.pub-foot a { color: var(--accent); }

/* ---------- CV (card grid) ---------- */
.cv-download {
  margin-left: auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  transition: border-color 0.2s, color 0.2s;
}
.cv-download:hover { border-color: var(--accent); }
.cv-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 44px;
}
.cv-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s;
}
.cv-card:hover { transform: translateY(-4px); border-color: rgba(124, 92, 255, 0.5); }
.cv-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cv-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.cv-tag.alt { color: var(--accent-2); }
.cv-when { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.cv-card h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.cv-org { color: var(--text); font-size: 0.95rem; margin-bottom: 10px; }
.cv-desc { color: var(--muted); font-size: 0.92rem; }
.cv-skills-heading { font-family: var(--mono); color: var(--accent-2); font-size: 0.9rem; letter-spacing: 0.06em; margin-bottom: 22px; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.skill-col { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.skill-col h6 { color: var(--accent-2); font-family: var(--mono); font-size: 0.8rem; margin-bottom: 12px; }
.skill-col ul { list-style: none; }
.skill-col li { padding: 5px 0; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.skill-col li:last-child { border-bottom: none; }

/* ---------- about ---------- */
.about { max-width: 720px; }
.about p { color: var(--muted); font-size: 1.05rem; margin-bottom: 18px; }

/* ---------- contact ---------- */
.contact-lede { color: var(--muted); max-width: 560px; margin-bottom: 28px; font-size: 1.05rem; }
.contact-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- footer ---------- */
footer {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
}

@media (max-width: 720px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-wrap: wrap; }
  .cv-download { margin-left: 0; }
}

@media (max-width: 620px) {
  .nav nav { display: none; }
  footer { flex-direction: column; gap: 8px; }
}
