:root {
  --bg: #050114;
  --card: #0f0631;
  --accent: #ff4da6;
  --accent-alt: #36c5f0;
  --accent-warm: #ffb347;
  --text: #f6f6ff;
  --muted: #c4c4da;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 1.25rem;
  --shadow: 0 25px 50px rgba(5, 1, 20, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top left, #1b0a44, var(--bg));
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-alt);
  margin-bottom: 0.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 6vw;
  background: rgba(5, 1, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  width: 72px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

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

.main-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.main-nav a {
  position: relative;
  padding-bottom: 0.25rem;
}

.main-nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -0.35rem 0;
  height: 2px;
  background: transparent;
  transition: background 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
  background: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
}

main {
  padding: 4rem 6vw 6rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 4rem;
  background: linear-gradient(135deg, rgba(255, 77, 166, 0.1), rgba(54, 197, 240, 0.05));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.7);
  box-shadow: var(--shadow);
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.hero-banner-slideshow {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 2rem;
  border-radius: calc(var(--radius) * 1.2);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(5, 1, 20, 0.3);
}

.slideshow-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 30%; /* Reduced by 25% from 40% */
  overflow: hidden;
  background: var(--card);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--card);
}

.slideshow-prev,
.slideshow-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(5, 1, 20, 0.7);
  color: var(--text);
  border: none;
  padding: 1rem 1.2rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease, transform 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.slideshow-prev:hover,
.slideshow-next:hover {
  background: rgba(255, 77, 166, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.slideshow-prev {
  left: 1rem;
}

.slideshow-next {
  right: 1rem;
}

.slideshow-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.dot.active,
.dot:hover {
  background: var(--accent);
  transform: scale(1.2);
  border-color: var(--accent);
}

.hero-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-photo img {
  width: 100%;
  max-width: 426px; /* 387px + 10% */
  height: auto;
  border-radius: var(--radius);
  border: 3px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-alt), var(--accent-warm)) border-box;
  box-shadow: 0 20px 40px rgba(255, 77, 166, 0.3), 0 0 60px rgba(54, 197, 240, 0.2);
  object-fit: cover;
  aspect-ratio: 1;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 4vw, 3.8rem);
}

.hero .subtitle {
  color: var(--muted);
  max-width: 50ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-ctas .btn {
  flex: 0 1 auto;
  min-width: fit-content;
}

.hero-ctas #download-pdf:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.hero-ctas #download-pdf:disabled:hover {
  transform: none;
}

.btn {
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #050114;
  box-shadow: 0 15px 30px rgba(255, 77, 166, 0.3);
}

.btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--accent-alt);
}

.btn:hover {
  transform: translateY(-2px);
}

.hero-highlight {
  background: var(--card);
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  display: grid;
  gap: 0.5rem;
  align-content: center;
  text-align: center;
}

.hero-highlight span {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
}

.panel {
  padding: 3rem;
  border-radius: var(--radius);
  background: rgba(17, 8, 42, 0.8);
  border: 1px solid var(--border);
  box-shadow: 0 18px 35px rgba(3, 0, 11, 0.45);
}

.panel header {
  margin-bottom: 1.5rem;
}

.timeline {
  display: grid;
  gap: 1.5rem;
}

.timeline article {
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 0.8);
  background: rgba(5, 1, 20, 0.55);
  border: 1px solid var(--border);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.timeline ul {
  padding-left: 1rem;
  margin: 0;
}

.timeline li {
  margin-bottom: 0.35rem;
}

.duo .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.duo article {
  background: rgba(5, 1, 20, 0.6);
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 0.8);
  border: 1px solid var(--border);
}

.about-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  align-items: center;
}

.about-wrapper {
  display: block;
}

.about-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  margin: 2rem auto 3rem;
}

.about-media img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: calc(var(--radius) * 1.1);
  border: 3px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-alt)) border-box;
  box-shadow: 0 25px 50px rgba(5, 1, 20, 0.4);
  object-fit: contain;
  display: block;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-list {
  margin: 0 0 1rem 1rem;
  padding-left: 1rem;
  color: var(--text);
  line-height: 1.5;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.pill-list li {
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--accent-alt);
  background: rgba(54, 197, 240, 0.15);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skill-card {
  padding: 1.5rem;
  border-radius: calc(var(--radius) * 0.7);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 77, 166, 0.1), rgba(5, 1, 20, 0.7));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.highlight-grid article {
  padding: 1.25rem;
  border-radius: calc(var(--radius) * 0.7);
  border: 1px solid var(--border);
  background: rgba(5, 1, 20, 0.65);
}

.projects .project-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.8);
  padding: 2rem;
  background: rgba(5, 1, 20, 0.7);
}

.projects .project-card::after {
  content: "";
  display: block;
  clear: both;
}

.project-thumb {
  float: right;
  width: min(70%, 420px);
  border-radius: calc(var(--radius) * 0.6);
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-alt)) border-box;
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 15px 35px rgba(5, 1, 20, 0.5);
}

.project-images {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 1.75rem;
}

.project-images .project-image {
  flex: 1 1 0;
  min-width: 0;
  max-width: 48%;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) * 0.6);
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-alt)) border-box;
  box-shadow: 0 15px 35px rgba(5, 1, 20, 0.5);
  display: block;
  object-fit: contain;
}

@media (max-width: 900px) {
  .project-images {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .project-images .project-image {
    max-width: 100%;
  }
}

.projects .tag {
  align-self: flex-start;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 179, 71, 0.2);
  border: 1px solid var(--accent-warm);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.projects .project-card a {
  color: var(--accent-alt);
  text-decoration: underline;
  text-decoration-color: rgba(54, 197, 240, 0.4);
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.projects .project-card a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.project-banner {
  width: 100%;
  overflow: hidden;
}

.project-banner img {
  display: block;
  width: 100%;
  height: auto;
}

.skills-image {
  width: 100%;
  overflow: hidden;
}

.skills-image img {
  display: block;
  width: 100%;
  height: auto;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: start;
}

.contact-image-wrapper {
  position: relative;
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.contact-image-wrapper a {
  display: inline-block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-image-wrapper a:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.contact-image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: calc(var(--radius) * 0.8);
  border: 1px solid var(--border);
  box-shadow: 0 15px 35px rgba(5, 1, 20, 0.5);
  display: block;
  cursor: pointer;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  background: rgba(5, 1, 20, 0.6);
  border-radius: calc(var(--radius) * 0.9);
  border: 1px solid var(--border);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
}

input,
textarea {
  background: rgba(12, 5, 30, 0.9);
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 77, 166, 0.25);
}

.form-status {
  min-height: 1.5rem;
  font-size: 0.95rem;
  margin: 0;
}

.site-footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.footer-logo img {
  max-width: 160px; /* doubled size for footer logo */
  height: auto;
  display: block;
}

.site-footer .btn {
  font-size: 1rem;
  padding: 1rem 2rem;
  box-shadow: 0 10px 25px rgba(255, 77, 166, 0.25);
}

.site-footer .btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.site-footer .btn:disabled:hover {
  transform: none;
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    inset: 0 0 auto;
    top: 64px;
    flex-direction: column;
    padding: 1rem 6vw 2rem;
    background: rgba(5, 1, 20, 0.95);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }

  .main-nav.open {
    transform: translateY(0);
  }

  .nav-toggle {
    display: block;
  }
}

/* Laptop/Desktop specific styles */
@media (min-width: 1025px) {
  .about-wrapper {
    position: relative;
  }

  /* Only apply float to about-media within about-wrapper (About section) */
  .about-wrapper .about-media {
    float: right;
    margin: 0 0 1.5rem 2rem;
    max-width: 536px; /* Reduced by 33% from 800px */
    width: auto;
    display: block;
    shape-outside: margin-box; /* Better text wrapping around image */
  }

  .about-wrapper .about-media img {
    max-width: 100%;
    width: 536px;
    height: auto;
  }

  .about-content {
    margin-right: 0;
    overflow: visible; /* Allow text to wrap around floated image */
  }

  .about-content p {
    text-align: justify; /* Better text distribution */
  }

  .highlights-intro {
    margin-top: 1.5rem !important; /* Add spacing before Highlights include */
    margin-bottom: 0.5rem !important;
  }

  /* Ensure featured section image stays centered */
  #featured .about-media {
    float: none !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 2rem auto 3rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  #featured .about-media img {
    max-width: 800px !important;
    width: 100% !important;
  }
}

@media (max-width: 1024px) {
  .project-banner {
    margin: 1.25rem auto 1.75rem !important;
  }

  .project-banner img {
    max-width: 100% !important;
    border-radius: calc(var(--radius) * 0.9) !important;
  }

  .skills-image {
    margin: 1.25rem auto 1.75rem !important;
  }

  .skills-image img {
    max-width: 100% !important;
    border-radius: calc(var(--radius) * 0.9) !important;
  }

  .hero-ctas {
    gap: 0.875rem;
  }

  .hero-ctas .btn {
    padding: 0.75rem 1.4rem;
    font-size: 0.95rem;
  }

  .slideshow-container {
    padding-bottom: 37.5%; /* Reduced by 25% from 50% for iPad */
  }

  .slide img {
    width: 100% !important;
    object-fit: cover !important; /* Fill the banner width on iPad */
  }

  .slideshow-prev,
  .slideshow-next {
    padding: 0.75rem 1rem;
    font-size: 1.2rem;
  }

  .slideshow-dots {
    bottom: 1rem;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 0.6rem 5vw; /* reduce header height for small/mobile views */
  }

  .hero {
    padding: 2.5rem 1.5rem;
  }

  .hero-banner-slideshow {
    margin-bottom: 1.5rem;
    max-width: 240px; /* Match hero-photo width on mobile */
  }

  .slideshow-container {
    padding-bottom: 60%; /* Original height for mobile */
  }

  .slide img {
    width: 100% !important;
    object-fit: cover !important; /* Fill the banner width on mobile */
  }

  .slideshow-prev,
  .slideshow-next {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
  }

  .slideshow-prev {
    left: 0.5rem;
  }

  .slideshow-next {
    right: 0.5rem;
  }

  .slideshow-dots {
    bottom: 0.75rem;
    gap: 0.4rem;
  }

  .dot {
    width: 8px;
    height: 8px;
  }

  .hero-photo img {
    max-width: 319px; /* 290px + 10% */
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }

  .panel {
    padding: 2rem;
  }

  .project-banner {
    margin: 1rem auto 1.5rem !important;
  }

  .project-banner img {
    max-width: 100% !important;
    border-radius: calc(var(--radius) * 0.8) !important;
    border-width: 2px !important;
  }

  .skills-image {
    margin: 1rem auto 1.5rem !important;
  }

  .skills-image img {
    max-width: 100% !important;
    border-radius: calc(var(--radius) * 0.8) !important;
    border-width: 2px !important;
  }

  .projects .project-card {
    padding: 1.5rem;
  }
}

/* PDF Generation Styles */
main.pdf-export {
  padding: 2rem !important;
  background: #050114 !important;
  max-width: 100% !important;
}

main.pdf-export .panel {
  page-break-inside: avoid;
  page-break-after: auto;
  margin-bottom: 2rem !important;
  padding: 2rem !important;
  break-inside: avoid;
}

main.pdf-export .hero {
  page-break-after: avoid;
  break-after: avoid;
  margin-bottom: 2rem !important;
}

main.pdf-export .hero-photo img {
  max-width: 300px !important;
}

main.pdf-export .about-media img,
main.pdf-export .project-banner img {
  max-width: 100% !important;
  height: auto !important;
}

main.pdf-export section {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 2rem !important;
}

main.pdf-export h2,
main.pdf-export h3 {
  page-break-after: avoid;
  break-after: avoid;
  margin-top: 1.5rem !important;
  margin-bottom: 1rem !important;
}

main.pdf-export .timeline article,
main.pdf-export .project-card {
  page-break-inside: avoid;
  break-inside: avoid;
  margin-bottom: 1.5rem !important;
}

main.pdf-export ul,
main.pdf-export ol {
  page-break-inside: avoid;
  break-inside: avoid;
}

main.pdf-export img {
  max-width: 100% !important;
  height: auto !important;
  page-break-inside: avoid;
  break-inside: avoid;
}

@media print {
  @page {
    margin: 10mm;
    size: A4;
  }
  
  main {
    page-break-inside: avoid;
  }
  
  .panel {
    page-break-inside: avoid;
    page-break-after: auto;
  }
  
  .hero {
    page-break-after: avoid;
  }
}

