:root {
  --primary-color: #dd9be2;
  --secondary-color: #76278f;
  --accent-color: #8650ab;
  --light-color: #f5f5f5;
  --dark-color: #524e53;
  --text-color: #2d2d2d;
  --box-color: rgb(220 105 254 / 8%);
  --primary: #2b3d5b;
  --secondary: #3a5a7a;
  --accent: #4fc3f7;
  --surface: #ffffff;
  --surface-subtle: #f6f8fb;
  --text: #495057;
  --muted: #6c757d;
  --ring: rgba(79, 195, 247, 0.45);
  --shadow: 0 8px 28px rgba(19, 31, 53, 0.08);
  --radius: 14px;
  --fs-hero: clamp(1.75rem, 2.5vw + 1rem, 2.25rem);
  --fs-h2: clamp(1.35rem, 1.6vw + 0.9rem, 1.75rem);
  --fs-h3: clamp(1.05rem, 1.1vw + 0.8rem, 1.25rem);
  --fs-body: clamp(0.98rem, 0.3vw + 0.9rem, 1.05rem);
  --fs-small: 0.9rem;
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0f1420;
    --surface-subtle: #111a2a;
    --text: #d7e2f1;
    --muted: #a7b4c9;
    --primary: #cfe4ff;
    --secondary: #b7d0ec;
    --accent: #7ad6ff;
    --ring: rgba(122, 214, 255, 0.45);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
  img {
    opacity: 0.98;
  }
}

/* =========================
       Base / Layout
    ========================== */
* {
  box-sizing: border-box;
}
html:focus-within {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  background: #ffffff;
  color: var(--text-color);
  line-height: 1.7;
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip link (a11y) */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  width: auto;
  height: auto;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: #06121f;
  border-radius: 8px;
  outline: none;
}

header[role="banner"] {
  position: relative;
  background: linear-gradient(
    160deg,
    var(--secondary-color),
    var(--primary-color)
  );
  color: #fff;
  text-align: center;
  padding: var(--space-6) var(--space-4);
  box-shadow: var(--shadow);
  overflow: hidden;
}
header .header-par {
  color: #ffffff !important;
}
/* Subtle parallax shimmer (GPU-friendly) */
header[role="banner"]::after {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  height: 240%;
  width: 60%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.18),
    transparent 60%
  );
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: none;
  animation: float 18s ease-in-out infinite alternate;
}
@keyframes float {
  to {
    transform: translate3d(-6%, 4%, 0) rotate(2deg);
  }
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: var(--fs-hero);
  font-weight: 600;
  letter-spacing: 0.2px;
}
header p {
  margin: 0.25rem 0 0;
  opacity: 0.95;
}

main {
  padding: var(--space-6) var(--space-4);
  max-width: 1040px;
  margin: 0 auto;
}

h2 {
  color: var(--secondary-color);
  font-size: var(--fs-h2);
  margin: 0 0 var(--space-3);
  padding-bottom: 0.5rem;
  position: relative;
  letter-spacing: 0.2px;
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 2px;
}

h3,
h4,
h5,
h6,
p,
div,
li {
  color: var(--text-color);
}

/* Card */
.project {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-5);
  border: 1px solid rgba(58, 90, 122, 0.08);
  --lift: 0;
  transform: translateY(var(--lift));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project:hover {
  --lift: -2px;
  box-shadow: 0 14px 40px rgba(17, 34, 51, 0.12);
}
.project-header h3 {
  margin: 0;
  font-size: var(--fs-h3);
}
.project-header p {
  margin: 0.35rem 0 0;
}

.links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background-color 0.2s ease, color 0.2s ease;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}
.btn-primary {
  background: var(--accent);
  color: #072233;
}
.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 195, 247, 0.25);
}
.btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

aside.note {
  border: 1px dashed var(--primary-color);
  /* background: color-mix(in srgb, var(--box-color) 9%, transparent); */
  background-color: var(--box-color);
  border-radius: 12px;
  padding: var(--space-3);
  margin: var(--space-4) 0;
}

.content p {
  margin: 0 0 var(--space-3);
}

/* Tech chips */
.tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 var(--space-2);
}
.tech li {
  background: var(--box-color);
  color: var(--secondary-color);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.2s ease;
}
.tech li:hover {
  transform: translateY(-1px);
}
@media (prefers-color-scheme: dark) {
  .tech li {
    background: #0e2239;
    color: #cde2ff;
    border-color: rgba(122, 214, 255, 0.2);
  }
}

/* =========================
       Carousel (no-crop, adaptive)
    ========================== */
.carousel-wrap {
  margin: var(--space-3) auto var(--space-4);
  max-width: 960px;
  position: relative;
}
.carousel {
  height: 600px !important;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--surface);
  transition: height 0.3s ease; /* JS updates height per slide */
}
.slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
  touch-action: pan-y;
}
figure.slide {
  min-width: 100%;
  margin: 0;
  text-align: center;
  background: var(--surface);
}
.media {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.media.is-landscape {
  aspect-ratio: var(--landscape-ar, 16/9);
}
.media.is-portrait {
  aspect-ratio: auto;
}
.media img {
  max-width: 100%;
  height: auto;
  width: auto;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}
figure.slide figcaption {
  padding: 0.65rem;
  color: var(--muted);
  font-size: var(--fs-small);
}

.nav {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.nav button {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.08);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.nav button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.nav button:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* Slide status pill (a11y feedback) */
.status {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  backdrop-filter: saturate(120%) blur(4px);
}

/* Reveal on scroll (progressive enhancement) */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  .slides {
    transition: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  header[role="banner"]::after {
    animation: none;
  }
}

footer {
  text-align: center;
  padding: 3rem 2rem;
  background-color: var(--primary-color);
  color: white !important;
  margin-top: 3rem;
  position: relative;
}
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent-color), #fff);
}
footer p {
  color: white !important;
}
footer .social-links a {
  color: white;
  margin: 0 10px;
  font-size: 1.2rem;
}

/* Responsive rhythm */
@media (max-width: 720px) {
  .project {
    padding: var(--space-4);
  }
}

@media (max-width: 576px) {
  .carousel {
    height: 300px !important;
  }
}
