/* style.css */

/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Outlined');

/* CSS Variables */
:root {
  --text-color: #000000;
  --accent-color: #000000;
  --bg: #ffffff;
  --card-bg: rgba(255,255,255,0.9);
  --muted-text: rgba(0,0,0,0.7);
  --blur-strength: blur(16px);
  --radius: 1.5rem;
  --spacing: 1rem;
  --fade-time: 0.3s;
  --max-content: 1200px;
}

:root[data-theme="dark"] {
  --text-color: #f3f3f3;
  --accent-color: #f3f3f3;
  --bg: #0e0f12;
  --card-bg: rgba(255,255,255,0.08);
  --muted-text: rgba(255,255,255,0.7);
}

/* Global Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background: var(--bg) url('./assets/background.jpg') no-repeat center center;
  background-size: cover;          
  background-attachment: fixed;    
  min-height: 100svh;             
  opacity: 0;
  animation: fadeIn 0.5s ease-out 0.1s forwards;
}


/* Improve readability over image */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(0,0,0,0.25), transparent 60%),
              linear-gradient(to bottom, rgba(0,0,0,0.15), transparent 40%);
  pointer-events: none;
  z-index: -1;
}
:root[data-theme="dark"] body::before {
  background: radial-gradient(ellipse at 50% -20%, rgba(0,0,0,0.55), transparent 60%),
              linear-gradient(to bottom, rgba(0,0,0,0.45), transparent 40%);
}

/* NAVBAR */
#desktop-nav,
#hamburger-nav {
  position: fixed; top: 0; left: 0; width: 100%; height: 4rem;
  display: flex; align-items: center; gap: 1rem;
  backdrop-filter: var(--blur-strength);
  background-color: rgba(255,255,255,0.16);
  padding: 0 1rem;
  z-index: 1000;
}
:root[data-theme="dark"] #desktop-nav,
:root[data-theme="dark"] #hamburger-nav {
  background-color: rgba(0,0,0,0.24);
}
.logo { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.04em; color: var(--text-color); }

/* Icon nav centered */
.icon-nav {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; list-style: none; gap: 2.25rem;
}
.icon-nav li { display: flex; flex-direction: column; align-items: center; padding: 0.5rem; border-radius: var(--radius); }
.icon-nav li.active { background-color: #fff; }
.icon-nav li.active .material-icons,.icon-nav li.active .label { color: #000; }
.icon-nav a { text-decoration: none; display: flex; flex-direction: column; align-items: center; }
.icon-nav .material-icons,.icon-nav .material-icons-outlined { font-size: 1.5rem; color: var(--text-color); }
.icon-nav .label { margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-color); }

/* Resume button */
.btn-resume {
  margin-left: auto; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
  background: transparent; border: 1px solid var(--text-color); border-radius: var(--radius);
  color: var(--text-color); cursor: pointer; transition: background 0.3s, color 0.3s, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hamburger (mobile) */
#hamburger-nav .hamburger-menu { margin-left: auto; }
.hamburger-icon { display: flex; flex-direction: column; cursor: pointer; gap: 4px; }
.hamburger-icon span { width: 24px; height: 2px; background-color: var(--text-color); transition: 0.3s; border-radius: 2px; }
.hamburger-icon.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu-links {
  display: none; position: absolute; top: 4rem; right: 0.75rem;
  background: var(--card-bg); flex-direction: column; width: min(85vw, 320px);
  padding: 0.75rem; border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.menu-links.open { display: flex; }
.menu-links li { list-style: none; }
.menu-links a { color: var(--text-color); text-decoration: none; padding: 0.75rem; display: block; border-radius: 0.75rem; }
.menu-links a:active { background: rgba(0,0,0,0.06); }

/* Section Base */
section {
  padding-top: 5rem;
  position: relative;
  min-height: calc(100svh - 4rem);
  margin: 0 auto;
  padding-left: 2rem; padding-right: 2rem;
  display: flex; flex-direction: column; gap: 2rem;
  max-width: var(--max-content);
}
.section__text__p1 { text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted-text); }
.title { font-size: clamp(1.75rem, 4.5vw, 3rem); font-weight: 600; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.section__text__p2 { font-size: 1.125rem; color: var(--muted-text); }

/* Profile Section */
#profile {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: clamp(1.25rem, 5vw, 4rem);
  margin-top: -0.5rem;
}
.section__pic-container img {
  width: clamp(160px, 28vw, 300px); height: clamp(160px, 28vw, 300px);
  border-radius: 50%; border: 4px solid var(--accent-color); object-fit: cover;
}
.section__text {
  max-width: 640px; text-align: left; background: rgba(255,255,255,0.5);
  padding: 1.25rem 1.5rem; border-radius: var(--radius);
  backdrop-filter: blur(8px);
}
:root[data-theme="dark"] .section__text { background: rgba(0,0,0,0.35); }
.btn-container { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
#socials-container { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

/* About & Experience Cards */
.about-wrapper {
  background: rgba(214,214,214,0.75);
  padding: 2rem; border-radius: 1.5rem; display: flex; flex-direction: column; gap: 2rem;
}
:root[data-theme="dark"] .about-wrapper { background: rgba(255,255,255,0.06); }

.cards-container {
  display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.25rem; justify-content: space-between;
}
.cards-container .card {
  flex: 1 1 calc(50% - 1.25rem);
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius);
  padding: 1.25rem; color: var(--text-color);
}
:root[data-theme="dark"] .cards-container .card { border-color: rgba(255,255,255,0.12); }
.cards-container .card h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 1.05rem; }
.cards-container .card ul { list-style: none; columns: 2; column-gap: 2rem; }
.cards-container .card ul li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

/* Project Cards */
.project-cards {
  display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.25rem; justify-content: space-between;
}
.project-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 1.25rem;
  width: clamp(260px, 30vw, 320px); color: var(--text-color);
  display: flex; flex-direction: column; align-items: center; position: relative; overflow: hidden; border: 1px solid rgba(0,0,0,0.1);
}
:root[data-theme="dark"] .project-card { border-color: rgba(255,255,255,0.12); }
.project-card img { width: 100%; border-radius: 1rem; object-fit: cover; }
.project-card h3 { margin: 0.75rem 0 0.4rem; text-align: center; font-size: 1.05rem; }
.project-card::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.08) 100%);
  animation: shimmer 2.2s infinite; pointer-events: none;
}
@keyframes shimmer { to { transform: translateX(50%); } }
.project-btn { margin: 0.5rem 0; padding: 0.5rem 1rem; border: 1.5px solid var(--text-color); background: transparent; border-radius: 1rem; cursor: pointer; }

/* Tags */
.tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; justify-content: center;
}
.tag {
  background: rgba(0,0,0,0.06);
  color: var(--text-color);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}
:root[data-theme="dark"] .tag { background: rgba(255,255,255,0.1); }
.tag:active { transform: scale(0.98); }

/* ——— Contact Bar ——— */
.contact-bar {
  display: flex;
  flex-wrap: wrap;                 /* wrap instead of overflow */
  gap: 0.75rem 1rem;               /* tighter gaps on small screens */
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 2rem;
  padding: 0.9rem 1.25rem;
  margin: 1rem auto 0;
  max-width: 860px;
}
:root[data-theme="dark"] .contact-bar { border-color: rgba(255,255,255,0.12); }

.contact-bar a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;

  /* let items shrink instead of pushing off-screen */
  min-width: 0;
  flex: 1 1 auto;
}

/* text inside contact links never forces overflow */
.contact-bar a span,
.contact-bar a .label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  /* If you prefer wrapping over ellipsis, swap the three lines above for: */
  /* white-space: normal; overflow: visible; overflow-wrap: anywhere; */
}

/* Slider Arrows (bottom lock on mobile too) */
.slider-nav {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; justify-content: space-between;
  padding: 0 1rem;
  z-index: 1100;
  pointer-events: none; /* arrows themselves will enable pointer events */
}
.arrow {
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  padding: 0.6rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s, transform 0.15s ease;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
}
.arrow:active { transform: scale(0.98); }
.arrow:hover { background: rgba(0,0,0,0.75); }

/* Footer */
.site-footer {
  position: fixed;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  z-index: 1000;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Reveal animations (hooked by script) */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.visible { opacity: 1; transform: none; transition: opacity 420ms ease, transform 420ms ease; }

/* Fade transitions for page navigation hook */
html.fade-loaded body { opacity: 1; transition: opacity var(--fade-time) ease; }
html:not(.fade-loaded) body { opacity: 0; }

/* Responsive */
@media (min-width: 768px) {
  .icon-nav { display: flex; }
  #hamburger-nav { display: none; }
}
@media (max-width: 420px) {
  .contact-bar { justify-content: flex-start; border-radius: 1.25rem; }
  .contact-bar a { flex: 1 1 100%; }   /* each item on its own line if needed */
}

/* Background */
@media (max-width: 767px) {
  body { background-attachment: scroll; }

.bg-cover {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 100svh;       
}

/* iOS fix: avoid parallax jitter */
@media (max-width: 767px) {
  .bg-cover { background-attachment: scroll; }
}

  #desktop-nav { display: none; }
  section { padding-left: 1rem; padding-right: 1rem; }

  /* Stack content and relax columns */
  #profile { flex-direction: column; text-align: center; margin-top: 0; }
  .section__text { text-align: left; width: 100%; }

  .cards-container, .project-cards { flex-direction: column; align-items: stretch; }
  .cards-container .card { flex: 1 1 100%; }
  .cards-container .card ul { columns: 1; }

  .project-card { width: 100%; }

  /* Make tags wrap nicely and avoid overflow */
  .tags { justify-content: flex-start; }
  .tag { font-size: 0.72rem; padding: 0.32rem 0.66rem; }

  /* Keep room for fixed arrows */
  section { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}

/* Button Hover & Active Animations (shared) */
.btn-resume,
.project-btn {
  position: relative;
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--text-color);
  background: transparent;
  color: var(--text-color);
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  will-change: transform;
  z-index: 1;
}
.btn-resume:hover,
.project-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.18);
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}
.btn-resume:active,
.project-btn:active { transform: translateY(0) scale(0.98); box-shadow: 0 4px 8px rgba(0,0,0,0.18); }

/* Keyframes */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
