:root {
  --page-width: 1440px;
  --text: #000;
  --key-border: rgb(0 0 0 / 20%);
  --font-serif: "Source Serif 4", "Times New Roman", Times, serif;
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.36;
}

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

button,
input {
  font: inherit;
}

.page {
  --page-padding-x: 48px;
  --page-padding-y: 24px;

  position: relative;
  width: min(100%, var(--page-width));
  min-height: 0;
  margin: 0;
  padding: var(--page-padding-y) var(--page-padding-x) 48px;
  background: #fff;
}

.topbar {
  position: relative;
  min-height: 33px;
  background: #fff;
}

.topbar::before {
  content: none;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  width: max-content;
  max-width: calc(100% - 220px);
  font: inherit;
  font-style: italic;
  white-space: nowrap;
}

h2 {
  margin: 48px 0 17px;
  font: inherit;
}

.compact-section h2 {
  margin-top: 32px;
}

#ui-patterns-inspiration-title {
  margin-top: 48px;
}

.content {
  width: 100%;
}

.tools-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 684px) max-content;
  column-gap: 169px;
  align-items: start;
  min-height: 105px;
  color: var(--text);
  line-height: 1.44;
  cursor: pointer;
  transition: color 140ms ease;
}

.most-used-section .tool-row:nth-child(1),
.most-used-section .tool-row:nth-child(4) {
  min-height: 175px;
}

.most-used-section .tool-row:nth-child(5) {
  min-height: 105px;
}

.most-used-section .tool-row:nth-child(6) {
  min-height: 99px;
}

.most-used-section .tool-row:nth-child(7) {
  min-height: 140px;
}

.most-used-section .tool-row:nth-child(8) {
  min-height: 35px;
}

.compact-section .tool-row {
  grid-template-columns: minmax(0, 512px) max-content;
  column-gap: 0;
  min-height: 35px;
}

.tool-row p {
  max-width: 684px;
  line-height: 1.44;
}

.tool-row span {
  display: block;
  padding-left: 32px;
}

.tool-row.is-hovered,
.tool-row.is-pressed {
  transition-duration: 0ms;
}

.tool-row:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}

.tool-category {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.category-arrow {
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  padding-left: 0;
  opacity: 0;
  transform: translateY(1px);
  transition: opacity 120ms ease;
}

.tool-category .category-arrow {
  padding-left: 0;
}

.category-arrow::before {
  position: absolute;
  inset: 0;
  display: block;
  background: currentColor;
  content: "";
  mask: url("data:image/svg+xml,%3Csvg width='19' height='19' viewBox='0 0 19 19' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 15L15 4M8 4H15V11' stroke='black' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg width='19' height='19' viewBox='0 0 19 19' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 15L15 4M8 4H15V11' stroke='black' stroke-width='1.8' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (hover: hover) and (pointer: fine) {
  .tool-row.is-hovered {
    color: var(--hover-color);
  }

  .tool-row.is-hovered .category-arrow {
    opacity: 1;
  }
}

@media (hover: none), (pointer: coarse) {
  .tool-row.is-pressed {
    color: var(--hover-color);
  }

  .tool-row.is-pressed .category-arrow {
    opacity: 1;
  }
}

.page-footer {
  display: grid;
  grid-template-columns: minmax(0, 512px) max-content;
  column-gap: 0;
  margin-top: 112px;
  font-size: 20px;
  font-style: italic;
  line-height: 1.3;
}

.avatar-link {
  --avatar-rotate-x: 0deg;
  --avatar-rotate-y: 0deg;
  --avatar-scale: 1;

  position: absolute;
  top: 0;
  right: 0;
  z-index: 6;
  display: block;
  width: 41px;
  height: 59px;
  border-radius: 8px;
  outline-offset: 8px;
  perspective: 450px;
  transform: scale(var(--avatar-scale));
  transform-origin: center;
  transition: transform 420ms cubic-bezier(0.22, 1.35, 0.36, 1);
}

.avatar-link:hover {
  --avatar-scale: 1.2;
}

.avatar-link:focus-visible {
  outline: 2px solid currentColor;
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  transform: rotateX(var(--avatar-rotate-x)) rotateY(var(--avatar-rotate-y));
  transform-origin: center;
  transition: transform 180ms ease-out, filter 180ms ease-out;
  will-change: transform;
}

.avatar-link:hover .avatar {
  filter: saturate(1.08) contrast(1.03);
}

@media (max-width: 1120px) {
  .page {
    --page-padding-x: 35px;
    --page-padding-y: 20px;

    min-height: 768px;
  }

  h2 {
    margin-top: 37px;
  }

  h1 {
    max-width: calc(100% - 72px);
    white-space: normal;
  }

  .most-used-section .tool-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding-bottom: 28px;
  }

  .most-used-section .tool-row p {
    max-width: none;
  }

  .most-used-section .tool-category {
    padding-left: 0;
    white-space: normal;
  }
}

@media (max-width: 760px) {
  .compact-section .tool-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: auto;
    padding-bottom: 28px;
  }

  .compact-section .tool-category {
    padding-left: 0;
    white-space: normal;
  }

  .page-footer {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 96px;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 21px;
  }

  .page {
    --page-padding-x: 24px;
    --page-padding-y: 24px;

    min-height: 100vh;
  }

  h1 {
    max-width: calc(100% - 130px);
    white-space: normal;
  }

  h2 {
    margin-top: 40px;
  }

}

@media (max-width: 520px) {
  body {
    font-size: 18px;
  }

  .page {
    --page-padding-x: 18px;
    --page-padding-y: 20px;

    padding-bottom: 84px;
  }

  h1 {
    max-width: 100%;
  }

  h2 {
    margin-top: 32px;
  }

}

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
    font-size: 24px;
  }

  .page {
    --page-padding-x: 24px;
    --page-padding-y: 24px;

    width: 100%;
    min-height: 0;
    padding: var(--page-padding-y) var(--page-padding-x) 24px;
  }

  .topbar {
    min-height: 66px;
  }

  h1 {
    width: auto;
    max-width: 258px;
    white-space: normal;
  }

  h2 {
    margin: 48px 0 16px;
  }

  .compact-section h2 {
    margin-top: 32px;
  }

  #ui-patterns-inspiration-title {
    margin-top: 48px;
  }

  .tools-list {
    gap: 0;
  }

  .tool-row,
  .most-used-section .tool-row,
  .compact-section .tool-row,
  .tool-row:nth-child(n),
  .most-used-section .tool-row:nth-child(n) {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
    padding-bottom: 0;
  }

  .most-used-section .tools-list {
    gap: 24px;
  }

  .compact-section .tools-list {
    gap: 16px;
  }

  .tool-row p,
  .most-used-section .tool-row p {
    width: 100%;
    max-width: none;
  }

  .tool-row p span,
  .most-used-section .tool-row p span {
    display: inline;
    padding-left: 0;
  }

  .tool-category,
  .most-used-section .tool-category,
  .compact-section .tool-category {
    display: flex;
    width: 100%;
    min-height: 35px;
    justify-content: space-between;
    gap: 16px;
    padding-left: 0;
    white-space: normal;
  }

  .category-arrow {
    width: 17px;
    height: 17px;
    opacity: 1;
    transform: translateY(4px);
  }

  .avatar-link {
    top: 0;
    right: 0;
  }

  .page-footer {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 112px;
  }
}
