/* Colors and font */
:root {

  --background-color: #fdf6e3;

  --cards-background: #ffee88;

  --text-color: #554e56;

  --primary-color: #f6ba17;

  --default-font: Verdana, Geneva, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Page defaults */
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text-color);
  background-color: var(--background-color);
  font-family: var(--default-font);
  font-size: 18px;
}

/* Text links */
a {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

a:hover {
  background-color: transparent;
  text-decoration: none;
}

/* Page width and spacing */
.profile-home {
  width: min(935px, calc(100% - 40px));
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  margin: 48px auto 0;
  padding-bottom: 68px;
}

.profile-home img {
  display: block;
}

/* Profile */
.profile-intro {
  padding: 20px clamp(20px, 6vw, 56px) 44px;
}

.profile-intro h1 {
  margin: 0 0 18px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.1;
}

.profile-about {
  --profile-image-size: clamp(120px, 36vw, 160px);

  display: grid;
  grid-template-columns: var(--profile-image-size) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 40px);
  align-items: start;
}

.profile-copy {
  min-width: 0;
  max-width: 540px;
}

.profile-picture {
  width: var(--profile-image-size);
  height: var(--profile-image-size);
  aspect-ratio: 1;
  border: 1px solid var(--primary-color);
  object-fit: cover;
}

.profile-picture-link {
  display: block;
  width: fit-content;
  text-decoration: none;
  outline: 5px solid transparent;
  outline-offset: -5px;
  transition: outline-color 160ms ease;
}

/* Social icons and list reset */
.social-links,
.page-grid {
  padding: 0;
  margin: 0;
  list-style: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.social-link {
  display: block;
  width: 28px;
  height: 28px;
  text-decoration: none;
}

.social-link img {
  width: 100%;
  height: 100%;
}

.profile-picture-link:hover,
.profile-picture-link:focus-visible {
  outline-color: var(--primary-color);
}

.social-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* Description and text links */
.profile-description,
.profile-links {
  min-width: 0;
  max-width: 540px;
}

.profile-description {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.profile-links {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  font-size: 16px;
  line-height: 1.3;
}

.profile-links img {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.profile-links span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-grid {
  display: grid;
  /* Change 3 for the column count; gap sets the card spacing. */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.page-grid li {
  min-width: 0;
}

.page-card {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--primary-color);
  background: var(--cards-background);
  text-decoration: none;
  outline: 5px solid transparent;
  outline-offset: -5px;
  transition: outline-color 160ms ease;
}

.page-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The overlay link handles clicks and keyboard focus. */
.page-card-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}

.page-card-link {
  position: absolute;
  z-index: 1;
  inset: 0;
  text-decoration: none;
}

.page-card:hover,
.page-card:focus-visible,
.page-card:focus-within {
  background: var(--cards-background);
  outline-color: var(--primary-color);
}

/* Mobile overrides (600px and below) */
@media (max-width: 600px) {
  .profile-home {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: 24px;
  }

  .profile-intro {
    padding: 24px 18px 28px;
  }

  .profile-intro h1 {
    margin-bottom: 14px;
    font-size: 1.25rem;
  }

  .profile-about {
    gap: 18px;
  }

  .profile-description {
    line-height: 1.4;
  }

  .social-links {
    gap: 8px;
    margin-top: 10px;
  }

  .social-link {
    width: 24px;
    height: 24px;
  }

  .page-grid {
    gap: 2px;
  }
}
