/* ==========================================================================
   Michael Guo - Minimalist Portfolio
   Inspired by colebemis.com & tomanistor.com
   ========================================================================== */

:root {
  --bg-color: #161618;
  --bg-card: #202023;
  --bg-card-hover: #27272a;
  --border-color: #2e2e34;
  --border-hover: #44444c;
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
  
  --max-width: 920px;
  --radius: 8px;
  --transition: all 0.18s ease-in-out;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
}

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

/* Hero Section */
.hero {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.hero-layout {
  display: flex;
  gap: 3rem;
  align-items: center;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 400;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.hero-bio strong {
  color: var(--text-main);
  font-weight: 600;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.social-link {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
}

.social-link:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* Hover Tooltip for Email Button with Upward Arrow */
.email-tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.email-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: #232327;
  border: 1px solid #3f3f46;
  color: #f4f4f5;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

/* Upward pointing CSS arrow */
.email-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 24px;
  width: 10px;
  height: 10px;
  background: #232327;
  border-left: 1px solid #3f3f46;
  border-top: 1px solid #3f3f46;
  transform: rotate(45deg);
}

.email-tooltip-wrapper:hover .email-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Profile Photo */
.profile-frame {
  width: 200px;
  height: 240px;
  flex-shrink: 0;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

/* Sections Common */
.section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-subtitle {
  color: var(--text-subtle);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
}

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

.project-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.6rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-box:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.project-box-top {
  margin-bottom: 1.25rem;
}

.project-box-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}

.project-box-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.project-box-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-subtle);
  white-space: nowrap;
}

.project-box-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.project-box-tagline {
  font-size: 0.9rem;
  color: var(--text-subtle);
  line-height: 1.5;
}

.project-box-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.project-box-tech {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.details-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.project-box:hover .details-link {
  color: #ffffff;
  transform: translateX(2px);
}

/* Experience List */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.exp-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-subtle);
  padding-top: 0.2rem;
}

.exp-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.exp-org {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.exp-bullets {
  list-style: disc;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.exp-bullets li {
  margin-bottom: 0.35rem;
}

/* Honors Grid */
.honors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.honor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.honor-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.honor-org {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.honor-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  margin-top: 0.35rem;
}

/* Modal Popup */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #1c1c1f;
  border: 1px solid #3f3f46;
  border-radius: var(--radius);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-header-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.modal-header-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.modal-section-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin: 1.25rem 0 0.5rem;
  font-family: var(--font-mono);
}

.modal-body-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.modal-links-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.modal-action-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* Footer */
footer {
  padding: 2.5rem 0;
  color: var(--text-subtle);
  font-size: 0.88rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .honors-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-layout {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }
  
  .profile-frame {
    width: 160px;
    height: 200px;
  }
  
  .exp-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
