/* ABOUTME: Home page styles: the circular author tiles and the About and Get in touch boxes. */
/* ABOUTME: A tile opens on hover, on keyboard focus, or when authors.js marks it open after a tap; opening fades the image and reveals the description and link. */

.authors { padding-top: clamp(8px, 2vw, 24px); }

.author-grid {
  --gap: clamp(28px, 5vw, 56px);
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  margin: 0;
  padding: 0;
}

.author {
  position: relative;
  flex: 0 1 calc((100% - var(--gap)) / 2);
  max-width: 440px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-deep);
  box-shadow: 0 1px 2px rgba(31, 48, 55, 0.08), 0 18px 40px -18px rgba(31, 48, 55, 0.45);
  container-type: inline-size;
  isolation: isolate;
}

.author img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.45s ease, transform 0.6s ease;
}

.author__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 15% 15%;
  text-align: center;
  color: #fff;
  transition: padding 0.45s ease;
}

.author__name {
  margin: 0;
  padding: 0.35em 0.9em 0.4em;
  border-radius: 999px;
  background: rgba(23, 36, 42, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: clamp(1.2rem, 7cqi, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  transition: background-color 0.45s ease;
}

.author__details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows 0.45s ease, opacity 0.3s ease;
}
.author__details > div { min-height: 0; overflow: hidden; }
.author__details p {
  margin: 0.6em 0 1.1em;
  font-size: clamp(0.95rem, 4.6cqi, 1.25rem);
  line-height: 1.45;
}

.author__link {
  display: inline-block;
  margin-bottom: 0.25em;
  padding: 0.6em 1.3em;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  color: #fff;
  font-size: clamp(0.85rem, 3.8cqi, 1.05rem);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.author__link:hover,
.author__link:focus-visible { background: #fff; color: var(--brand-deep); }
.author__link:focus-visible { outline-color: #fff; }

/* Open state: keyboard focus, a tap (via authors.js) or, on devices that can hover, the pointer. */
.author:focus-within img,
.author.is-open img { opacity: 0.14; transform: scale(1.06); }
.author:focus-within .author__overlay,
.author.is-open .author__overlay { padding-bottom: 22%; }
.author:focus-within .author__name,
.author.is-open .author__name { background-color: rgba(23, 36, 42, 0); }
.author:focus-within .author__details,
.author.is-open .author__details { grid-template-rows: 1fr; opacity: 1; pointer-events: auto; }

@media (hover: hover) {
  .author:hover img { opacity: 0.14; transform: scale(1.06); }
  .author:hover .author__overlay { padding-bottom: 22%; }
  .author:hover .author__name { background-color: rgba(23, 36, 42, 0); }
  .author:hover .author__details { grid-template-rows: 1fr; opacity: 1; pointer-events: auto; }
}

/* Without JavaScript, touch screens cannot open a tile, so the details are shown on every tile. */
@media (hover: none) {
  html:not(.js) .author img { opacity: 0.14; }
  html:not(.js) .author__overlay { padding-bottom: 22%; }
  html:not(.js) .author__name { background-color: transparent; }
  html:not(.js) .author__details { grid-template-rows: 1fr; opacity: 1; pointer-events: auto; }
}

@media (max-width: 640px) {
  .author { flex-basis: 100%; max-width: 400px; }
}

/* About and Get in touch */
.info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 3vw, 32px);
  margin-top: clamp(64px, 10vw, 112px);
}

.info-box {
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  scroll-margin-top: 24px;
}
.info-box h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem); }
.info-box p:last-child { margin-bottom: 0; }
.info-box a { font-weight: 600; overflow-wrap: anywhere; }
