@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --ink:       #0f0f0f;
  --ink-2:     #333333;
  --muted:     #777777;
  --faint:     #e9e9e9;
  --faintest:  #f4f4f4;
  --bg:        #ffffff;
  --font:      'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:      'DM Mono', 'SF Mono', 'Fira Code', monospace;
  --max:       700px;
  --nav-h:     56px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ── */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--faint);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-logo:hover { opacity: 0.6; }

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

.nav-links a {
  display: block;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 500; }

/* ── MAIN ── */
main {
  flex: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 5rem;
}

/* ── PAGE HEADER ── */
.page-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: block;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 2.5rem;
}

/* ── SECTION ── */
section {
  margin-bottom: 3.5rem;
}

section:last-child {
  margin-bottom: 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: block;
}

/* ── DIVIDER ── */
hr.divider {
  border: none;
  border-top: 1px solid var(--faint);
  margin: 2.5rem 0;
}

/* ── TAGS ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--faint);
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  line-height: 1.6;
}

/* ── LINKS ── */
a.underline {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: opacity 0.15s;
}

a.underline:hover { opacity: 0.45; }

a.subtle {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

a.subtle:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--faint) 25%, #efefef 50%, var(--faint) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 2px;
  height: 0.85rem;
  margin-bottom: 0.5rem;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── FOOTER ── */
#footer {
  border-top: 1px solid var(--faint);
  padding: 1.75rem 1.5rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-copy {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
}

/* ── PAGE FADE-IN ── */
.fade-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s var(--ease) forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.10s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.20s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.30s; }
.fade-up:nth-child(7) { animation-delay: 0.35s; }

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--faint);
}

.timeline-item {
  position: relative;
  margin-bottom: 2.75rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-3px);
}

.timeline-dot.open {
  background: var(--bg);
  border: 1.5px solid var(--ink);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.15rem;
}

.timeline-company {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.timeline-period {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
}

.timeline-role {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
}

.timeline-bullets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-bullets li {
  font-size: 0.9rem;
  color: var(--ink-2);
  padding-left: 1.1rem;
  position: relative;
}

.timeline-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ── PROJECT CARD ── */
.project-item {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--faint);
}

.project-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.project-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.project-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 540px;
  line-height: 1.65;
}

/* ── OSS ── */
.oss-item {
  padding: 1.25rem;
  border: 1px solid var(--faint);
  border-radius: 3px;
}

.oss-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.oss-desc {
  font-size: 0.875rem;
  color: var(--ink-2);
  margin-bottom: 0.75rem;
}

.oss-links {
  display: flex;
  gap: 1.25rem;
}

/* ── SKILLS TABLE ── */
.skills-table {
  width: 100%;
  border-collapse: collapse;
}

.skills-table tr {
  border-bottom: 1px solid var(--faintest);
}

.skills-table tr:last-child {
  border-bottom: none;
}

.skills-table td {
  padding: 0.6rem 0;
  font-size: 0.875rem;
  vertical-align: top;
}

.skills-table td:first-child {
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  padding-right: 2rem;
  width: 140px;
}

.skills-table td:last-child {
  color: var(--ink-2);
}

/* ── EVENTS ── */
.event-item {
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--faint);
}

.event-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.15rem;
}

.event-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.event-date {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
}

.event-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.event-desc {
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 540px;
  margin-bottom: 0.75rem;
}

.event-image {
  margin-top: 1rem;
  border: 1px solid var(--faint);
  border-radius: 3px;
  overflow: hidden;
  max-width: 480px;
}

.event-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.event-image-placeholder {
  background: var(--faintest);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--muted);
  max-width: 480px;
  border: 1px solid var(--faint);
  border-radius: 3px;
}

/* ── BLOG ── */
.blog-item {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--faint);
}

.blog-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.blog-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: opacity 0.15s;
  display: block;
  margin-bottom: 0.2rem;
}

.blog-title:hover { opacity: 0.5; }

.blog-date {
  font-size: 0.75rem;
  font-family: var(--mono);
  color: var(--muted);
}

/* ── RICK ROLL ── */
.rick-zone {
  padding: 1.5rem;
  border: 1px dashed var(--faint);
  border-radius: 3px;
  text-align: center;
}

.rick-zone p {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.rick-btn {
  font-size: 0.78rem;
  font-family: var(--mono);
  background: none;
  border: 1px solid var(--ink);
  padding: 0.45rem 1rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: inline-block;
}

.rick-btn:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ── CONTACT ── */
.contact-block {
  margin-bottom: 2.5rem;
}

.contact-block p {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
  max-width: 440px;
}

.contact-email {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity 0.15s;
}

.contact-email:hover { opacity: 0.45; }

.contact-socials {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2rem;
}

.contact-social-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.875rem;
}

.contact-social-row .platform {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 80px;
}

.contact-social-row a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 1px;
  transition: border-color 0.15s;
}

.contact-social-row a:hover {
  border-color: var(--ink);
}

/* ── HOME SPECIFIC ── */
.home-name {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.home-tagline {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 2rem;
  font-weight: 300;
}

.home-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-bottom: 3.5rem;
}

.home-nav-links a {
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  margin-right: 1.5rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
  transition: opacity 0.15s;
}

.home-nav-links a:hover { opacity: 0.4; }

.now-block p {
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: 540px;
}

.about-block p {
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: 540px;
}

/* ── EDUCATION BLOCK ── */
.edu-block {
  padding: 1.25rem;
  border: 1px solid var(--faint);
  border-radius: 3px;
  margin-top: 0.5rem;
}

.edu-inst {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.edu-degree {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.edu-meta {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  /* Hide logo on mobile */
  .nav-logo {
    display: none;
  }

  /* Make nav scrollable horizontally */
  .nav-inner {
    padding: 0;
    justify-content: flex-start;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    gap: 0;
    padding: 0 1rem;
  }

  .nav-links::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .nav-links a {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Add swipe indicator */
  #nav::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.92));
    pointer-events: none;
  }

  /* Make footer more compact */
  .footer-links {
    gap: 1rem;
  }

  .footer-links a {
    font-size: 0.78rem;
  }

  /* Improve touch targets */
  .home-nav-links a {
    padding: 0.25rem 0;
    font-size: 0.88rem;
  }

  /* Better project spacing */
  .project-item {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
  }

  /* Better event images */
  .event-image, .event-image-placeholder {
    max-width: 100%;
  }

  /* Compact education block */
  .edu-block {
    padding: 1rem;
  }
}

@media (max-width: 520px) {
  main { padding: 2.5rem 1.25rem 4rem; }
  .home-name { font-size: 1.6rem; }
  .page-title { font-size: 1.5rem; }
  .nav-links a { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
  .timeline-header { flex-direction: column; gap: 0; }
  .event-header { flex-direction: column; gap: 0; }
  .skills-table td:first-child { width: 100px; padding-right: 1rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; }
  
  /* Better spacing for mobile */
  .timeline { padding-left: 1.25rem; }
  .timeline-dot { left: -1.25rem; }
  .section-label { font-size: 0.65rem; }
  .page-label { font-size: 0.65rem; }
  
  /* Improve readability */
  .timeline-bullets li { font-size: 0.88rem; }
  .project-desc, .event-desc, .oss-desc { font-size: 0.88rem; }
  .about-block p, .now-block p { font-size: 0.92rem; }
  
  /* Better contact page */
  .contact-email { font-size: 1.05rem; }
  .contact-social-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .contact-social-row .platform { min-width: auto; }
}
