/* ==========================================================================
   Lee Jung-Hoon Portfolio Stylesheet
   Modern, Clean, Responsive & Printable Developer Portfolio
   ========================================================================== */

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #eff6ff;
  --primary-glow: rgba(29, 78, 216, 0.10);
  
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  
  --border: #e2e8f0;
  --border-card: #cbd5e1;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --card-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 6px 12px -2px rgba(15, 23, 42, 0.04);
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* ==========================================================================
   Featured case study — Logistics Center Shipping Intelligence AX
   Two visual-first sheets on screen and exactly two A4 pages when printed.
   ========================================================================== */

.featured-case-study {
  padding: 0;
  overflow: hidden;
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: 0 20px 50px -28px rgba(29, 78, 216, 0.5);
}

.featured-sheet {
  position: relative;
  padding: 34px;
  background:
    radial-gradient(circle at 100% 0, rgba(37, 99, 235, 0.11), transparent 34%),
    linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.featured-sheet + .featured-sheet {
  border-top: 1px solid #bfdbfe;
}

.featured-sheet-kicker,
.featured-role,
.featured-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.featured-label,
.featured-media-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.featured-label {
  padding: 6px 11px;
}

.featured-page-index {
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.featured-title {
  margin: 14px 0 8px;
  color: var(--slate-900);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.045em;
}

.featured-title span {
  color: var(--primary);
  font-weight: 650;
}

.featured-lead {
  max-width: 880px;
  color: var(--slate-600);
  font-size: 17px;
  line-height: 1.65;
}

.featured-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 16px;
}

.featured-stat {
  min-height: 94px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.featured-stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}

.featured-stat span {
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 700;
}

.featured-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.featured-tags span {
  padding: 5px 9px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1e40af;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 750;
}

.featured-role {
  margin: 14px 0 22px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: var(--slate-700);
  background: #eff6ff;
  font-size: 13px;
}

.featured-role strong {
  flex: 0 0 auto;
  color: var(--slate-900);
}

.featured-story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 22px;
  align-items: stretch;
}

.featured-story-copy,
.featured-detail-points {
  display: grid;
  gap: 12px;
}

.case-point {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.case-point > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--slate-900);
  font-size: 12px;
  font-weight: 850;
}

.case-point h4 {
  margin-bottom: 4px;
  color: var(--slate-900);
  font-size: 15px;
}

.case-point p {
  color: var(--slate-600);
  font-size: 13px;
  line-height: 1.55;
}

.featured-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.featured-media {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px -18px rgba(15, 23, 42, 0.5);
}

.featured-media-wide {
  grid-column: 1 / -1;
}

.featured-media-label {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(8px);
}

.featured-video-slot,
.featured-photo-slot {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.3), transparent 48%),
    #0f172a;
}

.featured-video-slot iframe,
.featured-photo-slot img {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
}

.featured-photo-slot img {
  object-fit: contain;
}

.featured-video-slot iframe {
  position: absolute;
  inset: 0;
}

.featured-video-slot:has(iframe[src^="https://www.youtube.com/embed/"]) iframe,
.featured-photo-slot:has(img[src]) img {
  display: block;
}

.featured-video-slot:has(iframe[src^="https://www.youtube.com/embed/"]) .media-slot-empty,
.featured-photo-slot:has(img[src]) .media-slot-empty {
  display: none;
}

.media-slot-empty {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  color: #dbeafe;
  text-align: center;
}

.media-slot-empty strong {
  font-size: 15px;
  letter-spacing: 0.06em;
}

.media-slot-empty code {
  padding: 5px 8px;
  border: 1px dashed rgba(191, 219, 254, 0.5);
  border-radius: 6px;
  color: #bfdbfe;
  font-family: inherit;
  font-size: 11px;
}

.featured-media figcaption {
  min-height: 58px;
  padding: 12px 14px;
  color: var(--slate-600);
  font-size: 12px;
  line-height: 1.45;
}

.featured-media figcaption strong {
  color: var(--slate-900);
}

.featured-detail-heading {
  margin: 14px 0 18px;
}

.featured-detail-heading h3 {
  color: var(--slate-900);
  font-size: 28px;
  letter-spacing: -0.035em;
}

.featured-detail-heading p {
  max-width: 480px;
  color: var(--slate-600);
  font-size: 13px;
  text-align: right;
}

.featured-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.featured-flow > div {
  position: relative;
  min-height: 88px;
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #0f172a, #1e3a8a);
}

.featured-flow > div:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}

.featured-flow span {
  display: block;
  margin-bottom: 6px;
  color: #93c5fd;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.featured-flow strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.featured-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
}

.featured-validation {
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.featured-validation h4 {
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 15px;
}

.featured-validation ul {
  padding-left: 18px;
  color: var(--slate-700);
  font-size: 13px;
  line-height: 1.65;
}

@media (max-width: 960px) {
  .featured-stat-grid,
  .featured-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured-story-grid,
  .featured-detail-grid {
    grid-template-columns: 1fr;
  }

  .featured-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .featured-detail-heading p {
    text-align: left;
  }

  .featured-flow > div:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .featured-sheet {
    padding: 24px 18px;
  }

  .featured-stat-grid,
  .featured-media-grid {
    grid-template-columns: 1fr;
  }

  .featured-media-wide {
    grid-column: auto;
  }

  .featured-role {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  #projects > .section-header {
    display: none !important;
  }

  .featured-case-study,
  #projects > .project-card:first-of-type.featured-case-study {
    display: block !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    break-before: auto;
    page-break-before: auto;
  }

  .featured-case-study .featured-sheet {
    width: 100%;
    height: 257mm;
    padding: 7mm !important;
    overflow: hidden;
    border: 0.25mm solid #bfdbfe;
    border-radius: 2mm;
    box-sizing: border-box;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .featured-case-study .featured-sheet + .featured-sheet {
    border-top: 0.25mm solid #bfdbfe;
    break-before: page;
    page-break-before: always;
  }

  .featured-sheet-kicker {
    gap: 3mm;
  }

  .featured-label {
    padding: 1.3mm 2.4mm;
    font-size: 7pt;
  }

  .featured-page-index {
    font-size: 7pt;
  }

  .featured-title {
    margin: 3mm 0 1.5mm;
    font-size: 19pt;
    line-height: 1.12;
  }

  .featured-lead {
    font-size: 8.3pt;
    line-height: 1.45;
  }

  .featured-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2.3mm;
    margin: 4mm 0 3mm;
  }

  .featured-stat {
    min-height: 17mm;
    padding: 2.5mm;
    border-radius: 2mm;
  }

  .featured-stat strong {
    margin-bottom: 1mm;
    font-size: 14pt;
  }

  .featured-stat span,
  .featured-tags span {
    font-size: 6.5pt;
  }

  .featured-tags {
    gap: 1.2mm;
  }

  .featured-tags span {
    padding: 1mm 1.8mm;
  }

  .featured-role {
    margin: 3mm 0 4mm;
    padding: 2.3mm 3mm;
    font-size: 7.4pt;
  }

  .featured-story-grid {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: 4mm;
  }

  .featured-story-copy,
  .featured-detail-points,
  .featured-media-grid {
    gap: 2.4mm;
  }

  .case-point {
    grid-template-columns: 7mm 1fr;
    gap: 2mm;
    padding: 2.7mm;
    border-radius: 2mm;
  }

  .case-point > span {
    width: 7mm;
    height: 7mm;
    font-size: 6.5pt;
  }

  .case-point h4 {
    margin-bottom: 0.7mm;
    font-size: 8pt;
  }

  .case-point p {
    font-size: 7pt;
    line-height: 1.4;
  }

  .featured-media {
    border-radius: 2mm;
    box-shadow: 0 2mm 5mm rgba(15, 23, 42, 0.09);
  }

  .featured-media-label {
    top: 2mm;
    left: 2mm;
    padding: 1mm 1.7mm;
    font-size: 6.2pt;
  }

  .featured-video-slot,
  .featured-photo-slot {
    aspect-ratio: 16 / 8.4;
  }

  .featured-video-slot iframe {
    display: none !important;
  }

  .featured-video-slot .youtube-print-card {
    display: flex !important;
    position: absolute;
    inset: 0;
  }

  .media-slot-empty {
    gap: 1.5mm;
    padding: 3mm;
  }

  .media-slot-empty strong {
    font-size: 8pt;
  }

  .media-slot-empty code {
    padding: 1mm 1.5mm;
    font-size: 6.3pt;
  }

  .featured-media figcaption {
    min-height: 9mm;
    padding: 2mm 2.5mm;
    font-size: 6.8pt;
    line-height: 1.35;
  }

  .featured-detail-heading {
    margin: 3mm 0;
  }

  .featured-detail-heading h3 {
    font-size: 16pt;
  }

  .featured-detail-heading p {
    max-width: 92mm;
    font-size: 7.2pt;
  }

  .featured-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2mm;
    margin-bottom: 3mm;
  }

  .featured-flow > div {
    min-height: 15mm;
    padding: 2.2mm;
    border-radius: 2mm;
  }

  .featured-flow > div:not(:last-child)::after {
    right: -3mm;
    font-size: 11pt;
  }

  .featured-flow span {
    margin-bottom: 0.8mm;
    font-size: 5.8pt;
  }

  .featured-flow strong {
    font-size: 7.2pt;
  }

  .featured-detail-grid {
    grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
    gap: 4mm;
  }

  .featured-validation {
    padding: 2.8mm;
    border-radius: 2mm;
  }

  .featured-validation h4 {
    margin-bottom: 1mm;
    font-size: 8pt;
  }

  .featured-validation ul {
    padding-left: 3.5mm;
    font-size: 6.8pt;
    line-height: 1.45;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  line-height: 1.7;
  color: var(--slate-800);
  background-color: var(--slate-50);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

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

/* Floating Navigation Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 68px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: var(--slate-900);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.5px;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
  color: var(--slate-900);
  letter-spacing: -0.02em;
}

.brand-role {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-600);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-100);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.btn-github:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: var(--primary-dark);
}

/* Main Container */
.main-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* Common Section Layout */
.section {
  margin-bottom: 56px;
}

.section-header {
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 15px;
  color: var(--slate-600);
  max-width: 780px;
}

/* ==========================================================================
   Hero & Profile Card (Section 1)
   ========================================================================== */
.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--card-shadow);
}

.hero-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.hero-title {
  font-size: 27px;
  font-weight: 850;
  line-height: 1.4;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  margin: 8px 0 10px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--slate-500);
  font-style: italic;
  margin-bottom: 18px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.tag.primary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(29, 78, 216, 0.2);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

.bio-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bio-heading {
  font-size: 18px;
  font-weight: 750;
  color: var(--slate-900);
  margin-bottom: 10px;
}

.bio-text {
  font-size: 15px;
  color: var(--slate-700);
  line-height: 1.75;
  margin-bottom: 14px;
}

/* Compact Strength Cards */
.bio-strengths-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.strength-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.strength-card:hover {
  border-color: var(--primary);
}

.strength-icon-box {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.strength-content strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 2px;
}

.strength-content p {
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.5;
  margin: 0;
}

/* Contact & Sidebar Box */
.contact-box {
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.profile-photo-wrapper {
  width: 104px;
  height: 134px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2.5px solid var(--slate-200);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
  flex-shrink: 0;
  background: #f1f5f9;
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.profile-photo-wrapper:hover .profile-photo {
  transform: scale(1.03);
}

.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-name-en {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-400);
  letter-spacing: 0;
  margin-left: 4px;
}

.profile-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
  line-height: 1.3;
}

.profile-univ {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  line-height: 1.3;
}

.profile-major {
  font-size: 11.5px;
  color: var(--slate-500);
  line-height: 1.3;
}

.profile-badge-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 5px;
  align-self: flex-start;
}

.contact-list {
  list-style: none;
  font-size: 13px;
  margin-bottom: 14px;
}

.contact-list li {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
}

.contact-list li:last-child {
  border-bottom: none;
}

.contact-list strong {
  color: var(--slate-500);
  font-weight: 600;
}

.contact-list span, .contact-list a {
  color: var(--slate-800);
  font-weight: 600;
  text-align: right;
}

.contact-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* GPA & Academic Honors Card */
.gpa-card {
  background: linear-gradient(135deg, #f8faff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 14px;
  box-shadow: 0 3px 12px rgba(29, 78, 216, 0.05);
  transition: all 0.2s ease;
}

.gpa-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.12);
  transform: translateY(-1px);
}

.gpa-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.gpa-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gpa-badge {
  font-size: 12px;
  font-weight: 800;
  color: #1e40af;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gpa-sub-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
}

.gpa-score-wrap {
  text-align: right;
}

.gpa-score {
  font-size: 25px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.gpa-max {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-400);
  margin-left: 2px;
}

.gpa-progress-bar {
  width: 100%;
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.gpa-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.8s ease-in-out;
}

.gpa-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

.gpa-tag {
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

.gpa-tag-sub {
  color: var(--slate-500);
  font-size: 11px;
}

/* ==========================================================================
   Tech Icon Styles (Inline SVG)
   ========================================================================== */
.tech-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  flex-shrink: 0;
}

.tech-icon svg {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Skills Grid (Section 2)
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--card-shadow-hover);
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.skill-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.skill-icon-wrap .tech-icon {
  width: 22px;
  height: 22px;
}

.skill-category {
  font-size: 16px;
  font-weight: 750;
  color: var(--slate-900);
}

.skill-sub {
  display: block;
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 500;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--border);
}

.skill-desc-easy {
  font-size: 13.5px;
  color: var(--slate-600);
  line-height: 1.6;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin: 0;
}

/* ==========================================================================
   Selected Projects (Section 3)
   ========================================================================== */
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 32px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.project-card:hover {
  box-shadow: var(--card-shadow-hover);
}

.project-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-badge-num {
  font-size: 13px;
  font-weight: 800;
  background: var(--slate-900);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.project-period {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-600);
}

.project-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

.metric-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(29, 78, 216, 0.15);
}

.project-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.project-lead {
  font-size: 15px;
  color: var(--slate-600);
  line-height: 1.6;
  margin-bottom: 16px;
}

.project-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 22px;
}

.project-role-badge span {
  font-weight: 700;
  color: var(--primary);
}

.project-role-badge strong {
  color: var(--slate-800);
  font-weight: 600;
}

.project-content-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.points-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.point-item-easy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.point-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.point-item-easy h4 {
  font-size: 15px;
  font-weight: 750;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.point-item-easy p {
  font-size: 13.5px;
  color: var(--slate-600);
  line-height: 1.65;
  margin: 0;
}

/* Modern Media Boxes */
.project-media-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.media-box-modern {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.media-badge-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.media-box-modern video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  object-fit: contain;
  background: #000;
}

.media-box-modern img {
  width: 100%;
  display: block;
  object-fit: contain;
  background: #f8fafc;
  max-height: 260px;
  padding: 6px;
}


.youtube-print-card {
  display: none;
}

.media-caption {
  font-size: 12px;
  color: var(--slate-700);
  background: #ffffff;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

.media-caption strong {
  color: var(--slate-900);
}

.hw-summary-box {
  padding: 18px 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-spec-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

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

.hw-spec-row span {
  color: var(--slate-500);
  font-weight: 600;
}

.hw-spec-row strong {
  color: var(--slate-900);
  font-weight: 700;
  text-align: right;
}

/* ==========================================================================
   Experience & Education (Section 4 & 5)
   ========================================================================== */
.experience-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.exp-company {
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-900);
}

.exp-dept {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.exp-period {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
}

.exp-desc {
  font-size: 14.5px;
  color: var(--slate-700);
  line-height: 1.7;
  margin-bottom: 20px;
}

.exp-achievements {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.achieve-item {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achieve-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.achieve-item strong {
  font-size: 13.5px;
  color: var(--slate-900);
  line-height: 1.4;
}

.achieve-item p {
  font-size: 12.5px;
  color: var(--slate-600);
  line-height: 1.55;
  margin: 0;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
}

.edu-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.edu-item {
  margin-bottom: 18px;
}

.edu-item:last-child {
  margin-bottom: 0;
}

.edu-item strong {
  display: block;
  font-size: 14px;
  color: var(--slate-900);
  margin-bottom: 2px;
}

.edu-sub {
  display: block;
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.edu-meta {
  font-size: 12.5px;
  color: var(--slate-600);
  line-height: 1.5;
  margin: 0;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--slate-500);
  line-height: 1.7;
}

/* ==========================================================================
   Responsive & Print Styles
   ========================================================================== */
@media (max-width: 960px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .project-content-grid {
    grid-template-columns: 1fr;
  }
  .exp-achievements {
    grid-template-columns: 1fr;
  }
  .edu-grid {
    grid-template-columns: 1fr;
  }
  .nav-menu {
    display: none;
  }
}

/* Official C Language Icon */
.tech-icon-c {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 18px;
  vertical-align: -3px;
  flex-shrink: 0;
  margin-right: 5px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.12));
}

/* ==========================================================================
   Tech Stack Badge Table (GitHub Profile Decoration Style)
   ========================================================================== */
.tech-table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 28px;
}

.tech-stack-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.tech-stack-table thead {
  background: var(--slate-100);
  border-bottom: 1px solid var(--border);
}

.tech-stack-table th {
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--slate-800);
  letter-spacing: -0.01em;
}

.th-cat {
  width: 220px;
}

.tech-stack-table td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tech-stack-table tr:last-child td {
  border-bottom: none;
}

.tech-stack-table tr:hover {
  background-color: #fafbfc;
}

.td-cat {
  width: 220px;
  font-size: 13.5px;
  color: var(--slate-900);
  white-space: nowrap;
}

.td-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge-img {
  height: 28px;
  border-radius: 4px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-block;
  vertical-align: middle;
}

.badge-img:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
  .tech-stack-table, .tech-stack-table tbody, .tech-stack-table tr, .tech-stack-table td {
    display: block;
    width: 100%;
  }
  .tech-stack-table thead {
    display: none;
  }
  .td-cat {
    padding-bottom: 6px;
    background: var(--slate-50);
  }
  .td-tech {
    padding-top: 6px;
    border-bottom: 1px solid var(--border);
  }
}


/* -------------------------------------------------------------
   Scroll Margin & Smooth Scrolling for Project Jump Links
------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

.section,
.project-card,
article[id],
section[id] {
  scroll-margin-top: 86px;
}

/* -------------------------------------------------------------
   Navbar Dropdown Menu for Projects
------------------------------------------------------------- */
.nav-dropdown-wrapper {
  position: relative;
}

.dropdown-caret {
  font-size: 10px;
  margin-left: 2px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.nav-dropdown-wrapper button { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.nav-dropdown-wrapper button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.nav-dropdown-wrapper button[aria-expanded="true"] .dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: fixed;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  min-width: 250px;
  padding: 8px;
  list-style: none;
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  z-index: 1200;
}

.nav-dropdown-menu[hidden] { display: none; }

.nav-dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-dropdown-menu li a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.drop-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 6px;
  border-radius: 4px;
}

/* -------------------------------------------------------------
   Project Quick Navigation Pill Bar (Section 3)
------------------------------------------------------------- */
.project-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 24px;
}

.proj-nav-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.proj-nav-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(29, 78, 216, 0.1);
  background: #f8faff;
}

.pill-badge {
  background: #eff6ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #bfdbfe;
  flex-shrink: 0;
}

.pill-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-to-top {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 88px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgb(15 23 42 / 18%);
}

.back-to-top:hover {
  background: var(--slate-900);
  border-color: var(--slate-900);
  color: #fff;
}

.back-to-top:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* -------------------------------------------------------------
   Career Experience Company Brand Header & Logo
------------------------------------------------------------- */
.exp-company-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.exp-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  height: 52px;
  text-decoration: none;
}

.exp-logo-link:hover {
  border-color: #e52528;
  box-shadow: 0 4px 14px rgba(229, 37, 40, 0.16);
  transform: translateY(-1px);
}

.exp-company-logo {
  max-height: 38px;
  max-width: 150px;
  object-fit: contain;
  display: block;
}

.exp-company-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exp-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.company-link {
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-900);
  text-decoration: none;
  transition: color 0.15s ease;
}

.company-link:hover {
  color: var(--primary);
}

.exp-website-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #e52528;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 999px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.exp-website-badge:hover {
  background: #e52528;
  color: #ffffff;
  border-color: #e52528;
}

.exp-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exp-company-sub {
  font-size: 12px;
  color: var(--slate-500);
  font-weight: 500;
}

.exp-inline-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.exp-inline-link:hover {
  color: var(--primary-hover);
}

@media (max-width: 640px) {
  .project-quick-nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .exp-company-group {
    gap: 12px;
  }
}


/* -------------------------------------------------------------
   Centered Contact Header & Large Profile Photo (2x scale)
------------------------------------------------------------- */
.contact-header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.profile-photo-wrapper-lg {
  width: 180px;
  height: 232px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 0 0 1px var(--border);
  flex-shrink: 0;
  background: #f1f5f9;
  margin-bottom: 14px;
}

.profile-photo-wrapper-lg .profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.profile-photo-wrapper-lg:hover .profile-photo {
  transform: scale(1.03);
}

.profile-header-info-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.profile-header-info-centered .profile-name {
  font-size: 22px;
  font-weight: 850;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-header-info-centered .profile-name-en {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-400);
  margin-left: 4px;
}

.profile-header-info-centered .profile-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 3px;
  margin-bottom: 2px;
}

.profile-header-info-centered .profile-univ {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-600);
}

@media (max-width: 960px) {
  .edu-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   A4 Print / PDF Layout
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  html,
  body {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 9pt;
    line-height: 1.42;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html {
    scroll-behavior: auto;
  }

  .navbar,
  .footer,
  .project-quick-nav,
  .back-to-top {
    display: none !important;
  }

  .main-wrapper {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .section {
    margin: 0 0 6mm !important;
  }

  /* Keep the dense skills overview together on its own A4 page. */
  #skills {
    zoom: 0.82;
  }

  #skills,
  #projects,
  #experience {
    break-before: page;
    page-break-before: always;
  }

  .section-header {
    margin-bottom: 4mm !important;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .eyebrow {
    font-size: 7.5pt;
    margin-bottom: 1mm;
  }

  .section-title {
    font-size: 17pt;
    margin-bottom: 1mm;
  }

  .section-desc,
  .hero-subtitle,
  .bio-text,
  .project-lead,
  .exp-desc {
    font-size: 9pt;
    line-height: 1.45;
  }

  .hero-card,
  .tech-table-card,
  .skill-card,
  .project-card,
  .experience-card,
  .edu-card {
    box-shadow: none !important;
    border: 0.25mm solid #cbd5e1 !important;
    border-radius: 2mm !important;
  }

  .hero-card {
    padding: 6mm !important;
  }

  .hero-header {
    padding-bottom: 3mm !important;
    margin-bottom: 4mm !important;
  }

  .hero-title {
    font-size: 18pt;
    line-height: 1.3;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr) 70mm !important;
    gap: 6mm !important;
  }

  .profile-photo-wrapper-lg {
    width: 31mm;
    height: 40mm;
    margin-bottom: 2.5mm;
  }

  .contact-box {
    padding: 4.5mm !important;
  }

  .contact-header-centered {
    padding-bottom: 3mm !important;
    margin-bottom: 2mm !important;
  }

  .profile-header-info-centered .profile-name {
    font-size: 16pt !important;
  }

  .profile-header-info-centered .profile-title {
    font-size: 9.5pt !important;
    line-height: 1.25 !important;
  }

  .profile-header-info-centered .profile-univ {
    font-size: 8.5pt !important;
  }

  .contact-list {
    font-size: 8.2pt !important;
    margin-bottom: 2.5mm !important;
  }

  .contact-list li {
    display: grid !important;
    grid-template-columns: 17mm minmax(0, 1fr);
    gap: 2mm;
    align-items: start;
    padding: 1.8mm 0 !important;
  }

  .contact-list strong {
    white-space: nowrap;
  }

  .contact-list span,
  .contact-list a {
    text-align: left !important;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .gpa-card {
    padding: 3mm !important;
    margin-top: 2.5mm !important;
  }

  .gpa-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1mm;
    font-size: 7.5pt;
  }

  .gpa-tag-sub {
    font-size: 7.2pt;
  }

  .strength-card {
    padding: 3mm !important;
    gap: 3mm !important;
  }

  .tag-cloud {
    gap: 1.5mm !important;
  }

  .tag,
  .skill-tag,
  .metric-badge {
    font-size: 7.5pt !important;
    padding: 1mm 2.2mm !important;
  }

  .tech-stack-table th,
  .tech-stack-table td {
    padding: 2.2mm 3mm !important;
  }

  .tech-stack-table,
  .tech-stack-table tbody,
  .tech-stack-table tr {
    display: table !important;
    width: 100% !important;
  }

  .tech-stack-table thead {
    display: table-header-group !important;
  }

  .tech-stack-table tr {
    display: table-row !important;
  }

  .tech-stack-table td,
  .tech-stack-table th {
    display: table-cell !important;
    width: auto !important;
  }

  .td-tech {
    display: flex !important;
  }

  .badge-img {
    height: 5.5mm;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 3mm !important;
  }

  .skill-card {
    padding: 4mm !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .project-card {
    margin: 0 !important;
    min-height: 255mm;
    padding: 7mm !important;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #ffffff 0%, #ffffff 72%, #f8fbff 100%) !important;
    break-before: page;
    page-break-before: always;
    break-inside: auto;
    page-break-inside: auto;
  }

  #projects > .project-card:first-of-type {
    min-height: 235mm;
    break-before: auto;
    page-break-before: auto;
  }

  .project-topbar {
    gap: 2mm !important;
    margin-bottom: 3mm !important;
  }

  .project-meta,
  .metric-strip {
    flex-wrap: wrap;
    gap: 1.5mm !important;
  }

  .project-title {
    font-size: 16.5pt;
    margin-bottom: 2mm;
  }

  .project-lead {
    margin-bottom: 3mm;
  }

  .project-role-badge {
    display: flex;
    margin-bottom: 4mm !important;
    padding: 2mm 3mm !important;
    font-size: 8pt;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .project-content-grid {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr) !important;
    gap: 6mm !important;
    flex: 1;
    align-items: stretch;
  }

  .points-list {
    display: grid !important;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 4mm !important;
  }

  .point-item-easy {
    gap: 3mm !important;
    height: 100%;
    padding: 3.5mm !important;
    background: #f8fbff !important;
    border-left: 0.8mm solid #dbeafe !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .point-item-easy h4 {
    font-size: 9.2pt;
    margin-bottom: 1mm;
  }

  .point-item-easy p,
  .media-caption,
  .hw-spec-row,
  .edu-meta {
    font-size: 8pt !important;
    line-height: 1.4 !important;
  }

  .media-box-modern {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .project-media-col {
    gap: 4mm !important;
    justify-content: space-between;
    position: relative;
    padding: 3mm;
    background: linear-gradient(145deg, #eff6ff, #f8fafc);
    border: 0.25mm solid #dbeafe;
    border-radius: 3mm;
  }

  .project-media-col::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -2.5mm;
    width: 0.25mm;
    background: #dbeafe;
  }

  .project-media-col .media-box-modern {
    width: 100%;
    border-color: #bfdbfe !important;
    box-shadow: 0 2.5mm 6mm rgba(15, 23, 42, 0.10) !important;
  }

  .media-box-modern:has(iframe) {
    display: block !important;
  }

  .media-box-modern iframe {
    display: none !important;
  }

  .media-box-modern > div[style*="padding-bottom"] {
    position: relative !important;
    width: 100% !important;
    padding-bottom: 56.25% !important;
    height: 0 !important;
    background: #0f172a;
  }

  .youtube-print-card {
    display: flex !important;
    position: absolute;
    inset: 0;
    align-items: flex-end;
    overflow: hidden;
    color: #ffffff !important;
    background: #0f172a;
  }

  .youtube-print-card img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    object-fit: cover !important;
    aspect-ratio: auto;
  }

  .youtube-print-card span {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 2.5mm 3mm;
    font-size: 8pt;
    font-weight: 750;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.92));
  }

  .media-box-modern img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    max-height: 72mm !important;
    object-fit: contain !important;
  }

  .media-caption {
    min-height: 10mm;
    padding: 2.5mm 3mm !important;
  }

  .hw-summary-box {
    padding: 10mm 3mm 3mm !important;
  }

  .media-box-modern > .tag-cloud {
    margin: 0 !important;
    padding: 10mm 3mm 3mm !important;
  }

  #proj-guidedog .project-media-col {
    justify-content: flex-start;
    gap: 2.5mm !important;
  }

  #proj-guidedog .hw-summary-box {
    gap: 1mm;
    padding: 8mm 2.5mm 2mm !important;
  }

  #proj-guidedog .hw-spec-row {
    padding: 1mm 0 !important;
    font-size: 7.5pt !important;
  }

  #proj-guidedog .media-box-modern > img {
    height: 38mm !important;
    max-height: 38mm !important;
    aspect-ratio: 16 / 7;
    object-fit: cover !important;
  }

  #proj-guidedog .media-caption {
    min-height: 0;
    padding: 2mm 2.5mm !important;
  }

  .exp-header,
  .edu-grid {
    gap: 3mm !important;
  }

  .edu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .experience-card,
  .edu-card {
    padding: 4mm !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

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

/* Final A4 fill pass: use the full sheet height without changing page count. */
.featured-flow small {
  display: block;
  margin-top: 3px;
  color: #dbeafe;
  font-size: 11px;
}

.featured-validation {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.featured-validation strong {
  width: 100%;
  color: var(--primary-dark);
}

.featured-validation span {
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1e40af;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

@media print {
  .featured-case-study .featured-sheet-overview .featured-story-grid {
    min-height: 166mm;
  }

  .featured-case-study .featured-sheet-detail .featured-detail-grid {
    min-height: 174mm;
  }

  .featured-case-study .featured-story-copy,
  .featured-case-study .featured-detail-points {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .featured-case-study .featured-detail-points {
    grid-template-rows: repeat(3, minmax(0, 1fr)) auto;
  }

  .featured-case-study .featured-media-grid-page1 {
    grid-template-rows: minmax(0, 1.65fr) minmax(0, 1fr);
  }

  .featured-case-study .featured-media-grid-page2 {
    grid-template-rows: minmax(0, 0.78fr) minmax(0, 1.45fr);
  }

  .featured-case-study .featured-media-grid-page1 .featured-media,
  .featured-case-study .featured-media-grid-page2 .featured-media {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .featured-case-study .featured-media-grid-page1 .featured-video-slot,
  .featured-case-study .featured-media-grid-page1 .featured-photo-slot,
  .featured-case-study .featured-media-grid-page2 .featured-video-slot,
  .featured-case-study .featured-media-grid-page2 .featured-photo-slot {
    min-height: 0;
    flex: 1;
    aspect-ratio: auto;
  }

  .featured-case-study .featured-media figcaption {
    flex: 0 0 auto;
  }

  .featured-flow small {
    margin-top: 0.6mm;
    font-size: 6pt;
  }

  .featured-validation {
    align-content: flex-start;
    gap: 1.2mm;
  }

  .featured-validation strong {
    font-size: 8pt;
  }

  .featured-validation span {
    padding: 1mm 1.5mm;
    font-size: 6.3pt;
  }
}

/* ==========================================================================
   Unified portfolio system
   White canvas, one blue accent, flat cards, consistent reading hierarchy.
   ========================================================================== */

:root {
  --primary: #175cd3;
  --primary-dark: #1849a9;
  --primary-light: #ffffff;
  --slate-900: #101828;
  --slate-800: #1d2939;
  --slate-700: #344054;
  --slate-600: #475467;
  --slate-500: #667085;
  --slate-400: #98a2b3;
  --slate-200: #e4e7ec;
  --slate-100: #f2f4f7;
  --slate-50: #ffffff;
  --border: #dfe3e8;
  --border-card: #d0d5dd;
  --card-bg: #ffffff;
  --card-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  --card-shadow-hover: 0 12px 30px rgba(16, 24, 40, 0.09);
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

html,
body,
.main-wrapper,
.section,
.hero-card,
.hero-header,
.profile-grid,
.bio-card-inner,
.contact-box,
.tech-table-card,
.skill-card,
.project-card,
.experience-card,
.edu-card,
.featured-case-study,
.featured-sheet {
  background: #ffffff !important;
  background-image: none !important;
}

body {
  color: var(--slate-800);
  letter-spacing: -0.012em;
}

.navbar {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}

.hero-card,
.tech-table-card,
.skill-card,
.project-card,
.experience-card,
.edu-card {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.hero-header,
.bio-card-inner,
.contact-box,
.strength-card,
.gpa-card,
.project-role-badge,
.point-item-easy,
.project-media-col,
.media-box-modern,
.featured-stat,
.case-point,
.featured-validation,
.featured-media {
  background: #ffffff !important;
  background-image: none !important;
}

.hero-title,
.section-title,
.project-title,
.featured-detail-heading h3,
.bio-heading,
.skill-category,
.exp-company,
.edu-title {
  color: var(--slate-900);
  letter-spacing: -0.035em;
}

.hero-subtitle,
.section-desc,
.project-lead,
.bio-text,
.point-item-easy p,
.case-point p,
.media-caption,
.featured-media figcaption,
.exp-desc,
.edu-meta {
  color: var(--slate-600);
}

.section-header {
  max-width: 820px;
}

.section-title {
  margin-top: 3px;
}

.section-desc,
.project-lead,
.featured-lead {
  max-width: 880px;
  line-height: 1.65;
}

.eyebrow,
.project-period,
.skill-sub,
.featured-page-index {
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tag,
.metric-badge,
.profile-badge-pill,
.gpa-tag,
.gpa-tag-sub,
.featured-tags span,
.featured-validation span {
  border: 1px solid #b9d3fb !important;
  color: var(--primary-dark) !important;
  background: #ffffff !important;
}

.skill-icon-wrap,
.strength-icon-box {
  border: 1px solid #b9d3fb;
  color: var(--primary);
  background: #ffffff !important;
}

.project-role-badge,
.point-item-easy {
  border-color: var(--border) !important;
}

.project-role-badge {
  border-left-color: var(--primary) !important;
}

.project-media-col {
  border: 1px solid var(--border) !important;
}

.media-box-modern,
.featured-media {
  border-color: var(--border-card) !important;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.06) !important;
}

.featured-case-study {
  border-color: var(--border-card);
  box-shadow: var(--card-shadow);
}

.featured-sheet + .featured-sheet {
  border-top-color: var(--border);
}

.featured-label {
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  background: #ffffff;
}

.featured-stat strong,
.featured-title span {
  color: var(--primary);
}

.featured-stat,
.case-point,
.featured-validation {
  border-color: var(--border-card);
}

.featured-role {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}

.featured-flow > div {
  border: 1px solid #b9d3fb;
  color: var(--slate-900);
  background: #ffffff;
  background-image: none;
}

.featured-flow span {
  color: var(--primary);
}

.featured-flow small {
  color: var(--slate-600);
}

.featured-video-slot,
.featured-photo-slot {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  background-image: none;
}

.media-slot-empty {
  color: var(--primary-dark);
}

.media-slot-empty code {
  border-color: #b9d3fb;
  color: var(--primary);
  background: #ffffff;
}

.tech-stack-table th,
.tech-stack-table td {
  border-color: var(--border);
}

.tech-stack-table thead,
.tech-stack-table .td-cat {
  background: #ffffff !important;
}

.footer {
  border-top: 1px solid var(--border);
  background: #ffffff !important;
}

@media (hover: hover) {
  .skill-card:hover,
  .project-card:hover {
    border-color: #b9d3fb;
    transform: translateY(-2px);
  }
}

@media print {
  html,
  body,
  .main-wrapper,
  .section,
  .hero-card,
  .hero-header,
  .profile-grid,
  .bio-card-inner,
  .contact-box,
  .tech-table-card,
  .skill-card,
  .project-card,
  .project-media-col,
  .point-item-easy,
  .experience-card,
  .edu-card,
  .featured-case-study,
  .featured-sheet,
  .featured-stat,
  .case-point,
  .featured-validation,
  .featured-media,
  .featured-flow > div {
    background: #ffffff !important;
    background-image: none !important;
  }

  .hero-card,
  .tech-table-card,
  .skill-card,
  .project-card,
  .experience-card,
  .edu-card,
  .featured-media,
  .media-box-modern {
    box-shadow: none !important;
  }

  .project-card,
  .featured-case-study .featured-sheet {
    border-color: #cfd6df !important;
  }

  .project-media-col::before {
    background: #dfe3e8;
  }
}

/* ==========================================================================
   Project 01 consistency pass
   Keep the two-page case study, but reuse the visual grammar of projects 02-06.
   ========================================================================== */

.featured-sheet-kicker {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.featured-label {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.featured-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.featured-lead {
  margin-bottom: 16px;
  font-size: 15px;
}

.featured-stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.featured-stat {
  display: inline-flex;
  min-height: 0;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border-color: #b9d3fb;
  border-radius: var(--radius-sm);
}

.featured-stat strong {
  margin: 0;
  font-size: 13px;
}

.featured-stat span {
  font-size: 12px;
}

.featured-role {
  margin: 14px 0 22px;
  padding: 8px 14px;
  border-left-width: 3px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
}

.case-point {
  grid-template-columns: 28px 1fr;
  gap: 14px;
  padding: 16px;
  border-left: 3px solid #dbeafe;
  border-radius: var(--radius-md);
}

.case-point > span {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  color: #ffffff;
  background: var(--primary);
  font-size: 12px;
}

.case-point h4 {
  font-size: 15px;
  font-weight: 750;
}

.case-point p {
  font-size: 13.5px;
  line-height: 1.65;
}

.featured-media {
  border-radius: var(--radius-md);
}

.featured-media-label {
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.featured-media figcaption {
  min-height: 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.featured-detail-heading {
  margin: 0 0 16px;
}

.featured-detail-heading h3 {
  font-size: 22px;
  letter-spacing: -0.035em;
}

.featured-detail-heading p {
  font-size: 13.5px;
  line-height: 1.6;
}

.featured-flow > div {
  min-height: 72px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.featured-flow strong {
  font-size: 13px;
}

.featured-validation {
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

@media print {
  .featured-sheet-kicker {
    margin-bottom: 2.5mm;
    padding-bottom: 2mm;
  }

  .featured-label {
    padding: 0;
    border: 0;
    font-size: 7pt;
  }

  .featured-title {
    margin: 0 0 2mm;
    font-size: 16.5pt;
    line-height: 1.2;
  }

  .featured-lead {
    margin-bottom: 3mm;
    font-size: 8pt;
    line-height: 1.4;
  }

  .featured-stat-grid {
    display: flex;
    gap: 1.5mm;
    margin: 0 0 2mm;
  }

  .featured-stat {
    min-height: 0;
    padding: 1mm 2mm;
    border-radius: 1.5mm;
  }

  .featured-stat strong {
    margin: 0;
    font-size: 7pt;
  }

  .featured-stat span {
    font-size: 6.5pt;
  }

  .featured-role {
    margin: 2.5mm 0 4mm;
    padding: 2mm 3mm;
    border-left-width: 0.8mm;
    font-size: 7.5pt;
  }

  .featured-case-study .featured-sheet-overview .featured-story-grid {
    min-height: 176mm;
  }

  .case-point {
    grid-template-columns: 6mm 1fr;
    gap: 2.5mm;
    padding: 3.5mm;
    border-left-width: 0.8mm;
    border-radius: 2mm;
  }

  .case-point > span {
    width: 5.5mm;
    height: 5.5mm;
    margin-top: 0.5mm;
    font-size: 6pt;
  }

  .case-point h4 {
    font-size: 8pt;
  }

  .case-point p {
    font-size: 7pt;
    line-height: 1.45;
  }

  .featured-media-label {
    top: 2mm;
    left: 2mm;
    padding: 0.8mm 1.6mm;
    border-radius: 1.5mm;
    font-size: 6.2pt;
  }

  .featured-media figcaption {
    padding: 2mm 2.5mm;
    font-size: 6.8pt;
    line-height: 1.4;
  }

  .featured-detail-heading {
    margin: 0 0 3mm;
  }

  .featured-detail-heading h3 {
    font-size: 16.5pt;
  }

  .featured-detail-heading p {
    font-size: 7.2pt;
    line-height: 1.4;
  }

  .featured-flow > div {
    min-height: 15mm;
    padding: 2.5mm 3mm;
    border-radius: 2mm;
  }

  .featured-validation {
    border-left-width: 0.8mm;
    border-radius: 0 2mm 2mm 0;
  }
}

/* ==========================================================================
   Web readability and project density
   ========================================================================== */

@media screen {
  .navbar {
    height: 72px;
  }

  .nav-container {
    max-width: 1180px;
    gap: 28px;
  }

  .nav-menu {
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 8px;
  }

  .nav-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    padding: 9px 13px;
    color: var(--slate-800);
    font-size: 15px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
  }

  .nav-link:hover,
  .nav-link.active {
    color: var(--primary-dark);
    background: #ffffff;
    box-shadow: inset 0 -2px 0 var(--primary);
  }

  .nav-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .btn-github,
  .btn-print {
    min-height: 42px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
  }

  .btn-github {
    color: var(--slate-800);
    background: #ffffff;
  }
}

@media screen and (min-width: 961px) {
  /* Use the VIP card's inset and text/media proportions for both LOGITLE sheets. */
  #proj-warehouse.featured-case-study { padding: 0; }
  #proj-warehouse > .featured-sheet { padding: 30px; }
  #proj-warehouse .featured-story-grid,
  #proj-warehouse .featured-detail-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 28px;
    align-items: stretch;
  }
  #proj-warehouse .featured-story-copy,
  #proj-warehouse .featured-detail-points { gap: 16px; }
  #proj-warehouse .featured-story-copy { grid-template-rows: repeat(3, minmax(min-content, 1fr)); }
  #proj-warehouse .featured-detail-points { grid-template-rows: repeat(3, minmax(min-content, 1fr)) auto; }
  #proj-warehouse .case-point { align-content: center; }
  #proj-warehouse .featured-story-grid > *,
  #proj-warehouse .featured-detail-grid > * { min-width: 0; }
  #proj-vip .project-content-grid,
  #proj-kickcan .project-content-grid,
  #proj-guidedog .project-content-grid,
  #proj-balance .project-content-grid,
  #proj-plc .project-content-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: stretch;
  }

  #proj-vip .points-list,
  #proj-kickcan .points-list,
  #proj-guidedog .points-list,
  #proj-balance .points-list,
  #proj-plc .points-list {
    display: grid;
    height: 100%;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  #proj-vip .point-item-easy,
  #proj-kickcan .point-item-easy,
  #proj-guidedog .point-item-easy,
  #proj-balance .point-item-easy,
  #proj-plc .point-item-easy {
    height: 100%;
    align-items: center;
  }

  #proj-vip .point-num,
  #proj-kickcan .point-num,
  #proj-guidedog .point-num,
  #proj-balance .point-num,
  #proj-plc .point-num {
    margin-top: 0;
  }
}

@media screen and (max-width: 1080px) and (min-width: 961px) {
  .nav-container {
    gap: 14px;
    padding-inline: 16px;
  }

  .nav-menu {
    gap: 2px;
  }

  .nav-link {
    padding-inline: 9px;
    font-size: 14px;
  }

  .btn-github,
  .btn-print {
    padding-inline: 10px;
    font-size: 13px;
  }
}

/* Shared credentials content: screen reflows, print remains an A4 document. */
.profile-experience { grid-column: 1 / -1; min-width: 0; scroll-margin-top: 124px; }
.profile-experience .experience-card { padding: 20px; }
.profile-experience-title { font-size: 20px; margin: 0 0 16px; }
.profile-experience .exp-desc { margin-bottom: 0; }
@media print {
  #experience.profile-experience { break-before: auto !important; page-break-before: auto !important; margin: 0 !important; }
  .profile-experience .experience-card { padding: 3mm !important; break-inside: avoid; }
  .profile-experience-title { font-size: 10pt; margin-bottom: 2mm; }
  .profile-experience .exp-desc { font-size: 7.5pt; line-height: 1.4; }
}
.gpa-card-link { display: block; color: inherit; text-decoration: none; }
.gpa-card-link:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 4px; }
@media (hover: hover) { .gpa-card-link:hover { border-color: #1d4ed8; } }
@media screen and (min-width: 961px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr) clamp(320px, 32vw, 380px); gap: 28px; }
  .profile-grid > div { min-width: 0; }
  .profile-credentials .credentials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .credentials-grid .edu-card:first-child { grid-column: 1 / -1; }
  .contact-box { padding: 28px 24px; }
  .profile-photo-wrapper-lg { width: 220px; height: 284px; margin-bottom: 20px; }
}
@media screen {
  .contact-header-centered { padding-bottom: 24px; margin-bottom: 20px; }
  .profile-header-info-centered { gap: 8px; }
  .profile-header-info-centered .profile-name { font-size: 28px; }
  .profile-header-info-centered .profile-name-en { display: block; margin: 6px 0 0; font-size: 14px; }
  .profile-header-info-centered .profile-univ { font-size: 13px; line-height: 1.6; }
  .profile-photo-wrapper-lg .profile-photo { object-position: center top; }
  #profile .hero-header { margin-bottom: 24px; padding-bottom: 20px; }
  #profile .hero-title { font-size: clamp(23px, 2.6vw, 32px); line-height: 1.4; margin: 0; text-wrap: balance; }
}
.profile-credentials { min-width: 0; scroll-margin-top: 120px; }
.profile-overview-header { margin-bottom: 16px; }
.profile-overview-header .section-title { font-size: 24px; margin-bottom: 0; }
.credentials-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.credentials-grid .edu-card { padding: 18px 20px; }
.credentials-grid .edu-title { padding-bottom: 8px; margin-bottom: 10px; }
.credentials-grid .edu-item { margin-bottom: 12px; }
.credentials-grid .edu-item:last-child { margin-bottom: 0; }
.contact-list a, .contact-list span { min-width: 0; overflow-wrap: anywhere; }

@media screen and (max-width: 960px) {
  .navbar { height: auto; }
  .nav-container { flex-direction: column; gap: 4px; padding: 8px 12px; }
  .nav-menu {
    display: flex; width: 100%; min-width: 0; flex: none;
    overflow-x: auto; gap: 2px; padding-bottom: 2px;
    overscroll-behavior-x: contain;
  }
  .nav-menu > li { flex-shrink: 0; }
  .nav-link { padding: 10px; font-size: 14px; min-height: 44px; }
  .nav-actions { width: 100%; justify-content: flex-end; }
  .btn-github, .btn-print { min-height: 44px; font-size: 13px; }
  .dropdown-caret { display: inline-block; }
  .main-wrapper { width: 100%; padding: 24px 16px; }
  .section, .project-card, section[id], article[id] { scroll-margin-top: 124px; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .contact-col { grid-row: 1; }
  .bio-col, .contact-col, .points-list, .project-media-col { min-width: 0; }
  .contact-box { max-width: none; }
  .profile-photo-wrapper-lg { width: 220px; height: 284px; margin-bottom: 20px; }
  .project-content-grid, .featured-story-grid, .featured-detail-grid {
    grid-template-columns: minmax(0, 1fr); gap: 20px;
  }
  .points-list { height: auto; }
  .point-item-easy { height: auto; min-height: 0; }
  .project-media-col { gap: 16px; justify-content: flex-start; }
  .project-topbar, .project-meta, .metric-strip { flex-wrap: wrap; }
  .featured-story-grid, .featured-detail-grid, .featured-story-copy,
  .featured-detail-points, .featured-media-grid { min-height: 0; height: auto; }
  .featured-media-grid { grid-auto-rows: auto; }
  .featured-media-grid-page1, .featured-media-grid-page2 { grid-template-rows: none; }
  .featured-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-role-badge { flex-wrap: wrap; }
  .tag, .skill-tag { max-width: 100%; white-space: normal; }
}

@media screen and (max-width: 640px) {
  .main-wrapper { padding: 20px 12px; }
  .project-quick-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj-nav-pill { min-width: 0; padding: 10px 8px; }
  .proj-nav-pill .pill-title { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .section { margin-bottom: 36px; }
  .hero-card, .project-card, .skill-card, .experience-card { padding: 20px 16px; }
  .featured-case-study { padding: 0; }
  .featured-sheet { padding: 20px 16px; }
  .hero-title { font-size: clamp(23px, 6vw, 30px); line-height: 1.4; }
  #profile .hero-title { word-break: keep-all; }
  .hero-title br { display: none; }
  .hero-subtitle, .project-lead, .section-desc { font-size: 14px; }
  .section-title, .project-title, .featured-title { font-size: 23px; line-height: 1.4; }
  .contact-box { padding: 20px 16px; }
  .contact-list li { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 10px; }
  .contact-list a, .contact-list span { text-align: right; font-size: 13px; }
  .contact-list .contact-email { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .contact-list .contact-email a { text-align: left; }
  .profile-photo-wrapper-lg { width: 184px; height: 238px; margin-bottom: 18px; }
  .credentials-grid .edu-card { padding: 16px; }
  .credentials-grid .edu-item strong, .point-item-easy h4 { font-size: 15px; }
  .credentials-grid .edu-sub, .credentials-grid .edu-meta,
  .point-item-easy p, .case-point p, .media-caption { font-size: 13px; line-height: 1.65; }
  .featured-media-grid { grid-template-columns: minmax(0, 1fr); }
  .featured-media-wide { grid-column: auto; }
  .featured-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .point-item-easy { padding: 16px; gap: 12px; }
  .featured-story-copy, .featured-detail-points { gap: 12px; }
  .featured-stat { min-width: 0; }
  .featured-stat strong { font-size: 16px; overflow-wrap: anywhere; }
  .featured-detail-heading h3 { font-size: 22px; }
  .exp-header { flex-wrap: wrap; }
}

@media print {
  .profile-overview-header { margin-bottom: 2mm !important; }
  .profile-overview-header .eyebrow { font-size: 6.5pt; }
  .profile-overview-header .section-title { font-size: 13pt; }
  /* Fill the first A4 sheet and keep credentials/contact on a shared baseline. */
  #profile .hero-card {
    display: flex;
    flex-direction: column;
    min-height: 265mm;
    box-sizing: border-box;
    break-inside: avoid-page;
  }
  #profile .profile-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) !important;
    grid-template-rows: minmax(min-content, 1fr) auto;
    gap: 5mm !important;
    align-items: stretch;
    flex: 1;
  }
  #profile .bio-col > .profile-credentials {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  #profile .contact-col { display: flex; }
  #profile .contact-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
  }
  #profile .gpa-card { margin-top: auto; }
  .profile-grid > .bio-col, .profile-grid > .contact-col { min-width: 0; }
  .profile-credentials .credentials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto minmax(min-content, 1fr);
    flex: 1;
    gap: 3mm !important;
    align-items: stretch;
  }
  .credentials-grid .edu-card:first-child { grid-column: 1 / -1; }
  #profile .profile-photo-wrapper-lg {
    width: 43mm;
    height: 55.5mm;
    max-width: 100%;
    margin-bottom: 4mm;
  }
  #profile .profile-photo-wrapper-lg .profile-photo { object-position: center top; }
  #profile .profile-header-info-centered { gap: 2mm; }
  #profile .profile-header-info-centered .profile-name-en {
    display: block;
    margin: 1.5mm 0 0;
    font-size: 9pt;
  }
  .credentials-grid .edu-card { padding: 4mm !important; }
  .credentials-grid .edu-title { font-size: 11pt; padding-bottom: 2mm; margin-bottom: 3mm; }
  .credentials-grid .edu-item { margin-bottom: 3mm; }
  .credentials-grid .edu-item strong { font-size: 9pt; }
  .credentials-grid .edu-sub, .credentials-grid .edu-meta { font-size: 8pt !important; line-height: 1.5 !important; margin-bottom: 0; }
  #profile .profile-experience .experience-card { padding: 4mm !important; }
  #profile .profile-experience-title { font-size: 12pt; margin-bottom: 3mm; }
  #profile .profile-experience .exp-desc { font-size: 9pt; line-height: 1.5; }
}

.edu-item > .edu-institution {
  display: flex;
  align-items: center;
  gap: 12px;
}
.edu-institution-logo {
  width: 96px;
  height: 34px;
  flex: 0 0 96px;
  object-fit: contain;
}
.edu-institution > span { min-width: 0; line-height: 1.5; }
@media screen and (max-width: 640px) {
  .edu-institution-logo { width: 76px; height: 30px; flex-basis: 76px; }
  .edu-item > .edu-institution { gap: 10px; }
}
@media print {
  .edu-institution-logo { width: 22mm; height: 7mm; flex-basis: 22mm; }
  .edu-item > .edu-institution { gap: 2mm; }
}

/* Compact desktop contact panel with a shared credentials/contact baseline. */
@media screen and (min-width: 961px) {
  #profile .profile-grid { align-items: stretch; }
  #profile .bio-col > .profile-credentials { flex: 1; display: flex; flex-direction: column; }
  #profile .profile-credentials .credentials-grid {
    flex: 1;
    grid-template-rows: auto minmax(min-content, 1fr);
  }
  #profile .contact-col { display: flex; }
  #profile .contact-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  #profile .contact-header-centered { padding-bottom: 14px; margin-bottom: 10px; }
  #profile .profile-photo-wrapper-lg { margin-bottom: 14px; }
  #profile .profile-header-info-centered { gap: 4px; }
  #profile .contact-list { margin-bottom: 8px; }
  #profile .gpa-card { margin-top: auto; padding: 8px 12px; }
  #profile .gpa-card-header { align-items: center; margin-bottom: 4px; }
  #profile .gpa-score { font-size: 22px; }
  #profile .gpa-progress-bar { height: 4px; margin-bottom: 4px; }
  #profile .gpa-card-footer { line-height: 1.4; }
  #profile .gpa-tag-sub { font-size: 10px; }
}

/* Visual-first project presentation, without changing the source reading order. */

/* Figma-designed, outlined SVG shared by screen and print. */
.docking-diagram {
  margin: 0 0 20px;
  padding: 8px 8px 12px;
  border: 1px solid #d4e1f2;
  border-radius: 12px;
  background: #fff;
  break-inside: avoid;
}
.docking-diagram-scroll { overflow-x: auto; }
.docking-diagram-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.docking-diagram-scroll img { display: block; width: 100%; height: auto; }
.docking-diagram figcaption { margin: 8px 10px 0; color: #536782; font-size: 11px; line-height: 1.6; }
.docking-diagram-mobile-hint { display: none; }
.docking-state-reference { margin-top: 10px; border-top: 1px solid #e4ebf4; padding-top: 8px; font-size: 12px; color: #536782; }
.docking-state-reference summary { cursor: pointer; font-weight: 600; }
.docking-state-reference ol { margin: 12px 0 0; padding-left: 22px; line-height: 1.8; }
.docking-state-reference code { color: #16469a; overflow-wrap: anywhere; }
@media screen and (max-width: 767px) {
  .docking-diagram { padding: 8px; }
  .docking-diagram-scroll img { min-width: 1080px; }
  .docking-diagram-mobile-hint { display: block; margin: 6px 0 0; color: #6d7f96; font-size: 11px; }
}
@media print {
  .docking-diagram { margin: 0 0 3mm; padding: 2mm; border-radius: 2mm; }
  .docking-diagram-scroll { overflow: visible; }
  .docking-diagram-scroll img { width: 100%; min-width: 0; }
  .docking-diagram figcaption { margin-top: 1mm; font-size: 6pt; }
  .docking-state-reference, .docking-diagram-mobile-hint { display: none; }
}

@media screen {
  .featured-video-slot, .featured-photo-slot { aspect-ratio: 16 / 9; }
  .featured-photo-slot img, .media-box-modern > img { object-fit: contain; }
}

@media screen and (max-width: 960px) {
  .project-content-grid > .project-media-col,
  .featured-story-grid > .featured-media-grid,
  .featured-detail-grid > .featured-media-grid { order: -1; }
}

@media print {
  #projects .project-content-grid,
  #projects .featured-story-grid,
  #projects .featured-detail-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
    gap: 4mm !important;
  }
  #projects .project-content-grid > *,
  #projects .featured-story-grid > *,
  #projects .featured-detail-grid > * { min-width: 0; }

  .featured-case-study .featured-media-grid-page1,
  .featured-case-study .featured-media-grid-page2 {
    align-content: stretch;
    align-items: stretch;
    min-height: 0;
  }
  .featured-case-study .featured-media-grid-page1 {
    grid-template-rows: minmax(0, 1.65fr) minmax(0, 1fr);
  }
  .featured-case-study .featured-media-grid-page2 {
    grid-template-rows: minmax(0, 1.45fr) minmax(0, 0.78fr);
  }
  .featured-case-study .featured-media-grid .featured-media-wide {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .featured-case-study .featured-media-grid .featured-video-slot,
  .featured-case-study .featured-media-grid .featured-photo-slot {
    flex: 1 1 0;
    min-height: 0;
    aspect-ratio: auto;
  }
  /* Bound the bitmap to its own slot, never to the adjacent caption/card. */
  #projects .featured-photo-slot img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    padding: 0 !important;
  }
  #projects .featured-photo-slot img,
  #projects .media-box-modern > img {
    object-fit: contain !important;
    aspect-ratio: 16 / 9;
  }
  #projects .project-media-col { justify-content: flex-start; }
  #projects #proj-balance .media-box-modern > img,
  #projects #proj-guidedog .media-box-modern > img {
    object-fit: cover !important;
    padding: 0 !important;
  }
  #projects .featured-media figcaption,
  #projects .media-caption { min-height: 0; }
}

@media print {
  /* Definite page/card height is required for fractional media rows to fill.
     A min-height alone leaves the image column at its intrinsic 16:9 height. */
  #projects > .project-card:not(.featured-case-study) {
    height: 255mm;
    min-height: 255mm;
    box-sizing: border-box;
  }
  #projects .project-content-grid {
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
  }
  #projects .project-content-grid > * { min-height: 0; }
  #projects .project-media-col {
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    align-content: stretch;
    align-items: stretch;
    min-height: 0;
  }
  #projects .project-media-col > .media-box-modern {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
    margin: 0 !important;
    overflow: hidden;
    break-inside: auto;
    page-break-inside: auto;
  }
  #projects .media-box-modern > div[style*="padding-bottom"] {
    flex: 1 1 0;
    min-height: 0;
    height: auto !important;
    padding-bottom: 0 !important;
  }
  #projects .media-box-modern > img {
    flex: 1 1 0;
    min-height: 0;
    height: 0 !important;
    max-height: none !important;
    aspect-ratio: auto;
    padding: 0 !important;
  }
  #projects .media-caption,
  #projects .featured-media figcaption { flex: 0 0 auto; }

  #proj-warehouse.featured-case-study > .featured-sheet {
    display: flex;
    flex-direction: column;
  }
  #proj-warehouse .featured-sheet > * { flex-shrink: 0; }
  #proj-warehouse .featured-story-grid,
  #proj-warehouse .featured-detail-grid {
    flex: 1 1 0;
    min-height: 0 !important;
    grid-template-rows: minmax(0, 1fr);
  }
  #proj-warehouse .featured-story-grid > *,
  #proj-warehouse .featured-detail-grid > * { min-height: 0; }
  #proj-warehouse .featured-media-grid { min-height: 0; }
  #proj-warehouse .featured-photo-slot img { aspect-ratio: auto; }
}
