/* ============================================================
   Berkeley NetSys Lab — Academic stylesheet
   Clean, content-first. No startup vibes.
   ============================================================ */

:root {
  --berkeley-blue: #003262;
  --berkeley-blue-light: #1a5899;
  --gold: #b8860b;           /* darker gold — readable on white */
  --gold-bg: #fef9ed;        /* very light gold for subtle highlights */
  --text-primary: #1a1a1a;
  --text-secondary: #444;
  --text-muted: #666;
  --border: #d0d7e0;
  --border-light: #e8ecf0;
  --bg: #ffffff;
  --bg-alt: #f7f9fb;
  --link: #003262;
  --container: 1100px;
  --nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1000;
  background: #fff;
  color: var(--berkeley-blue);
  border: 2px solid var(--berkeley-blue);
  border-radius: 0.35rem;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.14em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.12em; }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #fdb515;
  outline-offset: 3px;
}

p { margin: 0; color: var(--text-secondary); }

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: 1.25;
  color: var(--text-primary);
  font-weight: 700;
}

/* ── Layout ── */

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Nav ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.nav-row {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand,
.nav-links a,
.btn,
.person-name a,
.person-link {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--berkeley-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--berkeley-blue);
  line-height: 1.2;
}

.brand-copy span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover {
  color: var(--berkeley-blue);
  background: var(--bg-alt);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--berkeley-blue);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

/* ── Hero ── */

.hero {
  background: var(--berkeley-blue);
  color: #fff;
  padding: 3.5rem 0;
}

.hero h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 800;
}

.hero .lead {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.82);
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }

.btn-primary {
  background: var(--california-gold, #fdb515);
  color: var(--berkeley-blue);
}

.hero-btn-primary {
  background: #fff;
  color: var(--berkeley-blue);
}

.hero-btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}

/* ── Sections ── */

.section {
  padding: 3rem 0;
}

.section + .section {
  border-top: 1px solid var(--border-light);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--berkeley-blue);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--berkeley-blue);
  display: inline-block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--berkeley-blue);
}

.section-header h2 {
  font-size: 1.35rem;
  color: var(--berkeley-blue);
}

.section-header a {
  font-size: 0.85rem;
  color: var(--berkeley-blue-light);
}

/* ── Page hero (inner pages) ── */

.page-hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}

.page-hero h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 0.5rem;
}

.page-hero p {
  max-width: 600px;
  font-size: 0.97rem;
}

/* ── Two-column layout ── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── Publication list ── */

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pub-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.pub-meta-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.venue-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}

.badge-sigcomm { background: #1a5276; }
.badge-osdi    { background: #7b241c; }
.badge-nsdi    { background: #1d6a39; }
.badge-ase     { background: #5b2c8c; }
.badge-leonet  { background: #7d5a00; }
.badge-nines   { background: #0f766e; }
.badge-hotnets { background: #9a3412; }
.badge-arxiv   { background: #1e3a8a; }
.badge-default { background: #4a5568; }

.pub-link {
  font-size: 0.82rem;
  color: var(--berkeley-blue-light);
}

.year-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--berkeley-blue);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.year-heading:first-child { margin-top: 0; }

/* ── People grid ── */

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.person-card {
  padding: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
}

.person-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 0.75rem;
  display: block;
  border: 2px solid var(--border-light);
}

.person-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--berkeley-blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.person-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.person-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.person-link {
  font-size: 0.8rem;
  color: var(--berkeley-blue-light);
}

/* ── Project cards ── */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
}

.project-card h3 {
  font-size: 0.97rem;
  margin-bottom: 0.5rem;
  color: var(--berkeley-blue);
}

.project-card p {
  font-size: 0.87rem;
  line-height: 1.6;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* ── News ── */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.news-item:last-child { border-bottom: none; }

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.news-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.news-summary {
  font-size: 0.87rem;
}

/* ── Home two-column ── */

.home-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
}

/* ── Mission blurb ── */

.mission-block {
  background: var(--bg-alt);
  border-left: 4px solid var(--berkeley-blue);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0 4px 4px 0;
}

.mission-block p {
  font-size: 0.97rem;
  line-height: 1.7;
}

/* ── Sponsors ── */

.sponsor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sponsor-chip {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
}

/* ── Join page ── */

.join-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.join-card {
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
}

.join-card h3 {
  font-size: 0.97rem;
  margin-bottom: 0.5rem;
  color: var(--berkeley-blue);
}

.join-card p { font-size: 0.88rem; }

.faculty-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ── Alumni ── */

.alumni details {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.alumni summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--berkeley-blue);
  background: var(--bg-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alumni summary::after {
  content: "▸";
  font-size: 0.8rem;
  color: var(--text-muted);
}

details[open] summary::after { content: "▾"; }

.alumni summary::-webkit-details-marker { display: none; }

.alumni-inner {
  padding: 1.25rem;
}

.alumni-list {
  margin: 0;
  padding-left: 1.25rem;
}

.alumni-list li + li {
  margin-top: 0.55rem;
}

.alumni-meta {
  color: var(--text-muted);
}

/* ── Footer ── */

.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-brand strong {
  font-size: 0.92rem;
  color: var(--berkeley-blue);
}

.footer-brand p {
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.footer-sponsors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.footer-sponsors span {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}

/* ── Responsive ── */

@media (max-width: 1024px) {
  .two-col, .home-split { grid-template-columns: 1fr; gap: 0; }
  .home-split > div + div { margin-top: 2rem; border-top: 1px solid var(--border-light); padding-top: 2rem; }
  .three-col, .project-grid, .join-grid, .faculty-links { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0.5rem; border-radius: 0; border-bottom: 1px solid var(--border-light); }
  .nav-links a:last-child { border-bottom: none; }
  .three-col, .project-grid, .join-grid, .faculty-links { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-row { flex-direction: column; }
  .footer-sponsors { justify-content: flex-start; }
}

@media (max-width: 480px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
}
