: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;
}

.portfolio,
.process,
.service-notes,
.seo-faq,
.contact {
  scroll-margin-top: 72px;
}

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%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  color: var(--paper);
  text-align: left;
  background: var(--soft);
  border: 0;
  border-radius: 0;
}

.project-trigger.is-portrait {
  aspect-ratio: var(--photo-ratio);
}

.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,
.service-notes,
.seo-faq,
.contact {
  padding: 42px 18px;
  border-top: 1px solid var(--line);
}

.process,
.service-notes {
  position: relative;
  left: 50%;
  width: min(980px, calc(100vw - 36px));
  transform: translateX(-50%);
}

.process {
  padding-top: 88px;
  padding-bottom: 96px;
  text-align: center;
  background: var(--paper);
}

.process .eyebrow,
.service-notes .eyebrow {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.process-lead {
  max-width: 34em;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(126px, auto));
  grid-auto-flow: column;
  gap: 46px 86px;
  margin-top: 72px;
  text-align: left;
}

.step-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 22px;
  min-height: 126px;
}

.step-icon {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
}

.step-icon::after {
  position: absolute;
  top: 70px;
  bottom: -56px;
  left: 50%;
  width: 1px;
  content: "";
  background: var(--line);
}

.step-card:nth-child(3) .step-icon::after,
.step-card:nth-child(6) .step-icon::after {
  display: none;
}

.step-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.step-heading {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 40px;
}

.step-heading span {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.step-card h3,
.note-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.step-card p {
  margin: 9px 0 0 38px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.service-notes {
  padding-top: 84px;
  padding-bottom: 92px;
  text-align: center;
  background: var(--bg);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 54px;
  text-align: left;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.note-card {
  min-height: 260px;
  padding: 34px 30px;
  border-left: 1px solid var(--line);
}

.note-card:first-child {
  border-left: 0;
}

.note-card .note-index {
  margin: 0 0 22px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
  letter-spacing: 0.05em;
}

.note-card > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.service-footnote {
  max-width: 46em;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.seo-faq {
  padding-top: 78px;
  padding-bottom: 84px;
  background: var(--paper);
}

.faq-lead {
  max-width: 42em;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.faq-list {
  margin-top: 42px;
  border-top: 1px solid var(--line);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 24px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  grid-column: 3;
  color: var(--accent);
  content: "+";
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list summary span {
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 2.15;
}

.faq-list details > p {
  max-width: 48em;
  margin: -12px 0 26px 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

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

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

.contact .form-link {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  margin: 8px 0 4px;
  padding: 15px 18px;
  color: var(--paper);
  font-size: 15px;
  background: var(--ink);
}

.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: 16 / 9;
  object-fit: cover;
}

.detail-hero img.is-portrait,
.detail-section img.is-portrait {
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

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

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

.case-subtitle {
  margin: -6px 0 18px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.45;
}

.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);
}

.fact-list {
  display: grid;
  gap: 1px;
  margin: 26px 0 0;
  padding: 0;
  background: var(--line);
}

.fact-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 16px;
  padding: 13px 0;
  background: var(--paper);
}

.fact-list dt {
  color: var(--accent);
  font-size: 13px;
}

.fact-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

.concept-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

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

.concept-block p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.planning-block {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

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

.planning-block h3 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 500;
}

.planning-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.planning-list section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.planning-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.planning-list p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

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

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

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

.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;
  }

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

@media (min-width: 900px) {
  main {
    max-width: 1180px;
  }

  .portfolio {
    padding-top: 46px;
  }

  .portfolio-title {
    padding-right: 24px;
    padding-bottom: 28px;
    padding-left: 24px;
  }

  .project-list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px;
    padding-right: 24px;
    padding-bottom: 72px;
    padding-left: 24px;
  }

  .project-card {
    grid-column: span 2;
  }

  .project-card:nth-child(-n + 2) {
    grid-column: span 3;
  }

  .seo-faq,
  .contact {
    width: min(760px, 100%);
    margin-right: auto;
    margin-left: auto;
  }
}

@media (max-width: 639px) {
  .seo-faq {
    padding-top: 62px;
    padding-bottom: 68px;
  }

  .faq-list summary {
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    font-size: 15px;
  }

  .faq-list details > p {
    margin-left: 38px;
  }

  .process,
  .service-notes {
    left: auto;
    width: calc(100% - 16px);
    margin-right: 8px;
    margin-left: 8px;
    padding-right: 24px;
    padding-left: 24px;
    transform: none;
  }

  .process {
    padding-top: 68px;
    padding-bottom: 74px;
  }

  .process h2,
  .service-notes h2 {
    font-size: 29px;
  }

  .steps {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
    gap: 38px;
    margin-top: 54px;
  }

  .step-card {
    grid-template-columns: 50px 1fr;
    gap: 17px;
    min-height: 118px;
  }

  .step-icon {
    width: 50px;
    height: 50px;
  }

  .step-icon svg {
    width: 36px;
    height: 36px;
  }

  .step-icon::after {
    top: 62px;
    bottom: -48px;
  }

  .step-card:nth-child(3) .step-icon::after {
    display: block;
  }

  .step-card:last-child .step-icon::after {
    display: none;
  }

  .step-card p {
    margin-left: 0;
  }

  .service-notes {
    padding-top: 66px;
    padding-bottom: 72px;
  }

  .note-grid {
    grid-template-columns: 1fr;
    margin-top: 42px;
  }

  .note-card {
    min-height: 0;
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .note-card:last-child {
    border-bottom: 0;
  }
}
