:root {
  --navy: #0b2341;
  --navy-light: #173a63;
  --yellow: #ffc91a;
  --yellow-dark: #d9a500;
  --ink: #17202a;
  --muted: #627080;
  --line: #dce2e7;
  --surface: #f3f5f7;
  --white: #fff;
  color: var(--ink);
  background: var(--white);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--white);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
input,
select,
a {
  outline-offset: 3px;
}

:focus-visible {
  outline: 3px solid rgba(255, 201, 26, 0.7);
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: var(--navy);
  background: var(--yellow);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 82px;
  padding: 0.9rem max(1rem, calc((100% - 1240px) / 2));
  color: var(--white);
  background: rgba(11, 35, 65, 0.97);
  box-shadow: 0 8px 24px rgba(11, 35, 65, 0.16);
  backdrop-filter: blur(10px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.wordmark > span {
  display: grid;
  width: 44px;
  height: 44px;
  border: 4px solid var(--yellow);
  border-radius: 50%;
  color: transparent;
  place-items: center;
}

.wordmark strong {
  color: var(--white);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.preview-state {
  justify-self: start;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgba(255, 201, 26, 0.6);
  border-radius: 999px;
  color: var(--yellow);
  font-size: 0.74rem;
  font-weight: 800;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-header nav a {
  color: var(--white);
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--yellow);
}

main {
  min-height: calc(100vh - 170px);
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--yellow-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.references-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  padding:
    clamp(4rem, 9vw, 8rem)
    max(1rem, calc((100% - 1240px) / 2))
    clamp(3rem, 6vw, 5rem);
  color: var(--white);
  background:
    linear-gradient(118deg, rgba(11, 35, 65, 0.98), rgba(23, 58, 99, 0.91)),
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 28px,
      rgba(255, 255, 255, 0.04) 28px,
      rgba(255, 255, 255, 0.04) 30px
    );
}

.references-hero > div {
  max-width: 760px;
}

.references-hero h1,
.reference-detail__heading h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.references-hero p:last-child {
  max-width: 690px;
  margin: 1.5rem 0 0;
  color: #d7e0e9;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.references-hero > strong {
  flex: 0 0 auto;
  padding: 1rem 1.2rem;
  border-left: 5px solid var(--yellow);
  color: var(--white);
  font-size: 1rem;
}

.references-list,
.reference-detail {
  width: min(calc(100% - 2rem), 1240px);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5.5rem) 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.reference-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 0.28fr) auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.reference-filters label {
  display: grid;
  gap: 0.45rem;
}

.reference-filters label span {
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 800;
}

.reference-filters input,
.reference-filters select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #b8c1ca;
  border-radius: 7px;
  color: var(--ink);
  background: var(--white);
}

.reference-filters button,
.reference-detail-dialog button,
.gallery-dialog button {
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--navy);
  border-radius: 7px;
  color: var(--white);
  background: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.reference-detail-dialog button {
  border-color: var(--white);
}

.reference-filters button:hover,
.reference-detail-dialog button:hover,
.gallery-dialog button:hover {
  border-color: var(--yellow-dark);
  color: var(--navy);
  background: var(--yellow);
}

.reference-filters button:disabled {
  border-color: #cbd1d6;
  color: #7d8791;
  background: #e4e8eb;
  cursor: not-allowed;
}

.reference-filters__actions {
  display: flex;
  gap: 0.65rem;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 2.5vw, 2rem);
}

.reference-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 12px 36px rgba(11, 35, 65, 0.08);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.reference-card:hover {
  box-shadow: 0 18px 42px rgba(11, 35, 65, 0.15);
  transform: translateY(-4px);
}

.reference-card[hidden] {
  display: none;
}

.reference-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #dfe4e9;
}

.reference-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.reference-card:hover .reference-card__image img {
  transform: scale(1.025);
}

.reference-card__image span {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  padding: 0.38rem 0.55rem;
  border-radius: 999px;
  color: var(--white);
  background: rgba(11, 35, 65, 0.88);
  font-size: 0.7rem;
  font-weight: 800;
}

.reference-card__content {
  padding: 1.2rem;
}

.reference-card__content > p {
  margin: 0 0 0.45rem;
  color: var(--yellow-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.25rem;
  line-height: 1.25;
}

.reference-card h2 a {
  text-decoration: none;
}

.reference-card h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.reference-card dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  margin: 1rem 0;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reference-card dl div {
  min-width: 0;
}

.reference-card dt,
.reference-detail__heading dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.reference-card dd,
.reference-detail__heading dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 800;
}

.detail-link,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 850;
  text-decoration: none;
}

.detail-link:hover,
.back-link:hover {
  color: #805f00;
}

.empty-state {
  padding: 1rem;
  border-left: 5px solid var(--yellow);
  color: var(--navy);
  background: #fff7d4;
  font-weight: 750;
}

.breadcrumbs {
  display: flex;
  gap: 0.55rem;
  width: min(calc(100% - 2rem), 1240px);
  margin: 0 auto;
  padding-top: 2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.breadcrumbs a {
  color: var(--navy);
  font-weight: 800;
}

.reference-detail {
  padding-top: 2rem;
}

.reference-detail__heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  align-items: end;
  gap: 3rem;
  padding: clamp(2rem, 5vw, 4rem);
  color: var(--white);
  background: var(--navy);
}

.reference-detail__heading .eyebrow {
  color: var(--yellow);
}

.reference-detail__heading h1 {
  font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.reference-detail__heading dl {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1.2rem;
  border-left: 5px solid var(--yellow);
  background: rgba(255, 255, 255, 0.07);
}

.reference-detail__heading dt {
  color: #bfcbd7;
}

.reference-detail__heading dd {
  color: var(--white);
  font-size: 0.95rem;
}

.reference-gallery {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.reference-gallery ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-gallery li {
  min-width: 0;
}

.reference-gallery a {
  display: block;
  height: 100%;
  min-height: 220px;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 9px;
  background: #dfe4e9;
}

.reference-gallery a:hover,
.reference-gallery a:focus-visible {
  border-color: var(--yellow-dark);
}

.reference-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.reference-detail-dialog {
  width: min(calc(100% - 2rem), 1180px);
  height: min(calc(100vh - 2rem), 900px);
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.reference-detail-dialog::backdrop {
  background: rgba(3, 14, 28, 0.88);
  backdrop-filter: blur(4px);
}

.reference-detail-dialog__panel {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--white);
}

.reference-detail-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 4px solid var(--yellow);
  color: var(--white);
  background: var(--navy);
}

.reference-detail-dialog header .eyebrow {
  color: var(--yellow);
}

.reference-detail-dialog header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.reference-detail-dialog header p:last-child {
  margin: 0.25rem 0 0;
  color: #c9d3de;
  font-size: 0.74rem;
  font-weight: 750;
}

.reference-detail-dialog header button {
  flex: 0 0 auto;
  border-color: var(--white);
  background: transparent;
}

.reference-detail-dialog__content {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.3fr);
}

.reference-detail-dialog__media {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(280px, 1fr) auto;
  background: #111923;
}

.reference-detail-dialog__media figure {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 1rem;
  overflow: hidden;
  place-items: center;
}

.reference-detail-dialog__media figure > img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transition: opacity 120ms ease;
}

.reference-detail-dialog[data-loading="1"] figure > img {
  opacity: 0.4;
}

.reference-detail-dialog__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  border-color: var(--white);
  border-radius: 50%;
  background: rgba(11, 35, 65, 0.84);
  transform: translateY(-50%);
  place-items: center;
}

.reference-detail-dialog__arrow span {
  margin-top: -0.08em;
  font-size: 2.2rem;
  line-height: 1;
}

.reference-detail-dialog__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.reference-detail-dialog__arrow--previous {
  left: 1.25rem;
}

.reference-detail-dialog__arrow--next {
  right: 1.25rem;
}

.reference-detail-dialog__thumbnails {
  display: grid;
  max-height: 190px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.8rem;
  overflow: auto;
  border-top: 1px solid #33404d;
  background: #18232f;
}

.reference-detail-dialog__thumbnails button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 3px solid transparent;
  border-radius: 6px;
  background: #dfe4e9;
}

.reference-detail-dialog__thumbnails button:hover,
.reference-detail-dialog__thumbnails button[aria-current] {
  border-color: var(--yellow);
  background: #dfe4e9;
}

.reference-detail-dialog__thumbnails button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.reference-detail-dialog__thumbnails img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reference-detail-dialog aside {
  min-width: 0;
  padding: 1.2rem;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.reference-detail-dialog aside dl {
  display: grid;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.reference-detail-dialog aside dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.reference-detail-dialog aside dd {
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-weight: 800;
}

.gallery-dialog {
  width: min(calc(100% - 2rem), 1180px);
  height: min(calc(100vh - 2rem), 900px);
  max-width: none;
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.gallery-dialog::backdrop {
  background: rgba(3, 14, 28, 0.88);
  backdrop-filter: blur(4px);
}

.gallery-dialog__panel {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--white);
}

.gallery-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 4px solid var(--yellow);
  color: var(--white);
  background: var(--navy);
}

.gallery-dialog header .eyebrow {
  color: var(--yellow);
}

.gallery-dialog header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.gallery-dialog header p:last-child {
  margin: 0.25rem 0 0;
  color: #c9d3de;
  font-size: 0.74rem;
  font-weight: 750;
}

.gallery-dialog header button {
  border-color: var(--white);
  background: transparent;
}

.gallery-dialog figure {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 0;
  padding: 1rem;
  overflow: hidden;
  background: #111923;
  place-items: center;
}

.gallery-dialog figure img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transition: opacity 120ms ease;
}

.gallery-dialog[data-loading="1"] figure img {
  opacity: 0.4;
}

.gallery-dialog__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  padding: 0;
  border-color: var(--white);
  border-radius: 50%;
  background: rgba(11, 35, 65, 0.84);
  transform: translateY(-50%);
  place-items: center;
}

.gallery-dialog__arrow span {
  margin-top: -0.08em;
  font-size: 2.2rem;
  line-height: 1;
}

.gallery-dialog__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.gallery-dialog__arrow--previous {
  left: 1.25rem;
}

.gallery-dialog__arrow--next {
  right: 1.25rem;
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem max(1rem, calc((100% - 1240px) / 2));
  color: #c9d3de;
  background: var(--navy);
  font-size: 0.8rem;
}

.site-footer strong {
  color: var(--white);
}

.site-footer a {
  margin-left: auto;
  color: var(--yellow);
  font-weight: 800;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .preview-state {
    justify-self: end;
  }

  .site-header nav {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .references-hero,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-grid,
  .reference-gallery ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-filters {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.35fr);
  }

  .reference-filters__actions {
    grid-column: 1 / -1;
  }

  .reference-detail-dialog__content {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.35fr);
  }

  .reference-detail__heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: static;
  }

  .preview-state {
    max-width: 150px;
    text-align: center;
  }

  .site-header nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .references-hero > strong {
    align-self: stretch;
  }

  .reference-filters,
  .reference-grid,
  .reference-gallery ol {
    grid-template-columns: 1fr;
  }

  .reference-filters__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reference-detail-dialog {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .reference-detail-dialog__content {
    display: block;
    overflow: auto;
  }

  .reference-detail-dialog__media {
    min-height: 520px;
    grid-template-rows: minmax(300px, 1fr) auto;
  }

  .reference-detail-dialog__thumbnails {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reference-detail-dialog aside {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .reference-detail-dialog__arrow {
    width: 42px;
    height: 42px;
  }

  .reference-detail-dialog__arrow--previous {
    left: 0.5rem;
  }

  .reference-detail-dialog__arrow--next {
    right: 0.5rem;
  }

  .reference-detail__heading {
    padding: 1.5rem;
  }

  .reference-gallery a {
    min-height: 0;
  }

  .gallery-dialog {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .gallery-dialog__arrow {
    width: 42px;
    height: 42px;
  }

  .gallery-dialog__arrow--previous {
    left: 0.5rem;
  }

  .gallery-dialog__arrow--next {
    right: 0.5rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer a {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
