:root {
  --paper: #f7f5ef;
  --paper-strong: #eee9dd;
  --white: #ffffff;
  --ink: #171815;
  --ink-soft: #33372f;
  --muted: #72766d;
  --line: #ded8cc;
  --sage: #5f735e;
  --sage-deep: #304834;
  --rose: #ad746d;
  --gold: #c69a48;
  --blue: #49677a;
  --danger: #b94b42;
  --shadow: 0 20px 70px rgba(23, 24, 21, 0.13);
  --radius: 8px;
  --site-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.site-header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  color: var(--white);
  transition: background 180ms ease, color 180ms ease, border 180ms ease;
}

.site-header.is-solid {
  background: rgba(247, 245, 239, 0.94);
  color: var(--ink);
  border-bottom: 1px solid rgba(222, 216, 204, 0.85);
  backdrop-filter: blur(16px);
}

.brand,
.nav-action,
.button,
.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand {
  min-width: 0;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.brand span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  font-size: 14px;
}

.main-nav a,
.nav-action {
  opacity: 0.9;
}

.main-nav a:hover,
.nav-action:hover {
  opacity: 1;
}

.nav-action {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
}

.hero {
  position: relative;
  min-height: 86svh;
  overflow: hidden;
  background: var(--ink);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 13, 11, 0.72), rgba(12, 13, 11, 0.16) 58%, rgba(12, 13, 11, 0.06)),
    linear-gradient(0deg, rgba(12, 13, 11, 0.38), rgba(12, 13, 11, 0.04) 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(var(--site-width), calc(100% - 40px));
  min-height: 86svh;
  margin: 0 auto;
  padding: 140px 0 80px;
  color: var(--white);
  flex-direction: column;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.feature-copy h2,
.contact-copy h2,
.admin-header h1,
.panel h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 760px;
  font-size: 48px;
  font-weight: 760;
}

.hero p:not(.eyebrow) {
  max-width: 660px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 48px;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 760;
  transition: transform 160ms ease, background 160ms ease, border 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-light {
  background: var(--white);
  color: var(--ink);
}

.button-quiet {
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.button-dark {
  background: var(--ink);
  color: var(--white);
}

.button-soft {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

.section {
  width: min(var(--site-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 44px;
  align-items: start;
}

.section-intro h2,
.section-head h2,
.feature-copy h2,
.contact-copy h2 {
  font-size: 34px;
}

.intro-text,
.section-head p,
.feature-copy p,
.contact-copy p {
  color: var(--muted);
}

.intro-text {
  margin: 0;
  font-size: 18px;
}

.section-works {
  padding-top: 20px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 26px;
}

.section-head p:last-child {
  margin: 12px 0 0;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink-soft);
}

.filter-button.is-active {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper-strong);
  color: var(--white);
  aspect-ratio: 3 / 4;
  padding: 0;
  text-align: left;
}

.gallery-card:nth-child(5n + 1) {
  grid-column: span 2;
  aspect-ratio: 16 / 10;
}

.gallery-card:nth-child(6n + 3) {
  aspect-ratio: 4 / 5;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.gallery-card:hover img {
  transform: scale(1.035);
}

.gallery-card::after {
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), transparent);
  content: "";
}

.gallery-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 15px;
}

.gallery-caption p,
.gallery-caption h3 {
  margin: 0;
}

.gallery-caption p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.gallery-caption h3 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
  word-break: break-word;
}

.empty-gallery {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.feature-band,
.contact-band {
  display: grid;
  width: min(var(--site-width), calc(100% - 40px));
  margin: 0 auto 86px;
  gap: 34px;
}

.feature-band {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
}

.feature-media {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper-strong);
  aspect-ratio: 16 / 10;
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-copy {
  padding: 12px 0;
}

.feature-copy p {
  margin: 18px 0 0;
  font-size: 17px;
}

.feature-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.feature-meta div {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.feature-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.feature-meta dd {
  margin: 4px 0 0;
  font-weight: 750;
}

.contact-band {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
  padding: 54px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}

.contact-copy p {
  color: rgba(255, 255, 255, 0.72);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-item {
  min-width: 0;
  min-height: 62px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.92);
}

.contact-item span {
  overflow-wrap: anywhere;
}

.site-footer {
  display: flex;
  width: min(var(--site-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 42px;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.footer-legal {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.footer-legal a {
  color: var(--ink-soft);
}

.footer-legal a:hover {
  color: var(--sage-deep);
}

.lightbox {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 11, 9, 0.82);
}

.lightbox[hidden] {
  display: none;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
}

.lightbox-close {
  position: absolute;
  top: 22px;
  right: 22px;
}

.lightbox-panel {
  display: grid;
  width: min(1040px, 100%);
  max-height: calc(100svh - 72px);
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
}

.lightbox-panel img {
  width: 100%;
  height: 100%;
  max-height: calc(100svh - 72px);
  object-fit: contain;
  background: #0f100e;
}

.lightbox-panel figcaption {
  padding: 28px;
  overflow: auto;
}

.lightbox-panel p,
.lightbox-panel h3 {
  margin: 0;
}

.lightbox-panel h3 {
  margin: 10px 0 14px;
  font-size: 28px;
  line-height: 1.15;
}

#lightboxMeta {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

#lightboxCaption {
  color: var(--muted);
}

.admin-body {
  background: #f5f2eb;
}

.admin-header,
.admin-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0 20px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-header h1 {
  font-size: 36px;
}

.admin-shell {
  padding-bottom: 60px;
}

.login-panel {
  display: grid;
  width: min(520px, calc(100% - 32px));
  min-height: 55svh;
  place-items: center;
  margin: 0 auto;
}

.login-panel[hidden],
.admin-shell[hidden] {
  display: none;
}

.login-card {
  width: 100%;
}

.login-card h2 {
  margin-bottom: 8px;
}

.login-card p:not(.eyebrow) {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-card label {
  margin-bottom: 16px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 42px rgba(23, 24, 21, 0.06);
  padding: 22px;
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: 24px;
}

.dropzone {
  display: grid;
  min-height: 178px;
  place-items: center;
  gap: 8px;
  border: 1px dashed #b9aa98;
  border-radius: var(--radius);
  background: #fbfaf7;
  color: var(--muted);
  text-align: center;
}

.dropzone.is-dragging {
  border-color: var(--sage);
  background: #eef3ec;
  color: var(--sage-deep);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone svg {
  color: var(--sage);
}

.dropzone strong {
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 720;
}

.wide-field {
  grid-column: 1 / -1;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(95, 115, 94, 0.14);
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.check-line {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--white);
}

.check-line input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.preview-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.preview-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--white);
}

.preview-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 6px;
}

.preview-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
}

.full-button {
  width: 100%;
}

.gallery-manager {
  margin-top: 18px;
}

.soft-count {
  color: var(--muted);
  font-weight: 750;
}

.admin-photo-list {
  display: grid;
  gap: 12px;
}

.admin-photo {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 12px;
}

.admin-photo img {
  width: 154px;
  height: 184px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--paper-strong);
}

.photo-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-fields .wide-field {
  grid-column: 1 / -1;
}

.photo-actions {
  display: grid;
  width: 136px;
  gap: 8px;
}

.mini-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  color: var(--ink);
  font-weight: 760;
}

.mini-button.danger {
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 24px;
  min-width: 240px;
  max-width: calc(100% - 40px);
  padding: 13px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

@media (min-width: 960px) {
  .hero h1 {
    font-size: 76px;
  }
}

@media (max-width: 860px) {
  .site-header {
    padding: 14px 16px;
  }

  .main-nav {
    display: none;
  }

  .nav-action span {
    display: none;
  }

  .nav-action {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .hero-content {
    width: min(100% - 28px, var(--site-width));
    padding-bottom: 58px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p:not(.eyebrow) {
    font-size: 17px;
  }

  .section,
  .feature-band,
  .contact-band {
    width: min(100% - 28px, var(--site-width));
  }

  .section {
    padding: 64px 0;
  }

  .section-intro,
  .feature-band,
  .contact-band,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-card:nth-child(5n + 1) {
    grid-column: span 2;
  }

  .contact-band {
    padding: 30px;
  }

  .contact-list,
  .form-grid,
  .photo-fields {
    grid-template-columns: 1fr;
  }

  .lightbox-panel {
    grid-template-columns: 1fr;
  }

  .lightbox-panel figcaption {
    max-height: 32svh;
  }

  .admin-photo {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .admin-photo img {
    width: 118px;
    height: 146px;
  }

  .photo-actions {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .brand span:last-child {
    max-width: 160px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .section-intro h2,
  .section-head h2,
  .feature-copy h2,
  .contact-copy h2 {
    font-size: 28px;
  }

  .button {
    width: 100%;
  }

  .gallery-grid {
    display: block;
    column-count: 2;
    column-gap: 9px;
  }

  .gallery-card,
  .gallery-card:nth-child(5n + 1) {
    display: inline-block;
    width: 100%;
    margin: 0 0 9px;
    break-inside: avoid;
    vertical-align: top;
    aspect-ratio: auto;
    grid-column: auto;
  }

  .gallery-card:nth-child(6n + 3) {
    aspect-ratio: auto;
  }

  .gallery-card img {
    height: auto;
    object-fit: contain;
  }

  .gallery-card::after {
    height: 62%;
  }

  .gallery-caption {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .gallery-caption p {
    font-size: 10px;
    line-height: 1.2;
  }

  .gallery-caption h3 {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.15;
  }

  .empty-gallery {
    display: grid;
    width: 100%;
    break-inside: avoid;
  }

  .contact-list {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-actions .button {
    width: 100%;
  }

  .admin-photo {
    grid-template-columns: 1fr;
  }

  .admin-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .photo-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .gallery-grid {
    column-gap: 8px;
  }

  .gallery-card,
  .gallery-card:nth-child(5n + 1) {
    margin-bottom: 8px;
  }

  .gallery-caption p {
    display: none;
  }
}
