:root {
  --navy: #202e2d;
  --muted: #665c55;
  --wine: #812b3c;
  --line: #ded6ca;
  --paper: #faf9f5;
}
header { border-bottom: 1px solid var(--line); }
header .brand strong { color: #482a2e; }
nav .query-link { border-color: #c6b8af; }
button, .query-link:hover { background: var(--wine); }
button:hover { background: #66202d; }
.journal { margin-block: 2.3rem 2.8rem; scroll-margin-top: 1rem; }
.section-heading h2 { font-family: "Songti SC","SimSun",serif; font-size: 1.75rem; font-weight: 700; }
.journal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.25rem; }
.journal-card { min-width: 0; border: 1px solid var(--line); background: #fff; border-radius: .35rem; }
.journal-card a { display: block; height: 100%; }
.journal-card a:hover { text-decoration: none; }
.journal-card a:hover h3, .journal-card a:focus-visible h3 { color: var(--wine); text-decoration: underline; text-underline-offset: .2em; }
.journal-photo { aspect-ratio: 1.85; overflow: hidden; background: #e4ded3; border-radius: .3rem .3rem 0 0; }
.journal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.journal-card:nth-child(2) .journal-photo { background: #1c1d19; }
.journal-card:nth-child(2) img { object-fit: contain; }
.journal-card:nth-child(3) img { object-position: 50% 42%; }
.journal-copy { padding: .95rem 1.15rem 1.2rem; }
.topic { color: var(--wine); font-size: .88rem; letter-spacing: .06em; font-weight: 700; }
.journal-copy h3 { font-size: 1.17rem; line-height: 1.5; margin: .3rem 0 .45rem; }
.card-intro { color: var(--muted); }
.card-intro { font-size: .96rem; line-height: 1.7; }
.query { margin: 1.9rem 0 2.2rem; box-shadow: none; border-color: var(--line); }
.services { margin-block: 0 1.7rem; }
.steps, .query { background: #fff; }
footer { background: #182c2d; }
footer .label-photo { object-fit: cover; border-radius: .1rem; }
.reader { width: min(calc(100% - 2.5rem), 45rem); margin: 1.65rem auto 3rem; }
.crumb { display:flex; gap:.7rem; align-items:center; font-size:.88rem; margin:0 0 2rem; color: var(--muted); }
.reader h1 { font-size: clamp(2.05rem,4vw,3.25rem); line-height: 1.3; color: #4b232f; }
.reader article > section p, .story-lead { font-size: 1.04rem; line-height: 1.95; }
.story-figure { margin: 1.5rem 0; border-block: 1px solid var(--line); padding: 1rem 0 .7rem; }
.story-figure img { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.story-figure figcaption { margin-top: .65rem; font-size: .88rem; color: var(--muted); }
.reader a { text-decoration: underline; text-underline-offset: .2em; }
.reader article > section { margin: 1.5rem 0; }
.reader article > section h2 { font-size: 1.32rem; margin-bottom: .5rem; }
.credits { margin-top: .85rem; border: none; color: var(--muted); font-size: .875rem; }
.credits summary { display: inline-block; padding: .25rem 1.25rem .25rem 0; font-weight: 500; }
.credits summary::after { right: 0; font-size: 1rem; }
.credits p { padding: .3rem 0; }
.credits a { text-decoration: underline; text-underline-offset: .2em; }
.reader .credits { margin: 1.5rem 0; }
.story-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1.25rem; }
@media (max-width: 52rem) {
  .journal-grid { gap: .75rem; }
  .journal-copy { padding: .75rem; }
}
@media (max-width: 39rem) {
  .journal { margin: 1.55rem 0 2rem; }
  .journal-grid { grid-template-columns: 1fr; gap: .75rem; }
  .journal-card a { display: grid; grid-template-columns: minmax(0,.82fr) minmax(0,1.42fr); }
  .journal-photo { aspect-ratio: auto; border-radius: .3rem 0 0 .3rem; min-height: 8.5rem; position: relative; }
  .journal-photo img { position: absolute; inset: 0; }
  .journal-copy h3 { font-size: 1.04rem; }
  .card-intro { font-size: .9rem; }
  .section-heading h2 { font-size: 1.45rem; }
  .query { margin: 1.25rem 0 1.6rem; }
  .reader { width: calc(100% - 2rem); margin-top: 1.2rem; }
  .reader article > section p, .story-lead { font-size: 1rem; }
  .crumb { margin-bottom: 1.2rem; }
}
.estate { position: relative; isolation: isolate; overflow: hidden; background: #182c2d; color: #fff; }
.estate-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 79%; z-index: -2; }
.estate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(8,23,26,.90) 0%,rgba(10,27,29,.79) 27%,rgba(12,28,31,.32) 52%,rgba(12,24,25,.04) 72%); z-index: -1; }
.estate-layout { min-height: clamp(28rem,39vw,39rem); display: flex; align-items: center; padding-block: 3rem; }
.estate-copy { max-width: 35rem; }
.estate-company { color: #f1dcb5; display: flex; align-items: center; gap: .7rem; font-size: .97rem; letter-spacing: .11em; }
.estate-company::before { content: ""; width: 2.05rem; height: 1px; background: #dbbd8e; }
.estate h1 { margin: 1.2rem 0 .8rem; color: #fffaf0; font-family: "Songti SC","STSong","SimSun",serif; font-size: clamp(3.6rem,5.4vw,5.65rem); line-height: 1.14; letter-spacing: .06em; }
.estate-intro { font-size: 1.04rem; line-height: 1.85; color: #fbf4e7; }
.estate-actions { display: flex; align-items: center; gap: 1.7rem; margin-top: 1.65rem; }
.estate-primary { padding: .66rem 1.24rem; background: #efd9ac; color: #263231; font-weight: 700; border-radius: .16rem; }
.estate-primary:hover { background: #fae7c5; text-decoration: none; }
.estate-secondary, .license-original { text-decoration: underline; text-underline-offset: .3rem; }
.estate-caption { position: absolute; right: max(1rem,calc((100% - 73rem)/2)); bottom: .9rem; color: #fff; background: #142627df; font-size: .875rem; padding: .27rem .65rem; border: 1px solid #ffffff50; }
.atelier { margin-block: 3.25rem 2.8rem; scroll-margin-top: 1rem; }
.atelier-grid { display: grid; grid-template-columns: 1.85fr 1fr 1fr 1fr; gap: 1rem; }
.atelier-item { margin: 0; min-width: 0; }
.atelier-item a { display: block; height: clamp(12rem,17.5vw,17rem); background: #e6e3db; overflow: hidden; }
.atelier-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.atelier-item:nth-child(2) img { object-position: 50% 34%; }
.atelier-item:nth-child(3) img { object-position: 50% 65%; }
.atelier-item figcaption { padding: .57rem 0; font-weight: 600; border-bottom: 1px solid var(--line); }
.zoom-photo { cursor: zoom-in; }
.license-section { display: grid; grid-template-columns: minmax(11rem,19rem) 1fr; gap: clamp(1.5rem,5vw,4.5rem); align-items: center; background: #f0eee6; border-block: 1px solid #d7ccba; padding: 1.5rem clamp(1rem,4vw,3rem); scroll-margin-top: 1rem; }
.license-preview { display: block; }
.license-preview img { display: block; width: 100%; height: auto; box-shadow: 0 4px 16px #29261d1a; }
.license-label { color: #785339; letter-spacing: .14em; font-size: .88rem; font-weight: 650; }
.license-copy h2 { font: 700 clamp(1.65rem,3vw,2.45rem)/1.4 "Songti SC","SimSun",serif; margin: .2rem 0 .6rem; }
.license-original { display: inline-block; margin-top: .85rem; font-weight: 600; font-size: .94rem; }
#photo-viewer { width: fit-content; max-width: min(94vw,79rem); max-height: 94vh; border: 1px solid #b6ad9b; padding: clamp(.7rem,1.5vw,1.25rem); color: #1e3333; background: #fcfaf5; }
#photo-viewer::backdrop { background: #101a1bea; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; padding-bottom: .65rem; }
.viewer-bar h2 { font-size: 1.1rem; }
.viewer-bar button { margin: 0; min-height: 2.4rem; padding: .38rem .85rem; font-size: .9rem; background: #253d3d; }
#viewer-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 70vh; margin-inline: auto; object-fit: contain; }
#viewer-description { margin-top: .6rem; font-size: .94rem; }
@media(max-width: 52rem) {
  .atelier-grid { gap: .65rem; grid-template-columns: 1.45fr repeat(3,1fr); }
  .estate-intro { max-width: 22rem; }
}
@media(max-width: 39rem) {
  .estate { display: flex; flex-direction: column; }
  .estate-layout { order: -1; min-height: auto; padding-block: 1.65rem 1.5rem; }
  .estate-image { position: static; height: auto; aspect-ratio: 2.02; object-position: 50% 81%; z-index: auto; }
  .estate::before { display: none; }
  .estate h1 { font-size: clamp(2.1rem,8.3vw,3rem); margin: .55rem 0; line-height: 1.25; letter-spacing: .01em; }
  .estate h1 br { display: none; }
  .estate-company { font-size: .89rem; }
  .estate-company::before { width: 1.3rem; }
  .estate-intro { font-size: .95rem; max-width: 24rem; }
  .estate-actions { margin-top: .9rem; gap: 1.2rem; }
  .estate-primary { padding: .52rem .92rem; }
  .estate-caption { bottom: .35rem; right: .5rem; font-size: .75rem; padding: .1rem .35rem; }
  nav .gallery-nav, nav .license-nav { display: none; }
  .atelier { margin-block: 1.7rem; }
  .atelier-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem .7rem; }
  .atelier-item a { height: clamp(9rem,43vw,15rem); }
  .atelier-item figcaption { font-size: .95rem; }
  .license-section { grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); gap: .9rem; padding: .85rem; }
  .license-copy h2 { font-size: 1.38rem; margin: .05rem 0 .2rem; }
  .license-copy > p:not(.license-label) { font-size: .88rem; }
  .license-original { margin-top: .35rem; font-size: .85rem; }
}
.primary-nav { gap: clamp(.75rem,2.2vw,2.2rem); }
.primary-nav a[aria-current="page"] { color: var(--wine); text-decoration: underline; text-underline-offset: .48em; text-decoration-thickness: 2px; }
.home-page .estate-layout { min-height: clamp(22rem,30vw,28rem); padding-block: 1.8rem; }
.home-page .estate h1 { font-size: clamp(3rem,4.3vw,4.2rem); margin-block: .7rem; }
.home-page .estate-actions { margin-top: 1.1rem; }
.home-page .query { margin-block: 1.6rem 2.2rem; }
.directory-page { min-height: 100vh; display: flex; flex-direction: column; }
.directory-body { flex: 1; padding-block: 1.8rem 3rem; }
.directory-body .atelier, .directory-body .services, .directory-body .journal { margin: 0; }
.directory-body h1 { font-size: clamp(2rem,3.6vw,3.1rem); line-height: 1.26; margin: 0; }
.directory-body .crumb { margin-bottom: 1.5rem; }
.company-profile { margin-bottom: 2rem; }
.profile-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(1.8rem,5vw,4.4rem); align-items: start; margin-top: 1.6rem; }
.profile-text h2 { margin-bottom: .85rem; font-size: clamp(1.25rem,2vw,1.65rem); }
.profile-text p { line-height: 1.95; margin-bottom: .85rem; }
.profile-text a, .help-return a { text-decoration: underline; text-underline-offset: .22rem; }
.registry { padding: 1rem 1.15rem; border-top: 2px solid #97734d; background: #f1eee7; }
.registry h3 { font-size: 1.03rem; }
.registry dl { margin: .55rem 0 0; }
.registry dl div { display: grid; grid-template-columns: 4.5rem 1fr; gap: .65rem; padding: .55rem 0; }
.registry dl div + div { border-top: 1px solid var(--line); }
.registry dt { color: var(--muted); }
.registry dd { margin: 0; }
.directory-body .help { margin-bottom: 1.6rem; }
.help-return { text-align: right; }
@media(max-width:45rem) {
  .site-mast { display: grid; gap: .4rem; padding-block: .55rem .65rem; }
  .primary-nav { flex-wrap: wrap; column-gap: clamp(.45rem,2vw,1rem); row-gap: .3rem; }
  .primary-nav a { font-size: .875rem; white-space: nowrap; }
  .primary-nav .query-link { padding: 0; border: 0; color: var(--wine); }
  .primary-nav .query-link:hover { background: transparent; text-decoration: underline; }
  .profile-grid { grid-template-columns: 1fr; gap: .9rem; }
  .directory-body { padding-block: 1.15rem 2rem; }
}
@media(max-width:39rem) {
  .home-page .estate-layout { min-height: auto; padding-block: .95rem; }
  .home-page .estate h1 { font-size: clamp(1.9rem,7.5vw,2.6rem); margin: .42rem 0; }
  .home-page .estate-actions { display: none; }
  .home-page .estate-image { aspect-ratio: 2.6; object-position: 50% 83%; }
  .home-page .query { margin-block: 1rem 1.4rem; }
  .home-page .tip-link { display: inline; }
}
