:root {
  color-scheme: light;
  --bg: #faf9f6;
  --bg-elevated: #ffffff;
  --bg-soft: #f1eee9;
  --text: #141416;
  --text-muted: #5f6570;
  --line: #dedad3;
  --primary: #0f6fff;
  --primary-ink: #ffffff;
  --secondary: #1f232b;
  --secondary-ink: #f5f7fa;
  --shadow: 0 24px 64px rgba(13, 26, 45, 0.08);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --max-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #050505;
    --bg-elevated: #101113;
    --bg-soft: #191b1f;
    --text: #f4f7fb;
    --text-muted: #a4adba;
    --line: #272b33;
    --primary: #75a7ff;
    --primary-ink: #081325;
    --secondary: #dce3f0;
    --secondary-ink: #10131a;
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 90% -10%, rgba(15, 111, 255, 0.2), transparent 40%), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: 0;
  color: var(--text);
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a {
  text-decoration: none;
  padding: 0.58rem 0.95rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 700;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--bg-soft);
}

main {
  padding-bottom: 5rem;
}

.section-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding-top: 2.2rem;
}

.eyebrow {
  font-family: "Space Grotesk", sans-serif;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
}

h1,
h2 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.15;
}

.hero {
  padding-top: clamp(2.4rem, 4vw, 4.8rem);
  padding-bottom: clamp(2rem, 3vw, 3rem);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4.3rem);
  max-width: 15.5ch;
  margin-top: 0.75rem;
}

.hero-text {
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin-top: 1rem;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  padding: 0.72rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn:disabled.btn-primary,
.btn:disabled.btn-secondary,
.btn:disabled.btn-danger {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 12px 20px color-mix(in srgb, var(--primary) 28%, transparent);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-ink);
}

.btn-danger {
  background: #d93754;
  color: #fff;
}

.btn-small {
  padding: 0.4rem 0.78rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.feature-card h2 {
  font-size: 1.15rem;
}

.feature-card p {
  color: var(--text-muted);
  margin-top: 0.55rem;
}

.gallery-shell,
.projects-shell,
.contacts-shell,
.admin-shell {
  padding-top: 2.6rem;
}

.gallery-head,
.projects-head,
.admin-head {
  margin-bottom: 1.2rem;
}

.gallery-head h1,
.projects-head h1,
.admin-head h1 {
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  margin-top: 0.65rem;
}

.gallery-head p,
.projects-head p,
.admin-head p {
  margin-top: 0.45rem;
  color: var(--text-muted);
}

.gallery-section {
  margin-top: 2rem;
}

.gallery-section h2 {
  font-size: 1.26rem;
  margin-bottom: 0.8rem;
}

.block-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}

.collections-block {
  margin-top: 1.2rem;
}

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

.collection-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.collection-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.collection-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.collection-summary {
  padding: 0.8rem;
}

.collection-summary h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.06rem;
}

.collection-dates {
  margin-top: 0.28rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.collection-description {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.collection-panel {
  border-top: 1px solid var(--line);
  padding: 0.75rem;
}

.collection-panel-template {
  display: none;
}

.collection-card.is-open {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
}

.collection-expanded-slot {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.35s ease;
}

.collection-expanded-slot.is-open {
  max-height: 5000px;
  opacity: 1;
  transform: translateY(0);
}

.collection-expanded-content {
  padding: 0.85rem;
}

.gallery-divider {
  margin: 1.7rem 0 0.4rem;
  border-top: 1px solid var(--line);
  position: relative;
  text-align: center;
}

.gallery-divider span {
  display: inline-block;
  transform: translateY(-0.65rem);
  padding: 0 0.6rem;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dates-block {
  margin-top: 0.8rem;
}

.group-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
}

.group-title {
  margin-bottom: 0.25rem;
}

.group-meta {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.group-description {
  color: var(--text-muted);
  margin: 0.35rem 0 0.9rem;
}

.group-cover {
  margin-bottom: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.group-cover img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}

.photo-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.photo-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.24s ease;
}

.photo-card img:hover {
  transform: scale(1.04);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  padding: 1rem;
}

.lightbox.visible {
  display: flex;
}

.lightbox img {
  max-width: min(1400px, 96vw);
  max-height: 92vh;
  border-radius: var(--radius-md);
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  font-size: 2rem;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.projects-grid {
  margin-top: 1.6rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.project-card {
  border-radius: var(--radius-xl);
  padding: 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-top: 6px solid var(--project-accent);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.project-card h2 {
  font-size: 1.35rem;
}

.project-card p {
  color: var(--text-muted);
}

.project-handle {
  font-family: "Space Grotesk", sans-serif;
  color: color-mix(in srgb, var(--project-accent) 85%, var(--text) 15%);
  font-size: 0.95rem;
  font-weight: 700;
}

.contacts-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(1.1rem, 3vw, 2rem);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.25rem;
  align-items: center;
}

.profile-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--line);
}

.contact-text p {
  margin-top: 0.45rem;
}

.contact-text a {
  color: var(--primary);
}

.admin-layout {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  margin-top: 1rem;
}

.admin-panel h2 {
  font-size: 1.25rem;
}

.admin-form {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.85rem;
}

.admin-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.admin-form input,
.admin-form textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  padding: 0.7rem 0.82rem;
  font: inherit;
}

.admin-form textarea {
  resize: vertical;
}

.flash {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  padding: 0.72rem 0.9rem;
  border: 1px solid;
  font-weight: 700;
}

.flash.success {
  border-color: #13a554;
  background: color-mix(in srgb, #13a554 18%, transparent);
}

.flash.error {
  border-color: #d42f4b;
  background: color-mix(in srgb, #d42f4b 18%, transparent);
}

.helper-text {
  margin-top: 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.upload-progress {
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #fff));
  transition: width 0.25s ease;
}

.project-manager-list,
.group-list {
  margin-top: 1rem;
}

.admin-compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}

.compact-manage-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}

.compact-manage-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0.82rem;
  display: grid;
  gap: 0.62rem;
}

.compact-manage-card.is-open {
  box-shadow: var(--shadow);
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: -2px;
}

.compact-manage-head {
  display: grid;
  gap: 0.24rem;
}

.compact-manage-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.compact-manage-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
}

.compact-manage-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.compact-manage-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.compact-manage-panel-template {
  display: none;
}

.compact-manage-body {
  padding: 0.86rem;
}

.compact-accent-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
}

.group-item,
.admin-project-item {
  padding: 0;
}

.admin-expanded-slot {
  grid-column: 1 / -1;
}

.admin-expanded-slot .collection-expanded-content {
  padding: 0;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.checkbox-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-disclosure {
  margin-top: 0.1rem;
}

.admin-disclosure > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 0.82rem 0.9rem;
  cursor: pointer;
}

.admin-disclosure > summary::-webkit-details-marker {
  display: none;
}

.admin-disclosure-summary h2 {
  margin: 0;
  font-size: 1.1rem;
}

.disclosure-meta {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.admin-image-sections {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.admin-image-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
  padding: 0;
}

.admin-image-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.86rem;
  background: var(--bg-soft);
  cursor: pointer;
}

.admin-image-section > summary::-webkit-details-marker {
  display: none;
}

.admin-image-section-title h3 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  font-size: 1rem;
}

.admin-image-section-title p {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.admin-image-section > summary .btn {
  flex-shrink: 0;
}

.admin-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
  padding: 0.86rem;
}

.admin-image-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem;
  background: var(--bg-elevated);
  display: grid;
  gap: 0.45rem;
}

.admin-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.admin-image-item figcaption {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.26rem 0.52rem;
  font-size: 0.74rem;
  font-weight: 800;
  width: fit-content;
}

.preview-badge.ok {
  background: color-mix(in srgb, #12a150 16%, transparent);
  border: 1px solid #12a150;
  color: color-mix(in srgb, #12a150 75%, var(--text));
}

.preview-badge.missing {
  background: color-mix(in srgb, #d47b13 16%, transparent);
  border: 1px solid #d47b13;
  color: color-mix(in srgb, #d47b13 75%, var(--text));
}

.project-manager-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-form {
  margin: 0;
}

.compact-form {
  margin-top: 0.75rem;
}

.project-form-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.delete-form {
  margin-top: 0.75rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
}

.chips {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.empty-state {
  margin-top: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.empty-state p {
  margin-top: 0.45rem;
  color: var(--text-muted);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

@media (max-width: 900px) {
  .feature-grid,
  .admin-layout,
  .contacts-card {
    grid-template-columns: 1fr;
  }

  .profile-img {
    width: min(220px, 100%);
  }
}

@media (max-width: 760px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--bg-elevated);
    padding: 0.6rem;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links a {
    border-radius: 12px;
    display: block;
  }
}
