:root {
  color-scheme: dark;
  --bg: #0d0d0c;
  --panel: #171612;
  --panel-soft: #201e19;
  --ink: #f5efe3;
  --muted: #bdb2a2;
  --line: rgba(245, 239, 227, 0.15);
  --accent: #e5a448;
  --accent-dark: #201407;
  --rust: #9d4a2d;
  --shadow: rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 75% 0, rgba(157, 74, 45, 0.16), transparent 26rem),
    linear-gradient(180deg, #11100e 0, var(--bg) 28rem);
  color: var(--ink);
}

img {
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 12, 0.9);
  backdrop-filter: blur(16px);
}

.brand,
nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.8rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 45%, var(--accent) 46% 54%, transparent 55%),
    radial-gradient(circle, #d8d2c6, #484640 54%, #171612 56%);
  box-shadow: 0 0 1.4rem rgba(229, 164, 72, 0.28);
}

nav {
  gap: 0.35rem;
}

nav a {
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

nav a:hover,
nav a.is-active {
  background: rgba(245, 239, 227, 0.08);
  color: var(--ink);
}

.home-hero {
  position: relative;
  display: grid;
  min-height: calc(100vh - 4.2rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 6vw, 6rem);
}

.home-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  opacity: 0.88;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.95), rgba(8, 8, 7, 0.72) 42%, rgba(8, 8, 7, 0.12)),
    linear-gradient(0deg, rgba(8, 8, 7, 0.82), transparent 44%);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  width: min(44rem, 100%);
}

.kicker {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h1 {
  margin-bottom: 1.1rem;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.94;
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.home-hero-copy p:not(.kicker),
.split-section > p,
.page-heading p,
.contact-card p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 850;
  cursor: pointer;
}

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

.button.secondary {
  background: rgba(245, 239, 227, 0.08);
  color: var(--ink);
}

.button.danger {
  border-color: rgba(255, 154, 122, 0.42);
  background: rgba(255, 154, 122, 0.1);
  color: #ffb19a;
}

.split-section,
.preview-section,
.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 0.8fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-bottom: 1px solid var(--line);
}

.preview-section {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.section-title,
.gallery-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.text-link {
  color: var(--accent);
  font-weight: 850;
}

.page {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

.page-heading {
  width: min(760px, 100%);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.page-heading p,
.home-hero-copy p {
  overflow-wrap: anywhere;
}

.page-heading h1 {
  font-size: clamp(3rem, 6vw, 5.4rem);
}

.gallery-tools {
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 239, 227, 0.04);
}

.gallery-tools p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.gallery-tools label,
.contact-form label {
  display: grid;
  gap: 0.45rem;
  width: 100%;
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #12110f;
  color: var(--ink);
  font: inherit;
  padding: 0.9rem 1rem;
}

input:focus,
textarea:focus {
  border-color: rgba(229, 164, 72, 0.78);
  outline: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.photo-grid-preview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-card {
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1rem 2.5rem var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.photo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(229, 164, 72, 0.48);
}

.photo-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #111;
}

.photo-card figcaption {
  padding: 0.9rem;
}

.photo-card h3 {
  margin: 0;
  line-height: 1.35;
}

.photo-card p {
  display: -webkit-box;
  min-height: 3.2rem;
  margin: 0.45rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.load-more {
  margin-top: 1.1rem;
}

.lightbox {
  width: min(1040px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b0b0a;
  color: var(--ink);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.65);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(7px);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #050505;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.lightbox-caption h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.lightbox-caption p {
  max-width: 66ch;
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.lightbox-close {
  position: absolute;
  z-index: 1;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 13, 12, 0.78);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.empty-state {
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 0.65fr) minmax(20rem, 1fr);
  gap: 1rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 0.85fr) minmax(20rem, 1fr);
  gap: 1rem;
}

.contact-card,
.contact-form,
.admin-output {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 239, 227, 0.04);
}

.contact-card h2 {
  font-size: 2rem;
}

.contact-card .kicker {
  margin-bottom: 0.8rem;
}

.contact-email a {
  color: var(--accent);
  font-weight: 900;
}

.contact-form,
.admin-output {
  display: grid;
  gap: 1rem;
}

.form-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.admin-output h2 {
  font-size: 2rem;
}

.admin-output p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-output img {
  width: 100%;
  max-height: 22rem;
  border-radius: 8px;
  object-fit: contain;
  background: #070706;
}

.admin-gallery-section {
  width: min(1180px, calc(100% - 2rem));
  margin: clamp(2rem, 5vw, 4rem) auto 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
}

.admin-gallery-list {
  display: grid;
  gap: 1rem;
}

.admin-artwork {
  display: grid;
  grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(245, 239, 227, 0.04);
}

.admin-artwork img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  background: #070706;
}

.admin-artwork-fields {
  display: grid;
  gap: 0.8rem;
}

.admin-artwork-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.form-message {
  min-height: 1.4rem;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.form-message[data-type="success"] {
  color: #8bdc9a;
}

.form-message[data-type="error"] {
  color: #ff9a7a;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

textarea {
  resize: vertical;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .split-section,
  .contact-layout,
  .admin-layout,
  .admin-artwork {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  body {
    font-size: 17px;
  }

  .site-header,
  .section-title,
  .gallery-tools,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    flex-wrap: wrap;
  }

  nav a {
    font-size: 1rem;
  }

  .home-hero {
    min-height: 780px;
    padding-top: 4rem;
  }

  .home-hero::after {
    background:
      linear-gradient(90deg, rgba(8, 8, 7, 0.94), rgba(8, 8, 7, 0.58)),
      linear-gradient(0deg, rgba(8, 8, 7, 0.88), transparent 44%);
  }

  .home-hero-copy {
    align-self: end;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 4.2rem);
  }

  h2 {
    font-size: clamp(2.35rem, 11vw, 3.5rem);
  }

  .home-hero-copy p:not(.kicker),
  .split-section > p,
  .page-heading p,
  .contact-card p {
    font-size: 1.16rem;
    line-height: 1.75;
  }

  .kicker {
    font-size: 0.86rem;
  }

  .button,
  input,
  textarea,
  .gallery-tools label,
  .contact-form label {
    font-size: 1rem;
  }

  .photo-card h3 {
    font-size: 1.15rem;
  }

  .photo-card p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .actions,
  .actions .button {
    width: 100%;
  }

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

  .lightbox-caption {
    align-items: flex-start;
    flex-direction: column;
  }
}
