/* Buttons */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius-small);
  font-weight: 600;
}

.button-primary {
  background: var(--color-copper);
  color: var(--color-on-copper);
}

.button-secondary {
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.button-large {
  min-height: 52px;
  padding: 0 26px;
  font-weight: 700;
}

.icon-button {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--color-muted);
}

.icon-button-square {
  width: 44px;
  padding: 0;
}

x-nav-toggle {
  display: none;
}

@media (max-width: 860px) {
  x-nav-toggle {
    display: block;
    margin-left: auto;
  }
}

/* Terminal */

.terminal {
  margin-top: 8px;
  padding: 14px 18px;
  border-radius: var(--radius-small);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 14px;
  color: var(--color-muted);
  overflow-x: auto;
  white-space: nowrap;
}

.cursor {
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Tool cards */

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-large);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

a.tool-card:hover {
  opacity: 1;
  border-color: var(--color-teal);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-medium);
  background: var(--color-surface-2);
  color: var(--color-copper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
}

.tool-name {
  font-weight: 700;
  font-size: 1.15rem;
}

.tool-description {
  color: var(--color-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.card-link,
.text-link {
  font-size: 14px;
  color: var(--color-teal);
}

.text-link {
  padding: 12px 0;
}

.tool-card-placeholder {
  justify-content: center;
  gap: 8px;
  background: transparent;
  border-style: dashed;
  color: var(--color-muted);
  font-size: 14px;
}

/* The last card on the homepage: a link to the tools page */
a.tool-card-more:hover {
  border-color: var(--color-teal);
  color: var(--color-text);
}

.tools-page {
  padding-bottom: 72px;
}

/* Services */

.service {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-tag {
  color: var(--color-copper);
  font-size: 14px;
}

.service h3 {
  font-size: 1.25rem;
}

.service p {
  color: var(--color-muted);
  line-height: 1.6;
}

/* A link in the breadcrumb above a tool or project ("// tools / json") */

.crumb-link {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}

.crumb-link:hover {
  opacity: 1;
  text-decoration-color: currentColor;
}

/* Projects */

.project-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-large);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

a.project-card:hover {
  opacity: 1;
  border-color: var(--color-teal);
}

.project-image {
  height: 170px;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-copper);
  overflow: hidden;
}

/* A photo or screenshot fills the whole frame. */
.project-image-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-image-top img {
  object-position: top;
}

/* An object without background (a device, a character) floats in the frame. */
.project-image-contain {
  padding: 14px;
}

.project-image-contain img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* A phone screenshot: a phone that rises from the bottom edge, only its top part visible. */
.project-image-phone {
  align-items: flex-start;
  padding-top: 18px;
}

.project-image-phone img {
  width: 150px;
  height: auto;
}

.phone {
  border: 6px solid #05080A;
  border-radius: 22px;
  overflow: hidden;
  background: #05080A;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.phone img {
  display: block;
}

.project-image-phone .phone {
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.project-body {
  flex-grow: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-body h3 {
  font-size: 1.15rem;
}

.project-body p {
  flex-grow: 1;
  color: var(--color-muted);
  line-height: 1.5;
}

/* Code block */

.code-block {
  flex: 1 1 320px;
  min-width: 0;
  padding: 20px 24px;
  border-radius: var(--radius-large);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 14px;
  line-height: 1.9;
  overflow-x: auto;
  white-space: nowrap;
}

.code-comment {
  color: var(--color-muted);
}
