:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b6b6b;
  --color-border: #e0ddd8;
  --max-width: 860px;
  --space: clamp(1rem, 4vw, 1.5rem);
  --gap: clamp(1rem, 3vw, 2.5rem);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
}

/* Nav */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: center;
  padding: 0.85rem var(--space);
}

nav a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9375rem;
}

nav a:hover {
  text-decoration: underline;
}

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
}

/* Page title banner */
.page-title {
  background: var(--color-navy);
  color: #fff;
  text-align: center;
  padding: 0.55rem var(--space);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Main */
main {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space);
}

section {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--color-border);
}

section:last-child {
  border-bottom: none;
}

:is(h2, h3) {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-text);
}

h2 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

h3 {
  font-size: 1.1rem;
  margin-block: 2rem 1rem;
}

/* About */
.about-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--gap);
  align-items: start;
}

.headshot img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border: 1px solid var(--color-border);
}

.bio p + p {
  margin-top: 1rem;
}

/* Resume */
.resume-attrs {
  margin-bottom: 1.5rem;
}

.resume-attrs p + p {
  margin-top: 0.25rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 480px;
}

th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.5rem 1rem 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

td {
  padding: 0.75rem 1rem 0.75rem 0;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #eef1f7;
}

td a {
  color: var(--color-text);
}

@media (max-width: 600px) {
  .table-scroll {
    overflow-x: unset;
  }

  table, thead, tbody, tr, th, td {
    display: block;
  }

  table {
    min-width: 0;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
  }

  tbody tr:nth-child(even) {
    background: #eef1f7;
  }

  td {
    padding: 0.25rem 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
    padding-top: 0.1em;
    white-space: nowrap;
  }
}

/* Headshot grid */
.headshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.headshot-grid a {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}

.headshot-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.headshot-grid img:hover {
  opacity: 0.85;
}

@media (max-width: 480px) {
  .headshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Carousel */
.carousel {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.carousel-main {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #111;
}

.carousel-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-caption {
  position: absolute;
  bottom: 1.25rem;
  left: 1.5rem;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.75rem;
  pointer-events: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  width: 2.75rem;
  height: 5rem;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.65);
}

.carousel-prev { left: 0; }
.carousel-next { right: 0; }

.carousel-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

.carousel-thumbs::-webkit-scrollbar {
  display: none;
}

.carousel-thumbs.at-end {
  mask-image: none;
  -webkit-mask-image: none;
}

.carousel-thumbs.scrolled {
  mask-image: linear-gradient(to right, transparent, black 8%, black 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 80%, transparent 100%);
}

.carousel-thumbs.scrolled.at-end {
  mask-image: linear-gradient(to right, transparent, black 8%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%);
}

.carousel-thumb {
  flex: 0 0 auto;
  border: 2px solid transparent;
  padding: 0;
  background: none;
  cursor: pointer;
  width: 70px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.carousel-thumb:hover img,
.carousel-thumb.active img {
  opacity: 1;
}

.carousel-thumb.active {
  border-color: var(--color-navy);
}

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

.lightbox:target {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90dvh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  text-decoration: none;
}

/* Contact */
.sent-message {
  display: none;
}

.sent-message:target {
  display: block;
  color: var(--color-text);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  margin-top: 1.5rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 1.5rem;
}

.contact-form label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.75rem;
}

.contact-form :is(input, textarea) {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  width: 100%;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form button {
  align-self: flex-start;
  margin-top: 1rem;
  padding: 0.6rem 1.75rem;
  background: var(--color-navy);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.contact-form button:hover {
  opacity: 0.8;
}

.contact-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */
footer {
  text-align: center;
  padding: clamp(1.25rem, 3vw, 2rem) var(--space);
  font-size: 0.8125rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}
