:root {
  --bg: #f6f7f9;
  --tile: #ffffff;
  --border: #e3e6eb;
  --border-hover: #b4bcc8;
  --text: #14181f;
  --muted: #5f6b7a;
  --faint: #8a94a3;
  --focus: #0C2340;
  --radius: 16px;
  --gap: 16px;
  --gutter: 24px;
  --fade: 0.15s ease;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --tile: #171b22;
    --border: #262c36;
    --border-hover: #4a5361;
    --text: #e8ebf0;
    --muted: #9aa4b2;
    --faint: #6b7584;
    --focus: #9cc3ff;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

main,
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main {
  padding-top: 48px;
}

.grid {
  display: grid;
  gap: var(--gap);
}

.primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.secondary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 48px;
}

.tile {
  --pad: 16px;
  --arrow: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: var(--pad);
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--fade);
}

.tile:hover {
  border-color: var(--border-hover);
}

.tile:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Open-in-new-tab arrow, shown on hover */
.tile::after {
  content: "";
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  width: var(--arrow);
  height: var(--arrow);
  background: var(--faint);
  mask: url("icons/arrow.svg") center / contain no-repeat;
  opacity: 0;
  transition: opacity var(--fade);
}

.tile:hover::after {
  opacity: 1;
}

.tile img {
  display: block;
  object-fit: contain;
}

.tile .name {
  font-size: 1.125rem;
  font-weight: 600;
}

.tile .desc {
  color: var(--muted);
  font-size: 0.875rem;
}

.tile .host {
  color: var(--faint);
  font-size: 0.75rem;
  margin-top: auto;
  padding-top: 8px;
  max-width: 100%;
}

/* Workday + Canvas */
.primary .tile {
  --pad: 24px;
  --arrow: 24px;
  min-height: 200px;
}

.primary img {
  width: auto;
  height: 64px;
  margin-bottom: 16px;
}

.primary img.wide {
  height: 56px;
  margin-bottom: 24px;
}

.primary .name {
  font-size: 1.5rem;
  letter-spacing: -0.015em;
}

.primary .desc {
  font-size: 1rem;
}

.primary .host {
  padding-top: 12px;
}

.secondary img {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 8px;
}

.site-footer {
  padding-top: 48px;
  padding-bottom: 48px;
  color: var(--faint);
  font-size: 0.8125rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer span {
  display: inline-block;
  text-wrap: balance;
}

.site-footer a {
  color: inherit;
}

/* Tablet and phone: 2 per row; an odd count makes the first tile full-width. */
@media (max-width: 820px) {
  .secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary .tile:first-child:nth-last-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  :root {
    --gap: 12px;
    --gutter: 16px;
  }

  main {
    padding-top: 16px;
  }

  .secondary {
    margin-top: 40px;
  }

  .primary .tile {
    --pad: 16px;
    --arrow: 20px;
    min-height: 160px;
  }

  .primary img {
    height: 44px;
    margin-bottom: 8px;
  }

  .primary img.wide {
    height: 36px;
    margin-bottom: 16px;
  }

  .primary .name {
    font-size: 1.25rem;
  }

  .primary .desc {
    font-size: 0.875rem;
  }

  .secondary .tile {
    --pad: 12px;
  }

  .secondary img {
    width: 32px;
    height: 32px;
  }

  .secondary .desc {
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .tile,
  .tile::after {
    transition: none;
  }
}
