/* Shared site stylesheet: variables, nav, footer, and link underline effects */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-400: #a0a0a0;
  --gray-600: #5a5a5a;
  --gray-800: #2a2a2a;
  --accent: #0071e3;
  --nav-h: 64px;
  --font: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* NAV */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
  transition: background 0.3s;
}

.nav-logo img { height: 28px; width: auto; display: block; }
.nav-logo i { display: inline-flex; color: var(--black); }
.nav-logo svg {
  color: var(--black);
  stroke: currentColor;
  stroke-width: 2px;
  width: 28px;
  height: 28px;
  display: block;
}
.nav-logo svg path,
.nav-logo svg line,
.nav-logo svg polyline {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
  text-decoration: none;
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--black); }
.nav-links a.active { color: var(--black); font-weight: 500; }

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--black);
  z-index: 1001;
}

.hamburger-box {
  position: relative;
  width: 22px;
  height: 16px;
}

.hamburger-line {
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.25s ease, top 0.3s ease;
}

.hamburger-line:nth-child(1) { top: 0; }
.hamburger-line:nth-child(2) { top: 7px; }
.hamburger-line:nth-child(3) { top: 14px; }

.nav-hamburger.open .hamburger-line:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.nav-hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open .hamburger-line:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

/* Mobile nav overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  transition: opacity 0.25s;
}
.nav-mobile-overlay.open { display: flex; opacity: 1; }
.nav-mobile-overlay a { text-decoration: none; color: var(--black); font-size: 28px; font-weight: 300; letter-spacing: -0.02em; }
.nav-mobile-close { position: absolute; top: 20px; right: 24px; background: none; border: none; cursor: pointer; color: var(--black); }

/* FOOTER */
footer {
  border-top: 1px solid var(--gray-200);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 13px; color: var(--gray-400); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--gray-400); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--black); }

/* Reusable left-growing underline for structural links */
.grow-link {
  position: relative;
  padding-bottom: 4px;
  text-decoration: none;
  color: inherit;
  border-bottom: none !important;
}
.grow-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2.5px;
  width: 100%;
  background: currentColor;
  transform-origin: left center;
  transform: scaleX(0.0001);
  transition: transform 480ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
  pointer-events: none;
}
.grow-link:hover::after,
.grow-link:focus::after { transform: scaleX(1); }

/* Show the underline for links explicitly marked as active */
/* Active underline left to components using grow-link */
.grow-link.active::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Accent text links within paragraphs */
.text-link {
  color: var(--accent);
}
.text-link:visited {
  color: var(--accent);
}

/* Card & social link underline (used across pages) */
.card-link { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--accent); transition: color 0.2s; padding-bottom: 4px; }
.card-link::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%; background: currentColor; transform-origin: left center; transform: scaleX(0.0001); transition: transform 480ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.card-link:hover::after, .card-link:focus::after { transform: scaleX(1); }
.card-link.github { color: var(--black); }

.social-link { position: relative; padding-bottom: 4px; }
.social-link::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2.5px; width: 100%; background: currentColor; transform-origin: left center; transform: scaleX(0.0001); transition: transform 480ms cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.social-link:hover::after, .social-link:focus::after { transform: scaleX(1); }

@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  footer { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
}
