:root {
  --moss: #7b9669;
  --sage: #bac8b1;
  --slate: #6c8480;
  --mist: #e6e6e6;
  --forest: #1a2b20;
  --forest-mid: #3d5442;
  --cream: #f2f1e8;
  --cream-2: #f5f2eb;
  --hero: #9e9c8f;
  --viber: #7360f2;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --radius: 10px;
  --header-h: 72px;
  --font-ui: "Montserrat", "Segoe UI", sans-serif;
  --font-logo: "Great Vibes", "Brush Script MT", cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

.site-main {
  flex: 1;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}

.site-header.is-solid {
  border-bottom-color: var(--forest-mid);
  border-bottom-width: 3px;
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.logo {
  font-family: var(--font-logo);
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.5px;
}

.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
}

.nav a {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest-mid);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.nav a.active,
.nav a:hover {
  border-bottom-color: var(--forest-mid);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
}

.icon-btn:hover {
  background: var(--mist);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--forest);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.btn-upload:hover {
  background: var(--forest-mid);
}

.menu-toggle {
  display: none;
}

/* Hero */
.hero {
  background: var(--hero);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 420px) 1fr;
  align-items: center;
  gap: 24px;
  padding: 48px 40px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.hero-side {
  max-width: 260px;
}

.hero-side.left {
  justify-self: end;
  text-align: left;
}

.hero-side.right {
  justify-self: start;
}

.hero-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

.hero-artist {
  margin: 0;
  opacity: 0.92;
  font-weight: 500;
}

.hero-tagline {
  margin: 0 0 24px;
  font-size: clamp(1.2rem, 2.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.hero-art {
  justify-self: center;
  width: min(100%, 380px);
  aspect-ratio: 1;
  background: #ddd;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  animation: rise-in 0.9s ease both;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--moss);
  color: #fff;
  padding: 12px 22px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-cta:hover {
  background: var(--forest-mid);
  transform: translateY(-1px);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
}

.section-title {
  margin: 0 0 28px;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

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

.painting-card {
  animation: fade-up 0.6s ease both;
}

.painting-card:nth-child(2) {
  animation-delay: 0.06s;
}
.painting-card:nth-child(3) {
  animation-delay: 0.12s;
}
.painting-card:nth-child(4) {
  animation-delay: 0.18s;
}

.card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--mist);
  overflow: hidden;
  border: 1px solid #ddd;
}

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

.painting-card:hover .card-media img {
  transform: scale(1.03);
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 6px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(61, 84, 66, 0.88);
}

.badge.sold {
  background: rgba(60, 70, 62, 0.9);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  top: 18%;
}

.card-body {
  padding-top: 12px;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.card-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card-sign {
  margin: 8px 0 0;
  font-family: var(--font-logo);
  font-size: 1.25rem;
  color: #333;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
}

.card-actions button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  padding: 4px;
}

/* Detail */
.detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}

.detail-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--mist);
  margin-bottom: 20px;
}

.detail h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

.detail-meta {
  color: var(--muted);
  margin: 0 0 16px;
}

.detail-specs {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  color: var(--forest-mid);
  font-size: 0.9rem;
}

.detail-desc {
  color: #333;
  margin-bottom: 20px;
}

.price-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 14px 28px;
  background: var(--forest-mid);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  border: 2px solid #c9a227;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  margin-bottom: 24px;
}

.contact-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  position: sticky;
  bottom: 12px;
}

.contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 4px;
}

.btn-viber {
  background: var(--viber);
}
.btn-phone {
  background: #111;
}
.btn-econt {
  background: var(--moss);
}

/* About / Contacts page */
.page-cream {
  background: var(--cream);
}

.page-cream .section {
  padding-top: 40px;
}

.page-heading {
  margin: 0 0 28px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 64px;
}

.about-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--sage);
}

.about-text p {
  margin: 0 0 16px;
  color: #2a2a2a;
  font-size: 1.02rem;
}

.about-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #cfcabe;
  color: var(--muted);
  font-size: 0.95rem;
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.contact-box {
  background: var(--forest);
  color: #fff;
  padding: 28px;
  border-radius: 4px;
}

.contact-box h3 {
  margin: 0 0 20px;
  font-size: 1.15rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  word-break: break-word;
}

.viber-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--viber);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  margin: 8px 0 18px;
  font-weight: 600;
  font-size: 0.92rem;
}

.contact-sub {
  margin: 18px 0 6px;
  font-weight: 700;
}

.contact-box p {
  margin: 0 0 4px;
  opacity: 0.95;
}

.form-box {
  background: #e9e7e0;
  border: 1px solid #cfcabe;
  padding: 28px;
  border-radius: 4px;
}

.form-box h3 {
  margin: 0 0 18px;
}

.form-field {
  margin-bottom: 14px;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--forest-mid);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--forest);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.btn-submit:hover {
  background: var(--forest-mid);
}

.alert {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 6px;
  font-size: 0.92rem;
}

.alert.success {
  background: #e4efdc;
  color: #254028;
}
.alert.error {
  background: #f5e0de;
  color: #6a2a24;
}

/* Admin */
.admin-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  background: var(--cream);
  min-height: calc(100vh - 140px);
}

.admin-wrap h1 {
  text-align: center;
  margin: 0 0 28px;
  font-size: 1.6rem;
}

.admin-form {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 28px;
  align-items: start;
}

.dropzone {
  border: 2px dashed var(--forest-mid);
  border-radius: 12px;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  color: var(--forest-mid);
  position: relative;
  cursor: pointer;
}

.dropzone.dragover {
  background: var(--sage);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 6px;
}

.admin-fields .form-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--forest);
}

.admin-fields .btn-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 14px;
  background: var(--forest-mid);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  text-align: left;
  font-size: 0.92rem;
  vertical-align: middle;
}

.admin-table th {
  background: var(--forest);
  color: #fff;
}

.admin-table img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
}

.login-card {
  max-width: 400px;
  margin: 48px auto;
  background: #fff;
  padding: 28px;
  border: 1px solid #d8d4c8;
  border-radius: 8px;
}

.login-card h1 {
  margin: 0 0 20px;
  font-size: 1.35rem;
  text-align: center;
}

.site-footer {
  background: var(--moss);
  color: #fff;
  padding: 18px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  padding: 24px 0;
}

/* Mobile */
@media (max-width: 960px) {
  .painting-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 32px 20px;
  }

  .hero-side {
    max-width: none;
    justify-self: center !important;
    text-align: center !important;
  }

  .hero-side.left {
    order: 1;
  }
  .hero-art {
    order: 2;
  }
  .hero-side.right {
    order: 3;
  }

  .about-grid,
  .contacts-grid,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .header-inner {
    grid-template-columns: auto auto;
  }

  .nav {
    display: none;
  }

  .nav.open {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    align-items: flex-start;
    padding-top: 8px;
  }

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

  .btn-upload span.hide-sm {
    display: none;
  }
}

@media (max-width: 560px) {
  .painting-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
  }

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

  .header-inner {
    padding: 12px 16px;
  }

  .section {
    padding: 32px 16px;
  }
}
