/* ============================================
   ICONS
   Uses CSS mask-image so icons inherit currentColor
   from their parent — hover and theme colors work
   without touching the SVG files.

   Usage in HTML:
     <span class="icon icon-github icon-md"></span>

   Sizes:  icon-sm (14px)  icon-md (17px)
   Names:  icon-github  icon-linkedin  icon-twitter
           icon-instagram  icon-external
   ============================================ */
.icon {
  display: inline-block;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 17px; height: 17px; }

.icon-github    { -webkit-mask-image: url(../icons/github.svg);        mask-image: url(../icons/github.svg); }
.icon-linkedin  { -webkit-mask-image: url(../icons/linkedin.svg);      mask-image: url(../icons/linkedin.svg); }
.icon-twitter   { -webkit-mask-image: url(../icons/twitter.svg);       mask-image: url(../icons/twitter.svg); }
.icon-instagram { -webkit-mask-image: url(../icons/instagram.svg);     mask-image: url(../icons/instagram.svg); }
.icon-external  { -webkit-mask-image: url(../icons/external-link.svg); mask-image: url(../icons/external-link.svg); }


/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Colors */
  --color-bg:           #FFFFFF;
  --color-bg-alt:       #F5F5F7;
  --color-bg-card:      #FBFBFD;
  --color-text:         #1D1D1F;
  --color-text-secondary: #6E6E73;
  --color-text-tertiary:  #86868B;
  --color-accent:       #0071E3;
  --color-accent-hover: #0077ED;
  --color-accent-light: #E8F2FF;
  --color-border:       #D2D2D7;
  --color-border-light: #E8E8ED;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;

  /* Layout */
  --max-width:       1120px;
  --nav-height:      64px;
  --section-padding: 96px;
  --container-px:    24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.05);

  /* Shape */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-full: 9999px;

  /* Motion */
  --transition:      0.2s ease;
  --transition-slow: 0.4s ease;
}


/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

a       { color: inherit; text-decoration: none; }
img     { max-width: 100%; display: block; }
ul      { list-style: none; }
button  { font-family: var(--font-body); cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-text);
}


/* ============================================
   LAYOUT HELPERS
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
}

.section {
  padding: var(--section-padding) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  margin-bottom: 56px;
}

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

.section-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
}

.section-subtitle {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--color-text-tertiary);
}


/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}

.nav-scrolled {
  border-bottom-color: var(--color-border-light);
  background: rgba(255, 255, 255, 0.90);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-px);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  margin-right: auto;
  transition: color var(--transition);
}
.nav-logo:hover { color: var(--color-accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.06);
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  flex-shrink: 0;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.social-icon svg { width: 17px; height: 17px; }
.social-icon:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.06);
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-hamburger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile slide-down menu */
.mobile-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  z-index: 999;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.mobile-menu.open { max-height: 360px; }
.mobile-menu ul   { padding: 12px 24px 24px; }
.mobile-menu li   { border-bottom: 1px solid var(--color-border-light); }
.mobile-menu a {
  display: block;
  padding: 16px 0;
  font-size: 1rem;
  font-weight: 500;
  transition: color var(--transition);
}
.mobile-menu a:hover { color: var(--color-accent); }


/* ============================================
   HERO / ABOUT
   ============================================ */
.section-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 80px;
  align-items: center;
}

.hero-greeting {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-style: italic;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.hero-bio {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 40px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-border-light);
  transform: translateY(-1px);
}

/* Avatar */
.hero-image { display: flex; justify-content: center; }

.avatar-frame {
  position: relative;
  width: 300px;
  height: 300px;
}
.avatar-frame::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), #34aadc);
  opacity: 0.12;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-bg-alt), var(--color-border));
  border: 3px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  /* Replace with: background-image: url('your-photo.jpg'); background-size: cover; */
}


/* ============================================
   WORK EXPERIENCE / TIMELINE
   ============================================ */
.timeline {
  position: relative;
  padding-left: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 40px;
  margin-bottom: 52px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-meta {
  padding-top: 6px;
  text-align: right;
  flex-shrink: 0;
}

.timeline-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.timeline-body {
  position: relative;
  padding-left: 28px;
  border-left: 1.5px solid var(--color-border);
}
.timeline-item:last-child .timeline-body { border-left-color: transparent; }

.timeline-dot {
  position: absolute;
  left: -5.75px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-bg-alt);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline-role {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.timeline-desc {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Shared tag pill */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}


/* ============================================
   PROJECTS
   ============================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.project-image {
  height: 200px;
  width: 100%;
}

.project-body { padding: 24px; }

.project-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
}

.project-links { display: flex; gap: 16px; }

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-accent);
  transition: opacity var(--transition);
}
.project-link:hover { opacity: 0.7; }


/* ============================================
   BLOG
   ============================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-image { height: 180px; width: 100%; }

.blog-body { padding: 24px; }

.blog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.blog-date {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
}

.blog-category {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.blog-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
}

.blog-excerpt {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 16px;
}

.blog-read-more {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  transition: opacity var(--transition);
}
.blog-read-more:hover { opacity: 0.7; }


/* ============================================
   PHOTOGRAPHY / MASONRY GRID
   ============================================ */
.masonry-grid {
  columns: 3;
  column-gap: 16px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}
.masonry-item:hover {
  transform: scale(1.015);
  box-shadow: var(--shadow-lg);
  z-index: 1;
}

/* When you add real images, use this structure:
   <div class="masonry-item">
     <img src="your-photo.jpg" alt="Description">
   </div>
*/
.masonry-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-text);
  color: #fff;
  padding: 64px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 32px;
}

.footer-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-tagline {
  font-size: 0.9rem;
  color: rgba(255,255,255,.45);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}

.footer-nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer-nav a {
  font-size: 0.875rem;
  color: rgba(255,255,255,.55);
  transition: color var(--transition);
}
.footer-nav a:hover { color: #fff; }

.footer-social {
  display: flex;
  gap: 4px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.45);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.footer-social a:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.footer-social svg { width: 17px; height: 17px; }

.footer-bottom {
  text-align: center;
}
.footer-bottom p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,.28);
}


/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr 280px;
    gap: 48px;
  }
  .avatar-frame { width: 260px; height: 260px; }

  .projects-grid,
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
  :root { --section-padding: 64px; }

  /* Hide desktop nav items, show hamburger */
  .nav-links,
  .nav-social    { display: none; }
  .nav-hamburger { display: flex; }

  /* Hero stacks vertically */
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-image { order: -1; }
  .avatar-frame { width: 200px; height: 200px; }
  .hero-bio    { max-width: 100%; }
  .hero-cta    { justify-content: center; }

  /* Single column grids */
  .projects-grid,
  .blog-grid { grid-template-columns: 1fr; }

  /* Timeline collapses */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .timeline-meta { text-align: left; }
  .timeline-body {
    border-left: none;
    padding-left: 20px;
  }
  .timeline-dot { left: 0; }

  /* 2-col masonry on tablet/mobile */
  .masonry-grid { columns: 2; }

  /* Footer */
  .footer-inner       { flex-direction: column; gap: 32px; }
  .footer-right       { align-items: flex-start; }
  .footer-nav         { justify-content: flex-start; }
}


/* ============================================
   RESPONSIVE — SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
  .masonry-grid { columns: 1; }
  .hero-name    { font-size: 2.5rem; }
  .section-title { font-size: 1.75rem; }
}
