:root {
  --bg: #f6f1e8;
  --bg2: #fffaf2;
  --panel: rgba(255, 255, 255, .78);
  --panel2: rgba(255, 255, 255, .94);
  --line: rgba(31, 28, 24, .14);
  --text: #171512;
  --muted: #6f6a60;
  --cyan: #007f90;
  --magenta: #b33786;
  --amber: #b97025;
  --danger: #b42333;
  --ok: #2f8f5b;
  --shadow: 0 24px 70px rgba(55, 45, 32, .13);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 5%, rgba(0, 127, 144, .10), transparent 34%),
    radial-gradient(circle at 90% 5%, rgba(179, 55, 134, .10), transparent 30%),
    linear-gradient(180deg, #fffaf2, #f6f1e8 46%, #ede4d6);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31,28,24,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,28,24,.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.42), transparent 70%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(255, 250, 242, .82);
  border-bottom: 1px solid var(--line);
}

.nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .18em;
  font-size: .95rem;
  font-weight: 850;
}

.brand span { color: var(--cyan); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-links a {
  padding: 10px 8px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-color: var(--cyan);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 76px 0 90px;
}

.narrow { width: min(860px, calc(100% - 32px)); }

.hero {
  min-height: calc(88vh - 74px);
  display: grid;
  place-content: center;
  text-align: center;
  position: relative;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  letter-spacing: .26em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  font-weight: 800;
}

h1, h2, h3 { margin: 0; line-height: .98; }

.hero h1 {
  font-size: clamp(3.6rem, 12vw, 10.5rem);
  letter-spacing: -.09em;
  text-transform: uppercase;
  color: #191512;
}

.hero-copy {
  margin: 24px auto 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.6;
}

.hero-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 34px;
}

.button, button, input::file-selector-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .76rem;
  box-shadow: 0 10px 25px rgba(55,45,32,.08);
}

.button:hover, button:hover {
  border-color: var(--cyan);
  background: rgba(0,127,144,.08);
}

.button.primary, button.primary {
  color: #fffaf2;
  background: linear-gradient(90deg, #1c1a16, #007f90);
  border-color: rgba(31,28,24,.2);
}

button.danger {
  border-color: rgba(180,35,51,.35);
  color: var(--danger);
}

.page-hero {
  padding: 72px 0 42px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}

.page-hero h1 {
  font-size: clamp(2.7rem, 7vw, 6.6rem);
  letter-spacing: -.06em;
  text-transform: uppercase;
  color: #191512;
}

.page-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 760px;
  line-height: 1.7;
}

.section { padding: 56px 0; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(2rem, 5vw, 4.8rem);
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 22px;
}

.card {
  grid-column: span 4;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
  position: relative;
  transform: translateY(0);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(0,127,144,.36);
  background: rgba(255,255,255,.96);
}

.card-image {
  height: 285px;
  background: #eee4d5;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

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

.card-body { padding: 18px; }

.card-body h3 {
  font-size: 1.25rem;
  letter-spacing: -.02em;
  margin-bottom: 10px;
}

.meta {
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.collection-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 32px 0 10px;
}

.collection-links a {
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 24px;
  display: flex;
  align-items: end;
  font-size: clamp(1.5rem, 4vw, 3.3rem);
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: -.05em;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(255,250,242,.62)),
    radial-gradient(circle at 90% 10%, rgba(0,127,144,.16), transparent 34%);
  box-shadow: var(--shadow);
}

.collection-links a:hover { border-color: var(--cyan); }

.panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255,255,255,.72);
  padding: 28px;
  box-shadow: var(--shadow);
}

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

.identity-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 18px;
}

.identity-tags {
  display: grid;
  gap: 12px;
}

.identity-tags div {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255,255,255,.62);
}

.artwork-detail {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: start;
  padding-top: 60px;
}

.artwork-detail img {
  width: 100%;
  border-radius: 30px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.detail-copy {
  position: sticky;
  top: 100px;
}

.detail-copy h1 {
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  letter-spacing: -.07em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  color: var(--text);
  border-radius: 16px;
  padding: 13px 14px;
  font: inherit;
}

textarea { min-height: 120px; resize: vertical; }
.full { grid-column: 1 / -1; }

.admin-shell {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 70vh;
  overflow: auto;
}

.admin-item {
  text-align: left;
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  cursor: pointer;
}

.admin-item strong { display: block; }
.admin-item small { color: var(--muted); }

.notice {
  border: 1px solid rgba(0,127,144,.25);
  background: rgba(0,127,144,.08);
  border-radius: 18px;
  padding: 14px 16px;
  color: #164a52;
  line-height: 1.5;
}

.error {
  border-color: rgba(180,35,51,.35);
  background: rgba(180,35,51,.08);
  color: #64121b;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,250,242,.54);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: .86rem;
}

.footer-link {
  color: var(--cyan);
  border-bottom: 1px solid rgba(0,127,144,.45);
}

.footer-link:hover {
  color: var(--text);
  border-color: var(--text);
}

code {
  color: #164a52;
  background: rgba(0,127,144,.08);
  border: 1px solid var(--line);
  padding: .15em .35em;
  border-radius: .45em;
}

@media (max-width: 900px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .nav-links { justify-content: flex-start; }
  .card { grid-column: span 6; }
  .collection-links, .identity-grid, .artwork-detail, .admin-shell { grid-template-columns: 1fr; }
  .detail-copy { position: static; }
}

@media (max-width: 600px) {
  .page { padding-top: 34px; }
  .card { grid-column: span 12; }
  .form-grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; }
}



/* Responsive device behavior */
.nav-top {
  display: contents;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Desktop: wide, spacious gallery */
@media (min-width: 1180px) {
  .card:nth-child(7n + 1) {
    grid-column: span 5;
  }

  .card:nth-child(7n + 2) {
    grid-column: span 4;
  }

  .card:nth-child(7n + 3) {
    grid-column: span 3;
  }

  .card-image {
    height: 320px;
  }

  .hero {
    min-height: calc(92vh - 74px);
  }
}

/* Tablet: two-column gallery and compact hero */
@media (max-width: 900px) {
  .nav {
    min-height: auto;
  }

  .nav-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    padding: 8px 0 12px;
    gap: 6px;
  }

  .nav-links.open {
    display: grid;
  }

  .nav-links a {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .hero h1 {
    font-size: clamp(3.2rem, 14vw, 7.2rem);
  }

  .page-hero h1 {
    font-size: clamp(2.4rem, 11vw, 5.2rem);
  }

  .collection-links a {
    min-height: 140px;
  }

  .card-image {
    height: 260px;
  }
}

/* Phone: single column, bigger tap targets, no sticky detail sidebar */
@media (max-width: 600px) {
  body::before {
    background-size: 36px 36px;
  }

  .page {
    width: min(100% - 22px, 1180px);
    padding: 28px 0 64px;
  }

  .nav {
    width: min(100% - 22px, 1180px);
  }

  .brand {
    font-size: .82rem;
    letter-spacing: .14em;
  }

  .hero {
    min-height: 72vh;
    text-align: left;
    place-content: center start;
  }

  .hero h1 {
    font-size: clamp(3rem, 19vw, 5.6rem);
    letter-spacing: -.08em;
  }

  .hero-copy {
    margin-left: 0;
    font-size: 1.02rem;
  }

  .hero-actions,
  .actions {
    justify-content: flex-start;
  }

  .button,
  button,
  input::file-selector-button {
    min-height: 46px;
    padding: 13px 15px;
  }

  .page-hero {
    padding: 38px 0 28px;
    margin-bottom: 20px;
  }

  .page-hero h1 {
    font-size: clamp(2.5rem, 15vw, 4.6rem);
  }

  .section {
    padding: 34px 0;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .section-heading h2 {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .grid {
    gap: 16px;
  }

  .card {
    min-height: auto;
    border-radius: 24px;
  }

  .card-image {
    height: 70vw;
    max-height: 390px;
    min-height: 230px;
  }

  .card-body {
    padding: 16px;
  }

  .collection-links {
    gap: 12px;
  }

  .collection-links a {
    min-height: 112px;
    border-radius: 24px;
    font-size: clamp(1.7rem, 9vw, 3rem);
  }

  .panel {
    border-radius: 24px;
    padding: 20px;
  }

  .artwork-detail {
    padding-top: 24px;
    gap: 18px;
  }

  .artwork-detail img {
    border-radius: 24px;
  }

  .detail-copy h1 {
    font-size: clamp(2.5rem, 14vw, 4.5rem);
  }

  .admin-shell {
    gap: 14px;
  }

  .admin-list {
    max-height: 330px;
  }

  input,
  textarea,
  select {
    font-size: 16px; /* prevents iOS zoom */
  }

  .footer-inner {
    display: grid;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 2.75rem;
  }

  .page-hero h1 {
    font-size: 2.25rem;
  }

  .nav-links {
    font-size: .72rem;
  }
}
