/* ═══════════════════════════════════════════
   Portfolio Grid — Personal Portfolio
   Clean, minimal, warm off-white aesthetic
   ═══════════════════════════════════════════ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f5f3f0;
  --surface-1: #ffffff;
  --surface-2: #faf8f6;
  --surface-3: #f0ede8;
  --text-primary: #1a1815;
  --text-secondary: #6b6560;
  --text-tertiary: #9e9890;
  --accent: #2d2a26;
  --border: rgba(26, 24, 21, 0.06);

  --font-zh: "PingFang SC", "PingFang TC", "PingFang HK", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-latin: "Nunito", var(--font-zh), sans-serif;
  --font-display: var(--font-latin);
  --font-body: var(--font-latin);

  --gap: 10px;
  --radius: 16px;
  --module-padding: clamp(16px, 3vw, 24px);

  /* Canvas cap: same ratio as 1140×774; at 1440px wide → 978px tall */
  --canvas-max-width: 1440px;
  --canvas-max-height: calc(1440px * 774 / 1140);
  --canvas-aspect: calc(1140 / 774);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.4s;
  --duration-float: 0.55s;
}

html, body {
  min-height: 100vh;
  overflow: hidden;
  cursor: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   Custom Cursor
   ═══════════════════════════════════════════ */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  mix-blend-mode: difference;
}

.cursor.no-invert {
  mix-blend-mode: normal;
  background: #000000;
}

a, button, [role="button"] {
  cursor: none;
}

/* ═══════════════════════════════════════════
   Grid Layout
   ─────────────────────────────────────────
   4 columns × 3 rows (using fr units)

   Left (col 1-2):
     Row 1       = Intro    → height 30%
     Row 2 + 3   = Project1 → height 70%

   Right (col 3-4):
     Row 1 + 2   = Project2 → height 60%
     Row 3 (col3) = Project3 → height 40%
     Row 3 (col4) = Project4 → height 40%
   ═══════════════════════════════════════════ */

.grid-container {
  display: grid;
  grid-template-columns: minmax(420px, 4fr) minmax(300px, 3fr) minmax(300px, 3fr);
  grid-template-rows: 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
  width: min(100vw, var(--canvas-max-width));
  height: min(
    var(--canvas-max-height),
    calc(min(100vw, var(--canvas-max-width)) / var(--canvas-aspect)),
    100vh
  );
  max-width: var(--canvas-max-width);
  max-height: var(--canvas-max-height);
  margin: 0 auto;
  flex-shrink: 0;
}

.intro-cell {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  display: flex;
  gap: var(--gap);
  min-width: 0;
  min-height: 0;
}

.intro-placeholder {
  display: none;
}

.module-project1 {
  grid-column: 1 / 2;
  grid-row: 3 / 7;
}

.module-project2 {
  grid-column: 2 / 4;
  grid-row: 1 / 4;
}

.module-project3 {
  grid-column: 2 / 3;
  grid-row: 4 / 7;
}

.module-project4 {
  grid-column: 3 / 4;
  grid-row: 4 / 7;
}

/* ═══════════════════════════════════════════
   Module Base
   ═══════════════════════════════════════════ */

.module {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-1);
  border-radius: var(--radius);
  padding: var(--module-padding);
  text-decoration: none;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out);
  min-width: 0;
  min-height: 0;
}

.module:hover {
  transform: scale(0.985);
  box-shadow: 0 8px 40px rgba(26, 24, 21, 0.06);
}

.module:active {
  transform: scale(0.975);
}

/* ═══════════════════════════════════════════
   Module Content
   ═══════════════════════════════════════════ */

.module-inner {
  position: relative;
  z-index: 2;
}

.module-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.module-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 8px;
  text-wrap: balance;
  max-width: 16ch;
}

.module-desc {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 28ch;
}

/* ═══════════════════════════════════════════
   Intro Module
   ═══════════════════════════════════════════ */

.module-intro {
  position: relative;
  flex: 1 1 0;
  width: auto;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: clamp(20px, 3vw, 32px);
  align-items: stretch;
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
  padding: var(--module-padding);
  overflow: hidden;
  background: var(--accent);
  color: var(--surface-1);
}

.module-intro .intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  width: max-content;
  min-height: 100%;
  box-sizing: border-box;
  gap: 12px;
}

.intro-visual.intro-photo-wrapper {
  position: absolute;
  top: var(--module-padding);
  right: var(--module-padding);
  bottom: var(--module-padding);
  z-index: 3;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: visible;
  pointer-events: none;
}

.intro-photo-stack {
  --intro-photo-scale: 1.05;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: 100%;
  max-height: 100%;
  transform: scale(var(--intro-photo-scale));
  transform-origin: center right;
}

.intro-photo {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: min(100%, 11.7rem);
  object-fit: contain;
  object-position: center right;
}

.module-intro .module-label {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.intro-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-top: auto;
  margin-bottom: 0;
}

.intro-role {
  font-size: clamp(0.8rem, 1vw, 0.95rem);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
}

.module-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: static;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--duration) var(--ease-out);
}

.module-intro .module-cta {
  opacity: 0;
  transform: translateY(10px);
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity var(--duration) var(--ease-out),
    transform var(--duration) var(--ease-spring),
    max-height var(--duration) var(--ease-out),
    margin-top var(--duration) var(--ease-out),
    color var(--duration) var(--ease-out);
}

.module-intro:hover .module-cta {
  opacity: 1;
  transform: translateY(0);
  max-height: 2.5rem;
  margin-top: 4px;
  overflow: visible;
  pointer-events: auto;
  color: rgba(255, 255, 255, 1);
}

.module-cta svg {
  display: block;
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease-out);
}

.module-intro:hover .module-cta svg {
  transform: translateX(2px);
}

/* ═══════════════════════════════════════════
   Thumbnail Placeholder
   ═══════════════════════════════════════════ */

.module-thumbnail {
  flex: 1; /* Use full flex for image area */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 20px;
  padding-top: 10px; /* Reduce padding to make more space for image */
  min-height: 0;
  position: relative;
  overflow: hidden;
  min-height: clamp(140px, 30%, 220px);
}

.placeholder-img {
  width: 100%;
  height: 100%;
  min-height: 60px;
  background: var(--surface-3);
  border-radius: 10px;
  transition: transform var(--duration) var(--ease-out);
}

/* Project 4 hover image */
.design-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  transform: translateY(6%);
  opacity: 0;
  transition:
    transform var(--duration-float) var(--ease-spring),
    opacity var(--duration) var(--ease-out);
  z-index: 3;
  pointer-events: none;
}

.module-project4:hover .design-image {
  transform: translateY(0);
  opacity: 1;
}

.module:hover .placeholder-img {
  transform: translateY(-4px) scale(1.01);
}

.module-thumbnail-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: scale(1);
  transition: transform var(--duration-float) var(--ease-spring);
}

.module-project2:hover .module-thumbnail-img {
  transform: translateY(-6px) scale(1.02);
}

.module-project4 .module-thumbnail-img {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: none;
  z-index: 2;
  transition:
    transform var(--duration) var(--ease-out),
    opacity var(--duration) var(--ease-out);
}

.module-project4:hover .module-thumbnail-img {
  transform: translateY(115%);
  opacity: 0;
}

.module-project4 .module-thumbnail {
  overflow: visible;
}

/* ═══════════════════════════════════════════
   Module Color Variations
   ═══════════════════════════════════════════ */

.module-project1 {
  background: #ffffff;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    background var(--duration) var(--ease-out);
}

.module-project1:hover {
  background: #9ea6ff;
}

.module-project1 .module-thumbnail {
  overflow: visible;
  align-items: stretch;
  justify-content: stretch;
  margin-top: 10px;
  margin-left: calc(-1 * var(--module-padding));
  margin-right: calc(-1 * var(--module-padding));
  margin-bottom: calc(-1 * var(--module-padding));
  padding-top: 0;
  width: calc(100% + 2 * var(--module-padding));
  min-height: clamp(168px, 36%, 252px);
}

.project1-thumbnail-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.project1-thumbnail-stage .module-thumbnail-img,
.project1-float {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  transition:
    transform var(--duration-float) var(--ease-spring),
    width var(--duration-float) var(--ease-spring),
    max-width var(--duration-float) var(--ease-spring),
    max-height var(--duration-float) var(--ease-spring);
}

/* Static: fig1 — cards bleed to module edges, clipped by card radius */
.project1-thumbnail-stage .module-thumbnail-img {
  left: 50%;
  top: 54%;
  z-index: 1;
  width: 80%;
  max-width: 80%;
  max-height: 92%;
  transform: translate(-50%, -50%) rotate(-3deg);
  transform-origin: center center;
}

.project1-float {
  opacity: 1;
  z-index: 2;
}

.project1-float-left {
  left: 0;
  top: 50%;
  width: 52%;
  max-height: 62%;
  transform: translate(-44%, -50%) rotate(-14deg);
  transform-origin: center center;
  z-index: 3;
}

.project1-float-top-right {
  right: 0;
  top: 0;
  width: 52%;
  max-height: 52%;
  transform: translate(30%, -22%) rotate(10deg);
  transform-origin: center center;
  z-index: 4;
}

.project1-float-bottom-right {
  right: 0;
  bottom: 0;
  width: 68%;
  max-height: 62%;
  transform: translate(34%, 30%) rotate(-7deg);
  transform-origin: center center;
  z-index: 3;
}

/* Hover: fig2 — center shrinks, satellites straighten and fit fully in frame */
.module-project1:hover .project1-thumbnail-stage .module-thumbnail-img {
  transform: translate(-50%, -50%) rotate(0deg);
  transition-delay: 0s;
}

.module-project1:hover .project1-float-left {
  width: 36%;
  max-height: 52%;
  transform: translate(6%, -50%) rotate(0deg);
  transition-delay: 0.06s;
}

.module-project1:hover .project1-float-top-right {
  width: 38%;
  max-height: 40%;
  transform: translate(-6%, 8%) rotate(0deg);
  transition-delay: 0.1s;
}

.module-project1:hover .project1-float-bottom-right {
  width: 46%;
  max-height: 48%;
  transform: translate(-8%, -6%) rotate(0deg);
  transition-delay: 0.14s;
}

/* Project 2 (YI CIRCLE): main dashboard bleeds to module edges, satellite shots float around */
.module-project2 .module-thumbnail {
  overflow: visible;
  align-items: stretch;
  justify-content: stretch;
  margin-top: 10px;
  margin-left: calc(-1 * var(--module-padding));
  margin-right: calc(-1 * var(--module-padding));
  margin-bottom: calc(-1 * var(--module-padding));
  padding-top: 0;
  width: calc(100% + 2 * var(--module-padding));
  min-height: clamp(168px, 36%, 252px);
}

.project2-thumbnail-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.project2-thumbnail-stage .module-thumbnail-img,
.project2-float {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  transition:
    transform var(--duration-float) var(--ease-spring),
    width var(--duration-float) var(--ease-spring),
    max-width var(--duration-float) var(--ease-spring),
    max-height var(--duration-float) var(--ease-spring);
}

/* Static: main image tilted, satellites scattered and partially out of frame */
.project2-thumbnail-stage .module-thumbnail-img {
  left: 50%;
  top: 54%;
  z-index: 1;
  width: 80%;
  max-width: 80%;
  max-height: 92%;
  transform: translate(-50%, -50%) rotate(-3deg);
  transform-origin: center center;
}

.project2-float {
  opacity: 1;
  z-index: 2;
}

.project2-float-left {
  left: 0;
  top: 50%;
  width: 38%;
  max-height: 26%;
  transform: translate(-32%, -50%) rotate(-14deg);
  transform-origin: center center;
  z-index: 3;
}

.project2-float-top-right {
  right: 0;
  top: 0;
  width: 46%;
  max-height: 32%;
  transform: translate(26%, -18%) rotate(10deg);
  transform-origin: center center;
  z-index: 4;
}

.project2-float-bottom-right {
  right: 0;
  bottom: 0;
  width: 72%;
  max-height: 42%;
  transform: translate(30%, 32%) rotate(-7deg);
  transform-origin: center center;
  z-index: 3;
}

/* Hover: main straightens, satellites straighten and fit fully in frame */
.module-project2:hover .project2-thumbnail-stage .module-thumbnail-img {
  transform: translate(-50%, -50%) rotate(0deg);
  transition-delay: 0s;
}

.module-project2:hover .project2-float-left {
  width: 28%;
  max-height: 20%;
  transform: translate(8%, -50%) rotate(0deg);
  transition-delay: 0.06s;
}

.module-project2:hover .project2-float-top-right {
  width: 34%;
  max-height: 26%;
  transform: translate(-8%, 12%) rotate(0deg);
  transition-delay: 0.1s;
}

.module-project2:hover .project2-float-bottom-right {
  width: 54%;
  max-height: 34%;
  transform: translate(-8%, -10%) rotate(0deg);
  transition-delay: 0.14s;
}

/* Project modules: unified default title size, full size on hover; desc appears on hover */
.module-project1 .module-title,
.module-project2 .module-title,
.module-project3 .module-title,
.module-project4 .module-title {
  font-size: 1.125rem;
  font-weight: 700;
  transition: font-size var(--duration) var(--ease-out);
}

.module-project2 .module-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: none;
}

.module-project1 .module-title-hover,
.module-project2 .module-title-hover {
  display: none;
}

.module-project1:hover .module-title-default,
.module-project2:hover .module-title-default {
  display: none;
}

.module-project1:hover .module-title-hover,
.module-project2:hover .module-title-hover {
  display: inline;
}

.module-title-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  object-fit: contain;
}

.module-project1:hover .module-title,
.module-project2:hover .module-title,
.module-project3:hover .module-title,
.module-project4:hover .module-title {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.module-project1 .module-desc,
.module-project2 .module-desc,
.module-project3 .module-desc,
.module-project4 .module-desc {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  line-height: 1.5;
  max-width: 28ch;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity var(--duration) var(--ease-out),
    max-height var(--duration) var(--ease-out);
}

.module-project1:hover .module-desc,
.module-project2:hover .module-desc,
.module-project3:hover .module-desc,
.module-project4:hover .module-desc {
  opacity: 1;
  max-height: 3rem;
  pointer-events: auto;
}

.module-project1 .module-desc {
  white-space: normal;
  max-width: none;
}

.module-project2 {
  background: #ffffff;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    background var(--duration) var(--ease-out);
}

.module-project2:hover {
  background: #64CAA8;
}

.module-project3 {
  background: #ffffff;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    background var(--duration) var(--ease-out);
}

.module-project3:hover {
  background: #96E99F;
}

.module-project3 .module-thumbnail {
  overflow: visible;
  align-items: stretch;
  justify-content: stretch;
  margin-top: 10px;
  margin-left: calc(-1 * var(--module-padding));
  margin-right: calc(-1 * var(--module-padding));
  margin-bottom: calc(-1 * var(--module-padding));
  padding-top: 0;
  width: calc(100% + 2 * var(--module-padding));
  min-height: clamp(140px, 32%, 200px);
}

.project3-thumbnail-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.project3-thumb-img {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 108%;
  max-width: 108%;
  max-height: 118%;
  object-fit: contain;
  object-position: left bottom;
  transform: translate(-14%, 10%) rotate(10deg);
  transform-origin: left bottom;
  transition: transform var(--duration-float) var(--ease-spring);
}

.project3-float-ui {
  position: absolute;
  left: 94%;
  top: 18%;
  z-index: 1;
  width: 54%;
  max-height: 28%;
  object-fit: contain;
  object-position: center center;
  opacity: 1;
  pointer-events: none;
  transform: translate(-50%, 0) rotate(14deg);
  transform-origin: center center;
  transition:
    left var(--duration-float) var(--ease-spring),
    top var(--duration-float) var(--ease-spring),
    width var(--duration-float) var(--ease-spring),
    max-height var(--duration-float) var(--ease-spring),
    transform var(--duration-float) var(--ease-spring);
}

/* Hover: hands scale up; UI grid enlarges and moves to top-center rest position */
.module-project3:hover .project3-thumb-img {
  transform: translate(-14%, 10%) rotate(10deg) scale(1.06);
}

.module-project3:hover .project3-float-ui {
  left: 50%;
  top: 2%;
  width: 68%;
  max-height: 34%;
  transform: translate(-50%, 0) rotate(0deg);
}

.module-project3 .module-title,
.module-project3 .module-desc {
  transition:
    font-size var(--duration) var(--ease-out),
    color var(--duration) var(--ease-out),
    opacity var(--duration) var(--ease-out),
    max-height var(--duration) var(--ease-out);
}

.module-project4 {
  background: #ffffff;
  transition:
    transform var(--duration) var(--ease-out),
    box-shadow var(--duration) var(--ease-out),
    background var(--duration) var(--ease-out);
}

.module-project4:hover {
  background: #FDF6AA;
}

.module-project2 .placeholder-img {
  opacity: 0.5;
}

/* Ensure text spacing is adequate for project 4 with larger image */
.module-project4 .module-inner {
  margin-bottom: -15px; /* Reduce space for text to allow larger image */
  flex-shrink: 0; /* Prevent text area from shrinking */
}

.module-project1 .module-title,
.module-project3 .module-title,
.module-project4 .module-title {
  white-space: nowrap;
}

/* Desktop height safety: prevent text/image collisions on short laptops */
@media (max-height: 860px) and (min-width: 901px) {
  .module {
    padding: clamp(20px, 2.2vw, 28px);
  }

  .module-title {
    font-size: clamp(1.2rem, 1.55vw, 1.7rem);
  }

  .module-project1 .module-title,
  .module-project2 .module-title,
  .module-project3 .module-title,
  .module-project4 .module-title {
    font-size: 1.0625rem;
  }

  .module-project1:hover .module-title,
  .module-project2:hover .module-title,
  .module-project3:hover .module-title,
  .module-project4:hover .module-title {
    font-size: clamp(1.2rem, 1.55vw, 1.7rem);
  }

  .module-desc {
    font-size: clamp(0.78rem, 0.85vw, 0.88rem);
  }

  .module-thumbnail {
    min-height: clamp(120px, 24%, 180px);
  }

  .intro-name {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: -12px;
  }

  .module-cta {
    font-size: 0.74rem;
  }
}

/* ═══════════════════════════════════════════
   Page Load Animation
   ═══════════════════════════════════════════ */

@keyframes moduleIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.module {
  animation: moduleIn 0.6s var(--ease-out) both;
}

.module-intro { animation-delay: 0ms; }
.module-project1 { animation-delay: 80ms; }
.module-project2 { animation-delay: 140ms; }
.module-project3 { animation-delay: 200ms; }
.module-project4 { animation-delay: 260ms; }

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  html, body {
    overflow: hidden;
  }

  .grid-container {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    height: 100vh;
    min-height: 100vh;
  }

  .intro-cell {
    grid-column: 1 / 3;
    grid-row: 1;
    min-height: 180px;
  }

  .module-project1 {
    grid-column: 1 / 3;
    grid-row: 2;
    min-height: 300px;
  }

  .module-project2 {
    grid-column: 1 / 3;
    grid-row: 3;
    min-height: 300px;
  }

  .module-project3 {
    grid-column: 1;
    grid-row: 4;
    min-height: 250px;
  }

  .module-project4 {
    grid-column: 2;
    grid-row: 4;
    min-height: 250px;
  }
}

@media (max-width: 600px) {
  :root {
    --gap: 8px;
    --radius: 12px;
    --module-padding: 20px;
  }

  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .intro-cell,
  .module-project1,
  .module-project2,
  .module-project3,
  .module-project4 {
    grid-column: 1;
    grid-row: auto;
    min-height: 220px;
  }
}

/* ═══════════════════════════════════════════
   PDF Modal
   ═══════════════════════════════════════════ */

.pdf-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.pdf-modal.active {
  display: flex;
}

.pdf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.pdf-modal-content {
  position: relative;
  width: 70vw;
  height: 85vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: var(--text-primary);
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 1;
}

.pdf-modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
}
