:root {
  --paper: #f6f1e7;
  --surface: #fbf8f1;
  --ink: #3b3128;
  --muted: #7a6d5f;
  --line: #e2d9c8;
  --sage: #6f7f63;
  --sage-strong: #56644c;
  --sage-tint: #e6e9dc;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.8;
  color: var(--ink);
  background-color: var(--paper);
}

h1, h2, h3, h4, .navbar-brand {
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  color: var(--ink);
}

p {
  color: var(--muted);
}

a {
  color: var(--sage-strong);
}

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

/* ---------- Navbar ---------- */
.site-nav {
  background-color: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav-photo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  margin-right: 0.75rem;
  border: 1px solid var(--line);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-link {
  color: var(--muted) !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--sage-strong) !important;
}

/* ---------- Hero ---------- */
.hero-wrap {
  padding: 3rem 0 2rem;
}

.profile-photo {
  display: block;
  width: min(280px, 70%);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  object-fit: cover;
  /* 拱門造型：整個頁面唯一的視覺焦點 */
  border-radius: 999px 999px 12px 12px;
  border: 1px solid var(--line);
  box-shadow: 14px 14px 0 var(--sage-tint);
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
}

/* ---------- Sections ---------- */
.section-block {
  padding: 3.5rem 0 0.5rem;
  scroll-margin-top: 72px;
}

.section-heading {
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ---------- Highlights ---------- */
.highlight-card {
  height: 100%;
  padding: 1.5rem;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sage);
  border-radius: 8px;
}

.highlight-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.highlight-card p {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.highlight-proof {
  font-size: 0.85rem;
  color: var(--sage-strong);
}

.tech-heading {
  margin: 2rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tech-tags li {
  padding: 0.2rem 0.9rem;
  font-size: 0.9rem;
  color: var(--sage-strong);
  background-color: var(--sage-tint);
  border-radius: 999px;
}

/* ---------- Project / award / activity cards ---------- */
.project-card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--sage-tint);
}

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

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.project-card p {
  margin: 0;
  font-size: 0.95rem;
}

.project-card .p-4 {
  flex: 1;
}

.project-card[role="button"] {
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.project-card[role="button"]:hover {
  border-color: var(--sage);
}

.card-hint {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--sage-strong);
}

/* ---------- Detail modal ---------- */
.modal-content {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background-color: var(--sage-tint);
  border-radius: 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 3rem;
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
}

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.footer-email {
  justify-self: start;
}

.footer-instagram {
  justify-self: end;
}

.footer-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .hero-wrap {
    padding-top: 2rem;
  }

  .profile-photo {
    box-shadow: 10px 10px 0 var(--sage-tint);
  }
}

@media (max-width: 767.98px) {
  .footer-content {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.5rem;
  }

  .footer-email,
  .footer-instagram {
    justify-self: center;
  }
}

@media (max-width: 767.98px) {
  .section-block {
    padding-top: 2.5rem;
  }
}
