/* Same palette as the tilesDeck look, on the shared tilesAndButtons --tb-* tokens. */
:root {
  --tb-background-color: light-dark(#fafafa, #111418);
  --tb-font-color: light-dark(#1b1f24, #e8eaed);
  --tb-border-color: light-dark(#c9ced6, #3a414b);
  --tb-hover-background: light-dark(#eef0f3, #1d2228);
  --tb-outline-color: light-dark(#2f6fde, #7aa7ff);
  --site-muted: light-dark(#5f6670, #9aa1ab);
  --site-glow-1: light-dark(rgb(47 111 222 / 0.22), rgb(122 167 255 / 0.2));
  --site-glow-2: light-dark(rgb(177 108 255 / 0.2), rgb(139 92 246 / 0.22));
  --site-glow-3: light-dark(rgb(0 163 122 / 0.14), rgb(0 255 170 / 0.1));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(55% 45% at 12% 8%, var(--site-glow-1), transparent 70%),
    radial-gradient(50% 55% at 92% 88%, var(--site-glow-2), transparent 70%),
    radial-gradient(40% 40% at 70% 20%, var(--site-glow-3), transparent 70%),
    var(--tb-background-color);
  background-attachment: fixed;
  color: var(--tb-font-color);
  font: clamp(1rem, 0.4vw + 0.9rem, 1.25rem) / 1.5 system-ui, sans-serif;
}

.menu-button {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
  z-index: 2;
  padding: 0.35em 0.9em;
  border: 1px solid var(--tb-border-color);
  border-radius: 999px;
  color: var(--tb-font-color);
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.menu-button:hover,
.menu-button:focus-visible {
  color: var(--tb-outline-color);
}

.menu-button:focus-visible {
  outline: 2px solid var(--tb-outline-color);
  outline-offset: 2px;
}

.site-menu {
  position: fixed;
  inset: auto;
  top: calc(3.5rem + env(safe-area-inset-top, 0px));
  right: calc(0.75rem + env(safe-area-inset-right, 0px));
  margin: 0;
  max-width: calc(100vw - 1.5rem);
  padding: 0.75rem 1rem;
  border: 1px solid var(--tb-border-color);
  border-radius: 1rem;
  color: var(--tb-font-color);
}

.site-menu::backdrop {
  background: transparent;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-label {
  color: var(--site-muted);
}

.home {
  width: min(100% - 2rem, 60rem);
  margin-inline: auto;
  padding-block: 4rem 3rem;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-logo {
  height: 4rem;
  width: auto;
  flex: none;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 0.25em;
}

h2 {
  font-size: 1.5em;
  margin: 2.5rem 0 1rem;
}

h3 {
  font-size: 1.15em;
  margin: 0 0 0.25em;
}

p {
  margin: 0;
}

.lead,
.post-meta {
  color: var(--site-muted);
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post-card,
.project-tile {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  color: inherit;
  text-decoration: none;
}

.post-card:hover {
  outline: 2px solid var(--tb-outline-color);
}

.post-card:focus-visible {
  outline: 3px solid var(--tb-outline-color);
  outline-offset: 2px;
}

.post-meta {
  font-size: 0.85em;
  margin-bottom: 0.5em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}

.project-tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  padding: 0.9rem;
  scroll-margin-top: 1rem;
}

.project-tile:target {
  outline: 3px solid var(--tb-outline-color);
}

.project-tile img,
.tile-mark {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  border-radius: 0.75rem;
}

.project-tile img {
  object-fit: contain;
}

.tile-mark {
  background: linear-gradient(135deg, var(--site-glow-1), var(--site-glow-2));
  border: 1px solid var(--tb-border-color);
}

.project-tile h3 {
  margin: 0;
  font-size: 1.05em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-tile p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 0.85em;
  line-height: 1.3;
}

@media (max-width: 600px) {
  .site-logo {
    height: 3rem;
  }

  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 0.75rem;
  }

  .project-tile {
    padding: 0.7rem;
    gap: 0.3rem;
  }

  .project-tile h3 {
    font-size: 0.95em;
  }

  .project-tile p {
    font-size: 0.78em;
  }
}

.tile-link {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  color: inherit;
  text-decoration: none;
}

.tile-link:focus-visible {
  outline: 3px solid var(--tb-outline-color);
  outline-offset: 4px;
}

.project-fact {
  margin: 0.25rem 0;
}

.link-list {
  list-style: none;
  padding: 0;
}
