/* Profile image in header */
/* Modern blue/gray theme variables */
:root {
  --primary: #ffffff; /* main text color */
  --accent: #8da0a8; /* muted slate accent */
  --background: #1A1E23; /* main background (user provided) */
  --bg-700: #15181c;
  --bg-600: #0f1113;
  --card-bg: #13171a; /* card / section background */
  --card-bg-2: #0f1113;
  --card-shadow: 0 10px 30px rgba(2,6,10,0.7);
  --fallback-overlay: 0.55; /* overlay opacity for header photo */
}
.profile-img {
  width: 200px;
  height: 200px;
  max-width: 200px;
  aspect-ratio: 1/1;
  object-fit: cover;
  object-position: 200% center;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(30,41,59,0.12);
  margin-bottom: 0;
  display: block;
  border: 2px solid #fff;
  background: #fff;
}
/* Sticky top navigation bar */
.topbar {
  position: sticky;
  top: 0;
  width: 100%;
  /* match the theme: slightly translucent dark bar using theme shades */
  background: rgba(20,24,28,0.72);
  box-shadow: 0 6px 30px rgba(2,6,10,0.6);
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 0;
  z-index: 1000;
  backdrop-filter: blur(10px) saturate(1.05);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.topbar a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.topbar a:hover {
  background: var(--accent);
  color: #fff;
}
body {
  margin: 0;
  font-family: 'Montserrat', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--primary);
  transition: background 0.3s, color 0.3s;
}
header {
  position: relative;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0;
  background: transparent;
  color: #fff;
}

/* persistent header fallback shown after intro overlay is removed */
.header-fallback {
  position: relative;
  width: 100%;
  min-height: 100vh;
  /* plain photo background (reverted) */
  background: url('images/100_2877.JPG') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  /* make the fallback reveal snappier to avoid a visible sliding frame */
  transition: opacity 120ms ease;
}
.header-fallback.visible {
  opacity: 1;
  pointer-events: auto;
}
.header-fallback::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8,10,12,var(--fallback-overlay,0.55));
  pointer-events: none;
  z-index: 0;
}
.header-fallback-inner {
  position: relative;
  z-index: 1; /* ensure inner content sits above overlay */
  background: rgba(2,6,23,0.22); /* more transparent so background blends through */
  padding: 1.2rem 2.4rem;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(2,6,23,0.5);
  backdrop-filter: blur(4px);
}
.fallback-title {
  margin: 0;
  font-size: 2.6rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -1px;
}

.intro-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  /* space-gray transition background */
  background: linear-gradient(120deg, var(--bg-600) 0%, var(--background) 100%);
  z-index: 0;
  /* no background transition here — switch to the photo instantly to avoid a sliding effect */
  transition: none;
}
.intro-bg.photo {
  background: url('images/100_2877.JPG') center/cover no-repeat;
  filter: brightness(0.85) blur(2px);
  transition: none;
}
.intro-content {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2501;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  pointer-events: auto;
}
.intro-hidden { opacity: 0; transform: translateY(6px); }
.intro-visible { opacity: 1; transform: translateY(0); transition: opacity 360ms ease, transform 360ms ease; }
.intro-photo-fade { opacity: 0; transition: opacity 480ms ease; }
.intro-photo-fade.visible { opacity: 1; }

/* overlay hide/show */
.overlay-hidden { opacity: 0; pointer-events: none; transition: opacity 420ms ease; }
.overlay-visible { opacity: 1; pointer-events: auto; transition: opacity 420ms ease; }

/* hide topbar while intro overlay is active */
.topbar.hidden { opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity 320ms ease, transform 320ms ease; }

/* while intro is active, prevent background scrolling */
body.intro-active {
  height: 100vh;
  overflow: hidden;
}
/* While intro runs, keep all page sections visually and interactively hidden
   so they cannot overlap or flash under the intro overlay. This preserves
   the post-intro IntersectionObserver reveal behavior. */
body.intro-active section {
  opacity: 0 !important;
  transform: translateY(18px) scale(0.995) !important;
  pointer-events: none !important;
  transition: none !important;
}
/* Also hide the persistent header fallback (photo) while intro runs so the
   overlay doesn't visually overlap or reveal partial page content. */
body.intro-active .header-fallback {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: none !important;
}
.intro-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 0;
  color: #fff;
  background: rgba(0,0,0,0.36);
  border-radius: 1rem;
  padding: 1.2rem 2.2rem;
  box-shadow: 0 6px 24px rgba(2,6,10,0.5);
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  max-width: 600px;
  margin: 0 auto;
}

/* About section two-column layout */
.about-flex {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
}
.about-text { flex: 1 1 60%; }
.about-photo { flex: 0 0 240px; display:flex; align-items:center; justify-content:flex-end; padding-right:8px; }
.about-profile {
  width: 220px;
  height: 220px;
  object-fit: cover;
  /* show more of the right side of the source image inside the circular crop */
  object-position: 85% center;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 30px rgba(2,6,10,0.6);
}

.about-photo-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.resume-btn {
  display: inline-block;
  padding: 0.52rem 0.9rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(2,6,10,0.45);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  font-size: 0.95rem;
}
.resume-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(2,6,10,0.6); }

.header-info {
  text-align: left;
}

@media (max-width: 700px) {
  .header-flex {
    flex-direction: column;
    gap: 1.2rem;
  }
  .header-info {
    text-align: center;
  }
  .about-flex { flex-direction: column-reverse; gap: 1rem; }
  .about-photo { flex: none; }
  /* Make topbar scrollable on small screens and reduce spacing
     so links don't overflow the viewport. */
  .topbar {
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap; /* keep links on a single line for scrolling */
  }
  .topbar a {
    display: inline-flex;
    flex: none; /* prevent links from stretching */
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
  }
}
header h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -2px;
}
header p {
  font-size: 1.2rem;
  font-weight: 400;
  opacity: 0.85;
}
nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
}
nav a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
nav a:hover {
  background: var(--accent);
  color: #fff;
}
section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 3.5rem 2.5rem;
  background: var(--card-bg);
  border-radius: 1.4rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255,255,255,0.04);
  transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}

/* Section reveal/focus animations */
.section-hidden {
  opacity: 0;
  /* smaller translate so entrance feels less 'thrown' */
  transform: translateY(8px) scale(0.995);
  /* Exit uses a quicker transition so hiding feels responsive */
  transition: opacity 420ms ease, transform 420ms ease;
  will-change: opacity, transform;
}
.section-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* smooth entrance animation: opacity+transform animate together */
  animation: section-in 720ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Exit animation used when a section is leaving focus */
@keyframes section-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
}

.section-exiting {
  animation: section-out 720ms cubic-bezier(.2,.8,.2,1) both;
}

/* (removed empty .section-visible ruleset) */
section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 1.2rem 0;
  color: var(--accent);
  text-align: center;
  letter-spacing: -0.6px;
  line-height: 1.05;
  display: inline-block;
}

section h2::after {
  content: '';
  display: block;
  margin: 0.8rem auto 0;
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Experience list styles */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.experience-item {
  background: linear-gradient(180deg, var(--card-bg), var(--card-bg-2));
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255,255,255,0.03);
}
.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.exp-company { font-weight: 800; color: var(--accent); }
.exp-dates { font-size: 0.92rem; color: rgba(255,255,255,0.6); }
.exp-role { font-weight: 700; margin-bottom: 0.6rem; }
.exp-points { margin: 0; padding-left: 1.1rem; color: rgba(255,255,255,0.82); }
.exp-points li { margin-bottom: 0.45rem; }

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.skill-column {
  text-align: center;
}
.skill-column h3 {
  margin: 0 0 0.8rem 0;
  color: var(--primary);
  /* slightly larger than body text but smaller than section h2 */
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  display: block;
}
.skill-column h3::after {
  content: '';
  display: block;
  margin: 0.6rem auto 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(0,0,0,0.32);
}
.skill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}
.skill-badge {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(2,6,10,0.45);
}
.project-card {
  background: linear-gradient(180deg, var(--card-bg), var(--card-bg-2));
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(2,6,10,0.6);
  padding: 1.4rem;
  transition: transform 0.22s, box-shadow 0.22s;
  cursor: pointer;
}
 .project-thumb {
   width: 100%;
   height: 140px;
   border-radius: 0.8rem;
   overflow: hidden;
   margin-bottom: 0.9rem;
   background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
}
.project-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: transparent;
}

/* Coming soon placeholder inside project thumb */
.coming-soon-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  color: rgba(255,255,255,0.88);
}
.coming-soon-inner {
  font-weight: 800;
  color: var(--accent);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.16);
  box-shadow: 0 6px 18px rgba(2,6,10,0.45);
}
.project-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 40px rgba(2,6,10,0.65);
}
.project-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.project-date {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
}
.project-desc {
  font-size: 0.98rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.5rem;
}
.project-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}
.project-link, .project-src {
  display: inline-block;
  padding: 0.46rem 0.8rem;
  border-radius: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}
.project-link { color: var(--accent); background: transparent; }
.project-src { background: rgba(255,255,255,0.03); color: var(--primary); box-shadow: 0 6px 18px rgba(2,6,10,0.45); }

/* Hover / focus feedback for project action buttons */
.project-link, .project-src {
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease, opacity 120ms ease;
}
.project-link:hover, .project-link:focus, .project-link:active {
  transform: translateY(-3px);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 30px rgba(2,6,10,0.45);
}
.project-src:hover, .project-src:focus, .project-src:active {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: 0 12px 36px rgba(2,6,10,0.55);
}

/* Contact buttons hover/focus */
.contact-btn {
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}
.contact-btn:hover, .contact-btn:focus {
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(2,6,10,0.45);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
}

/* Topbar link hover/focus for clearer affordance */
.topbar a { transition: background 120ms ease, transform 120ms ease, color 120ms ease; }
.topbar a:hover, .topbar a:focus { transform: translateY(-2px); background: rgba(141,160,168,0.14); color: #fff; }

/* Accessible focus ring */
.project-link:focus-visible, .project-src:focus-visible, .contact-btn:focus-visible, .topbar a:focus-visible {
  outline: 3px solid rgba(141,160,168,0.16);
  outline-offset: 3px;
}

/* visually-disabled inline link state (no boxed button) */
.project-link.disabled,
.btn-disabled {
  color: rgba(255,255,255,0.72); /* muted, but still inline */
  background: transparent;      /* remove boxed background */
  border: none;                 /* no border */
  padding: 0;                   /* match inline text spacing */
  cursor: default;
  pointer-events: auto;         /* allow hover so we can show hover text */
  opacity: 0.9;
  position: relative;           /* for the absolute ::before replacement */
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms ease, opacity 120ms ease;
}

.project-link.disabled:hover,
.btn-disabled:hover {
  /* keep appearance subtle on hover */
  opacity: 0.95;
}

.project-link.disabled:focus,
.btn-disabled:focus {
  outline: none;
}

/* CSS tooltip for disabled demo links (uses data-tooltip) */
/* tooltip removed for disabled demo link */

/* Replace link text with data-hover text on hover/focus */
.project-link.disabled[data-hover]::before {
  /* absolute replacement text placed exactly where the link sits
     so showing it won't shift layout. It's hidden by default. */
  content: attr(data-hover);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) translateY(6px);
  white-space: nowrap;
  color: rgba(255,255,255,0.92);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 9999; /* ensure pseudo-element sits above any residual inline styles */
  will-change: opacity, transform;
}
/* Only show the pseudo-element on hover; focus will momentarily show it but clicks will blur the element.
   This avoids the text 'sticking' when a click caused focus to persist. */
.project-link.disabled[data-hover]:hover::before,
.project-link.disabled[data-hover]:focus::before {
  opacity: 1;
  transform: translateY(-50%) translateY(0);
}
/* keep original text present but visually hidden while hover replacement shows */
.project-link.disabled[data-hover]:hover {
  color: transparent;
}
/* also hide original text on focus/active so keyboard users don't see overlap */
.project-link.disabled[data-hover]:focus,
.project-link.disabled[data-hover]:active,
.project-link.disabled:focus,
.project-link.disabled:active {
  color: transparent;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.contact-form input,
.contact-form textarea {
  padding: 0.8rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--primary);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}
.contact-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.9rem;
  border-radius: 0.7rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-form button:hover {
  background: var(--primary);
}

/* Contact buttons using downloaded icon images */
.contact-btn {
  display:flex;
  align-items:center;
  gap:0.6rem;
  color:var(--primary);
  text-decoration:none;
  font-weight:600;
  background:var(--card-bg);
  padding:0.7rem 1.2rem;
  border-radius:1rem;
  box-shadow:0 2px 8px rgba(30,41,59,0.07);
}
.contact-btn .icon {
  width:20px;
  height:20px;
  display:inline-block;
  vertical-align:middle;
}
@media (max-width: 700px) {
  .projects {
    grid-template-columns: 1fr;
  }
  section {
    padding: 1.2rem 0.5rem;
  }
  .skills-grid { grid-template-columns: 1fr; }
}

/* ensure footer text is readable (override inline color) */
footer { color: rgba(255,255,255,0.65) !important; }
