:root {
  --ink: #111315;
  --muted: #56616b;
  --line: #d8e1e5;
  --mist: #f4f8fa;
  --blue: #b8d7e1;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f7fafb;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 225, 229, .7);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
}
.nav { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-size: 24px; font-weight: 900; }
.nav-links { display: flex; align-items: center; gap: 22px; font-weight: 700; font-size: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
}
.btn-dark { background: #111315; color: #fff; }
.btn-light { background: #fff; color: #111315; border: 1px solid var(--line); }

.hero {
  min-height: 760px;
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.96), rgba(255,255,255,.72), rgba(255,255,255,.18)), url("https://images.unsplash.com/photo-1600566752355-35792bedcfea?auto=format&fit=crop&w=2200&q=85") center/cover;
}
.hero-content { position: relative; max-width: 760px; padding: 80px 0; }
.eyebrow { font-size: 13px; font-weight: 900; letter-spacing: .25em; text-transform: uppercase; color: #3f4b53; }
h1 { font-size: clamp(44px, 7vw, 82px); line-height: .96; margin: 22px 0; }
h2 { font-size: clamp(32px, 4vw, 48px); margin: 0; }
h3 { margin: 0; }
.lead { color: #303941; font-size: 21px; line-height: 1.55; max-width: 720px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.section { padding: 82px 0; }
.white { background: #fff; }
.dark { background: #111315; color: #fff; }
.light-text { color: #d7dee3; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.card-body { padding: 22px; }
.muted { color: var(--muted); line-height: 1.65; }
.service-img, .gallery-img { width: 100%; height: 220px; object-fit: cover; background: #eef6f8; }
.gallery-img { height: 260px; }
.reason { padding: 24px; box-shadow: 0 22px 60px rgba(17,19,21,.06); }
.gallery-container {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
}
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 28px;
}
.gallery-filter-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid #d4dce1;
  border-radius: 999px;
  background: #fff;
  color: #20262b;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.gallery-filter-button.active,
.gallery-filter-button:hover {
  background: #161b1f;
  border-color: #161b1f;
  color: #fff;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}
.gallery-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid #d8e0e5;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06);
}
.gallery-card[hidden] { display: none; }
.reference-image-button,
.gallery-card-image-wrapper {
  display: block;
  width: 100%;
  height: 230px;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #eef6f8;
  cursor: zoom-in;
}
.gallery-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.gallery-card-content {
  padding: 18px 20px 20px;
}
.gallery-card-category {
  margin: 0 0 9px;
  color: #56616b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.gallery-card h3 {
  font-size: 20px;
  line-height: 1.25;
}
.gallery-card-description {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  line-height: 1.55;
}

form { display: grid; gap: 22px; }
label { display: grid; gap: 7px; color: #303941; font-size: 14px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: #8eb8c4;
  box-shadow: 0 0 0 3px rgba(184, 215, 225, .35);
}
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.notice { border: 1px solid var(--blue); background: #eef9fc; border-radius: 8px; padding: 16px; }
.checkbox { display: flex; align-items: center; gap: 10px; }
.checkbox input { width: 18px; height: 18px; }
.message { border-radius: 8px; padding: 18px; font-weight: 800; }
.success { background: #eaf8ef; color: #14532d; }
.error { background: #fff1f2; color: #991b1b; }

.footer { padding: 46px 0; background: #111315; color: #fff; }
.footer-grid { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }

.ai-wrap {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 42px;
  align-items: start;
}
.ai-panel {
  border-radius: 8px;
  background: #c9c9c9;
  padding: 26px;
  color: #111315;
}
.ai-result {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.ai-result img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(17, 19, 21, .12);
}
.btn:disabled {
  cursor: wait;
  opacity: .7;
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 72px 24px 32px;
  background: rgba(0, 0, 0, .86);
}
.lightbox[hidden] { display: none; }
.lightbox-open { overflow: hidden; }
.lightbox-content {
  display: grid;
  gap: 12px;
  width: min(1100px, 100%);
  margin: 0;
  color: #fff;
  text-align: center;
}
.lightbox-content img {
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
}
.lightbox-close,
.lightbox-nav {
  position: fixed;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
}
.lightbox-close {
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}
.lightbox-nav {
  top: 50%;
  width: 48px;
  height: 56px;
  transform: translateY(-50%);
  border-radius: 8px;
  font-size: 42px;
  line-height: 1;
}
.lightbox-prev { left: 22px; }
.lightbox-next { right: 22px; }
.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.admin-thumb {
  width: 88px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}
.reference-preview-wrap img {
  width: min(360px, 100%);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.reference-admin-table form {
  display: block;
}

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; background: #f6f8fa; }
.sidebar { background: #111315; color: #fff; padding: 28px 20px; }
.sidebar a { display: block; padding: 11px 0; color: #d7dee3; font-weight: 700; }
.admin-main { padding: 30px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.table th, .table td { padding: 13px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: #eef2f5; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.image-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .grid-3, .grid-4, .form-grid, .form-grid-4, .ai-wrap { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { min-height: 680px; }
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 640px) {
  .gallery-container { width: min(100% - 32px, 1180px); }
  .gallery-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 70px 12px 24px; }
  .lightbox-nav {
    top: auto;
    bottom: 18px;
    transform: none;
  }
  .lightbox-prev { left: 18px; }
  .lightbox-next { right: 18px; }
}
