/* style.css */
:root {
  --bg: #0a0e1f;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.10);
  --text: #e9efff;
  --muted: rgba(233, 239, 255, 0.72);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --max: 1080px;

  --primary: #38bdf8;
  --secondary: #f472b6;
  --primary-soft: rgba(56, 189, 248, 0.16);
  --secondary-soft: rgba(244, 114, 182, 0.16);
  --primary-glow: rgba(56, 189, 248, 0.35);
  --secondary-glow: rgba(244, 114, 182, 0.30);
  --on-primary: #04121f;
}

[data-theme="light"] {
  --bg: #f6f8ff;
  --panel: rgba(10, 20, 60, 0.06);
  --panel-strong: rgba(10, 20, 60, 0.10);
  --text: #0a1230;
  --muted: rgba(10, 18, 48, 0.70);
  --border: rgba(10, 18, 48, 0.14);
  --shadow: 0 12px 30px rgba(10, 30, 80, 0.10);

  --primary: #0284c7;
  --secondary: #db2777;
  --primary-soft: rgba(2, 132, 199, 0.12);
  --secondary-soft: rgba(219, 39, 119, 0.12);
  --primary-glow: rgba(2, 132, 199, 0.30);
  --secondary-glow: rgba(219, 39, 119, 0.25);
  --on-primary: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

.bg-glow {
  position: fixed;
  inset: -30vh -30vw;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(900px 600px at 85% 10%, var(--secondary-glow), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, var(--primary-glow), transparent 60%),
    radial-gradient(700px 500px at 50% 90%, var(--primary-glow), transparent 65%);
  will-change: transform;
  animation: glow-breathe 28s ease-in-out infinite alternate;
}

@keyframes glow-breathe {
  0% {
    transform: translate3d(-2%, -2%, 0) scale(1);
    opacity: 0.92;
  }
  50% {
    transform: translate3d(2%, 1%, 0) scale(1.06);
    opacity: 1;
  }
  100% {
    transform: translate3d(-1%, 3%, 0) scale(1.02);
    opacity: 0.95;
  }
}

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

a:hover {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.container {
  max-width: var(--max);
  padding: 0 18px;
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
}

.skip-link:focus { left: 12px; }

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.75); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.logo {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background: var(--panel-strong);
  border: 2px solid transparent;
  background-image:
    linear-gradient(var(--bg), var(--bg)),
    linear-gradient(135deg, var(--primary), var(--secondary));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.name { font-weight: 700; }

.role {
  font-size: 0.92rem;
  color: var(--primary);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 14px;
}

.nav a {
  position: relative;
  padding: 8px 10px;
  border-radius: 10px;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-bottom-color: transparent;
}

.nav a.is-active {
  color: var(--primary);
}

.nav a.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

/* Hamburger — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.nav-toggle span:nth-child(1) { top: 13px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 27px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

/* HERO BANNER (single source of truth) */
.hero-banner {
  position: relative;
  width: 100%;
  height: clamp(420px, 64vh, 720px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 35%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.82) 0%,
      rgba(0, 0, 0, 0.58) 28%,
      rgba(0, 0, 0, 0.30) 42%,
      rgba(0, 0, 0, 0.12) 58%,
      rgba(0, 0, 0, 0.00) 100%
    ),
    radial-gradient(600px 400px at 20% 30%, var(--primary-glow), transparent 70%),
    radial-gradient(500px 400px at 80% 80%, var(--secondary-glow), transparent 70%);
  display: flex;
  align-items: center;
}

.hero-banner-inner {
  width: 100%;
  padding: 36px 18px;
  max-width: var(--max);
}

.hero-banner-copy {
  max-width: 680px;
}

/* keep hero readable on BOTH themes */
.hero-banner-copy,
.hero-banner-copy h1,
.hero-banner-copy p,
.hero-banner-copy a {
  color: #ffffff;
}

.hero-banner-copy p {
  color: rgba(255, 255, 255, 0.86);
}

.hero-banner-copy h1 {
  font-size: clamp(2rem, 3.4vw, 3rem);
  margin: 0 0 10px;
  line-height: 1.05;
}

/* BUTTONS */
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.btn:hover { background: var(--panel-strong); }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  border-color: transparent;
  font-weight: 600;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  filter: brightness(1.05);
}

.quick-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.quick-links a {
  color: rgba(255, 255, 255, 0.85);
}

.quick-links a:hover {
  color: #ffffff;
}

/* SECTIONS */
.section { padding: 34px 0; }

.section.alt {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .section.alt {
  background: rgba(0, 0, 0, 0.02);
}

.section h2 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.lead {
  color: var(--muted);
  max-width: 75ch;
  margin: 0 0 18px;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 2px 0 10px;
  font-style: italic;
}

/* CARDS + GRIDS */
.card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, translate 0.05s linear;
  translate: 0 var(--parallax-y, 0px);
  will-change: translate;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.30), 0 0 0 1px var(--primary-soft);
}

.project.clickable { cursor: pointer; }

.about-grid,
.grid,
.skills-grid,
.contact-grid {
  display: grid;
  gap: 14px;
}

.about-grid { grid-template-columns: 1fr 1fr; }
.grid,
.skills-grid,
.contact-grid { grid-template-columns: repeat(3, 1fr); }

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.project p { color: var(--muted); }

/* tag pill */
.tag {
  font-size: 0.78rem;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--secondary);
  background: var(--secondary-soft);
  color: var(--secondary);
  white-space: nowrap;
  flex: 0 0 auto;
  font-weight: 600;
}

.chips {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.chips li {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.links {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 10px 0 12px;
}

.card-img-logo {
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

/* FILTERS */
.filters {
  display: flex;
  gap: 10px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.filter-btn.is-active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  border-color: transparent;
  font-weight: 600;
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 50;
}

.modal.is-open { display: block; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-dialog {
  position: relative;
  max-width: 980px;
  margin: 6vh auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.modal-body {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.modal-body.no-media {
  grid-template-columns: 1fr;
}

.modal-media {
  padding: 16px;
  border-right: 1px solid var(--border);
}

/* media area has consistent height so video doesn't collapse */
.modal-media {
  min-height: 420px;
  display: grid;
  align-items: stretch;
}

.modal-media img,
.modal-media iframe {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.modal-media img {
  object-fit: cover;
}

.modal-media iframe {
  border: 0;
  display: none;
}

.modal-content {
  padding: 16px;
}

.modal-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-desc { color: var(--muted); }

.modal-bullets {
  color: var(--muted);
  padding-left: 18px;
}

/* FOOTER */
.site-footer { padding: 18px 0 26px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

/* SCROLL REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.reveal.reveal-left { transform: translateX(-32px); }
.reveal.reveal-right { transform: translateX(32px); }
.reveal.reveal-scale { transform: scale(0.94); }

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* staggered children inside a .reveal-group */
.reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-group.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.45s; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.55s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-group > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-banner-img { transform: none !important; }
  .card { translate: 0 0 !important; }
  .bg-glow { transform: none !important; }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .nav-toggle { display: block; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    background: rgba(10, 14, 31, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  [data-theme="light"] .nav {
    background: rgba(246, 248, 255, 0.96);
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 1.05rem;
  }

  .site-header { position: sticky; }
  .header-inner { position: relative; }

  .about-grid,
  .grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-banner-img {
    object-position: center;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-media {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 280px;
  }
}

@media (max-width: 520px) {
  .role { display: none; }
  .brand { min-width: 0; }
  .theme-toggle { padding: 8px 10px; font-size: 0.9rem; }
}
