/* =========================
   Reset & Base
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;

  scroll-snap-type: y mandatory;
}

body {
  background-color: #fefefe;
  color: #222;
  line-height: 1.8;
  font-family: 'Lora', serif;
}

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

ul {
  list-style: none;
}

/* =========================
   Layout Containers
   ========================= */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  display: flex;
  flex-direction: column;
}

main section {
  min-height: 100vh;
  width: 100%;
  position: relative;

  padding-top: 120px;
  padding-bottom: 80px;
  scroll-margin-top: 0;


  scroll-snap-align: start;

  scroll-snap-stop: always;
}

#about { order: 1; }
#projects { order: 2; }
.project-detail { order: 3; }
#education { order: 4; }
#experience { order: 5; }
#contact { order: 6; }
#cv { order: 7; }

#about::before,
#education::before,
#projects::before,
.project-detail::before {

  background-position: top center !important;
}

main ul li {
  list-style: disc;
  margin-left: 20px;
}

main a {
  color: #0070f3;
}

main a:hover {
  text-decoration: underline;
}

/* =========================
   Navigation (Fixed Top)
   ========================= */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  z-index: 1000;
}

.nav-container {

  width: 100%;
  max-width: none;
  margin: 0;


  display: flex;
  align-items: center;
  justify-content: space-between;


  padding: 12px 40px;
}

.top-nav h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
  white-space: nowrap;
}

.top-nav nav {
  position: relative;

}

.top-nav nav ul {
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-nav nav a {
  font-weight: 700;
  font-size: 15px;
  color: #333;
  padding: 8px 0;
  transition: color 0.3s;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.top-nav nav a:hover {
  color: #6a8caf;
}


.nav-underline, .nav-hoverline {
  position: absolute;
  bottom: 0;
  height: 2px;
  background-color: #6a8caf;
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.nav-underline { left: 0; }


/* =========================
   Section: About
   ========================= */
#about {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

#about::before {
  content: '';
  position: absolute;
  inset: 0;

  background-image: url('images/about-bg.jpg');
  background-size: cover;


  background-position: center center !important;
  background-repeat: no-repeat;

  opacity: 0.4;
  z-index: 0;
}

#about .container {
  position: relative;
  z-index: 1;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  padding-top: 80px;
}


.photo-stack {
  position: relative;
  width: 100%;
  height: 400px;
  margin-left: -220px;
}

.photo-stack img {
  position: absolute;
  width: 320px;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.25);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-stack .p1 {
  left: 0;
  top: 60px;
  z-index: 1;
  transform: rotate(-3deg);
}

.photo-stack .p2 {
  left: 240px;
  top: 0;
  z-index: 3;
  transform: rotate(2deg);
}

.photo-stack .p3 {
  left: 480px;
  top: 80px;
  z-index: 2;
  transform: rotate(4deg);
}

.photo-stack img:hover {
  z-index: 20;
  transform: translateY(-10px) scale(1.05) rotate(0deg);
}


.about-text {
  justify-self: end;
  max-width: 500px;
  text-align: left;
  transform: translateX(165px);
  margin-top: 45px;
}


.about-text h2 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
  color: #000;
}


.about-text p {
  font-size: 20px;
  line-height: 1.6;
  color: #333;
}


@media (max-width: 1000px) {
  .about-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 40px;
  }

  .photo-stack {
    margin-left: 0;
    height: 320px;
    transform: scale(0.9);
    transform-origin: center;
  }

  .photo-stack .p1 { left: 40px; }
  .photo-stack .p2 { left: 160px; }
  .photo-stack .p3 { left: 280px; }

  .about-text {
    justify-self: center;
    text-align: center;
    padding-bottom: 40px;
    transform: none;
  }
}

/* =========================
   Section: Academic
   ========================= */
#education {

  display: flex;
  flex-direction: column;
  justify-content: center;


  position: relative;
  overflow: hidden;
}

#education::before {
  content:'';
  position: absolute;
  inset: 0;
  background-image: url('images/education-bg.jpg');
  background-size: cover;
  background-position: center center !important;
  opacity: 0.4;
  z-index: 0;
}

#education .container {
  position: relative;
  z-index: 1;
  width: 100%;
}


.edu-timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;


  padding-top: 60px;
  margin-top: 20px;
}


.edu-timeline::before {
  content:'';
  position: absolute;
  left: 0;
  right: 0;


  top: 24px;

  height: 4px;
  background: rgba(107, 161, 232, 0.5);
  border-radius: 99px;
}


.edu-item {
  position: relative;
}


.edu-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #b0c4de;

  position: absolute;

  top: -44px;
  left: 0;

  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  z-index: 2;
}


.edu-card {
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 20px;
  padding: 24px;

  box-shadow: 0 14px 40px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.edu-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.85);
}

.edu-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #1f2a44;
}

.edu-meta {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
  font-family: monospace;
  background: rgba(0,0,0,0.03);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
}

.edu-desc {
  font-size: 16px;
  margin-bottom: 0;
  color: #333;
}


@media (max-width: 900px) {
  .edu-timeline {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 0;
    padding-left: 30px;
  }


  .edu-timeline::before {
    left: 8px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 4px;
    height: auto;
  }


  .edu-dot {
    top: 24px;
    left: -30px;
  }
}


.academic-publication {
  margin-top: 36px;
}

.academic-publication h3 {
  color: #1f2a44;
  font-size: 22px;
  margin-bottom: 12px;
}

.pub-card {
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pub-card h4 {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #1f2a44;
}

.pub-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
}

.pub-authors { font-size: 16px; opacity: 0.9; margin-bottom: 8px; }
.pub-venue { font-size: 15px; opacity: 0.85; margin-bottom: 14px; }
.pub-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  background: rgba(176,196,222,0.35);
  border: 1px solid rgba(176,196,222,0.55);
  color: #1f2a44;
  text-decoration: none;
  transition: background 0.2s;
}
.pub-btn:hover {
  background: rgba(176,196,222,0.55);
  text-decoration: none;
}

/* =========================
   Section: Projects List
   ========================= */
#projects::before {
  content:'';
  position:absolute;
  inset:0;
  background-image: url('images/projects-bg.jpg');
  background-size: cover;

  background-position: center center !important;
  opacity: 0.35;
  z-index: 0;
}

#projects .container, .projects-wrapper { position: relative; z-index: 1; }

.projects-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.projects-grid {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

/* Card Style */
.project-card {
  appearance: none;
  border: none;
  cursor: pointer;
  text-align: left;


  font-family: 'Lora', serif;

  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease;

  display: flex;
  flex-direction: column;
  justify-content: space-between;


  min-height: 320px;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.7);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 52px;
  margin-bottom: 12px;
  gap: 10px;
}


.project-top h3 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  color: #000;

  max-width: 70%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(176,196,222,0.4);
  border: 1px solid rgba(176,196,222,0.6);
  color: #1f2a44;
  white-space: nowrap;
  font-family: 'Lora', serif;
}


.project-role {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  opacity: 0.95;
  margin-bottom: 10px;
  min-height: 48px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}


.project-desc {
  font-size: 17px;
  opacity: 0.9;
  margin-bottom: 12px;
  line-height: 1.6;
  min-height: 80px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-tags {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


.project-tags span {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.7);
  white-space: nowrap;
  font-weight: 600;
}

.project-coming { background: rgba(176,196,222,0.22); }


/* =========================
   Project Detail Pages
   ========================= */
.project-detail {
  display: none;
  position: relative;
}

.project-detail::before {
  content:'';
  position:absolute;
  inset:0;
  background-image: url('images/projects-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.28;
  z-index: 0;
}

.project-detail .container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  padding-top: clamp(24px, 4vh, 56px);
}

/* Back Button */
.back-btn {

  font-family: 'Lora', serif;

  font-size: 17px;
  font-weight: 700;
  color: #1f2a44;

  background: transparent;
  border: none;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 30px;
  opacity: 0.85;
  transition: all 0.2s ease;
}

.back-btn:hover {
  opacity: 1;
  transform: translateX(-4px);
  color: #5a78a6;
  text-decoration: underline;
}

.store-kicker {
  margin-bottom: 10px;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}

.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(255,255,255,0.48), rgba(255,255,255,0.18));
  border: 1px solid rgba(255,255,255,0.62);
  color: #1f2a44;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.1;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.75),
    inset 0 -1px 1px rgba(31,42,68,0.08),
    0 12px 30px rgba(31,42,68,0.16);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.store-link:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.64), rgba(255,255,255,0.28));
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.85),
    inset 0 -1px 1px rgba(31,42,68,0.1),
    0 16px 36px rgba(31,42,68,0.2);
  transform: translateY(-2px);
  text-decoration: none;
}

.store-link-secondary {
  background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.14));
  border-color: rgba(255,255,255,0.48);
}

.store-link-secondary:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.56), rgba(255,255,255,0.22));
  color: #1f2a44;
}

/* Detail Layout (Left text, Right Image) */
.detail-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(420px, 560px) minmax(420px, 1fr);
  gap: 60px;
  align-items: start;
}

.detail-content h2 { margin-top: 0; }

.detail-stack {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 420px;
  justify-self: end;
  margin-top: 20px;
}

.detail-stack img {
  position: absolute;
  width: 320px;
  height: 400px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.20);
  transition: transform 0.25s ease;
}

.detail-stack img:hover {
  z-index: 10;
  transform: translateY(-10px) scale(1.04);
}

/* Image Positioning */
.detail-stack .d1 { left: 0; top: 60px; z-index: 1; transform: rotate(-2deg); }
.detail-stack .d2 { left: 160px; top: 0; z-index: 3; transform: rotate(1deg); }
.detail-stack .d3 { left: 320px; top: 70px; z-index: 2; transform: rotate(3deg); }

/* Variations */
.detail-stack.two .d2 { left: 190px; }
.detail-stack.single { height: auto; }
.detail-stack.single img { position: relative; width: 100%; height: auto; transform: none; }


.detail-stack.landscape img {
  width: 420px;
  height: 240px;
  object-fit: cover;
}


.detail-stack.landscape .d1 {
  left: 0;
  top: 60px;
  z-index: 1;
  transform: rotate(-3deg);
}


.detail-stack.landscape .d2 {
  left: 100px;
  top: 0;
  z-index: 2;
  transform: rotate(2deg);
}


.detail-stack.landscape img:hover {
  z-index: 10;
  transform: translateY(-5px) scale(1.05) rotate(0deg);
}


.detail-stack.quad img {
  width: 260px;
  height: 190px;
  object-fit: cover;
}


.detail-stack.quad .d1 {
  left: 0;
  top: 0;
  z-index: 1;
  transform: rotate(-3deg);
}


.detail-stack.quad .d2 {
  left: auto;
  right: 10px;
  top: 20px;
  z-index: 2;
  transform: rotate(2deg);
}


.detail-stack.quad .d3 {
  left: 20px;
  top: 160px;
  z-index: 3;
  transform: rotate(1deg);
}


.detail-stack.quad .d4 {
  left: auto;
  right: 0;
  top: 190px;
  z-index: 4;
  transform: rotate(-2deg);
}


.detail-stack.quad img:hover {
  z-index: 20;
  transform: scale(1.15) rotate(0deg);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}


#project-coming .detail-layout {

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;


  max-width: 800px;
  margin: 0 auto;
  gap: 0;
}

#project-coming .detail-content h2 {
  font-size: 40px;
  margin-bottom: 24px;
}

#project-coming .detail-text {
  font-size: 20px;
  color: #555;
  max-width: 600px;
  margin: 0 auto;
}

/* =========================
   Section: Experience (Glass Card Style)
   ========================= */

#experience {
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


#experience::before {
  content: '';
  position: absolute;
  inset: 0;


  background-image: url('images/experience-bg.jpg');

  background-size: cover;
  background-position: center center !important;
  opacity: 0.4;
  z-index: 0;
}

#experience .container {
  position: relative;
  z-index: 1;
  width: 100%;
}


/* =========================
   Section: Experience (Glass Card Style)
   ========================= */


.exp-card {
  margin-top: 28px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 22px;
  padding: 30px;
  box-shadow: 0 14px 38px rgba(0,0,0,0.14);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.exp-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 46px rgba(0,0,0,0.18);
}


.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.exp-main-info h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1f2a44;
}

.exp-role {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: #5a78a6;
  background: rgba(176,196,222,0.25);
  padding: 4px 10px;
  border-radius: 6px;
}

.exp-meta-info {
  text-align: right;
  font-family: 'Lora', serif;
  color: #666;
}

.exp-date {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.exp-loc {
  display: block;
  font-size: 14px;
  font-style: italic;
}


.exp-list {
  padding-left: 20px;
}

.exp-list li {
  list-style: disc;
  font-size: 16px;
  margin-bottom: 12px;
  line-height: 1.7;
  color: #333;
}

.exp-list strong {
  color: #000;
  font-weight: 700;
}


@media (max-width: 700px) {
  .exp-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .exp-meta-info {
    text-align: left;
    display: flex;
    gap: 15px;
  }
}

/* =========================
   Section: Contact Me
   ========================= */

#contact {
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


#contact::before {
  content: '';
  position: absolute;
  inset: 0;


  background-image: url('images/contact-bg.jpg');

  background-size: cover;
  background-position: center center !important;
  opacity: 0.4;
  z-index: 0;
}

#contact .container {
  position: relative;
  z-index: 1;
  width: 100%;
}


.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 0 40px;
}


.contact-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.contact-image-wrapper img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 24px;


  border: 8px solid #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);


  transform: rotate(-3deg);
  transition: transform 0.3s ease;
}

.contact-image-wrapper img:hover {
  transform: rotate(0deg) scale(1.02);
}


.contact-info {
  text-align: left;
}

.contact-info h2 {
  font-size: 48px;
  margin-bottom: 20px;
  color: #1f2a44;
}

.contact-text {
  font-size: 20px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 40px;
  max-width: 480px;
}

.contact-text strong {
  font-size: 24px;
  color: #000;
  display: block;
  margin-top: 10px;
}


.social-links {
  display: flex;
  gap: 24px;
}


.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 72px;
  height: 72px;
  border-radius: 50%;

  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  color: #333;

  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-btn svg {
  width: 32px;
  height: 32px;
}


.social-btn:hover {
  transform: translateY(-8px) scale(1.1);
  background: #fff;
  color: #0070f3;
  box-shadow: 0 14px 30px rgba(0,112,243,0.3);
}


@media (max-width: 900px) {
  .contact-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 50px;
    padding: 0;
  }

  .contact-image-wrapper img {
    max-width: 300px;
  }

  .contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .contact-text {
    text-align: center;
  }

  .contact-info h2 {
    font-size: 36px;
  }
}

/* =========================
   Section: CV
   ========================= */

#cv {
  position: relative;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  justify-content: center;
}


#cv::before {
  content: '';
  position: absolute;
  inset: 0;


  background-image: url('images/experience-bg.jpg');

  background-size: cover;
  background-position: center center !important;
  opacity: 0.4;
  z-index: 0;
}

#cv .container {
  position: relative;
  z-index: 1;
  width: 100%;
  text-align: center;
}


.cv-wrapper {
  width: 100%;
  max-width: 800px;
  height: 1000px;
  margin: 0 auto;

  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.9);

  overflow: hidden;
}


.cv-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}


.cv-actions {
  margin-top: 40px;
}

.download-btn {
  display: inline-block;
  font-family: 'Lora', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;

  background-color: #1f2a44;
  padding: 14px 32px;
  border-radius: 50px;
  box-shadow: 0 10px 20px rgba(31, 42, 68, 0.3);

  transition: all 0.3s ease;
}

.download-btn:hover {
  transform: translateY(-4px);
  background-color: #3b4d70;
  box-shadow: 0 14px 30px rgba(31, 42, 68, 0.4);
  text-decoration: none;
}


@media (max-width: 700px) {
  .cv-wrapper {
    height: 500px;
  }
}


/* =========================
   Media Queries (Responsive Design)
   ========================= */


@media (max-width: 1000px) {


  .detail-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }


  .detail-stack {
    justify-self: start;
    max-width: 520px;
    height: 360px;
  }
  .detail-stack img {
    width: 280px;
    height: 340px;
  }
  .detail-stack .d2 { left: 140px; }
  .detail-stack .d3 { left: 280px; }


  .detail-stack.landscape {
    height: 300px;
  }
  .detail-stack.landscape img {
    width: 340px;
    height: 200px;
  }
  .detail-stack.landscape .d1 { left: 20px; top: 40px; }
  .detail-stack.landscape .d2 { left: 80px; top: 0; }


  .detail-stack.quad {
    height: 380px;
    max-width: 100%;
  }
  .detail-stack.quad img {
    width: 200px;
    height: 150px;
  }
  .detail-stack.quad .d1 { left: 0; top: 0; }
  .detail-stack.quad .d2 { right: 0; top: 40px; }
  .detail-stack.quad .d3 { left: 10px; top: 140px; }
  .detail-stack.quad .d4 { right: 10px; top: 180px; }
}


@media (max-width: 900px) {


  .about-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 40px;
    padding-top: 40px;
  }


  .photo-stack {
    margin-left: 0;
    width: 100%;
    max-width: 360px;
    height: 420px;
    margin: 0 auto;
    transform: none;
  }


  .photo-stack img {
    width: 240px;
  }


  .photo-stack .p1 { left: 0; transform: rotate(-3deg); }
  .photo-stack .p2 { left: 60px; transform: rotate(2deg); }
  .photo-stack .p3 { left: 120px; transform: rotate(4deg); }


  .about-text {
    justify-self: center;
    text-align: center;
    padding-bottom: 40px;
    transform: none;
    margin-top: 0;
    max-width: 100%;
    padding: 0 20px;
  }

  .about-text h2 {
    font-size: 32px;
  }


  .edu-timeline {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .edu-timeline::before {
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
  }
  .edu-dot {
    top: 6px;
    left: 3px;
  }
  .edu-card {
    margin-left: 28px;
    width: auto;
  }


  .top-nav nav {
    display: none;
  }


  .contact-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 50px;
    padding: 0;
  }
  .contact-image-wrapper img { max-width: 300px; }
  .contact-info { align-items: center; }
  .contact-text { text-align: center; }
  .social-links { justify-content: center; }
}


@media (max-width: 650px) {

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .detail-stack img {
    width: 220px;
    height: 280px;
  }
}


/* =========================
   SushiRat Special Layout
   ========================= */

.sushi-visuals {
  display: flex;
  flex-direction: column;
  gap: 60px;
  width: 100%;
  max-width: 500px;
  justify-self: end;
  margin-top: 10px;
}


.deck-hint {
  text-align: center;
  font-size: 13px;
  color: #666;
  margin-bottom: 5px;
  font-style: italic;
}

.card-deck {
  position: relative;
  height: 220px;
  width: 100%;
  display: flex;
  justify-content: center;
  perspective: 1000px;
  margin-bottom: 20px;
}

.card {
  position: absolute;
  width: 100px;
  height: 140px;
  border-radius: 8px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  background: #fff;
  border: 1px solid #ddd;


  left: 50%;
  top: 0;
  margin-left: -50px;
  transform-origin: bottom center;


  transform: rotate(0deg);


  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: zoom-in;
}


.card:nth-child(odd) { transform: rotate(-2deg); }
.card:nth-child(even) { transform: rotate(1deg); }


.card-deck:hover .card:nth-child(1) { transform: translateX(-160px) translateY(10px) rotate(-30deg); z-index: 1; }
.card-deck:hover .card:nth-child(2) { transform: translateX(-120px) translateY(-5px) rotate(-20deg); z-index: 2; }
.card-deck:hover .card:nth-child(3) { transform: translateX(-80px)  translateY(-15px) rotate(-10deg); z-index: 3; }
.card-deck:hover .card:nth-child(4) { transform: translateX(-30px)  translateY(-20px) rotate(-3deg);  z-index: 4; }
.card-deck:hover .card:nth-child(5) { transform: translateX(30px)   translateY(-20px) rotate(3deg);   z-index: 5; }
.card-deck:hover .card:nth-child(6) { transform: translateX(80px)   translateY(-15px) rotate(10deg);  z-index: 6; }
.card-deck:hover .card:nth-child(7) { transform: translateX(120px)  translateY(-5px) rotate(20deg);   z-index: 7; }
.card-deck:hover .card:nth-child(8) { transform: translateX(160px)  translateY(10px) rotate(30deg);   z-index: 8; }


.card-deck .card:hover {
  z-index: 100 !important;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
  border-color: #888;

}


.card-deck:hover .card:nth-child(1):hover { transform: translateX(-160px) translateY(10px) rotate(-30deg) scale(1.35) !important; }
.card-deck:hover .card:nth-child(2):hover { transform: translateX(-120px) translateY(-5px) rotate(-20deg) scale(1.35) !important; }
.card-deck:hover .card:nth-child(3):hover { transform: translateX(-80px)  translateY(-15px) rotate(-10deg) scale(1.35) !important; }
.card-deck:hover .card:nth-child(4):hover { transform: translateX(-30px)  translateY(-20px) rotate(-3deg)  scale(1.35) !important; }
.card-deck:hover .card:nth-child(5):hover { transform: translateX(30px)   translateY(-20px) rotate(3deg)   scale(1.35) !important; }
.card-deck:hover .card:nth-child(6):hover { transform: translateX(80px)   translateY(-15px) rotate(10deg)  scale(1.35) !important; }
.card-deck:hover .card:nth-child(7):hover { transform: translateX(120px)  translateY(-5px) rotate(20deg)   scale(1.35) !important; }
.card-deck:hover .card:nth-child(8):hover { transform: translateX(160px)  translateY(10px) rotate(30deg)   scale(1.35) !important; }


.gameplay-stack {
  position: relative;
  height: 240px;
  width: 100%;
  margin-top: -80px;
}

.gameplay-stack img {
  position: absolute;
  width: 300px;
  height: auto;
  border: 8px solid #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  cursor: zoom-in;
  border-radius: 4px;
}

.gameplay-stack img:nth-child(1) {
  left: 20px;
  top: 10px;
  transform: rotate(-3deg);
  z-index: 1;
}

.gameplay-stack img:nth-child(2) {
  right: 40px;
  top: 0;
  transform: rotate(2deg);
  z-index: 2;
}

.gameplay-stack img:hover {
  z-index: 10;
  transform: scale(1.05) rotate(0deg);
}

/* =========================
   Image Lightbox
   ========================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 28px 36px;
  background: rgba(20, 24, 32, 0.42);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-content {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.48);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.58),
    0 26px 70px rgba(0,0,0,0.32);
}

.close-lightbox {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.42);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.45), 0 12px 30px rgba(0,0,0,0.22);
}

#caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 18px;
  color: rgba(255,255,255,0.9);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

body.lightbox-open {
  overflow: hidden;
}


@media (max-width: 900px) {
  .sushi-visuals {
    max-width: 100%;
    margin-top: 40px;
    gap: 80px;
  }


  .card-deck:hover .card:nth-child(1) { transform: translateX(-100px) rotate(-15deg); }
  .card-deck:hover .card:nth-child(8) { transform: translateX(100px) rotate(15deg); }


  .card-deck:hover .card:nth-child(1):hover { transform: translateX(-100px) rotate(-15deg) scale(1.2) !important; }
  .card-deck:hover .card:nth-child(8):hover { transform: translateX(100px) rotate(15deg) scale(1.2) !important; }
}
