:root {
  --bg: #f7f5f0;
  --paper: #fffdf8;
  --ink: #1c1b18;
  --muted: #726d64;
  --line: rgba(28, 27, 24, 0.14);
  --accent: #8d6e4f;
  --soft: #e4ded3;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "PingFang TC",
    "Microsoft JhengHei",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  background: rgba(247, 245, 240, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand-text {
  max-width: 170px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.menu-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 0;
}

.menu-button span {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--ink);
}

.menu-panel {
  position: fixed;
  inset: 59px 0 auto;
  z-index: 18;
  display: grid;
  gap: 1px;
  padding: 0 18px 18px;
  background: rgba(247, 245, 240, 0.96);
  border-bottom: 1px solid var(--line);
  transform: translateY(-115%);
  transition: transform 220ms ease;
}

.menu-panel.is-open {
  transform: translateY(0);
}

.menu-panel a {
  padding: 18px 0;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

main {
  max-width: 760px;
  margin: 0 auto;
}

.intro {
  padding: 58px 18px 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  max-width: 8em;
  font-size: 46px;
  line-height: 1.05;
}

h2 {
  font-size: 31px;
  line-height: 1.16;
}

.intro p:not(.eyebrow),
.detail-lead,
.text-block p,
.process,
.contact {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.intro p:not(.eyebrow) {
  max-width: 24em;
  margin: 22px 0 0;
}

.portfolio {
  padding-top: 28px;
}

.portfolio-title {
  padding: 0 18px 22px;
}

.portfolio-title h1 {
  font-size: 36px;
}

.project-list {
  display: grid;
  gap: 26px;
  padding: 0 18px 48px;
}

.project-card {
  margin: 0;
}

.project-trigger {
  position: relative;
  display: block;
  width: 100%;
  min-height: 430px;
  overflow: hidden;
  padding: 0;
  color: var(--paper);
  text-align: left;
  background: var(--soft);
  border: 0;
  border-radius: 0;
}

.project-trigger img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.project-trigger::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.54));
}

.project-trigger:active img {
  transform: scale(1.03);
}

.project-index {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 1;
  font-family: Georgia, serif;
  font-size: 18px;
}

.project-copy {
  position: absolute;
  right: 18px;
  bottom: 20px;
  left: 18px;
  z-index: 1;
}

.project-copy strong {
  display: block;
  margin-bottom: 9px;
  font-size: 25px;
  font-weight: 500;
}

.project-copy small {
  display: block;
  color: rgba(255, 253, 248, 0.86);
  font-size: 13px;
}

.process,
.contact {
  padding: 42px 18px;
  border-top: 1px solid var(--line);
}

.steps {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.steps p {
  display: flex;
  gap: 18px;
  align-items: baseline;
  margin: 0;
  color: var(--ink);
}

.steps span {
  color: var(--accent);
  font-family: Georgia, serif;
}

.contact {
  display: grid;
  gap: 10px;
  padding-bottom: 72px;
}

.contact a {
  color: var(--ink);
  font-size: 18px;
  text-decoration: none;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.contact .social-link {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.social-link[aria-label="Facebook"] svg {
  fill: currentColor;
  stroke: none;
}

.detail-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  background: var(--paper);
}

.detail-view[hidden] {
  display: none;
}

.back-button {
  position: sticky;
  top: 0;
  z-index: 2;
  width: 100%;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 253, 248, 0.92);
  border: 0;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.detail-hero {
  display: grid;
}

.detail-hero img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.detail-title {
  padding: 30px 18px 26px;
}

.detail-title h2 {
  margin-bottom: 16px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.meta li {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
}

.detail-section {
  padding: 0 18px 34px;
}

.detail-section img {
  width: 100%;
  margin: 0 0 16px;
  aspect-ratio: 1 / 1.18;
  object-fit: cover;
}

.text-block {
  margin: 4px 0 28px;
}

.text-block h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 500;
}

.text-block p {
  margin: 0;
}

.detail-cta {
  display: grid;
  gap: 12px;
  padding: 28px 18px 52px;
  background: var(--bg);
}

.detail-cta a,
.detail-cta button {
  display: block;
  width: 100%;
  padding: 16px;
  color: var(--paper);
  font-size: 15px;
  text-align: center;
  text-decoration: none;
  background: var(--ink);
  border: 1px solid var(--ink);
}

.detail-cta button {
  color: var(--ink);
  background: transparent;
}

@media (min-width: 640px) {
  h1 {
    font-size: 58px;
  }

  .project-list {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
  }

  .project-trigger {
    min-height: 520px;
  }

  .detail-view {
    left: 50%;
    width: min(760px, 100%);
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px var(--line);
  }
}
