/* ============================================================
   Michael Wasserstein — Personal Site
   Clean & minimal, light theme
   ============================================================ */

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

:root {
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --bg-alt2:      #f1f5f9;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --accent:       #2563eb;
  --accent-dark:  #1d4ed8;
  --accent-light: #eff6ff;
  --border:       #e2e8f0;
  --nav-h:        64px;
  --max-w:        1100px;
  --radius:       8px;
  --radius-lg:    14px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.1);
  --transition:   0.2s ease;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

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

/* ── Utilities ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Page switching ───────────────────────────────────────── */
.page {
  display: none;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
  opacity: 0;
  animation: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

section { padding: 88px 0; background: var(--bg); }

.section-label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}

h2.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3rem;
  line-height: 1.2;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: var(--accent);
  color: #fff !important;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--transition);
}
.nav-cta:hover { background: var(--accent-dark) !important; color: #fff !important; }

/* hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem 1.5rem;
  gap: 1rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  padding: .35rem 0;
}

/* ── Hero ─────────────────────────────────────────────────── */
#hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 55%, #f8fafc 100%);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.06) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-text { flex: 1; max-width: 600px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .9rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 1.25rem;
}

.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.hero-text h1 span { color: var(--accent); }

.hero-text p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.hero-social {
  display: flex;
  gap: .75rem;
  margin-top: 2.5rem;
}

.hero-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--transition);
}
.hero-social a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.hero-photo {
  flex-shrink: 0;
  position: relative;
}

.hero-photo img {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 4px solid var(--bg);
  box-shadow: var(--shadow-lg);
}

.hero-photo::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: .2;
}

/* ── About ────────────────────────────────────────────────── */
#about .about-inner {
  max-width: 760px;
}

#about p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
#about p:last-child { margin-bottom: 0; }

/* ── Education ────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1px 1fr;
  gap: 0 2rem;
  padding-bottom: 2.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-date {
  text-align: right;
  padding-top: .2rem;
}

.timeline-date .year {
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
}

.timeline-date .period {
  display: block;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .1rem;
}

.timeline-line {
  position: relative;
  background: var(--border);
}

.timeline-line::before {
  content: '';
  position: absolute;
  top: .25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-line::after {
  content: '';
  position: absolute;
  top: 1rem; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child .timeline-line::after { display: none; }

.timeline-content {
  padding-top: .1rem;
  padding-bottom: 1rem;
}

.timeline-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .2rem;
}

.timeline-content .institution {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

.timeline-content .institution strong {
  color: var(--text);
  font-weight: 600;
}

.timeline-content p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Experience ───────────────────────────────────────────── */
/* reuses .timeline styles */

/* ── Projects ─────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: rgba(37,99,235,.2);
}

.project-card .thumb {
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-alt2);
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.project-card:hover .thumb img { transform: scale(1.04); }

.project-card .card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
  line-height: 1.35;
}

.project-card p {
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 1rem;
}

.project-card .card-link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: auto;
}
.project-card .card-link:hover { color: var(--accent-dark); }
.project-card .card-link i { font-size: .7rem; }

/* ── Skills ───────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.skill-group h3 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .85rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag {
  display: inline-block;
  padding: .3rem .85rem;
  background: var(--bg-alt2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  transition: all var(--transition);
}
.tag:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Contact ──────────────────────────────────────────────── */
#contact { text-align: center; }
#contact .section-title { text-align: center; }

.contact-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: -2rem auto 2.5rem;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: all var(--transition);
}
.contact-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.contact-btn i { font-size: 1rem; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--text);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.75rem 2rem;
  font-size: .8rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  #hero { min-height: auto; padding: 3rem 0 4rem; }
  .hero-inner { flex-direction: column-reverse; text-align: center; gap: 2.5rem; }
  .hero-text p, .hero-text h1 { max-width: 100%; }
  .hero-actions, .hero-social { justify-content: center; }
  .hero-photo img { width: 200px; height: 200px; }

  .timeline-item {
    grid-template-columns: 1px 1fr;
    gap: 0 1.5rem;
  }
  .timeline-date { display: none; }
  .timeline-content h3::before {
    content: attr(data-year);
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .25rem;
  }

  .projects-grid { grid-template-columns: 1fr; }

  h2.section-title { font-size: 1.6rem; }
  section { padding: 64px 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero-text h1 { font-size: 2rem; }
}
