:root {
  color-scheme: light;
  --ink: #263729;
  --muted: #687567;
  --green: #617848;
  --green-dark: #3d5434;
  --cream: #fbf8ef;
  --line: #e2dfd2;
  --paper: #fffefa;
  --gold: #b99245;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(211, 224, 183, .35), transparent 28rem),
    linear-gradient(180deg, #fffdf7 0, #f7f5eb 100%);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
  min-height: 100vh;
}

a { color: inherit; }

#global-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  padding: 11px clamp(16px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 254, 249, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #a8b994;
  border-radius: 50%;
  color: var(--green-dark);
  font-size: 1.25rem;
}

#global-header nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
#global-header nav a { font-family: sans-serif; font-size: .86rem; font-weight: 750; text-decoration: none; }
#global-header nav a:hover { color: var(--green); }

.lang-select {
  border: 1px solid #bcc7b3;
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--ink);
  background: #fff;
  font: 700 .82rem sans-serif;
}

.shop-hero {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 72px 24px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(255,253,246,.98), rgba(255,253,246,.68)),
    radial-gradient(circle at 82% 48%, rgba(128, 157, 90, .42), transparent 28rem);
}

.shop-hero::before,
.shop-hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(100, 126, 72, .15);
  border-radius: 50% 5% 50% 5%;
  transform: rotate(35deg);
}
.shop-hero::before { width: 250px; height: 115px; right: -35px; top: 30px; }
.shop-hero::after { width: 180px; height: 80px; left: -30px; bottom: 18px; }

.shop-hero-content { position: relative; width: min(760px, 100%); }
.eyebrow { color: var(--green); font: 800 .78rem sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.shop-hero h1 { margin: 15px 0 12px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.28; letter-spacing: .08em; }
.shop-hero p { margin: 0 auto; max-width: 640px; color: #576457; font-size: clamp(.95rem, 2vw, 1.12rem); line-height: 2; }

.shop-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 80px; }
.shop-category-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 56px;
  font-family: sans-serif;
}
.shop-category-nav a {
  padding: 10px 18px;
  border: 1px solid #bcc9b3;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255,255,255,.78);
  font-size: .84rem;
  font-weight: 800;
  text-decoration: none;
}
.shop-category-nav a:hover { border-color: var(--green); background: #eff5e9; }
.listing-section { scroll-margin-top: 90px; }
.listing-section + .listing-section { margin-top: 76px; padding-top: 62px; border-top: 1px solid var(--line); }
.section-heading { text-align: center; margin-bottom: 30px; }
.category-kicker { margin-bottom: 8px; color: var(--green); font: 800 .72rem sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.section-heading h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: .08em; }
.section-heading p { margin: 0; color: var(--muted); font-family: sans-serif; }

.listing-status-group { margin-top: 20px; }
.listing-status-group:first-child { margin-top: 0; }
.listing-status-group-closed { margin-top: 38px; padding-top: 30px; border-top: 1px solid var(--line); }
.listing-status-heading { margin: 0 0 14px; color: var(--green-dark); font-size: 1.2rem; }
.listing-status-group-closed .listing-status-heading { color: #6f776f; }
.listing-status-group-closed .listing-card { opacity: .86; }
.listing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.listing-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 0 18px 45px rgba(56, 67, 49, .07);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 24px 54px rgba(56, 67, 49, .14); }
.listing-photo { position: relative; aspect-ratio: 4 / 3; background: #eef0e6; overflow: hidden; }
.listing-photo-link { display: block; width: 100%; height: 100%; }
.listing-main-image { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.listing-card:hover .listing-main-image { transform: scale(1.025); }
.guardian-medallion {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 10px;
  width: 64px;
  height: 64px;
  display: block;
  overflow: hidden;
  border-radius: 50%;
  background: #f2f0df;
  border: 3px solid rgba(255,255,255,.94);
  box-shadow: 0 8px 22px rgba(32, 47, 29, .22);
  transition: transform .16s ease, box-shadow .16s ease;
}
.guardian-medallion:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(32, 47, 29, .3); }
.guardian-medallion > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.listing-state {
  position: absolute;
  left: 13px;
  top: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(64, 85, 53, .9);
  font: 800 .72rem sans-serif;
}
.listing-state.negotiating { background: rgba(172, 119, 35, .92); }
.listing-state.sold { background: rgba(95, 95, 91, .9); }
.listing-body { padding: 23px 20px 20px; }
.listing-type-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #3f6047;
  background: #e8f2e8;
  font: 800 .68rem sans-serif;
}
.listing-type-badge.service { color: #755626; background: #f8edd6; }
.listing-body h3 { margin: 0 0 7px; font-size: 1.15rem; line-height: 1.45; }
.listing-title-link { text-decoration: none; }
.listing-title-link:hover { color: var(--green); }
.listing-guardian { color: var(--muted); font: 700 .78rem sans-serif; }
.listing-creator, .detail-creator { color: var(--muted); font: 700 .78rem sans-serif; }
.listing-creator span, .detail-creator span { color: #7d877b; font-size: .7rem; }
.guardian-profile-link { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-decoration: none; }
.guardian-profile-link:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.guardian-profile-action { flex: 0 0 auto; color: var(--green); font-size: .72rem; }
.listing-description { min-height: 3em; margin: 15px 0; color: #59665a; font-family: sans-serif; font-size: .87rem; line-height: 1.7; }
.listing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #ece9dd; padding-top: 15px; }
.listing-price { color: var(--green-dark); font-size: 1.12rem; font-weight: 900; }
.listing-closed-note { color: #7b837a; font: 800 .8rem sans-serif; }
.listing-more { color: var(--green); font: 800 .8rem sans-serif; }

.empty-state, .loading-state, .error-state {
  grid-column: 1 / -1;
  padding: 48px 20px;
  border: 1px dashed #b9c4ad;
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  font-family: sans-serif;
}
.error-state { color: #8d3535; border-color: #d9b2b2; }

.detail-shell { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr); gap: 42px; align-items: start; }
.detail-gallery, .detail-info, .inquiry-card { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 18px 45px rgba(56, 67, 49, .07); }
.detail-gallery { padding: 14px; }
.detail-main-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 9px; background: #eef0e6; }
.detail-main-photo > .listing-main-image { width: 100%; height: 100%; object-fit: cover; }
.detail-main-photo .guardian-medallion { width: 88px; height: 88px; right: 20px; bottom: 20px; border-color: rgba(255,255,255,.94); }
.thumb-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.thumb-row button { padding: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; border-radius: 7px; background: #eee; cursor: pointer; }
.thumb-row button.active { border-color: var(--green); }
.thumb-row img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { padding: 28px; }
.detail-info > .listing-type-badge { margin: 0 0 4px 8px; vertical-align: middle; }
.detail-info h1 { margin: 8px 0 8px; font-size: clamp(1.7rem, 4vw, 2.65rem); line-height: 1.35; }
.detail-guardian { margin-bottom: 20px; color: var(--green); font: 800 .9rem sans-serif; }
.detail-guardian .guardian-profile-action { font-size: .8rem; }
.detail-price { margin: 22px 0; color: var(--green-dark); font-size: 1.55rem; font-weight: 900; }
.detail-copy { color: #505e51; font-family: sans-serif; line-height: 1.9; white-space: pre-line; }
.detail-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid #ece9dd; }
.detail-block h2 { margin: 0 0 8px; font-size: 1.05rem; }
.detail-block p { margin: 0; color: #59665a; font-family: sans-serif; line-height: 1.8; white-space: pre-line; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--green-dark); font: 800 .88rem sans-serif; text-decoration: none; }

.inquiry-card { grid-column: 1 / -1; padding: clamp(22px, 4vw, 38px); }
.inquiry-card h2 { margin: 0 0 8px; font-size: 1.5rem; }
.inquiry-card > p { margin: 0 0 20px; color: var(--muted); font-family: sans-serif; line-height: 1.7; }
.inquiry-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inquiry-form label { display: grid; gap: 7px; font: 750 .83rem sans-serif; }
.inquiry-form label.wide { grid-column: 1 / -1; }
.inquiry-form input, .inquiry-form textarea { width: 100%; border: 1px solid #cbd3c4; border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); font: inherit; }
.inquiry-form textarea { min-height: 130px; resize: vertical; }
.primary-button { justify-self: start; min-width: 190px; border: 0; border-radius: 999px; padding: 12px 22px; color: #fff; background: var(--green-dark); cursor: pointer; font: 850 .9rem sans-serif; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-status { align-self: center; font: 750 .85rem sans-serif; }
.form-status.success { color: #347143; }
.form-status.error { color: #9a3636; }
.sold-message { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--muted); font-family: sans-serif; }

.shop-footer { padding: 28px 20px; text-align: center; color: #718071; border-top: 1px solid var(--line); background: #f3f1e7; font: .8rem sans-serif; }

@media (max-width: 900px) {
  .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-shell { grid-template-columns: 1fr; }
  .inquiry-card { grid-column: 1; }
}

@media (max-width: 620px) {
  #global-header { align-items: flex-start; padding: 10px 14px; }
  .brand span:last-child { display: none; }
  #global-header nav { justify-content: flex-end; gap: 11px; }
  #global-header nav a { font-size: .74rem; }
  .shop-hero { min-height: 280px; padding: 55px 18px; }
  .shop-hero h1 { letter-spacing: .04em; }
  .shop-main { width: min(100% - 22px, 1180px); padding-top: 34px; }
  .shop-category-nav { margin-bottom: 42px; gap: 7px; }
  .shop-category-nav a { padding: 9px 12px; font-size: .75rem; }
  .listing-section + .listing-section { margin-top: 50px; padding-top: 42px; }
  .listing-grid { grid-template-columns: 1fr; gap: 15px; }
  .listing-card { display: grid; grid-template-columns: 42% 58%; min-height: 170px; }
  .listing-photo { height: 100%; aspect-ratio: auto; }
  .guardian-medallion { width: 52px; height: 52px; right: 9px; bottom: 9px; }
  .listing-body { padding: 17px 14px 14px 24px; }
  .listing-type-badge { margin-bottom: 5px; font-size: .62rem; }
  .listing-body h3 { margin-right: 0; font-size: 1rem; }
  .listing-description { display: none; }
  .listing-footer { margin-top: 14px; align-items: flex-start; flex-direction: column; gap: 4px; }
  .detail-info { padding: 22px 18px; }
  .detail-main-photo .guardian-medallion { width: 76px; height: 76px; }
  .inquiry-form { grid-template-columns: 1fr; }
  .inquiry-form label.wide { grid-column: 1; }
}
