:root {
  --paper: #fbfaf6;
  --wall: #f4f0e8;
  --ink: #26231f;
  --muted: #756f66;
  --line: #d8d0c3;
  --frame: #8f7353;
  --frame-dark: #5d4935;
  --accent: #2f6f68;
  --accent-dark: #214d49;
  --gold: #b98733;
  --danger: #a13932;
  --shadow: 0 18px 40px rgba(51, 43, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), var(--wall));
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 4vw, 48px);
  background: rgba(251, 250, 246, 0.88);
  border-bottom: 1px solid rgba(216, 208, 195, 0.72);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.08rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--gold);
  border: 2px solid var(--gold);
}

.top-nav {
  display: flex;
  gap: 6px;
}

.top-nav a,
.bottom-nav a {
  color: var(--muted);
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-nav a {
  padding: 8px 12px;
}

.top-nav a.active,
.bottom-nav a.active {
  color: var(--accent-dark);
  background: rgba(47, 111, 104, 0.1);
}

main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0 92px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  line-height: 1.8;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4.8vw, 56px);
  min-height: 50vh;
}

#today-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  letter-spacing: 0;
}

.button-row,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.primary-button,
.ghost-button,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(47, 111, 104, 0.2);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button.small {
  min-height: 36px;
  padding: 8px 14px;
}

.hero-cta {
  min-height: 52px;
  padding: 13px 22px;
  font-size: 1.05rem;
}

.ghost-button {
  color: var(--accent-dark);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.text-button {
  color: var(--accent-dark);
  background: transparent;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.featured-frame,
.art-card,
.detail-image-wrap {
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.featured-display,
.museum-piece,
.detail-artwork-display {
  display: grid;
  justify-items: center;
  width: 100%;
}

.featured-display .featured-frame {
  width: 100%;
}

.featured-frame,
.museum-image-wrap {
  padding: clamp(12px, 2vw, 20px);
  border: 10px solid var(--frame);
  outline: 2px solid var(--frame-dark);
}

.featured-frame img,
.museum-image-wrap img,
.detail-image-wrap img,
.art-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-frame {
  min-height: 320px;
}

.featured-frame img {
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
  background: #eee8dd;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 300px;
  color: var(--muted);
}

.empty-art {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 230px;
  border: 1px dashed var(--line);
  background: #f6f1e8;
  text-align: center;
}

.empty-art-title {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.art-plate,
.museum-plate,
.detail-plate {
  margin: 16px auto 0;
  width: min(92%, 360px);
  padding: 10px 14px;
  text-align: center;
  background: #fffaf0;
  border: 1px solid rgba(185, 135, 51, 0.28);
  box-shadow: 0 8px 18px rgba(51, 43, 33, 0.08);
}

.art-plate strong,
.museum-plate strong,
.detail-plate strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.art-plate span,
.museum-plate span,
.detail-plate span {
  color: var(--muted);
  font-size: 0.86rem;
}

.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdf8;
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.notice {
  padding: 20px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.gallery-stage {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: clamp(12px, 3vw, 28px);
}

.nav-button {
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 2rem;
}

.museum-piece {
  padding: clamp(18px, 3.2vw, 34px);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.museum-image-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.museum-image-wrap img {
  max-height: 58vh;
  object-fit: contain;
  background: #eee8dd;
}

.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.art-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.art-card button {
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
}

.art-card img {
  aspect-ratio: 1 / 0.78;
  background: #eee8dd;
}

.art-card-body {
  padding: 14px;
}

.art-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.art-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.favorite-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--gold);
  background: rgba(255, 253, 248, 0.9);
  border-radius: 50%;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.9fr);
  gap: clamp(24px, 5vw, 56px);
  margin-top: 18px;
}

.detail-image-wrap {
  padding: 16px;
  border: 10px solid var(--frame);
  outline: 2px solid var(--frame-dark);
}

.detail-image-wrap img {
  max-height: 72vh;
  object-fit: contain;
  background: #eee8dd;
}

.detail-text h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: 0;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin: 20px 0;
  color: var(--muted);
}

.detail-block {
  margin-top: 22px;
}

.detail-block h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-wrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 10px;
  color: var(--accent-dark);
  background: rgba(47, 111, 104, 0.1);
  border-radius: 999px;
  font-size: 0.88rem;
}

.artwork-form {
  display: grid;
  gap: 18px;
  max-width: 820px;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
}

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

.image-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  border: 1px dashed var(--line);
  background: #fffdf8;
}

.image-preview img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.favorite-check {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}

.favorite-check input {
  width: auto;
}

.form-message {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.storage-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 250, 246, 0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 28px rgba(51, 43, 33, 0.1);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  min-height: 56px;
  font-size: 0.86rem;
  font-weight: 700;
  touch-action: manipulation;
}

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

  .top-nav {
    display: none;
  }

  main {
    width: min(100% - 24px, 1040px);
    padding-top: 22px;
    padding-bottom: 112px;
  }

  .today-layout,
  .detail-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .featured-frame {
    min-height: auto;
    border-width: 8px;
    padding: 10px;
  }

  .featured-frame img {
    max-height: 48vh;
  }

  .gallery-stage {
    grid-template-columns: 1fr;
  }

  .nav-button {
    display: none;
  }

  .museum-piece {
    padding: 16px 12px;
  }

  .museum-image-wrap {
    border-width: 8px;
    padding: 10px;
  }

  .filter-panel label {
    width: 100%;
  }

  .bottom-nav {
    display: grid;
  }
}
