:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --ink: #050505;
  --muted: #5d5d5d;
  --preview-radius: 7px;
  --mark-width: 72px;
  --dot: 5px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 300;
  letter-spacing: 0;
}

body:not(.is-loaded) {
  overflow: hidden;
}

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

video,
img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ensure preview videos never show browser controls */
.preview-link video {
  pointer-events: none;
}

.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--bg);
  pointer-events: auto;
  transition: opacity 260ms ease 1460ms, visibility 260ms ease 1460ms;
}

.intro-cluster {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: center;
  will-change: transform;
}

body.intro-ready:not(.is-loaded) .intro-cluster {
  animation: introPulse 1.6s ease-in-out infinite;
}

.intro-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 144px;
  transform: translate3d(-50%, -50%, 0);
  transform-origin: center;
  will-change: transform, opacity;
  transition: transform 1180ms cubic-bezier(0.83, 0, 0.17, 1), opacity 260ms ease 1080ms;
}

body.is-loaded .intro-cluster {
  animation: none;
}

.intro-mark img,
.pt-mark img {
  display: block;
  width: 100%;
  height: auto;
}

.intro-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--dot);
  height: var(--dot);
  background: var(--ink);
  transform: translate3d(var(--start-x), var(--start-y), 0);
  transition: transform 1280ms cubic-bezier(0.83, 0, 0.17, 1), opacity 180ms ease 1360ms;
  will-change: transform, opacity;
}

.intro-dot-top-left {
  --start-x: -86px;
  --start-y: -32px;
  --end-x: calc(29px - 50vw);
  --end-y: calc(19px - 50vh);
}

.intro-dot-top-right {
  --start-x: 86px;
  --start-y: -32px;
  --end-x: calc(100vw - 34px - 50vw);
  --end-y: calc(19px - 50vh);
}

.intro-dot-bottom-left {
  --start-x: -86px;
  --start-y: 32px;
  --end-x: calc(29px - 50vw);
  --end-y: calc(100vh - 24px - 50vh);
}

.intro-dot-bottom-right {
  --start-x: 86px;
  --start-y: 32px;
  --end-x: calc(100vw - 34px - 50vw);
  --end-y: calc(100vh - 24px - 50vh);
}

body.is-loaded .intro {
  visibility: hidden;
  opacity: 0;
}

body.is-loaded .intro-mark {
  opacity: 0;
  transform:
    translate3d(calc(-50% + var(--intro-logo-x, 0px)), calc(-50% + var(--intro-logo-y, 0px)), 0)
    scale(var(--intro-logo-scale, 0.5));
}

body.is-loaded .intro-dot {
  opacity: 0;
  transform: translate3d(var(--end-x), var(--end-y), 0);
}

@keyframes introPulse {
  0%,
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1);
  }

  50% {
    transform: translate3d(-50%, -50%, 0) scale(1.025);
  }
}

.pt-mark {
  display: block;
  width: var(--mark-width);
  opacity: 0;
  transition: opacity 180ms ease 820ms;
}

body.is-loaded .pt-mark {
  opacity: 1;
}

.page-corners {
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0;
  mix-blend-mode: difference;
  pointer-events: none;
  transition: opacity 120ms ease 830ms;
}

body.is-loaded .page-corners {
  opacity: 1;
}

.page-corners span {
  position: absolute;
  width: var(--dot);
  height: var(--dot);
  background: #fff;
}

.page-corners span:nth-child(1) {
  left: 29px;
  top: 19px;
}

.page-corners span:nth-child(2) {
  right: 29px;
  top: 19px;
}

.page-corners span:nth-child(3) {
  left: 29px;
  bottom: 19px;
}

.page-corners span:nth-child(4) {
  right: 29px;
  bottom: 19px;
}

.site-header {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 19px 12px 38px;
}

.site-header .pt-mark {
  --mark-width: 72px;
}

.site-nav {
  position: fixed;
  z-index: 30;
  right: 46px;
  top: 22px;
  display: flex;
  gap: 16px;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  mix-blend-mode: difference;
  text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
}

.layout-toggle {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: -3px 0 0 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.layout-toggle:hover,
.layout-toggle:focus-visible {
  color: #fff;
}

.layout-toggle-icon {
  position: relative;
  display: block;
  width: 13px;
  height: 13px;
}

.layout-toggle-icon span {
  position: absolute;
  width: 4px;
  height: 4px;
  background: currentColor;
}

.layout-toggle-icon span:nth-child(1) {
  left: 0;
  top: 0;
}

.layout-toggle-icon span:nth-child(2) {
  right: 0;
  top: 0;
}

.layout-toggle-icon span:nth-child(3) {
  left: 0;
  bottom: 0;
}

.layout-toggle-icon span:nth-child(4) {
  right: 0;
  bottom: 0;
}

body[data-showcase-layout="loose"] .layout-toggle-icon span:nth-child(1) {
  left: 1px;
  top: 6px;
}

body[data-showcase-layout="loose"] .layout-toggle-icon span:nth-child(2) {
  right: 1px;
  top: 1px;
}

body[data-showcase-layout="loose"] .layout-toggle-icon span:nth-child(3) {
  left: 5px;
  bottom: 0;
}

body[data-showcase-layout="loose"] .layout-toggle-icon span:nth-child(4) {
  right: 0;
  bottom: 5px;
}

.tools-index {
  width: min(674px, calc(100vw - 72px));
  margin: 0 auto;
}

.tool-row {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(220px, 310px);
  gap: 39px;
  align-items: stretch;
  margin-bottom: 70px;
  opacity: 0;
  transform: translate3d(0, calc(48px + var(--row-drift, 0px)), 0);
  transition: opacity 720ms ease, transform 780ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

body.is-loaded .tool-row.is-visible {
  opacity: 1;
  transform: translate3d(0, var(--row-drift, 0px), 0);
}

body.is-loaded .tool-row.is-visible:nth-child(1) {
  transition-delay: 560ms;
}

body.is-loaded .tool-row.is-visible:nth-child(2) {
  transition-delay: 700ms;
}

body.is-loaded .tool-row.is-visible:nth-child(3) {
  transition-delay: 840ms;
}

body.is-loaded .tool-row.is-visible:nth-child(4) {
  transition-delay: 980ms;
}

body.is-loaded .tool-row.is-visible:nth-child(5) {
  transition-delay: 1120ms;
}

body.is-loaded .tool-row.is-visible:nth-child(6) {
  transition-delay: 1260ms;
}

body.is-loaded .tool-row.is-visible:nth-child(7) {
  transition-delay: 1400ms;
}

.preview-link {
  display: block;
  position: relative;
  /* aspect-ratio as primary, explicit width ensures it has something to work from */
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--preview-radius);
  background: #e8e8e8;
  transform: translate3d(0, var(--media-drift, 0px), 0);
  transition: transform 180ms linear;
  will-change: transform;
}

.preview-link video,
.preview-link img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(-50%, -50%, 0) scale(1.08);
  transform-origin: center;
  transition: transform 180ms ease;
  will-change: transform;
}

.preview-link:hover {
  transform: translate3d(0, var(--media-drift, 0px), 0);
}

.preview-link:hover video,
.preview-link:hover img {
  transform: translate3d(-50%, -50%, 0) scale(1.1);
}

.tool-info {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 20px 20px 19px;
  color: var(--muted);
}

.tool-info h1,
.tool-info h2 {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 300;
  line-height: 1;
  text-transform: uppercase;
}

.tool-info p {
  max-width: 135px;
  margin: 0;
  font-size: 8px;
  line-height: 1.28;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: 8px;
  line-height: 1;
  text-transform: uppercase;
}

.tool-link span {
  display: inline-block;
  transition: transform 180ms ease;
  will-change: transform;
}

.tool-link:hover {
  color: var(--ink);
}

.tool-link:hover span {
  transform: translate3d(2px, -2px, 0);
}

.row-corner {
  position: absolute;
  width: var(--dot);
  height: var(--dot);
  background: var(--ink);
}

.row-corner-top-left {
  left: 0;
  top: 0;
}

.row-corner-top-right {
  right: 0;
  top: 0;
}

.row-corner-bottom-left {
  left: 0;
  bottom: 0;
}

.row-corner-bottom-right {
  right: 0;
  bottom: 0;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  width: min(1345px, calc(100vw - 95px));
  min-height: 105px;
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  grid-column: 2;
  display: grid;
  gap: 0;
  justify-items: start;
}

.site-footer a:hover {
  color: var(--ink);
}

.showcase-page {
  width: min(1338px, calc(100vw - 92px));
  margin: 0 auto 84px;
}

.showcase-grid {
  column-count: 4;
  column-gap: 26px;
}

body[data-showcase-layout="loose"] .showcase-grid {
  display: none;
}

.showcase-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 38px;
  break-inside: avoid;
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 680ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-loaded .showcase-card {
  opacity: 1;
  transform: translate3d(0, var(--showcase-drift, 0px), 0);
}

body.is-loaded .showcase-card:nth-child(2n) {
  transition-delay: 80ms;
}

body.is-loaded .showcase-card:nth-child(3n) {
  transition-delay: 150ms;
}

.showcase-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #e7e7e7;
}

.showcase-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
  text-transform: uppercase;
}

.showcase-field {
  display: none;
}

body[data-showcase-layout="loose"] .showcase-field {
  display: block;
}

.showcase-cluster {
  position: relative;
  min-height: clamp(760px, 108vw, 1260px);
}

.showcase-field-card {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: min(calc(var(--w) * 1vw), calc(var(--w) * 13.5px));
  min-width: 112px;
  max-width: 410px;
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition: opacity 680ms ease, transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-loaded .showcase-field-card {
  opacity: 1;
  transform: translate3d(0, var(--showcase-drift, 0px), 0);
}

.showcase-field-card img {
  display: block;
  width: 100%;
  height: auto;
  background: #e7e7e7;
}

.showcase-field-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
  text-transform: uppercase;
}

@media (min-width: 1500px) {
  .tools-index {
    width: min(928px, calc(100vw - 156px));
  }

  .tool-row {
    grid-template-columns: minmax(360px, 470px) minmax(245px, 345px);
    gap: 56px;
    margin-bottom: 86px;
  }
}

@media (min-width: 1900px) {
  .tools-index {
    width: min(1080px, calc(100vw - 220px));
  }

  .tool-row {
    grid-template-columns: minmax(430px, 560px) minmax(270px, 380px);
    gap: 72px;
    margin-bottom: 98px;
  }
}

/* Mac Studio and large external displays */
@media (min-width: 2200px) {
  .tools-index {
    width: min(1340px, calc(100vw - 280px));
  }

  .tool-row {
    grid-template-columns: minmax(560px, 720px) minmax(320px, 460px);
    gap: 90px;
    margin-bottom: 116px;
  }
}

@media (min-width: 2800px) {
  .tools-index {
    width: min(1640px, calc(100vw - 340px));
  }

  .tool-row {
    grid-template-columns: minmax(700px, 900px) minmax(400px, 560px);
    gap: 110px;
    margin-bottom: 136px;
  }
}

@media (max-width: 1100px) {
  :root {
    --dot: 8px;
  }

  .page-corners span:nth-child(1) {
    left: 24px;
    top: 24px;
  }

  .page-corners span:nth-child(2) {
    right: 24px;
    top: 24px;
  }

  .page-corners span:nth-child(3) {
    left: 24px;
    bottom: 24px;
  }

  .page-corners span:nth-child(4) {
    right: 24px;
    bottom: 24px;
  }

  .site-header {
    padding-bottom: 54px;
  }

  .site-nav {
    right: 58px;
    top: 28px;
  }

  .tools-index,
  .site-footer {
    width: min(720px, calc(100vw - 72px));
  }

  .showcase-page {
    width: min(720px, calc(100vw - 72px));
  }

  .showcase-grid {
    column-count: 2;
    column-gap: 22px;
  }

  .showcase-cluster {
    min-height: clamp(760px, 138vw, 1120px);
  }

  .showcase-field-card {
    width: clamp(118px, calc(var(--w) * 1.55vw), 330px);
  }

  .tool-row {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 86px;
  }

  /* iOS Safari: aspect-ratio can collapse to zero inside a grid 1fr column.
     Explicit height guarantees the tile is always visible. */
  .preview-link {
    height: min(648px, calc(100vw - 72px));
  }

  .tool-info {
    min-height: 260px;
    padding: 31px 32px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 44px;
    min-height: 160px;
    margin-top: 0;
    padding-bottom: 72px;
  }

  .footer-links {
    grid-column: 1;
  }
}

@media (max-width: 560px) {
  :root {
    --mark-width: 78px;
    --dot: 6px;
  }

  .site-header {
    padding: 36px 18px 42px;
  }

  .site-nav {
    position: fixed;
    right: 42px;
    top: 86px;
    margin-top: 0;
    gap: 10px;
    font-size: 8px;
  }

  .layout-toggle {
    width: 14px;
    height: 14px;
    margin: -3px 0 0 4px;
  }

  .layout-toggle-icon {
    width: 11px;
    height: 11px;
  }

  .layout-toggle-icon span {
    width: 3px;
    height: 3px;
  }

  .site-header .pt-mark {
    --mark-width: 78px;
  }

  .tools-index,
  .site-footer,
  .showcase-page {
    width: calc(100vw - 42px);
  }

  .showcase-grid {
    column-count: 2;
    column-gap: 14px;
  }

  .showcase-card {
    margin-bottom: 24px;
  }

  .showcase-card p {
    margin-top: 6px;
    font-size: 8px;
  }

  .showcase-cluster {
    min-height: 1180px;
  }

  .showcase-field-card {
    left: calc(var(--mobile-x) * 1%);
    top: calc(var(--mobile-y) * 1%);
    width: calc(var(--mobile-w) * 1%);
    min-width: 0;
  }

  .showcase-field-card p {
    font-size: 8px;
  }

  .site-footer {
    padding-bottom: 58px;
  }

  .tool-row {
    gap: 18px;
    margin-bottom: 62px;
  }

  .preview-link {
    height: calc(100vw - 42px);
  }

  .tool-info {
    min-height: 218px;
    padding: 25px 24px;
  }

  .tool-info h1,
  .tool-info h2 {
    margin-bottom: 18px;
    font-size: 15px;
  }

  .tool-info p {
    max-width: min(280px, calc(100vw - 90px));
  }

  .tool-info p {
    font-size: 10px;
  }

  .tool-link,
  .site-footer {
    font-size: 11px;
  }
}
