body {
  background-color: rgb(244, 244, 244);
  color: rgb(44, 44, 44);
  font-family: "Monaco", monospace;
  font-size: 18px;
  margin: 0;
  padding: 0;
  border-top: solid #69a2c8 6px;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: 1.5rem;
  margin: 1.5rem 0;
}

h3,
h4,
h5,
h6 {
  font-size: 1.25rem;
  margin: 1.25rem 0;
}

#main {
  border-top: solid #dd9d5d 6px;
  padding: 0 1rem;
}

section {
  max-width: 700px;
  margin: auto;
}

a:link {
  color: rgb(0, 64, 214);
}

a:visited {
  color: rgb(44, 44, 44);
}

a:hover {
  background: #ffe3cb;
}

a:active {
  background: #ffbe7d;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header h1 {
  margin: 1.5rem 0;
}

.back-button {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: #fbfbfb;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-family: "Monaco", monospace;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.back-button:link,
.back-button:visited {
  color: rgb(44, 44, 44);
}

.back-button:hover {
  background: #ffe3cb;
}

.back-button:active {
  background: #ffbe7d;
}

.columns {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.columns > div {
  flex: 1;
}

.columns h3 {
  margin-top: 0;
}

@media (max-width: 500px) {
  .columns {
    flex-direction: column;
  }
}

.toc-box {
  display: inline-block;
  border: 1px solid #d4d4d4;
  background: #fbfbfb;
  padding: 0.9rem 1.4rem 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-width: 16rem;
}

.toc-heading {
  margin: 0 0 0.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e4e4e4;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-box .toc {
  margin: 0;
}

.toc li {
  margin: 0.25rem 0;
}

.toc li::before {
  content: "→ ";
  color: #69a2c8;
}

figure.screenshot {
  margin: 1.5rem 0;
}

.screenshot-frame {
  position: relative;
  display: block;
  line-height: 0;
}

.screenshot-frame a:link,
.screenshot-frame a:visited,
.screenshot-frame a:hover,
.screenshot-frame a:active {
  background: transparent;
  display: block;
  line-height: 0;
}

.screenshot-frame img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.callout {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  box-sizing: border-box;
  background: #dd9d5d;
  background-clip: content-box;
  color: white;
  border: 0.625rem solid transparent;
  border-radius: 50%;
  font-family: "Monaco", monospace;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: help;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transform: translate(-50%, -50%);
  line-height: 1;
}

.callout::before,
.callout::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #dd9d5d;
  opacity: 0;
  pointer-events: none;
}

.screenshot-frame:hover .callout::before {
  animation: callout-pulse 1.6s ease-out infinite;
}

.screenshot-frame:hover .callout::after {
  animation: callout-pulse 1.6s ease-out infinite;
  animation-delay: 0.8s;
}

@keyframes callout-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screenshot-frame:hover .callout::before,
  .screenshot-frame:hover .callout::after {
    animation: none;
  }
}

.callout:focus-visible {
  outline: 2px solid #69a2c8;
  outline-offset: calc(2px - 0.625rem);
}

.callout:hover,
.callout:focus-visible {
  z-index: 1;
}

@media (hover: none) {
  .callout:focus {
    z-index: 1;
  }
}

.callout-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(calc(-50% + var(--tip-shift, 0px)));
  width: 16rem;
  max-width: calc(100vw - 1rem);
  background: rgba(44, 44, 44, 0.95);
  color: white;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  font-family: "Monaco", monospace;
  font-size: 0.8rem;
  font-weight: normal;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.callout-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(calc(-50% - var(--tip-shift, 0px)));
  border: 6px solid transparent;
  border-top-color: rgba(44, 44, 44, 0.95);
}

.callout:hover .callout-tip,
.callout:focus-visible .callout-tip {
  display: block;
}

@media (hover: none) {
  .callout:focus .callout-tip {
    display: block;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightbox-fade 0.18s ease-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox .screenshot-frame {
  display: inline-block;
  margin: 0;
  flex: 0 0 auto;
}

.lightbox .screenshot-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  cursor: default;
}

.lightbox .screenshot-frame .callout::before,
.lightbox .screenshot-frame .callout::after {
  animation: callout-pulse 1.6s ease-out infinite;
}

.lightbox .screenshot-frame .callout::after {
  animation-delay: 0.8s;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfbfb;
  border: 1px solid #d4d4d4;
  border-radius: 50%;
  color: rgb(44, 44, 44);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 101;
  -webkit-appearance: none;
  appearance: none;
}

.lightbox-close svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.lightbox-close:hover {
  background: #ffe3cb;
}

@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox {
    animation: none;
  }
}
