/* Programming subheader style */
.programming-subheader {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 1.15rem;
  color: var(--header-text);
  font-family: 'Noto Serif', serif;
  font-weight: 600;
}
/* =========================================================
   Base / Tokens (all colors come from variables in index.html)
   ========================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Merriweather', serif;
  text-align: left;
}
.container {
  max-width: 1000px;
  margin-inline: auto;
  padding-inline: 16px;
}
h1, h2, h3, .section-title {
  color: var(--header-text);
  margin: 0 0 12px 0;
  font-family: 'Noto Serif', serif;
}

/* =========================================================
   Header (top centered name, bottom centered nav)
   ========================================================= */

/* Top band: name centered */
.header-top { background: var(--header-top-bg); }
.header-top .container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  flex-direction: column;  /* stack name + links */
  gap: 6px;                /* space between name and links */
}
#site-name {
  text-align: center;
  font-size: 1.75rem;
  color: var(--title-text); /* new title color from config */
}

/* Links under the name */
.header-links {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.header-link {
  color: var(--title-text);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.header-link:hover,
.header-link:focus-visible {
  color: var(--button-text-hover);
  /* fallback then color-mix for modern browsers */
  background: rgba(0,0,0,0.04);
  background: color-mix(in srgb, var(--button-bg) 70%, transparent);
  outline: none;
}

/* Email hover/copy bubble */
.header-email {
  user-select: none;
}
.header-email[data-show-bubble="true"]::after {
  content: attr(data-hover-text);
  position: absolute;
  left: 50%;
  top: 110%;
  transform: translateX(-50%);
  background: var(--button-bg-hover);
  color: var(--button-text-hover);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.95em;
  white-space: nowrap;
  z-index: 10;
  opacity: 1;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: opacity 0.15s;
}

/* Bottom band: centered nav, hamburger on the right */
.header-bottom { background: var(--header-bottom-bg); }
/* Desktop: keep header sticky */
@media (min-width: 721px) {
  #site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }
}
/* Mobile: make header static (not sticky) */
@media (max-width: 720px) {
  #site-header {
    position: static; /* default flow; header will not follow the scroll */ 
  }
    .header-top .container {
    padding: 10px 0;   /* was 16px */
    gap: 4px;          /* slightly tighter spacing between name and links */
  }

  #site-name {
    font-size: 1.5rem; /* a touch smaller on phones */
  }

  .nav-row {
    padding: 6px 0;    /* was 8px */
  }

}

.nav-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* center nav group */
  padding: 8px 0;
}
.nav-main {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.nav-btn {
  appearance: none;
  background: var(--button-bg);
  color: var(--button-text);
  /* fallback then color-mix */
  border: 1px solid rgba(0,0,0,0.2);
  border: 1px solid color-mix(in srgb, var(--button-text) 20%, transparent);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.nav-btn:hover,
.nav-btn:focus-visible {
  background: var(--button-bg-hover);
  color: var(--button-text-hover);
  outline: none;
}

/* Hamburger: absolute to the right so nav stays centered */
.hamburger {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%); /* replaces translate shorthand */
  width: 42px;
  height: 38px;
  /* fallback then color-mix */
  border: 1px solid rgba(0,0,0,0.2);
  border: 1px solid color-mix(in srgb, var(--button-text) 20%, transparent);
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  display: none; /* shown via media query on small screens */
}
.hamburger:focus-visible { outline: 2px solid var(--button-text); }
.hamburger-bar {
  position: absolute; left: 8px; right: 8px; height: 2px; background: currentColor;
}
.hamburger-bar:nth-child(1) { top: 10px; }
.hamburger-bar:nth-child(2) { top: 18px; }
.hamburger-bar:nth-child(3) { top: 26px; }

/* =========================================================
   Mobile Drawer (shares nav/button color scheme)
   ========================================================= */
.drawer {
  position: fixed; inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  /* fallback then color-mix */
  background: rgba(0,0,0,0.2);
  background: color-mix(in srgb, var(--bg) 20%, black);
  padding-top: 64px;
  z-index: 1100;
}
.drawer[aria-hidden="false"] { display: flex; }
.drawer-content {
  background: var(--button-bg);
  color: var(--button-text);
  width: min(88vw, 340px);
  /* fallback then color-mix */
  border-left: 1px solid rgba(0,0,0,0.2);
  border-left: 1px solid color-mix(in srgb, var(--button-text) 20%, transparent);
  border-radius: 12px 0 0 12px;
  padding: 16px;
  display: grid; gap: 8px;
}
.drawer-close {
  justify-self: end;
  appearance: none;
  background: transparent;
  color: var(--button-text);
  /* fallback then color-mix */
  border: 1px solid rgba(0,0,0,0.2);
  border: 1px solid color-mix(in srgb, var(--button-text) 20%, transparent);
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.drawer-close:hover { background: var(--button-bg-hover); color: var(--button-text-hover); }
.drawer-link {
  display: block; text-decoration: none;
  background: var(--button-bg); color: var(--button-text);
  padding: 10px 12px; border-radius: 8px;
  /* fallback then color-mix */
  border: 1px solid rgba(0,0,0,0.2);
  border: 1px solid color-mix(in srgb, var(--button-text) 20%, transparent);
}
.drawer-link:hover,
.drawer-link:focus-visible {
  background: var(--button-bg-hover); color: var(--button-text-hover);
  outline: none;
}

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 28px 0; }
.section + .section {
  /* fallback then color-mix */
  border-top: 1px solid rgba(0,0,0,0.12);
  border-top: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}
.section-photo {
  display: block;
  width: min(480px, 100%);
  max-width: 100%;
  margin: 0 0 12px 0; /* above text */
  border-radius: 10px;
}
.section-text { margin: 0; }

/* Programming skills list */
.skills {
  list-style: none;
  margin: 12px 0 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px 12px;
}
.skill {
  padding-left: 0.9em;
  position: relative;
}
.skill::before {
  content: "•";
  position: absolute; left: 0;
  color: var(--header-text); /* matches headings */
}

/* =========================================================
   Projects: card with optional background image + haze overlay
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Card base */
.project-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  /* fallback then color-mix */
  border: 1px solid rgba(0,0,0,0.12);
  border: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  min-height: 180px;
  /* fallback then color-mix */
  background: rgba(0,0,0,0.08);
  background: color-mix(in srgb, var(--bg) 85%, black);
}

/* When an image is provided, use it as background */
.project-card.has-bg {
  background-size: cover;
  background-position: center;
}

/* Clickable area fills the card */
.project-link {
  display: block; width: 100%; height: 100%;
  text-decoration: none; color: inherit;
}

/* Overlay: defaults transparent, becomes dark haze on hover/press */
.project-overlay {
  position: absolute; inset: 0;
  display: grid; align-content: center; justify-items: center;
  padding: 18px;
  background: transparent;
  transition: background .15s ease;
}

/* Title shown by default; description hidden */
.project-title {
  margin: 0; text-align: center;
  color: var(--header-text);
  transition: color .12s ease, opacity .12s ease;
}
.project-desc {
  display: none; text-align: center; margin: 0;
  color: var(--project-hover-text); /* from config */
}

/* Hover/press state: dark haze, swap title->desc */
.project-card:hover .project-overlay,
.project-card.touch-hover .project-overlay {
  /* fallback then color-mix */
  background: rgba(0,0,0,0.55);
  background: color-mix(in srgb, black 55%, transparent);
}
.project-card:hover .project-title,
.project-card.touch-hover .project-title {
  opacity: 0; pointer-events: none;
}
.project-card:hover .project-desc,
.project-card.touch-hover .project-desc {
  display: block;
}

/* =========================================================
   Footer
   ========================================================= */
#site-footer {
  /* fallback then color-mix */
  border-top: 1px solid rgba(0,0,0,0.12);
  border-top: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
  padding: 16px 0 28px 0;
}
.footer-row {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px 16px;
  justify-content: space-between;
}
.footer-links {
  display: inline-flex; gap: 10px; align-items: center;
}
.footer-link {
  color: var(--header-text); text-decoration: none;
  padding: 2px 4px; border-radius: 6px;
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--button-text-hover);
  /* fallback then color-mix */
  background: rgba(0,0,0,0.04);
  background: color-mix(in srgb, var(--button-bg) 70%, transparent);
  outline: none;
}
.footer-copy { color: var(--text); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
  .nav-main { display: none; }
  .hamburger { display: inline-block; }
}
