/* Hero Photo Card */
.hero-photo-card {
  position: relative;
  border-radius: 22px;
  box-shadow: 0 4px 24px rgba(23,198,235,.10);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  z-index: 1;
}
.hero-photo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 0;
  z-index: 2;
  pointer-events: none;
  border: 3px solid transparent;
  background: linear-gradient(90deg, #ff6a6a, #ffd86a, #6affb7, #6a8bff, #ff6a6a);
  background-size: 400% 400%;
  animation: gradientMove 4s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  box-sizing: border-box;
}
.hero-photo-card img {
  width: 100%;
  max-width: 390px;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}
@media (min-width: 701px) and (max-width: 999px) {
  .hero-photo-card {
    max-width: 700px;
  }
  .hero-photo-card img {
    max-width: 600px;
  }
}
@media (min-width: 1000px) {
  .hero-photo-card {
    max-width: 900px;
  }
  .hero-photo-card img {
    max-width: 800px;
  }
}
/* Tablet: bigger image */
@media (min-width: 701px) and (max-width: 999px) {
  .hero-photo-card {
    max-width: 480px;
    padding: 10px;
  }
  .hero-photo-card img {
    max-width: 340px;
  }
}
/* Laptop: even bigger image */
@media (min-width: 1000px) {
  .hero-photo-card {
    max-width: 420px;
    padding: 10px;
  }
  .hero-photo-card img {
    max-width: 300px;
  }
}
@media (max-width: 700px) {
  .hero-photo-card {
    max-width: 98vw;
    padding: 10px;
    border-radius: 12px;
  }
  .hero-photo-card img {
    border-radius: 8px;
  }
}
:root {
  --bg: #0a0f1c;
  --panel: #0e1628;
  --card: #0b1324;
  --muted: #9aa7bd;
  --text: #e8eef8;
  --accent: #17c6eb;
  --accent-2: #4f8ef7;
  --ok: #16c172;
  --ring: rgba(23,198,235,.35);
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 90% -10%, rgba(23,198,235,.12), transparent),
              radial-gradient(900px 600px at -10% 10%, rgba(79,142,247,.1), transparent),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 40;
  backdrop-filter: saturate(160%) blur(10px);
  background: linear-gradient(to bottom, rgba(10,15,28,.85), rgba(10,15,28,.55));
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: background .3s;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 0 4px rgba(23,198,235,.08), 0 6px 18px rgba(23,198,235,.25);
  animation: spin 2.5s linear infinite alternate;
}
@keyframes spin { to { transform: rotate(1turn); } }
.brand span { font-weight: 800; letter-spacing: .3px; }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--muted); font-weight: 600; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.btn-cta {
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121e;
  font-weight: 800;
  box-shadow: 0 8px 24px rgba(23,198,235,.35);
  transition: transform .18s, box-shadow .18s;
}
.btn-cta:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 32px rgba(23,198,235,.45);
}
.menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
}
@media (max-width:900px) {
  .menu-btn { display: block; }
  .nav-links { display: none; }
  .container.nav.open .nav-links {
    position: fixed;
    left: 0; right: 0; top: 72px;
    width: 100vw;
    background: #0b1220;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
    padding: 14px 20px;
    animation: fadeInDown .4s;
    z-index: 1000;
  }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}

/* Hero */
.hero { padding: 72px 0 40px; }
.hero h1,
.hero .sub,
.hero .eyebrow {
  line-height: 1.7;
}
.hero-wrap {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 36px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  animation: fadeIn 1.2s;
}
h1 {
  font-size: clamp(2.1rem,5vw,2.8rem);
  line-height: 1.12;
  margin: 14px 0 12px;
  animation: fadeInUp .9s;
}
h1 .accent {
  -webkit-background-clip: text;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-clip: text;
  color: transparent;
}
.sub {
  color: var(--muted);
  max-width: 60ch;
  animation: fadeInUp 1.2s;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.btn {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  color: var(--text);
  font-weight: 700;
  transition: transform .16s, box-shadow .16s;
}
.btn:hover {
  border-color: rgba(255,255,255,.18);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 18px rgba(23,198,235,.13);
}
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #03121d;
}
.portrait {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(180deg,#0e1728,#0a0f1b);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  animation: fadeInRight 1.2s;
}
.portrait::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(closest-side, rgba(23,198,235,.22), transparent 70%);
  filter: blur(40px);
}
.portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .96;
  transition: transform .7s cubic-bezier(.22,1,.36,1);
}
.portrait:hover img { transform: scale(1.04) rotate(-2deg); }

/* Sections */
section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-head h2 { margin: 0; font-size: clamp(1.3rem,3vw,1.8rem); }
.muted { color: var(--muted); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  font-weight: 600;
  color: #c6d3e6;
  transition: background .2s;
}
.chip:hover { background: rgba(23,198,235,.13); color: var(--accent); }

/* Grid & Cards */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-3 { grid-template-columns: repeat(4,1fr); }
.grid-2 { grid-template-columns: repeat(2,1fr); }
@media(max-width:1200px) { .container { max-width: 98vw; } }
@media(max-width:1000px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .hero-wrap { grid-template-columns: 1fr; }
  .portrait { margin-top: 32px; }
}
@media(max-width:700px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 38px 0 18px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
@media(max-width:500px) {
  .container { padding: 0 7px; }
  .hero { padding: 18px 0 8px; }
  h1 { font-size: 1.5rem; }
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(23,198,235,.04);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  opacity: 0;
  transform: translateY(30px);
  will-change: transform, opacity;
}
.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(23,198,235,.12);
  margin-bottom: 10px;
  font-size: 1.3em;
}
.card.animated {
  opacity: 1;
  transform: none;
  animation: fadeInUp .7s;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px;
  margin-top: 16px;
}
.stat {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: transform .18s, box-shadow .18s;
}
.stat:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 4px 18px rgba(23,198,235,.13);
}
.stat h3 { margin: 0; font-size: 26px; }

/* Skills bars */
.skills-wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 22px;
}
.progress {
  background: #0a1423;
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
}
.bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  transition: width 1.2s cubic-bezier(.22,1,.36,1);
}
@media (max-width: 700px) {
  .skills-wrap {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Timeline */
.timeline {
  border-left: 2px solid rgba(255,255,255,.08);
  padding-left: 18px;
  display: grid;
  gap: 16px;
}
.t-item { position: relative; }
.t-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(23,198,235,.15);
}

/* Projects */
.project {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .18s, box-shadow .18s;
}
.thumb {
  aspect-ratio: 16/10;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  background: #0a1423;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.22,1,.36,1);
}
.project:hover .thumb img { transform: scale(1.06); }
.project:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 32px rgba(23,198,235,.10);
}

/* Contact */
.input {
  background: #0a1423;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

/* Footer */
footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,.06);
  color: var(--muted);
}

.footer-hr-anim {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #ff6a6a, #ffd86a, #6affb7, #6a8bff, #ff6a6a);
  background-size: 400% 400%;
  animation: gradientMove 4s ease-in-out infinite;
  border-radius: 2px;
  margin-bottom: 18px;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.footer-heart {
  display: inline-block;
  animation: heartBeat 1.2s infinite;
  font-size: 1.2em;
  vertical-align: middle;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  10%, 30%, 50%, 70%, 90% { transform: scale(1.2); }
  20%, 40%, 60%, 80% { transform: scale(0.95); }
}

@media (max-width: 786px) {
  footer .container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
  }
  footer .container > div {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px) } to { opacity: 1; transform: none } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(40px) } to { opacity: 1; transform: none } }
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s, transform .7s;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* Responsive fix for hero section and all containers/cards on screens <= 786px */
@media (max-width: 786px) {
  html, body {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .container {
    max-width: 100vw;
    width: 100vw;
    padding: 0 4px;
    margin: 0;
    box-sizing: border-box;
  }
  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .skills-wrap {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .card,
  .section-head,
  .hero-wrap,
  .stats,
  .footer-flex {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }
  .hero-wrap {
    grid-template-columns: 1fr !important;
    gap: 18px;
    padding: 0;
    width: 100vw;
    min-width: 0;
    box-sizing: border-box;
  }
  .hero {
    padding: 28px 0 18px;
  }
  .hero-wrap > div,
  .hero-wrap .portrait {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .eyebrow,
  .sub,
  .actions,
  .stats {
    max-width: 100vw;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  h1 {
    word-break: break-word;
    max-width: 100vw;
  }
  .portrait {
    margin-top: 18px;
    max-width: 320px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Make images full width on mobile (<=786px) */
@media (max-width: 786px) {
  .thumb img,
  .portrait img {
    width: 100% !important;
    height: auto !important;
    min-width: 0;
    max-width: 100vw;
    display: block;
    object-fit: cover;
    position: static;
  }
  .thumb {
    width: 100vw;
    max-width: 100vw;
    margin-left: -4px; /* aligns with .container padding */
    border-radius: 0;
  }
  .portrait {
    width: 100vw;
    max-width: 100vw;
    margin-left: -4px;
    border-radius: 0;
  }
}

/* Prevent horizontal scroll on mobile */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Prevent mobile browsers from zooming on input focus */
input, textarea, select, button {
  font-size: 16px !important;
}

body > main {
  margin-top: 72px;
}

/* Add margin around main content on mobile */
@media (max-width: 786px) {
  .container {
    margin: 10px !important;
    max-width: calc(100vw - 20px);
    width: auto;
    box-sizing: border-box;
  }
  .thumb,
  .portrait {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
}