:root {
  color-scheme: light;
  --navy: #102536;
  --navy-2: #1d4058;
  --ink: #18232b;
  --muted: #64727d;
  --line: #e1e7eb;
  --paper: #ffffff;
  --canvas: #f6f8f9;
  --gold: #b58b51;
  --shadow: 0 22px 55px rgba(7, 33, 52, .14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }

.topbar {
  min-height: 112px;
  padding: 24px clamp(20px, 5vw, 80px);
  background: linear-gradient(115deg, #0c1d29, var(--navy) 65%, #183f58);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-block { display: flex; align-items: center; gap: 16px; }
.brand-logo { width: clamp(150px, 19vw, 230px); height: 76px; padding: 7px 10px; border-radius: 7px; background: #fff; object-fit: contain; }
.eyebrow { margin: 0 0 4px; font-size: 12px; letter-spacing: .18em; color: #d9e4ea; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.4vw, 44px); font-weight: 400; letter-spacing: -.02em; }
.header-note { margin: 0; color: #cdd8df; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 28px clamp(16px, 4vw, 58px) 64px; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 1.5fr) repeat(5, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  background: var(--paper);
  border: 1px solid rgba(219,227,232,.9);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 12px 35px rgba(7, 33, 52, .07);
  position: sticky;
  top: 12px;
  z-index: 5;
}
.search-wrap, .filter-wrap { display: grid; gap: 7px; }
label { font-size: 13px; font-weight: 700; color: var(--navy); }
input, select {
  width: 100%; min-height: 46px; border: 1px solid #c7d1d8; border-radius: 9px;
  background: #fff; color: var(--ink); padding: 0 12px; font-size: 16px;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(189, 143, 69, .34); outline-offset: 2px; border-color: var(--gold); }
.clear-button {
  min-height: 46px; padding: 0 16px; border: 1px solid var(--navy); border-radius: 9px;
  background: transparent; color: var(--navy); font-weight: 700; cursor: pointer;
}
.clear-button:hover { background: #edf3f6; }
.results-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: 24px 2px 16px; }
.results-row p { margin: 0; }
#result-count { font-weight: 750; color: var(--navy); }
.catalog-note { color: var(--muted); font-size: 14px; }

.type-nav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: thin; }
.type-nav a { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 13px; }
.type-nav a:hover { border-color: var(--gold); }
.type-nav span { margin-left: 5px; color: var(--muted); font-weight: 600; }
.project-groups { display: grid; gap: 54px; }
.project-group { scroll-margin-top: 130px; }
.group-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 2px 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.group-heading p { margin: 0 0 3px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.group-heading h2 { margin: 0; color: var(--navy); font: 400 clamp(27px, 3.2vw, 38px)/1.05 Georgia, serif; }
.group-heading > span { color: var(--muted); font-size: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.project-card {
  padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: var(--paper); text-align: left; color: inherit; cursor: pointer;
  box-shadow: 0 6px 20px rgba(7, 33, 52, .06); transition: transform .18s ease, box-shadow .18s ease;
}
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card-image { position: relative; aspect-ratio: 4 / 3; background: #dfe7ec; overflow: hidden; }
.card-slides, .card-slide { position: absolute; inset: 0; }
.card-slide { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transform: scale(1.025); transition: opacity .7s ease, transform 4.8s ease; }
.card-slide.is-active { opacity: 1; transform: scale(1); }
.project-card:hover .card-slide.is-active { transform: scale(1.035); }
.photo-count { position: absolute; right: 12px; top: 12px; border-radius: 999px; background: rgba(10,28,40,.78); backdrop-filter: blur(8px); color: #fff; padding: 6px 9px; font-size: 12px; }
.photo-count.is-importing { background: rgba(112, 78, 27, .88); }
.slide-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); }
.slide-progress i { display: block; width: 34%; height: 100%; background: var(--gold); animation: progress 4.4s linear infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.card-body { padding: 16px 17px 18px; }
.designer { margin: 0 0 6px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.project-card h2 { margin: 0; min-height: 2.6em; font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.28; font-weight: 500; color: var(--navy); }
.project-date { margin: 9px 0 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.gallery-availability { margin: 9px 0 0; color: var(--navy-2); font-size: 13px; font-weight: 750; }
.gallery-availability.is-importing { color: #8a652d; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { padding: 6px 9px; border-radius: 999px; background: #eef3f5; color: #455a69; font-size: 12px; line-height: 1; }
.tag.color-tag { background: #f7f1e8; color: #755b31; }
.empty-state { margin: 70px auto; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--navy); font-family: Georgia, serif; font-weight: 500; }

.project-dialog {
  width: min(920px, calc(100vw - 30px)); max-height: calc(100vh - 30px); padding: 0;
  border: 0; border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.32); overflow: auto;
}
.project-dialog::backdrop { background: rgba(4, 20, 31, .72); backdrop-filter: blur(3px); }
.dialog-toolbar {
  position: sticky; top: 0; z-index: 10; min-height: 58px; padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); box-shadow: 0 5px 18px rgba(7,33,52,.1);
  backdrop-filter: blur(10px);
}
.back-to-projects {
  min-height: 42px; padding: 0 14px; display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid #c8d2d9; border-radius: 999px; background: #fff; color: var(--navy);
  font-weight: 800; cursor: pointer;
}
.back-to-projects span[aria-hidden="true"] { font-size: 22px; line-height: 1; }
.back-to-projects:hover { border-color: var(--gold); background: #f7f9fa; }
.close-dialog {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 27px; line-height: 1; cursor: pointer;
}
.close-dialog:hover { background: var(--navy-2); }
.dialog-hero { position: relative; aspect-ratio: 16 / 9; background: #dfe7ec; overflow: hidden; }
.dialog-slides, .dialog-slide { position: absolute; inset: 0; }
.dialog-slide { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: translateX(4%); transition: opacity .35s ease, transform .5s ease; }
.dialog-slide.is-active { opacity: 1; transform: translateX(0); }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(10,28,40,.76); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); }
.carousel-arrow:hover { background: var(--navy); }
.carousel-arrow.prev { left: 18px; }
.carousel-arrow.next { right: 18px; }
.carousel-dots { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: calc(100% - 96px); }
.carousel-dot { width: 9px; height: 9px; padding: 0; border: 1px solid #fff; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; }
.carousel-dot.is-active { background: #fff; transform: scale(1.25); }
.carousel-counter { position: absolute; z-index: 2; right: 18px; bottom: 16px; border-radius: 999px; background: rgba(10,28,40,.78); color: #fff; padding: 6px 10px; font-size: 13px; font-weight: 750; backdrop-filter: blur(6px); }
.dialog-body { padding: clamp(22px, 4vw, 38px); }
.dialog-body h2 { margin: 4px 0 10px; font-family: Georgia, serif; font-size: clamp(27px, 4vw, 40px); line-height: 1.1; font-weight: 500; color: var(--navy); }
.dialog-meta { margin: 0 0 20px; color: var(--muted); }
.all-photo-gallery { padding: 0 clamp(22px, 4vw, 38px) clamp(28px, 5vw, 48px); }
.gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.gallery-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.gallery-heading .group-kicker { margin-bottom: 4px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.gallery-heading h3 { margin: 0; color: var(--navy); font: 500 clamp(23px, 3vw, 31px)/1.1 Georgia, serif; }
.dialog-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.dialog-thumbnail { padding: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: #dfe7ec; cursor: pointer; }
.dialog-thumbnail:hover, .dialog-thumbnail.is-active { border-color: var(--gold); }
.dialog-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .22s ease; }
.dialog-thumbnail:hover img { transform: scale(1.035); }
.import-notice { display: grid; gap: 5px; margin: 0 clamp(22px, 4vw, 38px) clamp(28px, 5vw, 38px); padding: 16px 18px; border: 1px solid #e3c998; border-radius: 10px; background: #fff8eb; color: #65491f; }
.import-notice strong { color: #4f3919; }
.import-notice span { font-size: 14px; line-height: 1.45; }
@media (max-width: 1250px) {
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-wrap { grid-column: 1 / -1; }
  .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { align-items: flex-start; }
  .header-note { display: none; }
  .toolbar { position: static; grid-template-columns: 1fr; }
  .search-wrap { grid-column: auto; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .project-card h2 { font-size: 18px; }
  .catalog-note { display: none; }
  .dialog-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
}
@media (max-width: 500px) {
  .brand-logo { width: 132px; height: 64px; padding: 6px 8px; }
  .eyebrow { font-size: 10px; }
  .draft-badge { display: none; }
  main { padding-inline: 12px; }
  .project-grid { grid-template-columns: 1fr; }
  .carousel-arrow { width: 40px; height: 40px; }
  .dialog-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .dialog-toolbar { padding: max(8px, env(safe-area-inset-top)) 10px 8px; }
  .back-to-projects { min-height: 44px; padding-inline: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
