:root {
  --sage: #7d8a6e;
  --sage-dark: #5f6b52;
  --tan: #a8a08c;
  --cream: #f4f1ea;
  --cream-2: #ece7db;
  --ink: #24291f;
  --ink-soft: #565b4e;
  --white: #ffffff;
  --card-shadow: 0 20px 45px -20px rgba(36, 41, 31, 0.25);
  --radius-lg: 20px;
  --radius-md: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Work Sans", "PingFang TC", "Noto Sans TC", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  margin: 0 0 12px;
  line-height: 1.25;
  font-weight: 700;
}

p { margin: 0 0 12px; color: var(--ink-soft); }

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

ul { margin: 0; padding: 0; list-style: none; }

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 234, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(36, 41, 31, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.nav {
  display: flex;
  gap: 32px;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a { opacity: 0.85; transition: opacity 0.2s; }
.nav a:hover { opacity: 1; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.contact-call.btn { display: none; }
.contact-email.btn { display: inline-flex; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--sage-dark);
  color: var(--white);
}
.btn-primary:hover { background: var(--sage); }

.btn-outline {
  background: transparent;
  border-color: rgba(36, 41, 31, 0.35);
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--ink); background: rgba(36,41,31,0.05); }

.btn-sm {
  padding: 9px 18px;
  font-size: 0.85rem;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease;
}
.btn-icon-only:hover {
  background: rgba(36, 41, 31, 0.08);
}
.btn-icon-only img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}
.btn-icon-invert { filter: brightness(0) invert(1); }

.btn-arrow {
  transition: transform 0.15s ease;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* HERO */
.hero { padding: 72px 0 96px; }

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  letter-spacing: -0.01em;
}

.hero-bio { max-width: 46ch; }

.hero-actions {
  display: flex;
  gap: 14px;
  margin: 22px 0 28px;
  flex-wrap: wrap;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.contact-list a { color: var(--ink-soft); border-bottom: 1px solid transparent; }
.contact-list a:hover { border-color: var(--ink-soft); }

.hero-photo-wrap { display: flex; justify-content: center; }

.hero-photo {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 3.6;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(125,138,110,0.18), rgba(168,160,140,0.18)),
    linear-gradient(160deg, #e9e4d8, #cfd0c1);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ABOUT */
.about { padding: 0 0 96px; }

.about-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 56px 48px;
  text-align: center;
}

.about-card h2 { font-size: 1.9rem; }

.section-subtitle {
  max-width: 56ch;
  margin: 0 auto 36px;
  color: var(--ink-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  text-align: left;
  margin-bottom: 32px;
}

.about-item {
  background: var(--cream-2);
  border-radius: var(--radius-md);
  padding: 24px;
}
.about-item h3 { font-size: 1.05rem; }
.about-item p { font-size: 0.92rem; margin: 0; }

.about-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* WORKING PROCESS */
.process { padding: 0 0 96px; }

.process-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.process-text h2 { font-size: 1.9rem; }

.process-steps {
  display: flex;
  gap: 24px;
}

.step-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.step-col-offset {
  margin-top: 40px;
}

.step-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--card-shadow);
}

.step-icon { width: 44px; height: 44px; margin-bottom: 12px; }
.step-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.step-card h4 { font-size: 1rem; }
.step-card p { font-size: 0.88rem; margin: 0; }

/* PORTFOLIO */
.portfolio { padding: 0 0 96px; }

.center-title {
  text-align: center;
  font-size: 1.9rem;
  margin-bottom: 40px;
}

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

.portfolio-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.portfolio-card:hover,
.portfolio-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 28px 55px -20px rgba(36, 41, 31, 0.35);
}
.portfolio-card:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; }

.thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--cream-2);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.portfolio-body { padding: 20px; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 8px;
}

.portfolio-body h3 { font-size: 1.05rem; }
.portfolio-body p { font-size: 0.88rem; }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid rgba(36, 41, 31, 0.2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage-dark);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.portfolio-card:hover .link-more,
.portfolio-card:focus-visible .link-more {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: var(--white);
}

/* WORK EXPERIENCE */
.experience { padding: 0 0 40px; }

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.experience-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: 28px 32px;
}

.experience-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.experience-head h3 { font-size: 1.1rem; margin: 0; }
.experience-date { font-size: 0.88rem; color: var(--ink-soft); white-space: nowrap; }

.experience-card ul { display: flex; flex-direction: column; gap: 8px; }
.experience-card li {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-left: 18px;
  position: relative;
}
.experience-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.experience-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* PROJECT MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 28, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 88vh;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.4);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-card { transform: translateY(0); }

.modal-scroll {
  max-height: 88vh;
  overflow-y: auto;
  padding: 44px 44px 36px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream-2);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
}
.modal-close:hover { background: var(--cream); }

.modal-subtitle { font-size: 1rem; margin-bottom: 24px; }

.modal-thumb-link {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--cream-2);
  overflow: hidden;
  cursor: zoom-in;
}
.modal-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.modal-thumb-hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 28px;
  text-align: right;
}

.modal-section { margin-bottom: 28px; }
.modal-section h3 { font-size: 1.15rem; margin-bottom: 12px; }
.modal-section ul { display: flex; flex-direction: column; gap: 10px; }
.modal-section li {
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding-left: 20px;
  position: relative;
}
.modal-section li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}
.modal-section li strong { color: var(--ink); }

#modalAchievements li,
#modalChallenges li {
  padding-left: 26px;
}
#modalAchievements li::before,
#modalChallenges li::before {
  top: 1px;
  width: 16px;
  height: 16px;
  border-radius: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
#modalAchievements li::before {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6b52' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
#modalChallenges li::before {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b5793a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-tag {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(36,41,31,0.25);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.modal-cta {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(36,41,31,0.08);
}
.modal-credentials {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
}

body.modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .modal-scroll { padding: 56px 22px 28px; }
}

/* FOOTER */
.site-footer {
  background: var(--sage-dark);
  color: rgba(255,255,255,0.85);
  padding: 28px 0;
  text-align: center;
  font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo-wrap { order: -1; }
  .hero-photo { max-width: 260px; }
  .process-inner { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav { position: absolute; top: 72px; left: 0; right: 0; background: var(--cream); flex-direction: column; padding: 16px 24px; gap: 16px; border-bottom: 1px solid rgba(36,41,31,0.08); display: none; }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .contact-call.btn { display: inline-flex; }
  .contact-email.btn { display: none; }
  .header-actions { gap: 8px; }
  .header-actions .btn-sm { padding: 8px 12px; font-size: 0.78rem; }
  .logo-name { display: none; }
  .about-card { padding: 36px 22px; }
  .process-steps { flex-direction: column; }
  .step-col-offset { margin-top: 0; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .experience-head { flex-direction: column; align-items: flex-start; }
}
