:root {
  color-scheme: light;
  --page-background: #f2f4f3;
  --text: #000;
  --glass-background: rgba(242, 244, 243, 0.2);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.25),
    inset 1px 1px 0 rgba(255, 255, 255, 0.85),
    inset -1px -1px 0 rgba(255, 255, 255, 0.65),
    inset 4px 4px 12px rgba(208, 216, 212, 0.16),
    inset -4px -4px 12px rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--text);
  font-family: "neue-haas-unica", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
  outline: 2px solid #334e46;
  outline-offset: 5px;
}

.page {
  width: 100%;
  max-width: 433px;
  margin-inline: auto;
  padding: 29px 20px 20px;
}

.profile {
  margin-bottom: 25px;
  text-align: center;
}

.portrait {
  display: block;
  width: 266px;
  height: 266px;
  max-width: 100%;
  object-fit: contain;
  margin-inline: auto;
  transform: translateX(-8px);
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
}

.bio {
  margin-top: 5px;
  font-size: 18px;
  line-height: 27px;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.glass {
  border-radius: 8px;
  background: var(--glass-background);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.link, .social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 25px 16px;
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}

.social-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.social-link {
  padding-inline: 10px;
}

.social-link img {
  display: block;
  flex-shrink: 0;
}

@media (hover: hover) {
  .glass:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.55);
    box-shadow: var(--glass-shadow), 0 5px 12px rgba(38, 53, 46, 0.06);
  }
}

.glass:active {
  transform: translateY(1px);
}

footer {
  margin-top: 25px;
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 17px;
  text-align: center;
}

.ventures-page {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.back-link {
  position: absolute;
  top: 29px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  aspect-ratio: 1;
  flex: none;
}

.ventures-header {
  padding: 39px 0 30px;
  text-align: center;
}

.ventures-header p {
  margin-top: 5px;
  font-size: 16px;
  line-height: 24px;
  color: #626865;
}

.venture-card {
  position: relative;
  display: block;
  aspect-ratio: 40 / 21;
  overflow: hidden;
  isolation: isolate;
}

.venture-image {
  display: block;
  width: 100%;
  height: auto;
}

.venture-card.is-loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  animation: venture-spin 800ms linear infinite;
  pointer-events: none;
}

.venture-card.is-loading .venture-image {
  opacity: 0;
}

.venture-image[hidden] {
  display: none;
}

.venture-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  font-size: 18px;
  text-align: center;
}

@keyframes venture-spin {
  to { transform: rotate(360deg); }
}

.venture-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--glass-shadow);
  pointer-events: none;
}

.ventures-page footer {
  margin-top: auto;
  padding-top: 40px;
}

@media (min-width: 600px) {
  .page {
    padding-top: 48px;
    padding-bottom: 32px;
  }

  .back-link {
    top: 48px;
  }
}

/* Start mobile home content at the top of the visible viewport.
   The portrait gives up space first; shorter screens also tighten the controls. */
.home-page {
  --home-gap: clamp(6px, 1.17dvh, 10px);
  --home-section-gap: clamp(10px, 2.93dvh, 25px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 100svh;
  height: 100dvh;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(clamp(8px, 2.35dvh, 20px), env(safe-area-inset-bottom));
}

.home-page .profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 326px;
  min-height: 60px;
  margin-bottom: var(--home-section-gap);
}

.home-page .portrait {
  flex: 0 1 266px;
  min-height: 0;
}

.home-page h1,
.home-page .bio,
.home-page .links,
.home-page footer {
  flex-shrink: 0;
}

.home-page .links,
.home-page .social-links {
  gap: var(--home-gap);
}

.home-page .link,
.home-page .social-link {
  min-height: clamp(44px, 10dvh, 74px);
  padding-block: clamp(10px, calc(5dvh - 12px), 25px);
}

.home-page footer {
  margin-top: var(--home-section-gap);
}

/* A short landscape screen has more room beside the portrait than below it. */
@media (max-height: 500px) and (min-width: 600px) {
  .home-page {
    display: grid;
    max-width: 800px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 326px) auto;
    align-content: start;
    align-items: end;
    gap: 16px 24px;
  }

  .home-page .profile {
    height: 100%;
    max-height: 326px;
    margin-bottom: 0;
    justify-content: flex-end;
  }

  .home-page footer {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* Once a fifth main link is added, let mobile content grow and scroll naturally. */
@media (max-width: 1023px) {
  .home-page:has(.links > .link:nth-of-type(5)) {
    height: auto;
  }

  .home-page:has(.links > .link:nth-of-type(5)) .profile {
    flex-shrink: 0;
  }
}

@media (min-width: 1024px) {
  .home-page {
    justify-content: center;
    padding-block: 20px;
  }
}

@media (min-width: 1024px) and (max-height: 500px) {
  .home-page {
    grid-template-rows: minmax(0, 326px) auto;
    align-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glass {
    transition: none;
  }

  .venture-card.is-loading::before {
    animation: none;
  }
}
