:root {
  --bg: #f3efe8;
  --paper: #f7f4ef;
  --text: #221f1b;
  --muted: #6d675f;
  --line: #e3dcd2;
  --accent: #9a4e32;
  --max: 1080px;
  --pad: 20px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: inherit; }

img { display: block; max-width: 100%; }

.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 8px;
}

.brand {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.hero { padding: 48px 0 28px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero p {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 8px;
  padding: 8px 0 22px;
}

.filters a {
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  line-height: 1.4;
}

.filters a.is-on {
  background: var(--text);
  color: var(--paper);
  border-color: var(--text);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 28px;
}

.card { text-decoration: none; }

.card img,
.frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper);
  border: 1px solid var(--line);
}

.card h2 {
  margin: 12px 0 0;
  font-size: 18px;
  font-weight: 600;
}

.kicker {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.summary {
  margin: 4px 0 0;
  color: var(--muted);
}

.contact {
  border-top: 1px solid var(--line);
  padding: 36px 0 72px;
}

.qr {
  width: 168px;
  height: 168px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  margin: 8px 0 4px;
}

.qr-caption {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.contact h2 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.contact .lead {
  margin: 0 0 20px;
  color: var(--muted);
}

.row-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 0 0 10px;
}

.row-line span { min-width: 4em; color: var(--muted); }

button,
.button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf6;
}

.detail { padding: 28px 0 20px; }

.detail h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.detail-summary {
  margin: 8px 0 0;
  font-size: 18px;
}

.story {
  display: flex;
  flex-direction: column;
  gap: 36px;
  margin-top: 28px;
}

.zoom-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.story figure { margin: 0; }

.story a { display: block; cursor: zoom-in; }

.pswp__custom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 20px;
  color: #f7f4ef;
  background: rgba(34, 31, 27, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.story img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
}

.story figcaption {
  margin-top: 10px;
  line-height: 1.5;
}

.detail .frame {
  margin: 12px 0 16px;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.empty {
  color: var(--muted);
  padding: 24px 0 48px;
}

.admin {
  padding: 12px 0 64px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 20px;
  margin: 0 0 16px;
}

.panel h1,
.panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 600;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
}

textarea { min-height: 72px; resize: vertical; }

.form-actions { margin-top: 16px; }

.note {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.work-admin {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.work-admin img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg);
}

.work-admin .meta { flex: 1; min-width: 0; }

.work-admin strong { display: block; }

.work-admin em {
  font-style: normal;
  color: var(--muted);
  font-size: 13px;
}

.error { color: var(--accent); min-height: 1.4em; }

.error[data-kind="ok"] { color: var(--muted); }

.hidden { display: none; }

@media (min-width: 768px) {
  .hero { padding-top: 72px; }
  .hero h1 { font-size: 64px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 48px 28px; }
}

.case-frame { border-top: 1px solid var(--line); padding: 16px 0; }
.case-frame img { width: 100%; max-width: 360px; height: auto; display: block; }
.case-frame label { overflow-wrap: anywhere; }
.case-actions { display: flex; gap: 8px; }
button:disabled { opacity: .5; cursor: wait; }

/* A quiet frame keeps the artwork, rather than controls, as the visual focus. */
.showcase { margin-top: 32px; margin-bottom: 36px; }
.showcase-slide { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); min-height: 410px; background: var(--paper); border: 1px solid var(--line); }
.showcase-slide[hidden] { display: none; }
.showcase-copy { padding: 36px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; }
.eyebrow { font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 0 24px; }
.showcase-copy h1 { font-size: clamp(26px, 3.3vw, 42px); line-height: 1.3; letter-spacing: -.025em; margin: 0 0 20px; overflow-wrap: anywhere; }
.showcase-description { color: var(--muted); margin: 0 0 28px; font-size: 15px; overflow-wrap: anywhere; }
.showcase-link { display: inline-flex; align-items: center; gap: 20px; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 5px; font-size: 14px; }
.showcase-image { display: flex; align-items: center; justify-content: center; background: #e8e3da; min-width: 0; overflow: hidden; }
.showcase-image img { width: 100%; height: 100%; max-height: 530px; object-fit: contain; }
.showcase-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.showcase-dots, .showcase-actions { display: flex; align-items: center; gap: 4px; }
.showcase-dots button { border: 0; padding: 12px 8px; min-height: 44px; background: none; }
.showcase-dots span { display: block; width: 18px; height: 3px; background: var(--line); }
.showcase-dots [aria-pressed="true"] span { background: var(--text); }
.showcase-actions button { min-height: 44px; min-width: 44px; padding: 6px 10px; font-size: 14px; }
.about-page { padding-top: 64px; padding-bottom: 72px; }
.about-page h1 { font-size: clamp(32px, 5vw, 56px); line-height: 1.3; margin: 0 0 32px; overflow-wrap: anywhere; }
.about-text { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 740px; font-size: 18px; line-height: 1.95; margin-bottom: 40px; }
#presentation-fields { padding: 0; border: 0; min-width: 0; }
#presentation-fields legend { font-size: 20px; font-weight: 600; }
.banner-editor { border-top: 1px solid var(--line); padding: 20px 0; }
.banner-editor > img { max-height: 210px; width: 100%; object-fit: contain; background: var(--bg); margin-bottom: 16px; }
#aboutText { min-height: 200px; }
@media (max-width: 767px) {
  .nav { flex-wrap: wrap; gap: 10px; }
  .nav-links { gap: 14px; }
  .showcase { margin-top: 24px; }
  .showcase-slide { grid-template-columns: 1fr; min-height: 0; }
  .showcase-image { grid-row: 1; aspect-ratio: 4 / 3; }
  .showcase-copy { padding: 24px; }
  .showcase-copy .eyebrow { margin-bottom: 14px; }
  .showcase-copy h1 { font-size: 28px; margin-bottom: 14px; }
  .showcase-description { margin-bottom: 20px; }
  .about-page { padding-top: 40px; padding-bottom: 48px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.about-profile { display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: stretch; gap: 28px; padding-top: 36px; padding-bottom: 48px; border-top: 1px solid var(--line); }
.about-portrait { background: #ded8cf; min-height: 290px; }
.about-portrait img { width: 100%; height: 100%; max-height: 400px; object-fit: cover; }
.portrait-placeholder { height: 100%; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; background: #29413d; color: #f3efe8; min-height: 290px; }
.portrait-placeholder span { font-size: 11px; letter-spacing: .14em; opacity: .7; }
.portrait-placeholder strong { font-size: 34px; font-weight: 400; line-height: 1.5; }
.about-intro { align-self: center; min-width: 0; }
.about-intro .eyebrow { margin-bottom: 8px; }
.about-intro h1, .about-intro h2 { margin: 0 0 16px; font-size: 26px; overflow-wrap: anywhere; }
.about-intro p:not(.eyebrow) { font-size: 14px; color: var(--muted); margin: 0 0 20px; overflow-wrap: anywhere; }
.about-intro .about-greeting { color: var(--text); }
.about-proof { align-self: center; min-width: 0; }
.service-grid, .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 12px; text-align: center; }
.service-grid svg { display: block; width: 30px; height: 30px; margin: 0 auto 8px; }
.service-grid span, .stats-grid span { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.stats-grid { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; }
.stats-grid strong { display: block; font-size: 25px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.stat-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-preview { max-height: 240px; width: auto; margin: 12px 0; }
.showcase-slide { height: 480px; }
.showcase-copy h1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.showcase-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.showcase-image img { min-height: 0; }
@media (max-width: 900px) {
  .about-profile { grid-template-columns: .9fr 1.2fr; }
  .about-proof { grid-column: 1 / -1; }
  .service-grid, .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .showcase-slide { height: auto; }
  .showcase-copy { height: 320px; }
  .showcase-copy h1 { -webkit-line-clamp: 2; }
  .showcase-description { -webkit-line-clamp: 3; }
  .showcase-image img { max-height: 100%; }
}
@media (max-width: 560px) {
  .about-profile { grid-template-columns: 1fr; gap: 24px; }
  .about-portrait { aspect-ratio: 4 / 3; min-height: 0; }
  .about-portrait img { height: 100%; }
  .portrait-placeholder { min-height: 0; }
}
