:root {
  --paper: #fbfbfa;
  --ink: #171717;
  --muted: #a8a8a8;
  --line: #e8e8e4;
  --accent: #ff0808;
  --accent-hover: #171717;
  --arrow-hover: #ff0808;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.18;
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.profile-sheet {
  min-height: 100vh;
  padding: 24px 7px 28px;
  background: var(--paper);
}

.topline {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 28px;
  min-height: 30px;
  text-transform: lowercase;
}

.topline span:last-child {
  text-align: right;
}

.index-list {
  display: grid;
  gap: 1px;
  width: 210px;
  margin: 0 0 46px;
}

.index-list a {
  display: grid;
  grid-template-columns: 36px 1fr;
}

.index-list a:hover,
.index-list a:focus-visible {
  color: var(--accent-hover);
  outline: none;
}

.project-block {
  margin: 0 0 48px;
}

.project-grid {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  width: clamp(170px, calc(100% - 220px), 230px);
  margin: 0 0 14px auto;
}

.project-grid h1,
.project-grid p {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
}

.project-grid p {
  margin-top: 14px;
  color: var(--muted);
}

.pill-button {
  justify-self: start;
  min-width: 82px;
  height: 43px;
  display: inline-grid;
  place-items: center;
  padding: 0 25px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  margin: 0 0 12px;
  transition:
    color 180ms ease,
    border-color 180ms ease;
}

.pill-button:hover,
.pill-button:focus-visible,
.pill-button:active {
  color: var(--accent-hover);
  outline: none;
}

.gallery-block {
  width: calc(100% + 12px);
  max-width: none;
  margin: 0 -6px;
}

.carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ececea;
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  background: #e8e8e5;
}

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

.carousel-arrow {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.carousel:hover .carousel-arrow,
.carousel:focus-within .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible,
.carousel-arrow:active {
  outline: none;
}

.carousel-arrow.prev {
  left: 12px;
}

.carousel-arrow.next {
  right: 12px;
}

.carousel-arrow span {
  position: relative;
  width: 17px;
  height: 17px;
  display: block;
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.95);
}

.carousel-arrow.prev span {
  transform: translateX(2px) rotate(-135deg);
}

.carousel-arrow.next span {
  transform: translateX(-2px) rotate(45deg);
}

@media (max-width: 420px) {
  .project-grid {
    width: clamp(160px, calc(100% - 170px), 220px);
  }

  .project-grid {
    grid-template-columns: 34px 1fr;
    margin-left: auto;
  }

  .gallery-block {
    width: calc(100% + 12px);
    margin: 0 -6px;
  }
}

@media (hover: none) {
  .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
  }
}
