:root {
  color: #161616;
  background: #ffffff;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
}

body > main {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-is-entering > main {
  opacity: 0;
  transform: translateY(12px);
}

body.page-is-leaving > main {
  opacity: 0;
  transform: translateY(-8px);
}

body.page-is-leaving {
  pointer-events: none;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.cover-screen,
.gallery-screen {
  min-height: 100svh;
}

.cover-screen {
  position: relative;
  display: grid;
  place-items: center;
  padding: 32px;
}

.cover-screen.is-leaving {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  animation: cover-leave 520ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
  pointer-events: none;
}

.admin-entry {
  position: absolute;
  top: 30px;
  right: 32px;
  color: #161616;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.admin-entry::after {
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 4px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 180ms ease;
}

.admin-entry:hover::after,
.admin-entry:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.cover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 16px;
  color: #777;
  font-size: 11px;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 36px;
  font-size: clamp(64px, 16vw, 190px);
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.enter-button {
  min-width: 82px;
  padding: 10px 18px;
  border: 1px solid #161616;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  transition: background 180ms ease, color 180ms ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  background: #161616;
  color: #fff;
}

.gallery-screen {
  padding: 30px 32px 56px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-screen.is-entering {
  opacity: 0;
  transform: translateY(20px);
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gallery-header .admin-entry {
  position: static;
}

.back-button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.gallery-content {
  width: min(100%, 1040px);
  margin: clamp(72px, 15vh, 150px) auto 0;
}

.intro {
  text-align: center;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.intro p:not(.eyebrow) {
  margin-bottom: 5px;
  color: #707070;
  font-size: 14px;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 72px;
}

.content-card {
  aspect-ratio: 1;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  background: #fafafa;
  color: #a0a0a0;
  font-size: 12px;
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.content-card:hover,
.content-card:focus-visible {
  border-color: #a8a8a8;
  background: #f4f4f4;
  transform: translateY(-3px);
}

.detail-page,
.article-page,
.admin-page {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 30px 32px 100px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-header .back-button {
  text-decoration: none;
}

.detail-admin-entry {
  color: #161616;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.detail-hero {
  margin-top: clamp(72px, 13vh, 144px);
}

.detail-hero h1 {
  margin-bottom: clamp(42px, 7vw, 84px);
  font-size: clamp(52px, 10vw, 132px);
}

.hero-card-layout {
  display: grid;
  grid-template-columns: minmax(140px, 230px) minmax(220px, 360px) minmax(140px, 230px);
  align-items: stretch;
  justify-content: center;
  gap: clamp(18px, 3vw, 44px);
}

.portrait-card {
  aspect-ratio: 2 / 3;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  border-radius: 18px;
  background: #f3f3f3;
  color: #a0a0a0;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.portrait-card-right {
  background: #eaeaea;
}

body[data-collection="01"] .hero-card-layout {
  grid-template-columns: minmax(180px, 320px) minmax(180px, 300px) minmax(180px, 320px);
  gap: clamp(32px, 6vw, 92px);
}

body[data-collection="01"] .portrait-card {
  aspect-ratio: 4 / 5;
}

.hero-copy {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #686868;
  font-size: 15px;
  line-height: 1.8;
  text-align: center;
}

.hero-copy p {
  margin-bottom: 2px;
}

.detail-section {
  margin-top: clamp(100px, 18vw, 220px);
}

.section-intro {
  width: min(100%, 560px);
  margin-bottom: clamp(62px, 10vw, 130px);
}

.section-intro h2 {
  margin-bottom: 20px;
}

.section-intro > p:last-child {
  color: #707070;
  font-size: 15px;
  line-height: 1.8;
}

.detail-rows {
  display: grid;
  gap: clamp(60px, 11vw, 150px);
}

.detail-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(32px, 9vw, 150px);
}

.detail-row:nth-child(even) .detail-image-placeholder {
  order: 2;
  justify-self: end;
}

.detail-image-placeholder {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  border-radius: 18px;
  background: #f2f2f2;
  color: #9a9a9a;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.detail-row.cool .detail-image-placeholder {
  background: #edf1f2;
}

.detail-row.rose .detail-image-placeholder {
  background: #f4eeee;
}

.detail-row.stone .detail-image-placeholder {
  background: #efefec;
}

.detail-row-copy {
  max-width: 360px;
}

.detail-row:nth-child(even) .detail-row-copy {
  justify-self: end;
}

.row-number {
  display: block;
  margin-bottom: 18px;
  color: #9a9a9a;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.detail-row h3 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.05em;
}

.detail-row-copy p {
  margin-bottom: 0;
  color: #707070;
  font-size: 14px;
  line-height: 1.8;
}

.detail-row-link {
  color: inherit;
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.detail-row-link:hover,
.detail-row-link:focus-visible {
  opacity: 0.68;
  outline: none;
  transform: translateY(-4px);
}

.article-intro {
  width: min(100%, 680px);
  margin: clamp(90px, 15vh, 160px) auto 0;
  text-align: center;
}

.article-intro h1 {
  margin-bottom: 20px;
  font-size: clamp(46px, 8vw, 100px);
}

.article-intro h2 {
  margin-bottom: 28px;
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.article-description {
  margin: 0 auto;
  color: #707070;
  font-size: 15px;
  line-height: 1.9;
}

.article-content {
  margin-top: clamp(100px, 18vw, 220px);
}

.admin-header, .editor-heading, .editor-section-heading, .editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-status { margin: 0; color: #777; font-size: 12px; }
.login-view { display: grid; min-height: calc(100svh - 160px); place-items: center; }
.login-card { width: min(100%, 440px); }
.login-card h1, .editor-heading h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 68px); }
.login-intro, .demo-note, .editor-section-heading p { color: #777; font-size: 14px; line-height: 1.7; }
.login-form, .editor-fields, .editor-row-fields { display: grid; gap: 18px; }
.login-form { margin-top: 34px; }
.login-form label, .editor-section > label, .editor-fields label, .editor-row-fields label { display: grid; gap: 8px; color: #555; font-size: 13px; }
.login-form input, .editor-section input, .editor-section textarea { width: 100%; border: 1px solid #d8d8d8; border-radius: 10px; background: #fff; padding: 12px 13px; color: #161616; font: inherit; outline: none; }
.editor-section textarea { resize: vertical; line-height: 1.6; }
.login-form input:focus, .editor-section input:focus, .editor-section textarea:focus { border-color: #161616; }
.admin-primary-button, .admin-secondary-button { border-radius: 999px; padding: 12px 18px; font-size: 14px; }
.admin-primary-button { border: 1px solid #161616; background: #161616; color: #fff; }
.admin-secondary-button { border: 1px solid #161616; background: #fff; color: #161616; }
.text-button { border: 0; background: transparent; color: #161616; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.demo-note, .form-message { margin: 0; }
.demo-note { margin-top: 24px; }
.demo-note code { color: #161616; }
.form-message { min-height: 1.5em; color: #777; font-size: 13px; }
.editor-view { margin-top: clamp(72px, 12vw, 130px); }
.editor-section { margin-top: 64px; padding-top: 28px; border-top: 1px solid #e5e5e5; }
.editor-section h2 { margin: 0; font-size: 24px; font-weight: 500; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; }
.editor-rows { display: grid; gap: 14px; margin-top: 28px; }
.editor-row { display: grid; grid-template-columns: 32px 1fr 30px; gap: 14px; align-items: start; padding: 18px; border: 1px solid #e2e2e2; border-radius: 16px; }
.row-order { padding-top: 9px; color: #999; font-size: 12px; }
.image-input span { color: #888; font-size: 12px; }
.remove-row-button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #f2f2f2; color: #666; font-size: 18px; }
.editor-actions { justify-content: flex-end; margin-top: 36px; }

.detail-footer {
  display: flex;
  justify-content: center;
  margin-top: clamp(100px, 16vw, 200px);
}

.return-button {
  padding: 10px 18px;
  border: 1px solid #161616;
  border-radius: 999px;
  color: #161616;
  font-size: 14px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.return-button:hover,
.return-button:focus-visible {
  background: #161616;
  color: #fff;
}

.global-nav {
  position: fixed;
  right: 52px;
  bottom: 26px;
  z-index: 1000;
  width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.global-nav-main,
.scroll-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-circle,
.scroll-controls button {
  display: grid;
  place-items: center;
  border: 1px solid #161616;
  background: rgba(255, 255, 255, 0.92);
  color: #161616;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
  backdrop-filter: blur(8px);
}

.nav-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border-color: #161616;
  background: #161616;
  color: #fff;
  font-size: 17px;
}

.nav-map {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.nav-home {
  font-size: 24px;
  line-height: 1;
}

.scroll-controls {
  gap: 7px;
  margin-top: 2px;
}

.scroll-controls button {
  position: relative;
  width: 32px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 0;
  backdrop-filter: none;
}

.scroll-controls button + button {
  border-top: 0;
}

.scroll-controls button::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  content: "";
  transform: translate(-50%, -50%);
}

.scroll-controls button[data-action="top"]::after {
  border-right: 7px solid transparent;
  border-bottom: 10px solid #161616;
  border-left: 7px solid transparent;
}

.scroll-controls button[data-action="bottom"]::after {
  border-top: 10px solid #161616;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
}

.nav-circle:hover,
.nav-circle:focus-visible {
  background: #161616;
  color: #fff;
  outline: none;
}

.nav-circle:hover,
.nav-circle:focus-visible {
  transform: scale(1.05);
}

.scroll-controls button:hover,
.scroll-controls button:focus-visible {
  background: transparent;
  outline: none;
  transform: scale(1.15);
}

.map-panel {
  width: 150px;
  margin-bottom: 2px;
  padding: 14px;
  border: 1px solid #161616;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
}

.map-panel[hidden] {
  display: none !important;
}

.map-panel-title {
  margin: 0 0 10px;
  color: #777;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.map-panel a {
  display: block;
  padding: 6px 0;
  color: #161616;
  font-size: 13px;
  text-decoration: none;
}

.map-panel a:hover,
.map-panel a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes cover-leave {
  to {
    opacity: 0;
    transform: scale(1.015);
  }
}

@media (max-width: 640px) {
  .cover-screen,
  .gallery-screen {
    padding-right: 20px;
    padding-left: 20px;
  }

  .admin-entry {
    top: 22px;
    right: 20px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 52px;
  }

  .detail-page,
  .article-page,
  .admin-page {
    padding: 22px 20px 72px;
  }

  .two-columns { grid-template-columns: 1fr; }
  .editor-section-heading { align-items: flex-start; }
  .editor-row { grid-template-columns: 24px 1fr; }
  .remove-row-button { grid-column: 2; }

  .detail-hero {
    margin-top: 82px;
  }

  .hero-card-layout {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hero-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 20px;
    font-size: 14px;
  }

  .detail-section {
    margin-top: 100px;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .detail-row:nth-child(even) .detail-image-placeholder {
    order: 0;
    justify-self: stretch;
  }

  .detail-row:nth-child(even) .detail-row-copy {
    justify-self: start;
  }

  .detail-image-placeholder {
    max-width: none;
  }

  .global-nav {
    right: 28px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body > main {
    transition: none;
  }

  .cover-screen.is-leaving {
    animation: none;
  }

  .gallery-screen {
    transition: none;
  }

  .nav-circle,
  .scroll-controls button {
    transition: none;
  }
}
