:root {
  color: #182124;
  background: #f4f6f5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button {
  font: inherit;
}

.page-shell {
  width: min(100% - 2rem, 1040px);
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgb(24 33 36 / 8%);
}

.profile-photo-button {
  display: block;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #e9eeec;
  border: 0;
  border-radius: 0.75rem;
}

.profile-photo {
  display: block;
  width: 7rem;
  height: auto;
  max-height: 9.375rem;
  object-fit: contain;
}

.profile-content {
  min-width: 0;
}

.dive-experience {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgb(24 33 36 / 6%);
}

.dive-experience-section h2 {
  margin: 0;
  color: #12201c;
  font-size: 1.0625rem;
  line-height: 1.25;
  font-weight: 700;
}

.dive-experience-grid {
  display: grid;
  gap: 1rem;
}

.dive-experience-section {
  display: grid;
  gap: 0.5rem;
}

.dive-experience-section p {
  margin: 0;
  color: #52635d;
  font-size: 0.875rem;
  line-height: 1.45;
}

.photo-gallery {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgb(24 33 36 / 6%);
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.375rem, 1.5vw, 0.75rem);
}

.photo-gallery-grid button {
  display: block;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  background: #e9eeec;
  border: 0;
  border-radius: 0.5rem;
}

.photo-gallery-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.certifications-section {
  margin-top: 1rem;
}

.certifications-section > h2 {
  margin: 0 1rem;
  color: #12201c;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  line-height: 1.2;
}

.certification-groups {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.certification-group {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 1rem;
  box-shadow: 0 8px 24px rgb(24 33 36 / 6%);
}

.certification-group h3 {
  margin: 0;
}

.certification-group-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  cursor: pointer;
  color: #12201c;
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 1.0625rem;
  line-height: 1.25;
}

.certification-group-toggle::before {
  position: absolute;
  inset: -0.5rem 0;
  content: "";
}

.certification-group-toggle-label {
  min-width: 0;
  font-weight: 700;
}

.certification-group-count {
  margin-left: 0;
  color: #61716c;
  font-weight: 600;
}

.certification-group-chevron {
  flex: 0 0 auto;
  margin-left: 1rem;
  color: #61716c;
  font-size: 1.125rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.certification-group-toggle[aria-expanded="false"] .certification-group-chevron {
  transform: rotate(-90deg);
}

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

.certification-grid[hidden] {
  display: none;
}

.certification-card {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.certification-card img {
  display: block;
  width: 100%;
  aspect-ratio: 400 / 254;
  object-fit: cover;
  background: #e9eeec;
  border-radius: 0.625rem;
  box-shadow: 0 2px 8px rgb(24 33 36 / 10%);
}

.personal-dive-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  aspect-ratio: 400 / 254;
  padding: 1rem;
  overflow: hidden;
  color: #172421;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 26%), transparent 58%),
    linear-gradient(45deg, #e67876 0 40%, #fbfbf7 40.5% 59.5%, #e36361 60% 100%);
  border-radius: 0.625rem;
  box-shadow: 0 2px 8px rgb(24 33 36 / 16%);
}

.personal-dive-card-note {
  font-size: 0.625rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.personal-dive-card-note {
  align-self: end;
  color: rgb(23 36 33 / 72%);
}

.personal-dive-card-title {
  display: grid;
  gap: 0.125rem;
  align-self: start;
}

.personal-dive-card-title strong {
  font-size: clamp(1.5rem, 5.2vw, 2.25rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.personal-dive-card-title span {
  font-size: clamp(0.75rem, 2.6vw, 1rem);
  font-weight: 700;
}

.personal-dive-card--lightbox {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.personal-dive-card--lightbox .personal-dive-card-note {
  font-size: clamp(0.75rem, 2vw, 1rem);
}

.personal-dive-card--lightbox .personal-dive-card-title strong {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
}

.personal-dive-card--lightbox .personal-dive-card-title span {
  font-size: clamp(1rem, 3.25vw, 1.5rem);
}

.certification-card-name {
  color: #22312d;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: #61716c;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #12201c;
  font-size: clamp(1.65rem, 6vw, 2.4rem);
  line-height: 1.1;
}

.dive-counts {
  width: min(100%, 26rem);
  margin: 1.25rem 0 0;
}

.dive-totals {
  margin: 0;
}

.dive-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #dfe5e2;
}

.dive-total dt {
  margin: 0;
  color: #52635d;
  font-size: 0.875rem;
  font-weight: 450;
  line-height: 1.25;
}

.dive-total dd {
  justify-self: end;
  margin: 0;
  color: #12201c;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
}

.dive-total--primary dt {
  color: #12201c;
  font-size: 1rem;
  font-weight: 750;
}

.dive-total--primary dd {
  font-size: 1.25rem;
  font-weight: 800;
}

.dive-breakdown {
  width: 100%;
  border-spacing: 0;
  color: #12201c;
  font-variant-numeric: tabular-nums;
}

.dive-breakdown th,
.dive-breakdown td {
  padding: 0.625rem 0;
  border-bottom: 1px solid #dfe5e2;
}

.dive-breakdown thead th {
  color: #52635d;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: right;
}

.dive-breakdown thead th:first-child,
.dive-breakdown tbody th {
  text-align: left;
}

.dive-breakdown tbody th {
  color: #52635d;
  font-size: 0.875rem;
  font-weight: 450;
}

.dive-breakdown td {
  width: 4rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
}

.dive-breakdown abbr {
  text-decoration: none;
}

.cave-certification-count {
  margin: 0.375rem 0 0;
  color: #52635d;
  font-size: 0.75rem;
  text-align: right;
}

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

.photo-lightbox {
  width: fit-content;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  padding: 0.75rem;
  overflow: visible;
  background: transparent;
  border: 0;
}

.photo-lightbox::backdrop {
  background: rgb(0 0 0 / 78%);
}

.photo-lightbox img {
  display: block;
  width: auto;
  max-width: calc(min(90vw, 900px) - 1.5rem);
  max-height: calc(90vh - 1.5rem);
  height: auto;
  border-radius: 0.75rem;
}

.photo-lightbox img[hidden] {
  display: none;
}

.certificate-lightbox {
  width: min(90vw, 650px);
  max-width: 90vw;
  max-height: 90vh;
  padding: 0.75rem;
  overflow: visible;
  background: transparent;
  border: 0;
}

.certificate-lightbox::backdrop {
  background: rgb(0 0 0 / 78%);
}

.certificate-lightbox-content {
  display: grid;
  gap: 1rem;
  max-height: calc(90vh - 1.5rem);
  padding: 1rem;
  overflow: auto;
  color: #182124;
  background: #f4f6f5;
  border-radius: 1rem;
}

.certificate-lightbox h2 {
  margin: 0 3.75rem 0 0;
  color: #12201c;
  font-size: 1.125rem;
  line-height: 1.25;
}

.certificate-lightbox figure {
  display: grid;
  gap: 0.375rem;
  margin: 0;
}

.certificate-lightbox figure[hidden] {
  display: none;
}

.certificate-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 0.625rem;
}

.certificate-lightbox img[hidden] {
  display: none;
}

.digital-certificate-back {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #dfe5e2;
  border-radius: 0.625rem;
}

.digital-certificate-back[hidden] {
  display: none;
}

.certificate-details-summary,
.certificate-details-issuer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.certificate-details-summary div,
.certificate-details-issuer div {
  min-width: 0;
}

.certificate-details-summary dt,
.certificate-details-issuer dt {
  color: #61716c;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.certificate-details-summary dd,
.certificate-details-issuer dd {
  margin: 0.125rem 0 0;
  color: #182124;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.certificate-details-section {
  display: grid;
  gap: 0.375rem;
}

.certificate-details-section h3 {
  margin: 0;
  color: #182124;
  font-size: 0.875rem;
  line-height: 1.25;
}

.certificate-details-section p {
  margin: 0;
  color: #52635d;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.lightbox-close {
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: #ffffff;
  background: #182124;
  border: 1px solid #ffffff;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
}

@media (min-width: 620px) {
  .page-shell {
    padding-top: 2rem;
  }

  .profile-header {
    gap: 2rem;
    padding: 1.25rem;
  }

  .photo-gallery {
    padding: 1rem;
  }

  .dive-experience {
    padding: 1.25rem;
  }

  .dive-experience-grid {
    gap: 1rem;
  }

  .certification-group {
    padding: 1.25rem;
  }

  .certifications-section > h2 {
    margin-inline: 1.25rem;
  }

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

  .certificate-details-summary,
  .certificate-details-issuer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-photo {
    width: 11rem;
    max-height: 15rem;
  }

}

@media (min-width: 400px) and (max-width: 619px) {
  .page-shell {
    width: min(100% - 1rem, 1040px);
  }

  .photo-lightbox,
  .certificate-lightbox {
    max-width: 96vw;
    max-height: 94vh;
    padding: 0.375rem;
  }

  .certificate-lightbox {
    width: min(96vw, 650px);
  }

  .photo-lightbox img {
    max-width: calc(min(96vw, 900px) - 0.75rem);
    max-height: calc(94vh - 0.75rem);
  }

  .certificate-lightbox-content {
    gap: 0.75rem;
    max-height: calc(94vh - 0.75rem);
    padding: 0.75rem;
  }
}

@media (min-width: 900px) {
  .certification-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 399px) {
  .page-shell {
    width: min(100% - 1rem, 1040px);
    padding-top: 0;
    padding-bottom: 0;
  }

  .profile-header {
    gap: 0.875rem;
    padding: 0.875rem;
    margin-inline: -0.5rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .photo-gallery {
    padding: 0.625rem;
    margin-inline: -0.5rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .dive-experience {
    padding: 0.875rem;
    margin-inline: -0.5rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .certification-group {
    padding: 0.875rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .certification-groups {
    margin-inline: -0.5rem;
  }

  .certifications-section > h2 {
    margin-inline: 0.875rem;
  }

  .certification-grid {
    gap: 0.75rem;
  }

  .profile-photo {
    width: 5.5rem;
    max-height: 7.5rem;
  }

  .dive-total {
    padding: 0.625rem 0;
  }

  .dive-total dd,
  .dive-breakdown td {
    font-size: 1.0625rem;
  }

  .dive-total--primary dd {
    font-size: 1.1875rem;
  }

  .photo-lightbox,
  .certificate-lightbox {
    max-width: 98vw;
    max-height: 96vh;
    padding: 0.25rem;
  }

  .certificate-lightbox {
    width: min(98vw, 650px);
  }

  .photo-lightbox img {
    max-width: calc(min(98vw, 900px) - 0.5rem);
    max-height: calc(96vh - 0.5rem);
  }

  .certificate-lightbox-content {
    gap: 0.625rem;
    max-height: calc(96vh - 0.5rem);
    padding: 0.625rem;
  }
}
