/* ============================================================
   Mackenzie Li — Personal Site
   Dark, typographic, minimal
   ============================================================ */

/* ---- Reset & Custom Properties ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:        #080808;
  --bg-2:      #0f0f0f;
  --bg-3:      #161616;
  --text:      #ffffff;
  --text-2:    #d8d8d8;
  --text-3:    #909090;
  --accent:    #60b0ff;
  --border:    #1c1c1c;

  --font-serif: 'Ubuntu', system-ui, sans-serif;
  --font-sans:  'Ubuntu', system-ui, sans-serif;

  --max-w: 960px;
  --pad-x: 2rem;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

em {
  font-style: italic;
}

/* ============================================================
   Navigation
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 0;
  transition: background 0.4s ease, border-color 0.4s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  padding: 1rem 0;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  color: var(--text);
  transition: color 0.2s;
}

.nav-name:hover {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* Mobile hamburger — hidden by default */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--text-2);
  transition: all 0.3s;
}

/* ============================================================
   Hero
   ============================================================ */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem var(--pad-x) 6rem;
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(196, 168, 130, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 720px;
  position: relative;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 2rem;
}

.hero-name {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: clamp(3.5rem, 11vw, 7.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 2rem;
}

.hero-name em {
  color: var(--accent);
  font-style: italic;
}

.hero-rule {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 2rem;
}

.hero-headline {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-2);
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--text-3);
  transition: color 0.25s, border-color 0.25s;
}

.hero-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Scroll hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero-scroll-hint span {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-3), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.1); }
}

/* ============================================================
   Shared Section Styles
   ============================================================ */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

section:not(#hero) {
  padding: 7rem 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   About
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 4.5rem;
  align-items: start;
}

.about-photo {
  position: sticky;
  top: 5rem;
}

.photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

/* When a real photo is used */
.about-photo img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}

.about-company {
  color: #60b0ff;
  font-weight: bold;
}

.about-text p {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Timeline — Experience
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 3rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.2s;
}

.timeline-item:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline-meta {
  padding-top: 0.2rem;
}

.timeline-date {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.timeline-content h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.timeline-role,
.timeline-org {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.75;
}

/* ============================================================
   Education
   ============================================================ */
.edu-list {
  display: flex;
  flex-direction: column;
}

.edu-item {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 3rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--border);
}

.edu-item:last-child {
  border-bottom: 1px solid var(--border);
}

.edu-meta {
  padding-top: 0.2rem;
}

.edu-date {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
}

.edu-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.school-logo {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  flex-shrink: 0;
}

.edu-content h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.15rem;
  line-height: 1.4;
}

.edu-degree,
.edu-org {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent);
  margin-bottom: 0;
}

.edu-note {
  font-size: 0.87rem;
  color: var(--text-3);
  line-height: 1.65;
}

/* ============================================================
   Publications
   ============================================================ */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 3rem;
  padding: 2.75rem 0;
  border-top: 1px solid var(--border);
  align-items: start;
}

.pub-item:last-child {
  border-bottom: 1px solid var(--border);
}

.pub-year {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding-top: 0.3rem;
}

.pub-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.pub-venue {
  font-size: 0.83rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  :root {
    --pad-x: 1.25rem;
  }

  /* Mobile nav overlay */
  .nav-links {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 150;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--text-2);
  }

  .nav-toggle {
    display: flex;
    z-index: 200;
  }

  .nav-toggle.open span:first-child {
    transform: translateY(6px) rotate(45deg);
    background: var(--text);
  }

  .nav-toggle.open span:last-child {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--text);
  }

  /* Hero */
  .hero-scroll-hint {
    display: none;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    position: static;
    display: flex;
    justify-content: center;
  }

  .photo-placeholder {
    width: 110px;
    height: 110px;
    font-size: 1.3rem;
  }

  /* Timeline / Edu / Pub: stack date above content */
  .timeline-item,
  .edu-item,
  .pub-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.75rem 0;
  }

  /* Bump up body text for phone readability */
  .timeline-desc,
  .about-text p {
    font-size: 0.97rem;
    line-height: 1.8;
  }

  .edu-note,
  .pub-venue {
    font-size: 0.88rem;
  }

  section:not(#hero) {
    padding: 4.5rem 0;
  }

  .section-label {
    margin-bottom: 2.5rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --pad-x: 1rem;
  }

  .hero-links {
    gap: 1.25rem;
  }

  .hero-headline {
    font-size: 0.78rem;
  }

  .nav-inner {
    padding: 0 1rem;
  }
}
