:root {
  --paper: #FDFBF4;
  --ink: #18181B;
  --ink-muted: #52525B;
  --yellow: #FDE047;
  --sky: #7DD3FC;
  --mint: #86EFAC;
  --coral: #FDA4AF;
  --peach: #FED7AA;
  --white: #FFFFFF;
  --radius: 2px;
  --shadow: 4px 4px 0px #18181B;
  --shadow-sm: 2.5px 2.5px 0px #18181B;
  --shadow-lg: 6px 6px 0px #18181B;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(24, 24, 27, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 24, 27, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.serif {
  font-family: Georgia, "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Neo-Brutal Box Helpers */
.box {
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
}

.box-sm {
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
}

.hover-lift {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.hover-lift:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* Sticky Masthead */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(253, 251, 244, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.issue-badge {
  background: var(--yellow);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 11px;
  border: 2px solid var(--ink);
  background: var(--white);
  transition: transform 120ms ease, background-color 120ms ease;
  cursor: pointer;
}

.nav-pill:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.nav-pill.sky { background: var(--sky); }
.nav-pill.mint { background: var(--mint); }
.nav-pill.coral { background: var(--coral); }
.nav-pill.ink { background: var(--ink); color: var(--yellow); }

/* Sections */
main {
  padding: 32px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.section-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.section-title {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
}

/* Hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.hero-main {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.hero-tags-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-solid {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid var(--ink);
  background: var(--sky);
}

.tag-plain {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.hero-title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.25;
  text-wrap: balance;
}

.hero-bio {
  margin: 0;
  font-size: 15px;
  color: #27272A;
}

.specialty-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.specialty-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

.hero-aside {
  background: var(--yellow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.aside-label {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

.highlight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-row {
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.highlight-badge {
  background: var(--ink);
  color: var(--yellow);
  padding: 2px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.profile-meta-strip {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 2px dashed rgba(24, 24, 27, 0.35);
}

/* Philosophy Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.philosophy-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.philo-num {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.philo-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.38;
  text-wrap: balance;
}

.philo-body {
  margin: 0;
  font-size: 14px;
  color: #27272A;
}

/* Filter Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 800;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}

.filter-btn:hover {
  background: #FEF08A;
}

.filter-btn.active {
  background: var(--ink);
  color: var(--yellow);
  box-shadow: var(--shadow-sm);
}

.search-input {
  min-width: 220px;
  padding: 8px 12px;
  font-size: 13px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  outline: none;
}

.search-input:focus {
  box-shadow: var(--shadow-sm);
}

/* Portfolio Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card {
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  font: inherit;
}

.work-card-top {
  padding: 14px 16px;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.work-code {
  font-size: 12px;
  font-weight: 800;
}

.work-thumb-wrap {
  position: relative;
  width: 100%;
  height: 196px;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: #F4F4F5;
}

.work-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  transition: transform 220ms ease;
}

.work-card:hover .work-thumb-img {
  transform: scale(1.03);
}

.photo-count-tag {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  background: var(--yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.work-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
}

.result-pill {
  display: inline-block;
  align-self: flex-start;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
}

.work-title {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.work-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1.5px solid rgba(24, 24, 27, 0.2);
  font-size: 12px;
}

.work-cta {
  font-weight: 800;
}

/* Growth & Leadership */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}

.panel-title {
  margin: 0;
  font-size: 20px;
}

.role-item,
.curr-item {
  padding: 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.role-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.role-name {
  font-weight: 800;
  font-size: 15px;
}

.role-period {
  font-size: 12px;
  font-weight: 700;
  background: var(--yellow);
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
}

.pending-callout {
  margin-top: 18px;
  padding: 18px 20px;
  background: #FEF3C7;
  border: 2px dashed var(--ink);
  font-size: 13px;
}

.pending-callout ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

/* Footer */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--white);
  padding: 28px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Lightbox Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 24, 27, 0.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}

.modal-bar {
  background: var(--yellow);
  border-bottom: 2px solid var(--ink);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-close {
  padding: 5px 11px;
  background: var(--white);
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--ink);
  color: var(--white);
}

.modal-content {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-photo-stage {
  border: 2px solid var(--ink);
  padding: 18px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-photo-stage img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #18181B;
  border: 1.5px solid var(--ink);
  display: block;
}

.modal-thumb-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-thumb-btn {
  padding: 0;
  width: 64px;
  height: 46px;
  border: 2px solid var(--ink);
  background: #18181B;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 120ms ease, transform 120ms ease;
}

.modal-thumb-btn.active,
.modal-thumb-btn:hover {
  opacity: 1;
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.modal-thumb-btn img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  border: none;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-field {
  border: 2px solid var(--ink);
  background: var(--white);
  padding: 12px 14px;
  font-size: 13px;
}

.modal-field.highlight {
  background: #DCFCE7;
}

.modal-field-label {
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .grid-3,
  .cards-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .modal-meta-grid {
    grid-template-columns: 1fr;
  }
}

.print-masthead {
  display: none;
}

/* Print-friendly A4 Resume Mode (Preserves Plan C Colors) */
@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  body {
    background-color: #FDFBF4 !important;
    background-image:
      linear-gradient(rgba(24, 24, 27, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(24, 24, 27, 0.04) 1px, transparent 1px) !important;
    background-size: 24px 24px !important;
    font-size: 12px;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  main {
    padding: 0;
    gap: 22px;
  }

  .site-header,
  .toolbar,
  .modal-backdrop,
  .work-cta,
  .no-print {
    display: none !important;
  }

  .print-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ink);
    font-size: 12px;
  }

  .print-masthead-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .print-masthead-left strong {
    font-size: 18px;
  }

  .box {
    box-shadow: 3px 3px 0px #18181B !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .box-sm {
    box-shadow: 2px 2px 0px #18181B !important;
  }

  .hero-grid {
    grid-template-columns: 1.35fr 1fr !important;
    gap: 14px;
  }

  .hero-main,
  .hero-aside {
    padding: 16px;
    gap: 10px;
  }

  .hero-title {
    font-size: 22px;
  }

  .hero-bio {
    font-size: 12px;
  }

  .highlight-row {
    padding: 7px 10px;
    font-size: 11.5px;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px;
  }

  .philosophy-card {
    padding: 14px;
  }

  .philo-title {
    font-size: 14px;
  }

  .philo-body {
    font-size: 11.5px;
  }

  .section-head {
    margin-bottom: 12px;
    padding-bottom: 6px;
    break-after: avoid;
    page-break-after: avoid;
  }

  .section-title {
    font-size: 20px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }

  .work-thumb-wrap {
    height: 135px;
  }

  .work-card-body {
    padding: 11px 12px;
    gap: 8px;
  }

  .work-title {
    font-size: 14px;
  }

  .grid-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px;
  }

  .panel {
    padding: 14px;
    gap: 10px;
  }

  .site-footer {
    margin-top: 18px;
    padding: 12px 0;
  }
}
