:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-deep: #f4f4f4;
  --ink: #171717;
  --muted: #666664;
  --gallery-surface: #ffffff;
  --hairline: rgba(23, 23, 23, 0.16);
  --gallery-edge: rgba(23, 23, 23, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0.75rem 1.5rem;
}

.brand {
  display: block;
  width: min(18rem, 65vw);
  line-height: 0;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery {
  width: 100%;
  padding: 0 clamp(0rem, 2vw, 2rem);
}

.slideshow {
  width: min(100%, 112rem, calc(150vh - 16.5rem));
  width: min(100%, 112rem, calc(150svh - 16.5rem));
  margin: 0 auto;
  background: var(--gallery-surface);
  box-shadow: 0 1.5rem 4rem rgba(20, 20, 20, 0.1);
}

.slide-stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--gallery-surface);
  isolation: isolate;
  touch-action: pan-y;
}

.slide-stage::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 0 1px var(--gallery-edge);
}

.slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(1.008);
  transition:
    opacity 900ms var(--ease),
    transform 1400ms var(--ease);
  user-select: none;
}

.slide-image.is-active {
  z-index: 1;
  opacity: 1;
  transform: scale(1);
}

.gallery-state {
  z-index: 3;
  align-self: center;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(23, 23, 23, 0.62);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.gallery-state[hidden] {
  display: none;
}

.loader {
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(23, 23, 23, 0.2);
  border-top-color: rgba(23, 23, 23, 0.82);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.gallery-state.is-empty .loader {
  display: none;
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

.slide-arrow,
.pause-button {
  border: 1px solid rgba(239, 235, 226, 0.28);
  border-radius: 999px;
  background: rgba(12, 11, 10, 0.43);
  color: #f1ede5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.slide-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  padding: 0 0 0.19rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
}

.slide-arrow--previous { left: clamp(0.75rem, 2vw, 2rem); }
.slide-arrow--next { right: clamp(0.75rem, 2vw, 2rem); }

.slideshow:hover .slide-arrow,
.slide-arrow:focus-visible {
  opacity: 1;
}

.slide-arrow:hover,
.pause-button:hover {
  border-color: rgba(239, 235, 226, 0.62);
  background: rgba(12, 11, 10, 0.7);
}

.slide-arrow:focus-visible,
.pause-button:focus-visible,
.contact:focus-visible,
.brand:focus-visible {
  outline: 2px solid #4b4b49;
  outline-offset: 4px;
}

.slide-arrow[hidden] {
  display: none;
}

.slide-meta {
  position: absolute;
  right: clamp(0.85rem, 2vw, 1.75rem);
  bottom: clamp(0.85rem, 2vw, 1.75rem);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.slide-meta[hidden] {
  display: none;
}

.slide-count {
  color: rgba(241, 237, 229, 0.78);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.pause-button {
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  line-height: 1;
}

.progress {
  height: 2px;
  overflow: hidden;
  background: rgba(23, 23, 23, 0.08);
}

.progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: #2b2b2a;
  transform: scaleX(0);
  transform-origin: left center;
}

.progress.is-running span {
  animation: progress 6s linear forwards;
}

@keyframes progress {
  to { transform: scaleX(1); }
}

.about {
  padding: clamp(5.5rem, 10vw, 10rem) 1.5rem clamp(4.75rem, 9vw, 8rem);
}

.about-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vw, 4.75rem);
  width: min(54rem, 100%);
  margin: 0 auto;
}

.portrait-wrap {
  flex: 0 0 auto;
  width: clamp(9.75rem, 20vw, 13rem);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(23, 23, 23, 0.24);
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow:
    0 1.25rem 2.8rem rgba(23, 23, 23, 0.12),
    0 0 0 0.45rem rgba(255, 255, 255, 0.62);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 29%;
  filter: saturate(0.88) contrast(1.03);
}

.about-copy {
  min-width: min(21rem, 100%);
  max-width: 27rem;
  padding: 0.55rem 0 0;
}

.about-copy p {
  margin: 0;
}

.name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.15rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.descriptor {
  margin-top: 0.95rem !important;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  letter-spacing: 0.27em;
  text-transform: uppercase;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 2.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid currentColor;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.contact::after {
  content: "↗";
  font-size: 0.95rem;
  transition: transform 180ms ease;
}

.contact:hover::after {
  transform: translate(0.16rem, -0.16rem);
}

@media (max-width: 700px) {
  .site-header {
    min-height: 0;
    padding-block: 0.9rem;
  }

  .brand {
    width: min(17rem, 72vw);
  }

  .gallery {
    padding-inline: 0;
  }

  .slide-arrow {
    width: 2.85rem;
    height: 2.85rem;
    font-size: 1.9rem;
    opacity: 0.78;
  }

  .about-inner {
    flex-direction: column;
    gap: 2.2rem;
    text-align: center;
  }

  .about-copy {
    min-width: 0;
  }

  .name {
    font-size: clamp(2.25rem, 11vw, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .slide-image,
  .slide-arrow,
  .pause-button,
  .contact::after {
    transition: none;
  }

  .loader,
  .progress.is-running span {
    animation: none;
  }
}
