/* Pure Light Mode Academic Swiss Grid Design System */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Fully flat, no rounded corners */
}

:root {
  --bg-canvas: #eae7e1;
  --bg-frame: #f4f3ee;
  --bg-alt: #ecebe5;
  --fg-main: #111111;
  --fg-muted: #111111;
  --border-line: #111111;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
  --font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background-color: var(--bg-canvas);
  color: var(--fg-main);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--fg-main);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  background-color: var(--fg-main);
  color: var(--bg-frame);
  text-decoration: none;
}

/* Page Outer Bounded Canvas */
.page-canvas {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Grid Frame Matrix */
.grid-frame {
  background-color: var(--bg-frame);
  border: 1px solid var(--border-line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.grid-row {
  border-bottom: 1px solid var(--border-line);
  position: relative;
}

.grid-row:last-child {
  border-bottom: none;
}

/* Clean Streamlined Profile Hero Section */
.academic-hero-grid {
  display: block;
  padding: 2.5rem 2.2rem;
  background-color: var(--bg-frame);
}

.hero-name {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.contact-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.2rem;
  font-size: 0.92rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--border-line);
}

.contact-item strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--fg-main);
  margin-right: 0.3rem;
}

/* Avatar Box */
.avatar-box {
  width: 100%;
  height: 220px;
  border: 1px solid var(--border-line);
  background-color: var(--bg-alt);
  position: relative;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Section Header Rows */
.section-header-row {
  padding: 0.75rem 1.8rem;
  background-color: var(--fg-main);
  color: var(--bg-frame);
}

.section-title-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Education Matrix Row (Flat 3-Column Swiss Grid Layout) */
.edu-matrix-row {
  display: grid;
  grid-template-columns: max-content 1fr 1fr;
  background-color: var(--bg-frame);
}

.edu-col {
  padding: 1.8rem 2.2rem;
  border-right: 1px solid var(--border-line);
}

.edu-col:last-child {
  border-right: none;
}

.edu-col-info {
  white-space: nowrap;
}

.edu-school-name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--fg-main);
  margin-bottom: 0.35rem;
  line-height: 1.2;
}

.edu-major-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg-main);
  line-height: 1.4;
}

.edu-time-val {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg-main);
  margin-top: 0.5rem;
}

.edu-col-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--fg-main);
}

.edu-col-text {
  font-size: 0.92rem;
  color: var(--fg-main);
  line-height: 1.6;
}

/* Project Item Rows (Desktop: Index | Content | Right Edge-to-Edge 16:9 Media Cell) */
.project-item-row {
  display: grid;
  grid-template-columns: 56px 1fr 520px;
  background-color: var(--bg-frame);
  align-items: stretch;
}

.project-item-row.no-media-row {
  grid-template-columns: 56px 1fr;
}

.project-item-row.no-media-row .project-content {
  border-right: none;
}

.project-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--fg-main);
  border-right: 1px solid var(--border-line);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.6rem;
}

.project-content {
  padding: 1.6rem 2rem;
  border-right: 1px solid var(--border-line);
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
}

/* Project Meta Line */
.project-meta-line {
  font-size: 0.93rem;
  color: var(--fg-main);
  font-weight: 500;
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

/* Bullet Lists */
.bullet-list {
  padding-left: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fg-main);
  margin-bottom: 0.9rem;
}

.bullet-list li {
  margin-bottom: 0.35rem;
}

.bullet-list li:last-child {
  margin-bottom: 0;
}

/* Inline Tech Keywords */
.tech-inline {
  font-size: 0.88rem;
  color: var(--fg-main);
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-line);
}

.tech-label {
  font-weight: 700;
  color: var(--fg-main);
}

/* Right Column Media Carousel Cell (Edge-to-Edge 16:9 Grid Cell - NO Inner Nested Box) */
.project-media-col {
  background-color: var(--bg-frame);
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: start; /* Compact height pinned directly under image! */
  overflow: hidden;
  padding: 0; /* Direct edge-to-edge! */
}

.carousel-track {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Architectural Matrix Grid Texture Variations for Empty / Experience Cells */
.media-fallback-clean,
.texture-dot-matrix {
  display: flex;
  width: 100%;
  height: 100%;
  background-color: #faf9f6;
  background-image: 
    radial-gradient(#111111 0.75px, transparent 0.75px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.025) 0, rgba(0, 0, 0, 0.025) 1px, transparent 0, transparent 8px);
  background-size: 16px 16px, 16px 16px;
}

.texture-hatch-matrix {
  background-color: #faf9f6;
  background-image: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 0, rgba(0, 0, 0, 0.04) 1px, transparent 0, transparent 10px);
}

.texture-cross-matrix {
  background-color: #faf9f6;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Pure Texture Decorator Column for Experience Items (Floats to 100% text height) */
.exp-texture-col {
  border-left: 1px solid var(--border-line);
  background-color: #faf9f6;
  width: 100%;
  height: 100%;
  min-height: 100%;
  position: relative;
  overflow: hidden;
}

/* Hide fallback box by default if image tag is present before it */
.carousel-slide img + .media-fallback-clean,
.avatar-box img + .media-fallback-clean {
  display: none;
}

/* Mini Thumbnail Gallery Strip */
.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem 0.8rem;
  background-color: var(--bg-frame);
  border-top: 1px solid var(--border-line);
}

.thumb-item {
  position: relative;
  width: 58px;
  height: 36px;
  border: 1px solid var(--border-line);
  background-color: var(--bg-alt);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  border-radius: 0 !important;
}

.thumb-item:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.thumb-item.active {
  opacity: 1;
  border: 2px solid var(--fg-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--fg-main);
  background-color: #faf9f6;
  background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.04) 0, rgba(0, 0, 0, 0.04) 1px, transparent 0, transparent 6px);
}

.thumb-item img + .thumb-fallback {
  display: none;
}


/* Skills Matrix Row */
.skills-matrix-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--bg-frame);
}

.skill-col {
  padding: 1.8rem 2.2rem;
  border-right: 1px solid var(--border-line);
}

.skill-col:last-child {
  border-right: none;
}

.skill-col-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.skill-text {
  font-size: 0.92rem;
  color: var(--fg-main);
  line-height: 1.6;
}

/* Footer Row */
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2.2rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  background-color: var(--bg-frame);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.footer-left .divider {
  color: var(--fg-main);
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  color: var(--fg-main);
  text-decoration: none;
}

.footer-right a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 980px) {
  .academic-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  .hero-avatar-col {
    max-width: 180px;
  }
  .project-item-row {
    grid-template-columns: 50px 1fr;
  }
  .project-num {
    display: flex;
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-top: 1.5rem;
    font-size: 1.1rem;
    border-right: 1px solid var(--border-line);
  }
  .project-content {
    grid-column: 2;
    grid-row: 1;
    padding: 1.5rem 1.2rem;
    border-right: none;
  }
  .project-media-col {
    grid-column: 2;
    grid-row: 2;
    border-left: none;
    border-top: 1px solid var(--border-line);
  }
  .exp-texture-col {
    display: none !important;
  }
  .edu-matrix-row {
    grid-template-columns: 1fr;
  }
  .edu-col {
    border-right: none;
    border-bottom: 1px solid var(--border-line);
    padding: 1.2rem 1.5rem;
  }
  .edu-col:last-child {
    border-bottom: none;
  }
  .edu-col-info {
    white-space: normal;
  }
  .skills-matrix-row {
    grid-template-columns: 1fr;
  }
  .skill-col {
    padding: 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border-line);
  }
  .skill-col:last-child {
    border-bottom: none;
  }
  .footer-row {
    padding: 1.2rem 1.5rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
}

@media (max-width: 480px) {
  .page-canvas {
    padding: 1rem 0.5rem;
  }
  .project-item-row {
    grid-template-columns: 42px 1fr;
  }
  .project-num {
    font-size: 1rem;
    padding-top: 1.2rem;
  }
  .project-content {
    padding: 1.2rem 0.8rem;
  }
  .bullet-list {
    padding-left: 1rem;
  }
}

/* Wide Screen Display Optimization (2K / 4K / Ultra-wide monitors) */
@media (min-width: 1600px) {
  .page-canvas {
    max-width: 1560px;
    padding: 3rem 2rem;
  }
  .project-item-row {
    grid-template-columns: 60px 1fr 580px;
  }
  .project-item-row.no-media-row {
    grid-template-columns: 60px 1fr;
  }
  .project-content {
    padding: 2rem 2.5rem;
  }
  .thumb-item {
    width: 62px;
    height: 38px;
  }
}
