/* ============================================================
   PRINT · PDF-friendly layout (white bg, compact, no anim)
   Loaded only via <link media="print">
   ============================================================ */
@media print {
  @page {
    size: A4;
    margin: 12mm 14mm;
  }

  /* Hide nav, animations, decorative overlays */
  #nav, #progress-bar, .mobile-menu, .scroll-indicator,
  #particle-canvas, .nav-hamburger,
  body::before, .section-hero::after, .pf-card::before, .pf-card::after,
  .section-portfolio::before, .ops-card::before {
    display: none !important;
  }

  /* Force every reveal-up element visible */
  .reveal-up,
  .pf-card.reveal-up {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
    animation: none !important;
  }

  /* Body / globals */
  html, body {
    background: #ffffff !important;
    color: #1a1a1a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  * {
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    text-shadow: none !important;
  }

  /* Section spacing — much tighter */
  .section {
    padding: 14px 0 !important;
    background: #ffffff !important;
    page-break-inside: avoid;
  }
  .section.alt-bg { background: #f7f5f0 !important; }

  /* Hero — keep on first page */
  .section-hero {
    min-height: auto !important;
    padding: 0 0 14px !important;
    background: #ffffff !important;
    page-break-after: avoid;
  }
  .hero-inner {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .hero-label {
    font-size: 11px !important;
    color: #d94727 !important;
    letter-spacing: 0.3em !important;
    margin-bottom: 14px !important;
  }
  .hero-roles {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 30px !important;
    margin-bottom: 20px !important;
  }
  .role-item {
    font-size: 17px !important;
    color: #1a1a1a !important;
    gap: 10px !important;
  }
  .role-item::before {
    background: #d94727 !important;
    width: 14px !important;
    margin-bottom: 8px !important;
  }
  .hero-meta {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px 36px !important;
    padding-top: 14px !important;
    border-top: 0.5px solid #d4d4d4 !important;
  }
  .hero-name-block { padding-right: 0 !important; border: none !important; }
  .hero-name {
    font-size: 30px !important;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
    background: none !important;
    letter-spacing: 0.12em !important;
    margin-bottom: 6px !important;
    animation: none !important;
  }
  .hero-subtitle { font-size: 11px !important; color: #5a5a5a !important; margin-bottom: 8px !important; }
  .hero-info { font-size: 11px !important; color: #5a5a5a !important; }
  .hero-email { font-size: 12px !important; color: #d94727 !important; font-family: 'JetBrains Mono', monospace !important; }
  .hero-blurb {
    font-size: 12px !important;
    color: #3a3a3a !important;
    line-height: 1.7 !important;
  }
  .hero-blurb .hl-num, .hero-blurb .hl-accent {
    color: #d94727 !important;
    font-weight: 600 !important;
  }

  /* Section headers */
  .section-header { margin-bottom: 12px !important; }
  .sec-en { font-size: 9px !important; color: #d94727 !important; letter-spacing: 0.3em !important; }
  .sec-cn { font-size: 18px !important; color: #1a1a1a !important; }

  /* Container — single col on print */
  .container { max-width: 100% !important; padding: 0 !important; }

  /* About — compact */
  .about-grid { grid-template-columns: 300px 1fr !important; gap: 24px !important; }
  .about-meta { gap: 8px !important; }
  .meta-item { padding: 0 !important; }
  .meta-lbl { font-size: 9px !important; color: #8a8a8a !important; letter-spacing: 0.16em !important; }
  .meta-val { font-size: 12px !important; color: #1a1a1a !important; margin-top: 2px !important; }
  .capability-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .cap-item {
    background: #ffffff !important;
    border: 0.5px solid #d4d4d4 !important;
    padding: 10px 12px !important;
  }
  .cap-title { font-size: 13px !important; color: #1a1a1a !important; margin-bottom: 4px !important; }
  .cap-desc { font-size: 11px !important; color: #3a3a3a !important; line-height: 1.55 !important; }

  /* Timeline — single col tight */
  .timeline-track { padding-left: 18px !important; }
  .tl-item {
    grid-template-columns: 90px 1fr !important;
    gap: 10px !important;
    margin-bottom: 6px !important;
    page-break-inside: avoid;
  }
  .tl-dot { width: 6px !important; height: 6px !important; }
  .tl-card {
    background: #ffffff !important;
    border: 0.5px solid #d4d4d4 !important;
    padding: 8px 12px !important;
  }
  .tl-card-active { background: #fff5f0 !important; border-color: #d94727 !important; }
  .tl-period { font-size: 10px !important; color: #5a5a5a !important; }
  .tl-role { font-size: 13px !important; color: #1a1a1a !important; }
  .tl-company { font-size: 11px !important; color: #5a5a5a !important; }
  .ttag {
    background: rgba(217,71,39,0.06) !important;
    color: #d94727 !important;
    border: 0.5px solid rgba(217,71,39,0.2) !important;
    font-size: 10px !important;
    padding: 1px 6px !important;
  }
  .ttag.gold {
    background: rgba(184,134,11,0.08) !important;
    color: #b8860b !important;
    border-color: rgba(184,134,11,0.3) !important;
  }

  /* Section cards — generic flatten */
  .wcard, .wcard-sm, .wb, .mg-card, .ma-card, .tc, .loop-card, .tm-card,
  .sc-card, .eng-item, .ops-card, .pf-card, .pill, .pf-pill,
  .dm-cell, .sub-cell, .la-box, .af-node, .ef-node, .bf-step,
  .cf-chain, .cf-box, .contact-card, .gain-block,
  .code-stat-block, .exp-kpi-block, .browser-frame {
    background: #ffffff !important;
    border: 0.5px solid #d4d4d4 !important;
    color: #1a1a1a !important;
  }

  /* Phone / browser device frames keep dark for screenshot feel */
  .phone-frame, .finance-frame {
    background: #181f2c !important;
    border: 1px solid #444 !important;
  }
  .phone-screen, .finance-screen { background: #0a0e15 !important; }
  .browser-screen-admin { background: #0c1622 !important; }

  /* Numbers — flat orange (no gradient text-clip) */
  .pfk-num, .cs-big, .big-kpi-num, .ekpi-num, .ops-kpi-n,
  .pstat-num, .sm-num, .ekpi-num.gold-num, .num, .hl-num, .hl-accent {
    background: none !important;
    -webkit-text-fill-color: #d94727 !important;
    color: #d94727 !important;
  }
  .ekpi-num.gold-num, .sm-num.gold-num { color: #b8860b !important; -webkit-text-fill-color: #b8860b !important; }

  /* Text colors normalize */
  .pf-title, .ops-title, .ei-title, .wc-title, .wb-title, .mg-title, .ma-title,
  .tc-title, .ma-num, .wc-num, .wsn, .wb-num, .ops-num, .ops-cat, .la-title,
  .cf-title, .sm-v, .wr-k, .tr-name, .tcat-cn, .dc-cn, .sc-cn { color: #1a1a1a !important; }
  .pf-desc, .ops-points li, .wc-desc, .wsd, .wb-desc, .mg-desc, .ma-desc,
  .tc-desc, .ei-desc, .pm-val, .em-val, .sp, .gi, .li, .la-desc, .cf-sub,
  .sm-k, .wr-v, .tr-desc, .ops-source, .end-note, .ekpi-sub, .es-lbl,
  .pfk-lbl, .pf-status, .pstat-lbl, .pm-lbl, .em-lbl, .sm-lbl, .dc-en, .sc-en,
  .ttag, .pill, .pf-pill { color: #3a3a3a !important; }
  .sec-en, .pf-cat.web-cat, .pf-cat.android-cat, .pf-cat.finance-cat,
  .hl, .tr-name.core, .pill.core, .pf-pill.core, .pivot-badge {
    color: #d94727 !important;
  }
  .pivot-badge { background: #d94727 !important; color: #ffffff !important; }

  /* Ops + Engineering + Tech grids tighter */
  .ops-grid, .eng-grid, .tech-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .ops-card { padding: 12px 14px !important; }
  .ops-title { font-size: 13px !important; margin-bottom: 8px !important; }
  .ops-kpi-row { padding: 8px 0 !important; margin-bottom: 8px !important; }
  .ops-kpi-n { font-size: 18px !important; }
  .ops-kpi-l { font-size: 9px !important; }
  .ops-points li { font-size: 10.5px !important; padding-left: 12px !important; line-height: 1.45 !important; }
  .ops-points li::before { width: 6px !important; }
  .ops-source { font-size: 9px !important; padding-top: 8px !important; }
  .eng-item { padding: 10px 12px !important; }
  .ei-title { font-size: 13px !important; margin-bottom: 4px !important; }
  .ei-desc { font-size: 11px !important; line-height: 1.5 !important; }
  .tc-cat { padding-top: 6px !important; }
  .tcat-en { font-size: 9px !important; }
  .tcat-cn { font-size: 13px !important; }
  .tr { grid-template-columns: 140px 1fr !important; font-size: 10.5px !important; line-height: 1.5 !important; }

  /* Portfolio cards print — flatten */
  .portfolio-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .portfolio-grid .pf-card:first-child {
    grid-column: 1 / -1 !important;
    grid-template-columns: 1fr 1.2fr !important;
  }
  .pf-mock {
    background: #f5f3ee !important;
    height: 200px !important;
    border-bottom: 0.5px solid #d4d4d4 !important;
    padding: 12px !important;
  }
  .pf-mock::after { display: none !important; }
  .phone-frame { width: 140px !important; height: 290px !important; }
  .browser-frame { height: 190px !important; }
  .portfolio-grid .pf-card:first-child .phone-frame { width: 160px !important; height: 330px !important; }
  .portfolio-grid .pf-card:first-child .pf-mock { height: 100% !important; min-height: 280px !important; }

  .pf-body { padding: 12px 14px !important; gap: 8px !important; }
  .pf-title { font-size: 14px !important; line-height: 1.3 !important; }
  .pf-desc { font-size: 10.5px !important; line-height: 1.55 !important; }
  .pf-kpis { padding: 8px 0 !important; gap: 8px !important; }
  .pfk-num { font-size: 18px !important; }
  .pfk-plus { font-size: 11px !important; }
  .pfk-lbl { font-size: 9px !important; }
  .pf-pill { font-size: 9.5px !important; padding: 2px 6px !important; }
  .pf-meta { font-size: 10px !important; }
  .pf-cat { font-size: 9px !important; padding: 2px 7px !important; letter-spacing: 0.14em !important; }
  .pf-status { font-size: 9px !important; }
  .pf-link {
    background: rgba(217,71,39,0.06) !important;
    border-color: rgba(217,71,39,0.3) !important;
    color: #d94727 !important;
    font-size: 10px !important;
    padding: 5px 10px !important;
  }
  .portfolio-intro { gap: 6px !important; margin-bottom: 16px !important; }
  .pi-pill {
    background: #ffffff !important;
    border: 0.5px solid #d4d4d4 !important;
    color: #5a5a5a !important;
    font-size: 10px !important;
    padding: 3px 10px !important;
  }
  .portfolio-note { font-size: 10px !important; margin-top: 16px !important; }

  /* Projects 01/02/03 — collapse to 2-col */
  .project-layout { grid-template-columns: 280px 1fr !important; gap: 18px !important; }
  .proj-stats { gap: 8px !important; }
  .pstat-num { font-size: 22px !important; }
  .pstat-lbl { font-size: 9px !important; }
  .work-cards-3, .work-cards-6, .work-grid-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .wcard, .wcard-sm, .wb { padding: 6px 8px !important; }
  .wc-title, .wst, .wb-title { font-size: 11px !important; }
  .wc-desc, .wsd, .wb-desc { font-size: 9.5px !important; line-height: 1.4 !important; }

  /* Dubai / AG / Weiwen / Yulong — exp section */
  .exp-layout { grid-template-columns: 280px 1fr !important; gap: 18px !important; }
  .exp-period, .exp-company, .exp-product { font-size: 11px !important; }
  .exp-stats-row { gap: 8px !important; margin-top: 8px !important; }
  .es-num { font-size: 18px !important; }
  .es-lbl { font-size: 9px !important; }
  .ekpi-num { font-size: 36px !important; }
  .gain-block { padding: 10px 12px !important; margin-top: 10px !important; }
  .gb-title { font-size: 11px !important; }
  .gi { font-size: 10.5px !important; line-height: 1.55 !important; }

  /* Startup section big number */
  .startup-layout { grid-template-columns: 280px 1fr !important; gap: 18px !important; }
  .big-kpi-num { font-size: 64px !important; }
  .big-kpi-unit { font-size: 12px !important; }
  .kpi-label { font-size: 10px !important; }
  .sub-metrics { gap: 8px !important; }
  .sm-num { font-size: 20px !important; }
  .sm-lbl { font-size: 9px !important; }
  .loop-grid { grid-template-columns: 1fr 1fr 1fr !important; gap: 8px !important; }
  .loop-card { padding: 8px 10px !important; }
  .loop-head { font-size: 10px !important; }
  .li { font-size: 10px !important; line-height: 1.5 !important; }

  /* Contact — compact final block */
  .section-contact { padding: 20px 0 14px !important; }
  .contact-pre { font-size: 11px !important; }
  .contact-name {
    font-size: 36px !important;
    background: none !important;
    -webkit-text-fill-color: #1a1a1a !important;
    color: #1a1a1a !important;
    margin: 6px 0 !important;
  }
  .contact-name .cn-bold { color: #d94727 !important; -webkit-text-fill-color: #d94727 !important; }
  .contact-line { width: 36px !important; margin: 6px auto 12px !important; }
  .contact-subtitle { font-size: 11px !important; margin-bottom: 16px !important; }
  .contact-card {
    background: #ffffff !important;
    border: 0.5px solid #d94727 !important;
    padding: 14px 20px !important;
    max-width: 380px !important;
    margin: 0 auto !important;
  }
  .cc-lbl { font-size: 9px !important; }
  .cc-val { font-size: 14px !important; color: #d94727 !important; }
  .footer-bar {
    font-size: 9px !important;
    padding-top: 12px !important;
    margin-top: 14px !important;
    border-top: 0.5px solid #d4d4d4 !important;
  }

  /* Hide overly decorative architectures — keep description not flow */
  .arch-strip, .arch-flow, .biz-flow-row, .erp-flow-row,
  .chain-flow, .role-timeline, .stage-cards,
  .cs-hairline, .ekpi-hairline, .kpi-hairline { display: none !important; }

  /* Strict page-break safety */
  section,
  .pf-card, .ops-card, .eng-item, .tl-item, .cap-item, .wcard.featured, .wb, .mg-card, .ma-card.ma-featured, .sc-card, .loop-card, .tm-card.leader-card,
  .gain-block, .code-stat-block, .exp-kpi-block {
    page-break-inside: avoid;
  }
  h2, .sec-cn { page-break-after: avoid; }
}
